Commit 00ddf4f0432ef33f8f2b65cb21c8aa72752b719b

Authored by yvan.ni
1 parent affc0b6a

小程序增加隐私协议授权,对应弹出的场景:④商品详情页的优化完成

components/privacy_pop/privacy_pop.js
@@ -13,6 +13,7 @@ Component({ @@ -13,6 +13,7 @@ Component({
13 this.setData({store:e}) 13 this.setData({store:e})
14 }) 14 })
15 }, 15 },
  16 +
16 methods: { 17 methods: {
17 //判断用户有没有同意安全隐私 18 //判断用户有没有同意安全隐私
18 check_pri_show(){ 19 check_pri_show(){
@@ -25,6 +26,9 @@ Component({ @@ -25,6 +26,9 @@ Component({
25 show_pri: 1 26 show_pri: 1
26 }) 27 })
27 }else{ 28 }else{
  29 + this.setData({
  30 + show_pri: 0
  31 + })
28 this.triggerEvent('agree_pri');// 调用同意的函数 32 this.triggerEvent('agree_pri');// 调用同意的函数
29 } 33 }
30 } 34 }
packageA/pages/goodsInfo/goodsInfo.js
@@ -560,6 +560,12 @@ Page({ @@ -560,6 +560,12 @@ Page({
560 // gid 在onload阶段已经保存在this.data中 560 // gid 在onload阶段已经保存在this.data中
561 onShow: function() { 561 onShow: function() {
562 562
  563 + //-- 看一下隐私政策要不要显示 --
  564 + var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id
  565 + if (privacy_pop) {
  566 + privacy_pop.check_pri_show();
  567 + }
  568 +
563 getApp().check_can_share(); 569 getApp().check_can_share();
564 570
565 var that=this;var th=this; 571 var that=this;var th=this;
@@ -4047,22 +4053,43 @@ Page({ @@ -4047,22 +4053,43 @@ Page({
4047 hiddenCS: true, 4053 hiddenCS: true,
4048 }); 4054 });
4049 }, 4055 },
4050 -  
4051 -  
4052 -  
4053 -  
4054 -  
4055 -  
4056 4056
4057 -  
4058 -  
4059 -  
4060 4057
  4058 + //-- 弹出框的同意的优化,重新获取定位 ---
  4059 + agree_pri:function (){
  4060 + var th=this;
  4061 + var bconfig = th.data.bconfig;
  4062 + if (bconfig && bconfig.is_sort_storage) {
  4063 + wx.getLocation({
  4064 + type: 'gcj02',
  4065 + success: function (res) {
  4066 +
  4067 + th.data.lat = res.latitude;
  4068 + th.data.lon = res.longitude;
  4069 + th.data.is_get_local_ok = 1;
  4070 + th.setData({is_gps: 1});
  4071 + th.get_sto();
  4072 + },
  4073 + fail: function (res) {
  4074 + th.data.is_get_local_ok = 1;
  4075 + th.get_sto();
  4076 + if (res.errCode == 2) {
  4077 + th.setData({is_gps: 0});
  4078 + if (th.data.is_gps == 0) {
  4079 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  4080 + }
  4081 + } else {
  4082 + th.setData({is_gps: "3"});
  4083 + }
  4084 +
  4085 + }
  4086 + })
  4087 + }
  4088 + },
  4089 +
4061 4090
4062 -  
4063 4091
4064 4092
4065 -  
4066 }); 4093 });
4067 4094
4068 4095
packageA/pages/goodsInfo/goodsInfo.json
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 "usingComponents": { 4 "usingComponents": {
5 "nav_box": "/components/nav_box/nav_box", 5 "nav_box": "/components/nav_box/nav_box",
6 "warn": "/components/long_warn/long_warn", 6 "warn": "/components/long_warn/long_warn",
7 - "serviceCard_recommend": "/components/serviceCard_list/serviceCard_list" 7 + "serviceCard_recommend": "/components/serviceCard_list/serviceCard_list",
  8 + "privacy_pop": "/components/privacy_pop/privacy_pop"
8 } 9 }
9 } 10 }
10 \ No newline at end of file 11 \ No newline at end of file
packageA/pages/goodsInfo/goodsInfo.wxml
@@ -3,6 +3,9 @@ @@ -3,6 +3,9 @@
3 <wxs module="g_filters" src="g_filter.wxs"></wxs> 3 <wxs module="g_filters" src="g_filter.wxs"></wxs>
4 <wxs module="tool" src="filter.wxs"></wxs> 4 <wxs module="tool" src="filter.wxs"></wxs>
5 5
  6 +<!-- 判断隐私是不是显示 -->
  7 +<privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop>
  8 +
