Commit ad07eacbe5ddd2475e505cfe5ca50d22e4b0ea4e
1 parent
40716d94
隐私的兼容性
Showing
1 changed file
with
18 additions
and
16 deletions
components/privacy_pop/privacy_pop.js
| @@ -17,22 +17,24 @@ Component({ | @@ -17,22 +17,24 @@ Component({ | ||
| 17 | methods: { | 17 | methods: { |
| 18 | //判断用户有没有同意安全隐私 | 18 | //判断用户有没有同意安全隐私 |
| 19 | check_pri_show(){ | 19 | check_pri_show(){ |
| 20 | - wx.getPrivacySetting({ | ||
| 21 | - success: res => { | ||
| 22 | - console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' } | ||
| 23 | - if (res.needAuthorization) { | ||
| 24 | - // 需要弹出隐私协议 | ||
| 25 | - this.setData({ | ||
| 26 | - show_pri: 1 | ||
| 27 | - }) | ||
| 28 | - }else{ | ||
| 29 | - this.setData({ | ||
| 30 | - show_pri: 0 | ||
| 31 | - }) | ||
| 32 | - this.triggerEvent('agree_pri');// 调用同意的函数 | ||
| 33 | - } | ||
| 34 | - } | ||
| 35 | - }) | 20 | + if(wx.getPrivacySetting){ |
| 21 | + wx.getPrivacySetting({ | ||
| 22 | + success: res => { | ||
| 23 | + console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' } | ||
| 24 | + if (res.needAuthorization) { | ||
| 25 | + // 需要弹出隐私协议 | ||
| 26 | + this.setData({ | ||
| 27 | + show_pri: 1 | ||
| 28 | + }) | ||
| 29 | + }else{ | ||
| 30 | + this.setData({ | ||
| 31 | + show_pri: 0 | ||
| 32 | + }) | ||
| 33 | + this.triggerEvent('agree_pri');// 调用同意的函数 | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + }) | ||
| 37 | + } | ||
| 36 | }, | 38 | }, |
| 37 | //--- 分享 --- | 39 | //--- 分享 --- |
| 38 | goto:function (e) { | 40 | goto:function (e) { |