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

源代码

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

  

 

 

 

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

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

  

posted @ 2021-04-29 10:21  zhang_you_wu  阅读(822)  评论(0)    收藏  举报