微信小程序拨打电话点取消报错“errMsg“:“makePhoneCall:fail cancel“

问题:微信小程序中拨打电话点取消,控制台报错"errMsg":"makePhoneCall:fail cancel"

解决方法:在后面加上catch就可以解决这个报错

 wx.makePhoneCall({
        phoneNumber: '181********'
      })
      .catch((e) => {
         console.log(e)  //用catch(e)来捕获错误{makePhoneCall:fail cancel}
      }) 

注意:用拨打电话参数必须是字符串格式。

猜你喜欢

转载自blog.csdn.net/weixin_69670563/article/details/142375457