6 <!-- 商品内容区域,普通商品,秒杀,拼团 --> 9 <!-- 商品内容区域,普通商品,秒杀,拼团 -->
7 <block wx:if="{{isshow}}"> 10 <block wx:if="{{isshow}}">
8 <view class="container"> 11 <view class="container">
packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js
@@ -554,6 +554,12 @@ Page({ @@ -554,6 +554,12 @@ Page({
554 // gid 在onload阶段已经保存在this.data中 554 // gid 在onload阶段已经保存在this.data中
555 onShow: function () { 555 onShow: function () {
556 556
  557 + //-- 看一下隐私政策要不要显示 --
  558 + var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id
  559 + if (privacy_pop) {
  560 + privacy_pop.check_pri_show();
  561 + }
  562 +
557 getApp().check_can_share(this); 563 getApp().check_can_share(this);
558 var that = this; 564 var that = this;
559 var ee = this, gid = this.data.gid, i = getApp().request; 565 var ee = this, gid = this.data.gid, i = getApp().request;
@@ -3885,6 +3891,38 @@ Page({ @@ -3885,6 +3891,38 @@ Page({
3885 getApp().goto(url); 3891 getApp().goto(url);
3886 }, 3892 },
3887 3893
  3894 + //-- 弹出框的同意的优化,重新获取定位 ---
  3895 + agree_pri:function (){
  3896 + var th=this;
  3897 + var bconfig = th.data.bconfig;
  3898 + if (bconfig && bconfig.is_sort_storage) {
  3899 + wx.getLocation({
  3900 + type: 'gcj02',
  3901 + success: function(res) {
  3902 +
  3903 + th.data.lat = res.latitude;
  3904 + th.data.lon = res.longitude;
  3905 + th.data.is_get_local_ok = 1;
  3906 + th.setData({ is_gps: 1 });
  3907 + th.get_sto();
  3908 + },
  3909 + fail: function(res) {
  3910 +
  3911 + th.data.is_get_local_ok = 1;
  3912 + th.get_sto();
  3913 + if (res.errCode == 2) {
  3914 + th.setData({is_gps: 0});
  3915 + if (th.data.is_gps == 0) {
  3916 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  3917 + }
  3918 + } else {
  3919 + th.setData({ is_gps: "3" });
  3920 + }
  3921 +
  3922 + }
  3923 + })
  3924 + }
  3925 + },
3888 3926
3889 }); 3927 });
3890 3928
packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.json
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 "nav_box": "/components/nav_box/nav_box", 5 "nav_box": "/components/nav_box/nav_box",
6 "warn": "/components/long_warn/long_warn", 6 "warn": "/components/long_warn/long_warn",
7 "serviceCard_recommend": "/components/serviceCard_list/serviceCard_list", 7 "serviceCard_recommend": "/components/serviceCard_list/serviceCard_list",
8 - "share": "/components/share/share" 8 + "share": "/components/share/share",
  9 + "privacy_pop": "/components/privacy_pop/privacy_pop"
9 } 10 }
10 } 11 }
11 \ No newline at end of file 12 \ No newline at end of file
packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml
@@ -3,6 +3,9 @@ @@ -3,6 +3,9 @@
3 <wxs module="g_filters" src="g_filter.wxs"></wxs> 3 <wxs module="g_filters" src="g_filter.wxs"></wxs>
4 <wxs module="tool" src="filter.wxs"></wxs> 4 <wxs module="tool" src="filter.wxs"></wxs>
5 5
  6 +<!-- 判断隐私是不是显示 -->
  7 +<privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop>
  8 +
