From 1b7e2882646e14fba14e41a2251a922b2088c682 Mon Sep 17 00:00:00 2001 From: mahaifeng Date: Thu, 26 Sep 2024 11:45:11 +0800 Subject: [PATCH] =?UTF-8?q?[privacy]=E6=B7=BB=E5=8A=A0=E9=9A=90=E7=A7=81?= =?UTF-8?q?=E6=94=BF=E7=AD=96=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 4 ++-- pages/API/dialog-page/dialog-privacytest.uvue | 7 +++++-- pages/component/open-type/open-type.uvue | 7 ++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pages.json b/pages.json index c22aa3eb..da70da56 100644 --- a/pages.json +++ b/pages.json @@ -205,7 +205,7 @@ "navigationBarTitleText": "textarea | 多行输入框" } }, - // #ifdef APP-ANDROID + // #ifdef APP { "path": "pages/component/open-type/open-type", "group": "0,3,12", @@ -1864,7 +1864,7 @@ }, { "path" : "pages/API/dialog-page/dialog-privacytest", - "style" : + "style" : { "navigationBarTitleText" : "" } diff --git a/pages/API/dialog-page/dialog-privacytest.uvue b/pages/API/dialog-page/dialog-privacytest.uvue index 18dc793b..b844fc39 100644 --- a/pages/API/dialog-page/dialog-privacytest.uvue +++ b/pages/API/dialog-page/dialog-privacytest.uvue @@ -16,11 +16,14 @@ export default { data() { return { - + number: 0 } }, + unmounted() { + uni.offPrivacyAuthorizationChange(this.number) + }, onLoad() { - uni.onPrivacyAuthorizationChange((callback) => { + this.number = uni.onPrivacyAuthorizationChange((callback) => { uni.showToast({ title: 'isPrivacyAgree:' + !callback.needAuthorization }) diff --git a/pages/component/open-type/open-type.uvue b/pages/component/open-type/open-type.uvue index 9ff2f4be..2ee0d20c 100644 --- a/pages/component/open-type/open-type.uvue +++ b/pages/component/open-type/open-type.uvue @@ -15,10 +15,15 @@ return { isAgreeRes: false, log: "", + number: 0 } }, + unmounted() { + console.log('unmounted', this.number) + uni.offPrivacyAuthorizationChange(this.number) + }, onLoad() { - uni.onPrivacyAuthorizationChange((callback) => { + this.number = uni.onPrivacyAuthorizationChange((callback) => { this.isAgreeRes = !callback.needAuthorization uni.showToast({ title: 'isPrivacyAgree:' + this.isAgreeRes -- GitLab