实例效果
wxml代码示例:
<view class="weui-cell weui-cell_access" hover-class="weui-cell_active" data-reply-phone="188****4638" bindtap="phoneCall">
<view class="weui-cell__hd uslogo">王</view>
<view class="weui-cell__bd">王小鹿</view>
<view class="weui-cell__bd">188****4638</view>
<view class="weui-cell__ft">
<image src="/pages/icons/people/phone.png" />
</view>
</view>
js代码示例:
phoneCall: function (e) {
wx.makePhoneCall({
phoneNumber: e.currentTarget.dataset.replyPhone,
success: function () {
console.log("成功拨打电话")
},
})
},
其余可以参考小程序官方API https://mp./debug/wxadoc/dev/api/
如果觉得《小程序拨打电话功能 微信小程序点击手机号 拨打电话~!》对你有帮助,请点赞、收藏,并留下你的观点哦!