errMsg: "chooseMedia:fail api scope is not declared in the privacy agreement"
<privacyPopup ref="refPrivacyPopup" />
wx.getPrivacySetting({
success: res => {
console.log('getPrivacySetting**', res)
this.needAuthorization = res.needAuthorization
if (res.needAuthorization) {
console.log('需要弹出隐私协议')
this.$refs.refPrivacyPopup.handleOpen(res.privacyContractName)
} else {
console.log('用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用隐私接口')
}
},
fail: () => {
console.log('getPrivacySetting fail**', res)
},
complete: () => {}
})
<button id="disagree-btn" type="default" class="btns reject-btn" @click="handleDisagree">拒绝</button>
<button id="agree-btn" type="default" open-type="agreePrivacyAuthorization" class="btns agree-btn"
bindagreeprivacyauthorization="handleAgree">同意并继续</button>
let privacyHandler
let privacyResolves = new Set()
let closeOtherPagePopUpHooks = new Set()
wx.onNeedPrivacyAuthorization(resolve => {
if (typeof privacyHandler === 'function') {
privacyHandler(resolve)
}
})
const closeOtherPagePopUp = (closePopUp) => {
closeOtherPagePopUpHooks.forEach(hook => {
if (closePopUp !== hook) {
hook()
}
})
}
handleAgree() {
console.log('同意', privacyResolves)
privacyResolves.forEach(resolve => {
console.log('handleAgree ', resolve)
resolve({
event: 'agree',
buttonId: 'agree-btn'
})
})
privacyResolves.clear()
},
handleDisagree() {
console.log('不同意 ', privacyResolves)
privacyResolves.forEach(resolve => {
console.log('handleDisagree ', resolve)
resolve({
event: 'disagree',
})
})
privacyResolves.clear()
this.handleClose()
}

问题:bindagreeprivacyauthorization="handleAgree"回调没有触发。