6 <!-- 商品内容区域,普通商品,秒杀,拼团 --> 9 <!-- 商品内容区域,普通商品,秒杀,拼团 -->
7 <block wx:if="{{isshow}}"> 10 <block wx:if="{{isshow}}">
8 <view class="container"> 11 <view class="container">
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -898,6 +898,12 @@ Page({ @@ -898,6 +898,12 @@ Page({
898 //---展示--- 898 //---展示---
899 onShow: async function () { 899 onShow: async function () {
900 900
  901 + //-- 看一下隐私政策要不要显示 --
  902 + var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id
  903 + if (privacy_pop) {
  904 + privacy_pop.check_pri_show();
  905 + }
  906 +
901 //添加购物车的控制要清理0 907 //添加购物车的控制要清理0
902 this.data.adding=0; 908 this.data.adding=0;
903 909
@@ -7346,7 +7352,40 @@ Page({ @@ -7346,7 +7352,40 @@ Page({
7346 break; 7352 break;
7347 } 7353 }
7348 } 7354 }
7349 - } 7355 + },
  7356 +
  7357 + //-- 弹出框的同意的优化,重新获取定位 ---
  7358 + agree_pri:function (){
  7359 + var th=this;
  7360 + var bconfig = th.data.bconfig;
  7361 + if (bconfig && bconfig.is_sort_storage) {
  7362 + wx.getLocation({
  7363 + type: 'gcj02',
  7364 + success: function(res) {
  7365 +
  7366 + th.data.lat = res.latitude;
  7367 + th.data.lon = res.longitude;
  7368 + th.data.is_get_local_ok = 1;
  7369 + th.setData({ is_gps: 1 });
  7370 + th.get_sto();
  7371 + },
  7372 + fail: function(res) {
  7373 +
  7374 + th.data.is_get_local_ok = 1;
  7375 + th.get_sto();
  7376 + if (res.errCode == 2) {
  7377 + th.setData({is_gps: 0});
  7378 + if (th.data.is_gps == 0) {
  7379 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  7380 + }
  7381 + } else {
  7382 + th.setData({ is_gps: "3" });
  7383 + }
  7384 +
  7385 + }
  7386 + })
  7387 + }
  7388 + },
7350 7389
7351 7390
7352 7391
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.json
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 "nav_box": "/components/nav_box/nav_box", 5 "nav_box": "/components/nav_box/nav_box",
6 "warn": "/components/long_warn/long_warn", 6 "warn": "/components/long_warn/long_warn",
7 "goods_recommend": "/components/goods_list/goods_list", 7 "goods_recommend": "/components/goods_list/goods_list",
8 - "share": "/components/share/share" 8 + "share": "/components/share/share",
  9 + "privacy_pop": "/components/privacy_pop/privacy_pop"
9 } 10 }
10 } 11 }
11 \ No newline at end of file 12 \ No newline at end of file
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
@@ -3,6 +3,8 @@ @@ -3,6 +3,8 @@
3 <wxs module="g_filters" src="g_filter.wxs"></wxs> 3 <wxs module="g_filters" src="g_filter.wxs"></wxs>
4 <wxs module="tool" src="filter.wxs"></wxs> 4 <wxs module="tool" src="filter.wxs"></wxs>
5 5
  6 +<!-- 判断隐私是不是显示 -->
  7 +<privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop>
