privacy_pop.js
1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
var t = getApp(),os =t.globalData.setting;
Component({
properties: {
},
data: {
show_pri:0,
is_all_ok:0,
store:null
},
//获取一下商家的信息
ready: function () {
getApp().getConfig(e=>{
this.setData({store:e})
})
},
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
})
}
}
})
},
//--- 分享 ---
goto:function (e) {
var url= e.currentTarget.dataset.url;
getApp().goto(url);
},
need_ok:function (){
wx.showToast({
title: '请您先阅读和勾选指定的内容',
icon: 'none',
});
},
//同意隐私的内容
AgreePrivacy:function (){
this.setData({show_pri:0,});
this.triggerEvent('agree_pri');// 调用同意的函数
},
// 是否同意协议
isAgree(e) {
let isAgree = null;
if (e.detail.value[0]) {
isAgree = true;
} else { isAgree = false;}
this.setData({
is_all_ok:isAgree,
});
},
}
})