本文举例说明了微信小程序实现的一键拨号功能。分享给大家参考,如下:
1.中绑定拨号事件。wxml文件
button type=' default ' bind tap=' calling '打电话/button2。将逻辑代码添加到。js文件
调用:函数(){ wx . make phone call({ phone number : ' * * * * * * * * * * * ',success:函数(){console.log('调用成功!')},fail : function(){ console . log('调用失败!')} })}3.翻译
关于wx.makePhoneCall的更多详细说明,请参考官网的说明:https://开发者。weixin.qq.com/miniprogram/dev/API/WX.给Call.html打电话。
希望本文对微信小程序的开发有所帮助。