uniapp拨打电话:uni.makePhoneCall()


1.uni.makePhoneCall(OBJECT)

拨打电话。

 1 OBJECT 参数说明:
 2 参数名          类型        必填        说明
 3 phoneNumber    String        是            需要拨打的电话号码
 4 success        Function    否            接口调用成功的回调
 5 fail        Function    否            接口调用失败的回调函数
 6 complete    Function    否            接口调用结束的回调函数(调用成功、失败都会执行)
 7 
 8 <template>
 9     <view class="content">
10         <view @click="call_phone">拨打电话</view>
11     </view>
12 </template>
13 
14 //点击事件:拨打电话
15 call_phone() {
16     uni.makePhoneCall({
17         // 手机号
18         phoneNumber: '13783712192',
19         // 成功回调
20         success: (res) => {
21             console.log('调用成功!')
22         },
23         // 失败回调
24         fail: (res) => {
25             console.log('调用失败!')
26             this.call_phone();//重复调用一次
27         }
28     });
29 },

官方地址:https://uniapp.dcloud.io/api/system/phone?id=makephonecall


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM