华为手机拨打电话时分机号码没有了
发布于 6 年前 作者 chaozheng 20077 次浏览 来自 问答

phoneNumber格式为"座机号码,分机号码",iphone及其他安卓(现有)能正常拨打分机号,华为手机不能.

3 回复

经过实验,华为系统会把分区号去掉,暂时没有解决方法。

直接调用小程序的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,
              })
            }
          }
        })
      }
回到顶部