微信小程序拨打电话功能的实现是采用wx.makePhoneCall
具体方法如下:
.wxml
<
view
>电话:15888888888
</
view
>
<
view
data-ph=
'15888888888'
bindtap=
'callPhone'></
view
>
.js
callPhone:
function (e) {
var phone = e.currentTarget.dataset.ph;
if (check.isPhone(
phone)) {
wx.makePhoneCall({
phoneNumber: phone
})
} else {
wx.showToast({
title: '电话号码格式不正确',
})
}
},
如此即可实现
附: