.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
小程序













