diff --git a/components/privacy_pop/privacy_pop.js b/components/privacy_pop/privacy_pop.js index 1ec796c..9e03040 100644 --- a/components/privacy_pop/privacy_pop.js +++ b/components/privacy_pop/privacy_pop.js @@ -17,22 +17,24 @@ Component({ methods: { //判断用户有没有同意安全隐私 check_pri_show(){ - wx.getPrivacySetting({ - success: res => { - console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' } - if (res.needAuthorization) { - // 需要弹出隐私协议 - this.setData({ - show_pri: 1 - }) - }else{ - this.setData({ - show_pri: 0 - }) - this.triggerEvent('agree_pri');// 调用同意的函数 - } - } - }) + if(wx.getPrivacySetting){ + wx.getPrivacySetting({ + success: res => { + console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' } + if (res.needAuthorization) { + // 需要弹出隐私协议 + this.setData({ + show_pri: 1 + }) + }else{ + this.setData({ + show_pri: 0 + }) + this.triggerEvent('agree_pri');// 调用同意的函数 + } + } + }) + } }, //--- 分享 --- goto:function (e) {