| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- // component/privacy-popup/privacy-popup.ts
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- },
- /**
- * 组件的初始数据
- */
- data: {
- show: false,
- needAuthorization: false,
- privacyContractName: ''
- },
- /**
- * 组件的方法列表
- */
- methods: {
- check() {
- if (wx.canIUse('getPrivacySetting')) {
- wx.getPrivacySetting({
- success: res => {
- console.log(res)
- this.setData({
- ...res,
- show: res.needAuthorization
- })
- if (!res.needAuthorization) {
- this.privacySubmit()
- }
- }
- })
- } else {
- this.privacySubmit()
- }
- },
- handleAgreePrivacyAuthorization() {
- this.privacySubmit()
- },
- privacySubmit() {
- this.triggerEvent('privacySubmit')
- this.hidden()
- },
- hidden() {
- this.setData({
- show: false
- })
- },
- openPrivacyContract() {
- wx.openPrivacyContract({
- success() {
- console.log('打开隐私协议')
- }
- })
- }
- }
- })
|