收藏
回答

请问下getPhoneNumber的弹窗,点击“拒绝”后的事件怎么触发?

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

回答关注问题邀请回答
收藏

2 个回答

  • 黄思程
    黄思程
    2017-11-15

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

    2017-11-15
    有用
    回复
  • 2017-11-15
    // 可以通过 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


    2017-11-15
    有用
    回复
登录 后发表内容