小程序拉起手机拨号
拉起拨号其实很简单的,复制下面的代码运行就可以了
wxml 页面 198****2506 这个就是要拨打的手机号, 可以修改,也可以绑定值
<view class="weui-cell weui-cell_access" hover-class="weui-cell_active" data-reply-phone="198****2506" bindtap="phoneCall">
<view class="weui-cell__bd">点击拨号</view>
</view>
js
phoneCall:function(e){
wx.makePhoneCall({
phoneNumber: e.currentTarget.dataset.replyPhone,
success: function () {
console.log("成功拨打电话")
},
})
},