From b4db6596209e2fe37fd5479c34c525be3e61699b Mon Sep 17 00:00:00 2001 From: zoujiandong <10130823232@qq.com> Date: Fri, 8 Sep 2023 09:35:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=B9=E6=A1=86=E9=9A=90=E7=A7=81=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pages/index/index.js | 43 ++++++++++++++++++++++++++----------- Pages/index/index.wxml | 1 + Pages/login/index.js | 40 ++++++++++++++++++++++++---------- Pages/login/index.wxml | 1 + app.json | 1 + project.private.config.json | 2 +- 6 files changed, 63 insertions(+), 25 deletions(-) diff --git a/Pages/index/index.js b/Pages/index/index.js index 2afd403..78bf2f1 100644 --- a/Pages/index/index.js +++ b/Pages/index/index.js @@ -20,7 +20,7 @@ Page({ static_host: api.getStaticHost() }, onConfirmEntry(){ - wx.setStorageSync('hasEntry', true); + //wx.setStorageSync('hasEntry', true); }, onCloseEntry(){ this.setData({ @@ -72,20 +72,37 @@ Page({ tabBarShow:false, //true/false }) } + wx.getPrivacySetting({ + success: res => { + console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' } + if (res.needAuthorization) { + // 需要弹出隐私协议 + this.setData({ + showEntryTip:true + }) + } else { + this.setData({ + showEntryTip:false + }) + // 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用已声明过的隐私 + } + }, + fail: () => {}, + complete: () => {} + }) this.setData({ loading: false }); - let isEntry=wx.getStorageSync('hasEntry'); - - console.log("onshow:"+isEntry) - if(!isEntry){ - this.setData({ - showEntryTip:true - }); + // let isEntry=wx.getStorageSync('hasEntry'); + // console.log("onshow:"+isEntry) + // if(!isEntry){ + // this.setData({ + // showEntryTip:true + // }); - }else{ - this.setData({ - showEntryTip:false - }); - } + // }else{ + // this.setData({ + // showEntryTip:false + // }); + // } }, goCheck(e){ diff --git a/Pages/index/index.wxml b/Pages/index/index.wxml index 6b83382..5954550 100644 --- a/Pages/index/index.wxml +++ b/Pages/index/index.wxml @@ -39,6 +39,7 @@ bind:confirm="onConfirmEntry" bind:cancel="onCloseEntry" before-close="{{beforeClose}}" + confirm-button-open-type="agreePrivacyAuthorization" > 亲爱的用户,感谢您信任并使用肝胆相照互联网医院医师端!我们依据最新法律法规的要求,制定了《隐私协议》。请您仔细阅《隐私协议》,并确认了解我们对您的个人信息处理原则。 diff --git a/Pages/login/index.js b/Pages/login/index.js index 0bbfb07..c89a801 100644 --- a/Pages/login/index.js +++ b/Pages/login/index.js @@ -33,16 +33,34 @@ Page({ url: "/Pages/index/index" }) }; - let isEntry=wx.getStorageSync('hasEntry'); - if(!isEntry){ - this.setData({ - showEntryTip:true, - }); - }else{ - this.setData({ - showEntryTip:false - }); - } + wx.getPrivacySetting({ + success: res => { + console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' } + if (res.needAuthorization) { + // 需要弹出隐私协议 + this.setData({ + showEntryTip:true + }) + } else { + this.setData({ + showEntryTip:false + }) + // 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用已声明过的隐私 + } + }, + fail: () => {}, + complete: () => {} + }) + // let isEntry=wx.getStorageSync('hasEntry'); + // if(!isEntry){ + // this.setData({ + // showEntryTip:true, + // }); + // }else{ + // this.setData({ + // showEntryTip:false + // }); + // } }, onChange(event) { this.setData({ @@ -59,7 +77,7 @@ Page({ wx.navigateBack() }, onConfirmEntry(){ - wx.setStorageSync('hasEntry', true); + // wx.setStorageSync('hasEntry', true); }, onCloseEntry(){ this.setData({ diff --git a/Pages/login/index.wxml b/Pages/login/index.wxml index b890e15..8c29100 100644 --- a/Pages/login/index.wxml +++ b/Pages/login/index.wxml @@ -51,6 +51,7 @@ bind:confirm="onConfirmEntry" bind:cancel="onCloseEntry" before-close="{{beforeClose}}" + confirm-button-open-type="agreePrivacyAuthorization" > 亲爱的用户,感谢您信任并使用肝胆相照互联网医院医师端!我们依据最新法律法规的要求,制定了《隐私协议》。请您仔细阅《隐私协议》,并确认了解我们对您的个人信息处理原则。 diff --git a/app.json b/app.json index 12a4604..09137e7 100644 --- a/app.json +++ b/app.json @@ -105,5 +105,6 @@ } ] }, + "__usePrivacyCheck__": true, "sitemapLocation": "sitemap.json" } \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index 982700a..f83046b 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -18,5 +18,5 @@ ] } }, - "libVersion": "2.32.0" + "libVersion": "3.0.1" } \ No newline at end of file