微信小程序 跳转手机拨号页面 并将后端给的电话号码自动输入上去
wx.makePhoneCall(Object object) | 微信开放文档
phone(e){
//获取电话号码
let phone = e.currentTarget.dataset.phone
wx.makePhoneCall({
phoneNumber: phone,
success: function (res) {
wx.showToast({
title: '拨打电话成功!',
})
},
fail: function (res) {
wx.showToast({
icon:"none",
title: '拨打电话失败!',
})
}
})
},