6 8
7 <!-- 商品内容区域,普通商品,秒杀,拼团 --> 9 <!-- 商品内容区域,普通商品,秒杀,拼团 -->
8 <block wx:if="{{isshow}}"> 10 <block wx:if="{{isshow}}">
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -703,6 +703,13 @@ Page({ @@ -703,6 +703,13 @@ Page({
703 703
704 //---展示--- 704 //---展示---
705 onShow: function () { 705 onShow: function () {
  706 +
  707 + //-- 看一下隐私政策要不要显示 --
  708 + var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id
  709 + if (privacy_pop) {
  710 + privacy_pop.check_pri_show();
  711 + }
  712 +
706 getApp().check_can_share(this); 713 getApp().check_can_share(this);
707 var goods_list = null, th = this, that = this; 714 var goods_list = null, th = this, that = this;
708 715
@@ -4821,4 +4828,48 @@ Page({ @@ -4821,4 +4828,48 @@ Page({
4821 }); 4828 });
4822 }, 4829 },
4823 4830
  4831 + //-- 弹出框的同意的优化,重新获取定位 ---
  4832 + agree_pri:function (){
  4833 + var th=this;
  4834 + var bconfig = th.data.bconfig;
  4835 +
  4836 + if (bconfig && bconfig.is_sort_storage) {
  4837 + wx.getLocation({
  4838 + type: 'gcj02',
  4839 + success: function (res) {
  4840 +
  4841 + th.data.lat = res.latitude;
  4842 + th.data.lon = res.longitude;
  4843 + th.data.is_get_local_ok = 1;
  4844 + th.setData({
  4845 + is_gps: 1
  4846 + });
  4847 + //th.onShow();
  4848 + th.get_sto();
  4849 + },
  4850 + fail: function (res) {
  4851 + //th.onShow();
  4852 + th.data.is_get_local_ok = 1;
  4853 + th.get_sto();
  4854 + if (res.errCode == 2) {
  4855 + th.setData({
  4856 + is_gps: 0
  4857 + });
  4858 + if (th.data.is_gps == 0) {
  4859 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  4860 + }
  4861 + } else {
  4862 + th.setData({
  4863 + is_gps: "3"
  4864 + });
  4865 + }
  4866 +
  4867 + }
  4868 + })
  4869 + }
  4870 +
  4871 +
  4872 + },
  4873 +
  4874 +
4824 }); 4875 });
packageC/pages/presell/goodsInfo/goodsInfo.json
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 "nav_box": "/components/nav_box/nav_box", 5 "nav_box": "/components/nav_box/nav_box",
6 "warn": "/components/long_warn/long_warn", 6 "warn": "/components/long_warn/long_warn",
7 "goods_recommend": "/components/goods_list/goods_list", 7 "goods_recommend": "/components/goods_list/goods_list",
8 - "share": "/components/share/share" 8 + "share": "/components/share/share",
  9 + "privacy_pop": "/components/privacy_pop/privacy_pop"
9 } 10 }
10 } 11 }
11 \ No newline at end of file 12 \ No newline at end of file
packageC/pages/presell/goodsInfo/goodsInfo.wxml
@@ -3,6 +3,8 @@ @@ -3,6 +3,8 @@
3 <wxs module="g_filters" src="g_filter.wxs"></wxs> 3 <wxs module="g_filters" src="g_filter.wxs"></wxs>
4 <wxs module="tool" src="filter.wxs"></wxs> 4 <wxs module="tool" src="filter.wxs"></wxs>
5 5
  6 +<!-- 判断隐私是不是显示 -->
  7 +<privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop>
