.wxml文件
<button class="phone-btn" bindtap="call">电话联系</button>
.js文件
call: function () {
wx.makePhoneCall({
phoneNumber: '13322333456',
success: function () {
console.log('拨打电话成功!')
},
fail: function () {
console.log('拨打电话失败!')
}
})
}
官方文档
https://developers.weixin.qq.com/miniprogram/dev/api/device/phone/wx.makePhoneCall.html