wx.onNeedPrivacyAuthorization(resolve => {
console.log(2);
this.resolvePrivacyAuthorization = resolve
})
handleAgreePrivacyAuthorization() {
let that = this;
that.resolvePrivacyAuthorization({
buttonId: 'agree-btn',
event: 'agree'
})
// 用户同意隐私协议事件回调
console.log('用户同意隐私协议事件回调');
},
resolvePrivacyAuthorization 你这个方法 都没有声明,用this.resolvePrivacyAuthorization肯定会报错啊。然后建议你直接参考这个链接里的方案改吧:
https://developers.weixin.qq.com/community/develop/article/doc/0002aac6d6ce70522140e35ae6b813
打印一下this.resolvePrivacyAuthorization
看是个啥
onLoad中请求api
wx.onNeedPrivacyAuthorization(resolve => {
console.log(2);
this.resolvePrivacyAuthorization = resolve
})
隐私弹出框点击同意后触发下面这个事件,然后就报错this.resolvePrivacyAuthorization is not a function
handleAgreePrivacyAuthorization() {
let that = this;
that.resolvePrivacyAuthorization({
buttonId: 'agree-btn',
event: 'agree'
})
// 用户同意隐私协议事件回调
console.log('用户同意隐私协议事件回调');
},