小程序拨打电话api报错makePhoneCall:fail cancel

时间:2021-04-29 16:06:43   收藏:0   阅读:60

源代码

   wx.makePhoneCall({
      phoneNumber: app.globalData.phoneNumber,
    })

  

 
技术分享图片

 

 

只需要在后面加上catch就可以解决这个报错

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

  

原文:https://www.cnblogs.com/zhangyouwu/p/14716932.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!