| | |
| | | console.log('同意隐私授权') |
| | | } |
| | | const privacyComponent =ref(null) |
| | | onShow(() =>{ |
| | | wx.getPrivacySetting({ |
| | | success: res => { |
| | | console.log(res) |
| | | if (!res.needAuthorization) { |
| | | privacyComponent?.value?.closePrivacy() |
| | | // 查询授权,针对有tab切换的页面,可以在onshow中查询隐私授权状态,判断在tab切换后是否需要关闭授权弹框 |
| | | console.log('已经同意隐私授权,不需要再次授权') |
| | | } |
| | | }, |
| | | fail: () => {}, |
| | | complete: () => {} |
| | | }) |
| | | }) |
| | | // onShow(() =>{ |
| | | // wx.getPrivacySetting({ |
| | | // success: res => { |
| | | // console.log(res) |
| | | // if (!res.needAuthorization) { |
| | | // privacyComponent?.value?.closePrivacy() |
| | | // // 查询授权,针对有tab切换的页面,可以在onshow中查询隐私授权状态,判断在tab切换后是否需要关闭授权弹框 |
| | | // console.log('已经同意隐私授权,不需要再次授权') |
| | | // } |
| | | // }, |
| | | // fail: () => {}, |
| | | // complete: () => {} |
| | | // }) |
| | | // }) |
| | | // #endif |
| | | </script> |
| | | |