Commit 047ef2c495679ebb9338e56885650766451d1066
1 parent
b661d29e
隐私政策的优化
Showing
8 changed files
with
176 additions
and
17 deletions
app.wxss
... | ... | @@ -367,6 +367,7 @@ button { |
367 | 367 | .ai_end{ |
368 | 368 | align-items: flex-end; |
369 | 369 | } |
370 | + | |
370 | 371 | .cover-layer { |
371 | 372 | position: fixed; |
372 | 373 | left: 0; |
... | ... | @@ -1332,4 +1333,10 @@ background: #ffe3e2; |
1332 | 1333 | 100% { |
1333 | 1334 | transform: translateY(550rpx); |
1334 | 1335 | } |
1335 | -} | |
1336 | 1336 | \ No newline at end of file |
1337 | +} | |
1338 | + | |
1339 | +checkbox .wx-checkbox-input { | |
1340 | + width: 32rpx !important; | |
1341 | + height: 32rpx !important; | |
1342 | + margin-right: 16rpx; | |
1343 | +} | ... | ... |
components/privacy_pop/privacy_pop.js
0 → 100644
1 | +var t = getApp(),os =t.globalData.setting; | |
2 | +Component({ | |
3 | + properties: { | |
4 | + }, | |
5 | + data: { | |
6 | + show_pri:0, | |
7 | + is_all_ok:0, | |
8 | + store:null | |
9 | + }, | |
10 | + //获取一下商家的信息 | |
11 | + ready: function () { | |
12 | + getApp().getConfig(e=>{ | |
13 | + this.setData({store:e}) | |
14 | + }) | |
15 | + }, | |
16 | + methods: { | |
17 | + //判断用户有没有同意安全隐私 | |
18 | + check_pri_show(){ | |
19 | + wx.getPrivacySetting({ | |
20 | + success: res => { | |
21 | + console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' } | |
22 | + if (res.needAuthorization) { | |
23 | + // 需要弹出隐私协议 | |
24 | + this.setData({ | |
25 | + show_pri: 1 | |
26 | + }) | |
27 | + } | |
28 | + } | |
29 | + }) | |
30 | + }, | |
31 | + //--- 分享 --- | |
32 | + goto:function (e) { | |
33 | + var url= e.currentTarget.dataset.url; | |
34 | + getApp().goto(url); | |
35 | + }, | |
36 | + need_ok:function (){ | |
37 | + wx.showToast({ | |
38 | + title: '请您先阅读和勾选指定的内容', | |
39 | + icon: 'none', | |
40 | + }); | |
41 | + }, | |
42 | + //同意隐私的内容 | |
43 | + AgreePrivacy:function (){ | |
44 | + this.setData({show_pri:0,}); | |
45 | + this.triggerEvent('agree_pri');// 调用同意的函数 | |
46 | + }, | |
47 | + | |
48 | + // 是否同意协议 | |
49 | + isAgree(e) { | |
50 | + let isAgree = null; | |
51 | + if (e.detail.value[0]) { | |
52 | + isAgree = true; | |
53 | + } else { isAgree = false;} | |
54 | + | |
55 | + this.setData({ | |
56 | + is_all_ok:isAgree, | |
57 | + }); | |
58 | + }, | |
59 | + | |
60 | + } | |
61 | + | |
62 | +}) | |
63 | + | ... | ... |
components/privacy_pop/privacy_pop.json
0 → 100644
components/privacy_pop/privacy_pop.wxml
0 → 100644
1 | +<view wx:if="{{show_pri}}"> | |
2 | + <!-- 遮罩层 --> | |
3 | + <view class="cover-layer" style="z-index:11111"></view> | |
4 | + <!-- 内容层 --> | |
5 | + <view class="privacy_view"> | |
6 | + <view class="pri_title"> | |
7 | + 隐私政策更新提示 | |
8 | + </view> | |
9 | + <view class="pri_content"> | |
10 | + <view class="pri_content_p" > | |
11 | + 为了更好地保障您的权益,我们更新了《{{store.store_name}}小程序隐私政策》,本次更新主要包括: | |
12 | + | |
13 | + <view style="margin:40rpx 0">1. 调整注销账户功能的描述</view> | |
14 | + | |
15 | + 请您务必在勾选同意前仔细阅读、充分理解《{{store.store_name}}小程序隐私政策》的内容。若您不同意《{{store.store_name}}小程序隐私政策》的内容,请您选择不同意或立即停止使用我们的产品 | |
16 | + | |
17 | + <view style="margin-top:40rpx">如您对上述内容有任何疑问,可与我们电话联系[{{store.store_tel}}]</view> | |
18 | + </view> | |
19 | + </view> | |
20 | + | |
21 | + <!-- 用户使用协议和隐私政策 --> | |
22 | + <view class="pri_btn"> | |
23 | + <view class="flex-vertical fs24"> | |
24 | + <checkbox-group bindchange="isAgree"> | |
25 | + <checkbox class="m_ck_box" value="true"> | |
26 | + <label for="true"> | |
27 | + <view class="user-name-txt">我已阅读同意 <text class="gray" catchtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=0">《用户使用协议》</text>与<text class="gray" catchtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=1">《隐私政策》</text></view> | |
28 | + </label> | |
29 | + </checkbox> | |
30 | + </checkbox-group> | |
31 | + </view> | |
32 | + </view> | |
33 | + | |
34 | + <view class="pri_btn"> | |
35 | + <block wx:if="{{!is_all_ok}}"> | |
36 | + <button class="continue_btn" bindtap="need_ok"> | |
37 | + <view class="flex flex-center ali-c"> | |
38 | + <view>同意,继续使用</view> | |
39 | + </view> | |
40 | + </button> | |
41 | + </block> | |
42 | + <block wx:else> | |
43 | + <button class="continue_btn" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="AgreePrivacy"> | |
44 | + <view class="flex flex-center ali-c"> | |
45 | + <view>同意,继续使用</view> | |
46 | + </view> | |
47 | + </button> | |
48 | + </block> | |
49 | + </view> | |
50 | + | |
51 | + </view> | |
52 | +</view> | ... | ... |
components/privacy_pop/privacy_pop.wxss
0 → 100644
1 | +@import '../../app.wxss'; | |
2 | +.privacy_view{ | |
3 | + position: fixed; z-index: 110000; background-color: #fff; | |
4 | + left:50%;top: 50%;border-radius: 10rpx; | |
5 | + width: 640rpx;margin-left: -320rpx; | |
6 | + height:940rpx;margin-top: -470rpx; | |
7 | +} | |
8 | +.pri_title{ | |
9 | + color:#333;text-align: center;font-size: 30rpx; margin: 20rpx 0; | |
10 | +} | |
11 | +.pri_content{ | |
12 | + border: 1rpx solid #eee; color:#666; height: 560rpx;width: 600rpx; margin: 0 auto; font-size: 26rpx; | |
13 | +} | |
14 | +.pri_content_p{ width: 560rpx;display: block; margin-top: 20rpx;margin-left: 20rpx;} | |
15 | +.pri_btn{width: 600rpx; margin: 0 auto;margin-top: 20rpx} | |
16 | +.gray {color: #767f8e;} | |
17 | +.continue_btn{ | |
18 | + width: 600rpx; | |
19 | + height: 94rpx; | |
20 | + line-height: 94rpx; | |
21 | + background-color: #f23030; | |
22 | + border-radius: 48rpx; | |
23 | + color: rgb(255,255,255); | |
24 | + font-size: 32rpx; | |
25 | + margin-top: 40rpx; | |
26 | +} | |
27 | + | ... | ... |
pages/index/index/index.js
... | ... | @@ -391,13 +391,18 @@ Page({ |
391 | 391 | |
392 | 392 | async onShow() { |
393 | 393 | |
394 | - getApp().check_can_share(); | |
394 | + //-- 看一下隐私政策要不要显示 -- | |
395 | + var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id | |
396 | + if (privacy_pop) { | |
397 | + privacy_pop.check_pri_show(); | |
398 | + } | |
395 | 399 | |
396 | - if (typeof this.getTabBar === 'function' && this.getTabBar()) { | |
397 | - this.getTabBar().setData({ | |
398 | - cartGoodsNum: getApp().globalData.cartGoodsNum | |
399 | - }) | |
400 | - } | |
400 | + getApp().check_can_share(); | |
401 | + if (typeof this.getTabBar === 'function' && this.getTabBar()) { | |
402 | + this.getTabBar().setData({ | |
403 | + cartGoodsNum: getApp().globalData.cartGoodsNum | |
404 | + }) | |
405 | + } | |
401 | 406 | var th = this; |
402 | 407 | //-- 登录回来判断弹框 -- |
403 | 408 | var user_id = getApp().globalData.user_id; |
... | ... | @@ -418,7 +423,7 @@ Page({ |
418 | 423 | console.log(this.data.isTemplate, '首页'); |
419 | 424 | |
420 | 425 | if (!this.data.isTemplate) { |
421 | - // timetype: 1 仅查询已预售 置空查询全部, | |
426 | + //timetype: 1 仅查询已预售 置空查询全部, | |
422 | 427 | var pre_data = { store_id: os.stoid, is_end: 0, isuse: 1,timetype:3 }; |
423 | 428 | if (user_id) { |
424 | 429 | pre_data.user_id = user_id; | ... | ... |
pages/index/index/index.json
... | ... | @@ -18,14 +18,15 @@ |
18 | 18 | "picMax": "/components/diy_picMax/diy_picMax", |
19 | 19 | "mvideo": "/components/diy_video/diy_video", |
20 | 20 | "service": "/components/diy_service/diy_service", |
21 | - "scan": "/components/diy_scan/diy_scan", | |
22 | - "store_select": "/components/diy_store_select/diy_store_select", | |
21 | + "scan": "/components/diy_scan/diy_scan", | |
22 | + "store_select": "/components/diy_store_select/diy_store_select", | |
23 | 23 | "presell": "/components/diy_pregoods/diy_pregoods", |
24 | - "luckyGo": "/components/diy_luckyGo/diy_luckyGo", | |
25 | - "serviceCard": "/components/diy_serviceCard/diy_serviceCard", | |
26 | - "live": "/components/diy_live/diy_live", | |
27 | - "mp-dialog": "weui-miniprogram/dialog/dialog", | |
28 | - "mp-sticky": "/components/mp-sticky/mp-sticky" | |
24 | + "luckyGo": "/components/diy_luckyGo/diy_luckyGo", | |
25 | + "serviceCard": "/components/diy_serviceCard/diy_serviceCard", | |
26 | + "live": "/components/diy_live/diy_live", | |
27 | + "mp-dialog": "weui-miniprogram/dialog/dialog", | |
28 | + "mp-sticky": "/components/mp-sticky/mp-sticky", | |
29 | + "privacy_pop": "/components/privacy_pop/privacy_pop" | |
29 | 30 | }, |
30 | 31 | "enablePullDownRefresh": false, |
31 | 32 | "onReachBottomDistance":300 | ... | ... |
pages/index/index/index.wxml
1 | +<!-- 判断隐私是不是显示 --> | |
2 | +<privacy_pop id="privacy_pop"></privacy_pop> | |
1 | 3 | <!-- 全屏控制 --> |
2 | 4 | <view wx:if="{{is_full_screen_show && full_ad && !full_ad.show_type}}" class="full_screen" bindtap="go_full_ad" style="background-image: url('{{url+full_ad.ad_code}}');"> |
3 | 5 | <view catchtap="close_full_screen" class="skip_box">跳过 <text>{{sec_show}}</text></view> |
... | ... | @@ -406,8 +408,6 @@ |
406 | 408 | </view> |
407 | 409 | </view> |
408 | 410 | |
409 | - | |
410 | - | |
411 | 411 | <block wx:if="{{f_hidden}}"> |
412 | 412 | <!--是否是自定义--> |
413 | 413 | <view class="container" wx:if="{{isTemplate}}" style="background-color:{{bgcolor_t}}; padding-bottom: 10rpx"> | ... | ... |