小程序跳转到授权提示未使用你的任何信息
发布于 5 年前 作者 qianxiulan 9650 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)

谁遇到过这样的问题啊,位置授权不是用户信息授权,偶尔会出现这个问题,不是说每次都出现这个问题!但是有些机型打开就一直出现这个问题!

  • 附代码:

wx.getSetting({

                    success: function (res) {

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

                            wx.showModal({

                                title: '是否授权当前位置',

                                content: '需要获取您的地理位置,请确认授权,否则将无法使用本平台',

                                success: function (tip) {

                                    if (tip.confirm) {

                                        wx.openSetting({

                                            success: function (data) {

                                                if (data.authSetting["scope.userLocation"] === true) {

                                                    //授权成功之后,再调用chooseLocation选择地方

                                                     

                                                }else{

                                                    wx.showModal({

                                                        title: '系统提示',

                                                        content: '授权失败',

                                                        showCancel: false,

                                                        cancelText: '',

                                                        confirmText: '确定'

                                                    });

                                                }

                                            }

                                        })

                                    }

                                }

                            })

                        }else{

                            //若已授权

                        }

                    },

                    fail: function (res) {

                        wx.showToast({

                            title: '调用授权窗口失败',

                            icon: 'success',

                            duration: 1000

                        })

                    }

                })

代码片段:https://developers.weixin.qq.com/s/eTtJlemJ7279 代码片段好像无法跳转到授权设置页面,代码是一样看代码吧!

4 回复

最后怎么解决的能说一下吗

app.json文件里设置了么??

permission 这个参数

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

现在社区衰败了吗?都没人?

回到顶部