微信小程序中一键拨打电话可以使用提供的API接口:wx.makePhoneCall,下面是详细示例:
wxml中:
<button bindtap="to_call">拨打电话</button>
js中:
Page({
data: {
phone: "0551-66666666"
},
to_call: function(){
wx.makePhoneCall({
phoneNumber: this.data.phone
})
}
})
效果如下: