请问下getPhoneNumber的弹窗,点击“拒绝”后的事件怎么触发?
发布于 5 年前 作者 xiulandai 18958 次浏览 来自 问答

像这样,点击拒绝后不想让留在当前页面

2 回复

<button open-type=“bindgetphonenumber”/> 中是否可以收到回调

// 可以通过 wx.getSetting 查询用户是否授权
wx.getSetting({
    success(res) {
        if (!res.authSetting['scope.record']) {
            wx.authorize({
                scope: 'scope.record',
                success() {
                    // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
                    wx.startRecord()
                }
            })
        }
    }
})

https://mp.weixin.qq.com/debug/wxadoc/dev/api/authorize-index.html

回到顶部