收藏
回答

wx.authorize授權后再獲取地址信息報錯?

wx.getSetting({

      success: res=>{

        if (res.authSetting['scope.userLocation']) {

          //用户已授权

          this.getLocation();

        } else{

          //用户未授权

          wx.authorize({

            scope: 'scope.userLocation',

            success: resSuc=>{

              this.getLocation();

            },

            fail: errSuc => {

              hud.hideLoading();

              wx.showModal({

                title: '提示',

                content: '请前往设置打开位置权限',

                success(reso) {

                  if(reso.confirm{

                    wx.openSetting({

                      success(resn) {

                      }

                    })

                  } else {

                  }

                }

              })

            }

          })

        }

      }

    })


getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF"

使用流量的情況,安卓系統

最后一次编辑于  2021-05-13
回答关注问题邀请回答
收藏
登录 后发表内容