uni-app
app无法使用uni.makePhoneCall拨打电话,只能使用以下方法实现功能。
//#ifdef MP-WEIXIN
uni.makePhoneCall({
phoneNumber: '15952011111'
});
//#endif
//#ifdef APP-PLUS
plus.device.dial('15952011111', true);
//#endif
// true 让用户自己点呼叫按钮
// false 直接打这个号码
在manifest.json中配置权限
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
微信小程序
wx.makePhoneCall(Object object) | 微信开放文档
<view class="serve" data-phone="15952011111" bindtap="call">联系客服</view>
call(e) {
wx.makePhoneCall({
phoneNumber: e.currentTarget.dataset.phone
})
}