微信小程序扫一扫和拨打电话功能
.wxml button id="tapTest" bindtap="tapName"扫一扫/button button id="tapTest" bindtap="makePhoneCall"打电话/button.js //扫一扫 tapName: function (event) { wx.scanCode({ success: (res) = { console.log(res); } }) }, //打电话 makePhoneCall: function (event) { wx.makePhoneCall({ phoneNumber:'6830237', success: (res) = { console.log("拨打成功"); }, fail:(e)={ console.log("拨打失败") } })
官方文档api地址:
https://developers.weixin.qq.com/miniprogram/dev/api/device/scan/wx.scanCode.html
https://developers.weixin.qq.com/miniprogram/dev/api/device/phone/wx.makePhoneCall.html
小程序声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

