时间:2019-05-05 来源:小程序工厂
娇***:
麻烦给个相关的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),我们定位下问题
星***:
直接调用微信小程序的api拨打电话,400电话格式为"4007055222,5367" wx.makePhoneCall({
phoneNumber: realPhone,
})
完成代码如下(我们对华为机器添加了提醒)
app.aldstat.sendEvent('400电话拨打', {
'400电话': this.data.realMobile400
});
var realPhone = this.data.realMobile400
if(realPhone == null || realPhone == ''){
wx.showToast({
title: '暂无电话信息',
icon: 'none',
duration: 2000
})
}else{
var sysInfo = wx.getSystemInfoSync()
console.log(sysInfo.brand)
if (sysInfo.brand == 'Huawei') {
wx.showModal({
title: '拨打400电话',
content: '华为手机用户请手动输入分机号:' + realPhone.split(",")[1],
showCancel: true,
success: function (res) {
console.log(res)
if(res.confirm == true){
wx.makePhoneCall({
phoneNumber: realPhone,
})
}
}
})
}else{
wx.showModal({
title: '拨打400电话',
content: '将自动为您转拨楼盘分机号',
showCancel: true,
success: function(res){
if(res.confirm == true){
wx.makePhoneCall({
phoneNumber: realPhone,
})
}
}
})
}
getUserInfo还是用接口形式比较友好
s***:
经过实验,华为系统会把分区号去掉,暂时没有解决方法。