一、微信小程序实现拨打电话功能
微信小程序》API》设备》拨打电话
js接口 wx.makePhoneCall(OBJECT) ,用于实现拨打电话功能
OBJECT参数说明:
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
phoneNumber | String | 是 | 需要拨打的电话号码 |
success | Function | 否 | 接口调用成功的回调 |
fail | Function | 否 | 接口调用失败的回调函数 |
complete | Function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
二、使用示例:
wxml:
<view class="weui-cell weui-cell_access" hover-class="weui-cell_active" bindtap='call'>
<view class="weui-cell__hd">
<view class='fa fa-phone'></view>
</view>
<view class="weui-cell__bd">{{phone}}</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</view>
js:
//拨打电话事件
call:function(){
wx.makePhoneCall({
phoneNumber: this.data.phone,
})
},
运行结果:
更多:
http://ad.jnqianle.cn/ad/11.html
http://www.jnqianle.cn/Mina/Index