小程序点击进入设置没有位置信息?

发布于 6 年前作者 juan909112 次浏览最后编辑 6 年前来自 ask

使用uniapp配置的"permission" : {

            “scope.userLocation” : {

                “desc” : “商城定位”

            }

        },

但是进去设置里显示xxx未使用你的任何信息

1 回复
gangren
gangren1 楼4 年前

需要用户授权的。

wx.getSetting({
  success(res) {
    if (!res.authSetting['scope.userLocation']) {
      wx.authorize({
        scope: 'scope.userLocation',
        success () {
          wx.getLocation()
        }
      })
    }
  }
})