6 8
7 <block wx:if="{{show}}"> 9 <block wx:if="{{show}}">
8 <!-- 商品内容区域,普通商品,秒杀,拼团 --> 10 <!-- 商品内容区域,普通商品,秒杀,拼团 -->
pages/cart/cart/cart.js
@@ -125,6 +125,13 @@ Page({ @@ -125,6 +125,13 @@ Page({
125 125
126 }, 126 },
127 onShow: function () { 127 onShow: function () {
  128 +
  129 + //-- 看一下隐私政策要不要显示 --
  130 + var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id
  131 + if (privacy_pop) {
  132 + privacy_pop.check_pri_show();
  133 + }
  134 +
128 //每次显示都清空 135 //每次显示都清空
129 this.data.in_zhact_gdmap = {}; 136 this.data.in_zhact_gdmap = {};
130 this.setData({ 137 this.setData({
pages/cart/cart/cart.json
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 "usingComponents": { 3 "usingComponents": {
4 "warn": "/components/long_warn/long_warn", 4 "warn": "/components/long_warn/long_warn",
5 "goods_recommend":"/components/goods_list/goods_list", 5 "goods_recommend":"/components/goods_list/goods_list",
6 - "pro_pop": "/components/promate_pop/promate_pop" 6 + "pro_pop": "/components/promate_pop/promate_pop",
  7 + "privacy_pop": "/components/privacy_pop/privacy_pop"
7 } 8 }
8 } 9 }
9 \ No newline at end of file 10 \ No newline at end of file
pages/cart/cart/cart.wxml
  1 +<!-- 判断隐私是不是显示 -->
  2 +<privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop>
1 <!-- 促销弹出框 --> 3 <!-- 促销弹出框 -->
2 <pro_pop id="pro_pop" bind:sure_cx_group="sure_cx_group"></pro_pop> 4 <pro_pop id="pro_pop" bind:sure_cx_group="sure_cx_group"></pro_pop>
3 5
pages/goods/goodsInfo/goodsInfo.js
@@ -921,6 +921,13 @@ Page({ @@ -921,6 +921,13 @@ Page({
921 921
922 //---展示--- 922 //---展示---
923 onShow: function () { 923 onShow: function () {
  924 +
  925 + //-- 看一下隐私政策要不要显示 --
  926 + var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id
  927 + if (privacy_pop) {
  928 + privacy_pop.check_pri_show();
  929 + }
  930 +
924 //添加购物车的控制要清理0 931 //添加购物车的控制要清理0
925 this.data.adding=0; 932 this.data.adding=0;
926 933
@@ -8741,7 +8748,46 @@ Page({ @@ -8741,7 +8748,46 @@ Page({
8741 break; 8748 break;
8742 } 8749 }
8743 } 8750 }
8744 - } 8751 + },
  8752 +
  8753 + //-- 弹出框的同意的优化,重新获取定位 ---
  8754 + agree_pri:function (){
  8755 + var th=this;
  8756 + var bconfig = th.data.bconfig;
  8757 + if (bconfig && bconfig.is_sort_storage) {
  8758 + wx.getLocation({
  8759 + type: 'gcj02',
  8760 + success: function (res) {
  8761 + th.data.lat = res.latitude;
  8762 + th.data.lon = res.longitude;
  8763 + th.data.is_get_local_ok = 1;
  8764 + th.setData({
  8765 + is_gps: 1
  8766 + });
  8767 + //th.onShow();
  8768 + th.get_sto();
  8769 + },
  8770 + fail: function (res) {
  8771 + //th.onShow();
  8772 + th.data.is_get_local_ok = 1;
  8773 + th.get_sto();
  8774 + if (res.errCode == 2) {
  8775 + th.setData({
  8776 + is_gps: 0
  8777 + });
  8778 + if (th.data.is_gps == 0) {
  8779 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  8780 + }
  8781 + } else {
  8782 + th.setData({
  8783 + is_gps: "3"
  8784 + });
  8785 + }
  8786 +
  8787 + }
  8788 + })
  8789 + }
  8790 + },
8745 8791
8746 8792
8747 }) 8793 })
8748 \ No newline at end of file 8794 \ No newline at end of file
pages/goods/goodsInfo/goodsInfo.json
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 "warn": "/components/long_warn/long_warn", 6 "warn": "/components/long_warn/long_warn",
7 "goods_recommend": "/components/goods_list/goods_list", 7 "goods_recommend": "/components/goods_list/goods_list",
8 "share": "/components/share/share", 8 "share": "/components/share/share",
9 - "pro_pop": "/components/promate_pop/promate_pop" 9 + "pro_pop": "/components/promate_pop/promate_pop",
  10 + "privacy_pop": "/components/privacy_pop/privacy_pop"
10 } 11 }
11 } 12 }
12 \ No newline at end of file 13 \ No newline at end of file
pages/goods/goodsInfo/goodsInfo.wxml
  1 +<!-- 判断隐私是不是显示 -->
  2 +<privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop>
1 <!-- 促销弹出框 --> 3 <!-- 促销弹出框 -->
2 <pro_pop id="pro_pop"></pro_pop> 4 <pro_pop id="pro_pop"></pro_pop>
3 5