提交 1b7e2882 编写于 作者: M mahaifeng

[privacy]添加隐私政策示例

上级 d49c73f7
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
"navigationBarTitleText": "textarea | 多行输入框" "navigationBarTitleText": "textarea | 多行输入框"
} }
}, },
// #ifdef APP-ANDROID // #ifdef APP
{ {
"path": "pages/component/open-type/open-type", "path": "pages/component/open-type/open-type",
"group": "0,3,12", "group": "0,3,12",
...@@ -1864,7 +1864,7 @@ ...@@ -1864,7 +1864,7 @@
}, },
{ {
"path" : "pages/API/dialog-page/dialog-privacytest", "path" : "pages/API/dialog-page/dialog-privacytest",
"style" : "style" :
{ {
"navigationBarTitleText" : "" "navigationBarTitleText" : ""
} }
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
export default { export default {
data() { data() {
return { return {
number: 0
} }
}, },
unmounted() {
uni.offPrivacyAuthorizationChange(this.number)
},
onLoad() { onLoad() {
uni.onPrivacyAuthorizationChange((callback) => { this.number = uni.onPrivacyAuthorizationChange((callback) => {
uni.showToast({ uni.showToast({
title: 'isPrivacyAgree:' + !callback.needAuthorization title: 'isPrivacyAgree:' + !callback.needAuthorization
}) })
......
...@@ -15,10 +15,15 @@ ...@@ -15,10 +15,15 @@
return { return {
isAgreeRes: false, isAgreeRes: false,
log: "", log: "",
number: 0
} }
}, },
unmounted() {
console.log('unmounted', this.number)
uni.offPrivacyAuthorizationChange(this.number)
},
onLoad() { onLoad() {
uni.onPrivacyAuthorizationChange((callback) => { this.number = uni.onPrivacyAuthorizationChange((callback) => {
this.isAgreeRes = !callback.needAuthorization this.isAgreeRes = !callback.needAuthorization
uni.showToast({ uni.showToast({
title: 'isPrivacyAgree:' + this.isAgreeRes title: 'isPrivacyAgree:' + this.isAgreeRes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册