Commit aa2d3aaf7876191a3e92908dbe917a10803c9eb3

Authored by 后端研发-苏明海
2 parents 746de429 a857a0be

Merge branch 'dev' into 'test'

Dev

See merge request !978
Showing 150 changed files with 3145 additions and 1020 deletions
... ... @@ -51,7 +51,7 @@ App({
51 51 config: null, //门店参数
52 52 config2: null, //门店配置
53 53 code: null,
54   - user_id: null,//1564704,// 10153869,// 6453964,//5682094,6520044,6520119 qa 4687 6519901
  54 + user_id: null,//5682094,6520044,6520119 qa 4687 6519901
55 55 buy_now: null,
56 56 picklist: null, //门店列表
57 57 wuliuprice: null, //物流价格表
... ... @@ -205,6 +205,7 @@ App({
205 205 this.getConfig();
206 206 },
207 207  
  208 +
208 209 //---初始化第三方----
209 210 initExt: function () {
210 211 var tt = t;
... ... @@ -671,20 +672,29 @@ App({
671 672  
672 673 //清空登录时候缓存的值
673 674 onHide: function () {
674   - this.globalData.is_test = 0;
675   - this.globalData.guide_id = null; //导购清空
676   - this.globalData.first_leader = null; //分享的会员清空
677   - this.globalData.wuliu = null; //关闭要把物流清空
678   - this.globalData.room_id = null; //关闭要把房间号关闭
679   - this.globalData.room_goods_id = null; //关闭要把物流清空
680   - this.globalData.config2 = null; //清除config2的缓存
681   - this.globalData.config = null; //清除config的缓存
682   - this.globalData.gr_index = 0; //商品分组的序列
683   - this.globalData.pk_store = null;
684   - this.globalData.wxapp_buy_obj = null;
685   - this.globalData.dis_buy_obj = null; //等级卡的购买记录
686   - this.globalData.storeFooter = null; //底部的导航
687   - this.globalData.full_screen = null; //全屏
  675 + var th=this;
  676 + setTimeout(function () {
  677 + console.log("app onhide");
  678 + console.log(th.globalData.no_clear);
  679 + if(!th.globalData.no_clear) {
  680 + th.globalData.is_test = 0;
  681 + th.globalData.guide_id = null; //导购清空
  682 + th.globalData.first_leader = null; //分享的会员清空
  683 + th.globalData.wuliu = null; //关闭要把物流清空
  684 + th.globalData.room_id = null; //关闭要把房间号关闭
  685 + th.globalData.room_goods_id = null; //关闭要把物流清空
  686 + th.globalData.config2 = null; //清除config2的缓存
  687 + th.globalData.config = null; //清除config的缓存
  688 + th.globalData.gr_index = 0; //商品分组的序列
  689 + th.globalData.pk_store = null;
  690 + th.globalData.wxapp_buy_obj = null;
  691 + th.globalData.dis_buy_obj = null; //等级卡的购买记录
  692 + th.globalData.storeFooter = null; //底部的导航
  693 + th.globalData.full_screen = null; //全屏
  694 + }else{
  695 + th.globalData.no_clear=0;
  696 + }
  697 + },600)
688 698  
689 699 },
690 700  
... ... @@ -825,9 +835,92 @@ App({
825 835 }
826 836 },
827 837  
  838 + //重复函数,统一调用,
  839 + pre_img(path){
  840 + this.globalData.no_clear=1;
  841 + wx.previewImage({
  842 + //将图片预览出来
  843 + urls: [path]
  844 + });
  845 + },
  846 + //b是数组,t是wxml元素返回的
  847 + pre_img2(b,t){
  848 + this.globalData.no_clear=1;
  849 + wx.previewImage({
  850 + current: b[t.currentTarget.dataset.id],
  851 + urls: b
  852 + });
  853 + },
828 854  
  855 + con_wx(th){
  856 + var url=th.data.sys_switch.weapp_customertype_url;
  857 + var id=th.data.sys_switch.weapp_customertype_appid;
  858 + this.globalData.no_clear=1;
  859 + wx.openCustomerServiceChat({
  860 + extInfo: {url: url},
  861 + corpId: id,
  862 + success(res) {}
  863 + })
  864 + },
829 865  
830   -
  866 + con_Service(){
  867 + var th=this;
  868 + var oss= this.globalData.setting;
  869 + this.getConfig(function(t) {
  870 + if (t.store_tel == undefined) {
  871 + th.request.get("/api/weshop/store/get/" + oss.stoid, {
  872 + isShowLoading: 1,
  873 + data: {},
  874 + success: function(rs) {
  875 + th.globalData.config = rs.data.data;
  876 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  877 + wx.showToast({
  878 + title: "商家未设置电话",
  879 + icon: 'none',
  880 + duration: 3000
  881 + })
  882 + return false;
  883 + }
  884 + th.globalData.no_clear=1;
  885 + wx.makePhoneCall({ phoneNumber: rs.data.data.store_tel, })
  886 + }
  887 + })
  888 + } else {
  889 + th.globalData.no_clear=1;
  890 + wx.makePhoneCall({ phoneNumber: t.store_tel, })
  891 + }
  892 + });
  893 + },
  894 +
  895 + com_call(self) {
  896 + self.getTel()
  897 + .then(() => {
  898 + if(self.data.store_tel) {
  899 + wx.showModal({
  900 + title: '联系客服',
  901 + content: '客服热线:' + self.data.store_tel,
  902 + confirmText: '拨打',
  903 + success(res) {
  904 + if(res.confirm) {
  905 + getApp().globalData.no_clear = 1;
  906 + wx.makePhoneCall({
  907 + phoneNumber: self.data.store_tel,
  908 + })
  909 + };
  910 + },
  911 + });
  912 + };
  913 + });
  914 + },
  915 +
  916 + //检验能不能分享
  917 + check_can_share(){
  918 + if(!this.globalData.user_id) wx.hideShareMenu();
  919 + else wx.showShareMenu();
  920 + }
  921 +
  922 +
  923 +
831 924  
832 925  
833 926 });
... ...
app.wxss
1 1 @import './utils/weapp-icon.wxss';
2 2 @import "./utils/wxParse/wxParse.wxss";
  3 +@import './components/com_servicer/com_servicer.wxss';
3 4  
4 5 .pdt4 {
5 6 padding-top: 4rpx;
... ... @@ -743,11 +744,20 @@ background: #ffe3e2;
743 744 /* 图标字体(ty) */
744 745 @font-face {
745 746 font-family: 'iconfont'; /* Project id 2054717 */
746   - src: url('//at.alicdn.com/t/font_2054717_o34jrbrtxpk.woff2?t=1645781927179') format('woff2'),
747   - url('//at.alicdn.com/t/font_2054717_o34jrbrtxpk.woff?t=1645781927179') format('woff'),
748   - url('//at.alicdn.com/t/font_2054717_o34jrbrtxpk.ttf?t=1645781927179') format('truetype');
  747 + src: url('//at.alicdn.com/t/font_2054717_aefpqs97v86.woff2?t=1647056245887') format('woff2'),
  748 + url('//at.alicdn.com/t/font_2054717_aefpqs97v86.woff?t=1647056245887') format('woff'),
  749 + url('//at.alicdn.com/t/font_2054717_aefpqs97v86.ttf?t=1647056245887') format('truetype');
749 750 }
750 751  
  752 +.icon-kefu1:before {
  753 + content: "\e651";
  754 +}
  755 +
  756 +.icon-dianhua:before {
  757 + content: "\e64b";
  758 +}
  759 +
  760 +
751 761 .icon-infofill:before {
752 762 content: "\e6e6";
753 763 }
... ...
components/com_servicer/com_servicer.wxml 0 → 100644
  1 +<!-- 联系客服操作菜单 -->
  2 +<view class="action {{!hiddenCS ? 'active':''}}" hidden="{{hiddenCS}}">
  3 + <view class="pd20 t-c pr">
  4 + <text class="bold">联系客服</text>
  5 + <text class="iconfont icon-guan" bindtap="closeCS"></text>
  6 + </view>
  7 + <!-- 客服热线 -->
  8 + <view class="pd20 bdt fs30 btn2" bindtap="contactService">
  9 + <text class="iconfont icon-dianhua"></text>客服热线:
  10 + <text class="c-red">{{store_tel}}</text>
  11 + </view>
  12 + <!-- 小程序客服 -->
  13 + <block wx:if="{{sys_switch.weapp_customertype == 1}}">
  14 + <button class="pd20 bdt fs30 btn2" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
  15 + <text class="iconfont icon-kefu1"></text>在线客服
  16 + </button>
  17 + </block>
  18 + <!-- 微信客服 -->
  19 + <block wx:elif="{{sys_switch.weapp_customertype == 2}}">
  20 + <view class="pd20 bdt fs30 btn2" bindtap="con_weixin">
  21 + <text class="iconfont icon-kefu1"></text>在线客服
  22 + </view>
  23 + </block>
  24 +</view>
  25 +
  26 +<view class="mask2" bindtap="closeCS"></view>
0 27 \ No newline at end of file
... ...
components/com_servicer/com_servicer.wxss 0 → 100644
  1 +/* 联系客服操作菜单 */
  2 + .action {
  3 + position: fixed;
  4 + bottom: 100rpx;
  5 + z-index: 1;
  6 + width: 100%;
  7 + background-color: white;
  8 + border-radius: 20rpx 20rpx 0 0;
  9 + }
  10 +
  11 + .action .icon-guan {
  12 + position: absolute;
  13 + left: 20rpx !important;
  14 + right: auto !important;
  15 + padding: 10rpx 20rpx 10rpx 10rpx;
  16 + }
  17 +
  18 + .action .iconfont {
  19 + color: #ff7295;
  20 + margin-right: 10rpx;
  21 + }
  22 +
  23 + .action button {
  24 + text-align: left;
  25 + line-height: normal;
  26 + }
  27 +
  28 + .action button::after {
  29 + border-width: 0;
  30 + }
  31 +
  32 + .action .btn2 {
  33 + box-sizing: border-box;
  34 + height: 100rpx;
  35 + display: flex;
  36 + align-items: center;
  37 + }
  38 +
  39 + .mask2 {
  40 + display: none;
  41 + position: fixed;
  42 + left: 0;
  43 + right: 0;
  44 + top: 0;
  45 + bottom: 0;
  46 + background-color: rgba(0,0,0,.5);
  47 + }
  48 +
  49 + .action.active ~ .mask2 {
  50 + display: block;
  51 + }
0 52 \ No newline at end of file
... ...
components/diy_scan/diy_scan.js
... ... @@ -26,6 +26,7 @@ Component({
26 26 //-- 扫描成功之后 --
27 27 getScancode:function(){
28 28 var _this = this;
  29 + getApp().globalData.no_clear=1;
29 30 //-- 允许从相机和相册扫码 --
30 31 wx.scanCode({
31 32 success: (res) => {
... ...
components/diy_seckill/diy_seckill.js
... ... @@ -78,23 +78,26 @@ Component({
78 78 // 这里是一个自定义方法
79 79 customMethod: function () { },
80 80 init: function (g_id) {
81   - var th = this, app = getApp(), goodsidlist = "";
  81 + var th = this, app = getApp(), goodsidlist = "", idlist = "";
82 82 if (g_id.data_type == 2) {
83 83 if (g_id.data && g_id.data.length > 0) {
84 84 //--先把商品ID串起来--
85 85 g_id.data.forEach(function (val, ind) {
86 86 var item = {};
87 87 goodsidlist += val.goodsid + ",";
  88 + idlist += val.flashid + ",";
88 89 })
89 90 goodsidlist = ut.sub_last(goodsidlist);
  91 + idlist = ut.sub_last(idlist);
90 92  
91 93 var user_id=getApp().globalData.user_id;
92 94 if(!user_id){ user_id=0;}
93 95  
94 96 //--调用接口,读取秒杀--
95   - app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id="
96   - + os.stoid + "&goodsidlist=" + goodsidlist+"&user_id="+user_id+"&type=1", {}).then(res => {
97   - console.log(res);
  97 + // var gUrl = "/api/ms/flash_sale/getGoodsList?store_id=" + os.stoid + "&goodsidlist=" + goodsidlist+"&user_id="+user_id+"&type=1";
  98 + var gUrl = "/api/ms/flash_sale/getGoodsList?store_id=" + os.stoid + "&idlist=" + idlist + "&user_id="+user_id+"&type=1";
  99 + app.request.promiseGet(gUrl, {}).then(res => {
  100 +
98 101 //如果秒杀的数组为空的时候
99 102 var goodslist = res.data.data;
100 103 //就算是添加的活动已经过期,就要用最新的进行中活动
... ... @@ -153,16 +156,51 @@ Component({
153 156 for(let i in all_array){
154 157 let item=all_array[i];
155 158 if(item.user_price) item.price=item.user_price;
  159 + if(item.start_time > newTime) {
  160 + item.status = 0;
  161 + } else if(item.end_time > newTime) {
  162 + item.status = 1;
  163 + };
  164 +
156 165 }
  166 +
  167 +
  168 + var promisies = [];
  169 + for (const key in all_array) {
  170 + if (Object.hasOwnProperty.call(all_array, key)) {
  171 + const val = all_array[key];
  172 + promisies[key] = getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  173 + os.stoid + "/1/" + val.id,
  174 + {}
  175 + ).then(res => {
  176 + if (res.data.code == 0) {
  177 + if (res.data.data <= 0) all_array[key].status = 2;
  178 + };
  179 + });
  180 + }
  181 + }
157 182  
158   - var arr = new Array();
159   - //--三个三个一组---
160   - for (var i = 0; i < all_array.length; i += 3) {
161   - arr.push(all_array.slice(i, i + 3));
162   - }
163   - /*--熏染到前台--*/
164 183  
165   - th.setData({ goods_array: arr });
  184 + Promise.all(promisies).then(() => {
  185 +
  186 + // 判断活动是否结束
  187 + for(let i in all_array){
  188 + let item=all_array[i];
  189 + if(newTime > item.end_time) {
  190 + all_array[i].status = 3;
  191 + };
  192 +
  193 + }
  194 +
  195 + var arr = new Array();
  196 + //--三个三个一组---
  197 + for (var i = 0; i < all_array.length; i += 3) {
  198 + arr.push(all_array.slice(i, i + 3));
  199 + }
  200 + /*--熏染到前台--*/
  201 + th.setData({ goods_array: arr });
  202 + });
  203 +
166 204  
167 205 th.data.timer = setInterval(function () {
168 206 th.countDown2(th);
... ...
components/diy_seckill/diy_seckill.wxml
... ... @@ -16,17 +16,17 @@
16 16 <swiper-item class="s_it" wx:for="{{goods_array}}">
17 17 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
18 18 <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> -->
19   - <navigator url="{{aitem.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id )}}" class="s1_gk_a1">
  19 + <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1">
20 20 <view class='one'>
21 21 <view class='sp_top'>
22 22 <view class='po'></view>
23   - <block wx:if="{{aitem.start_time>newTime}}">
  23 + <block wx:if="{{aitem.status == 0}}">
24 24 <view class="rob" style="justify-content: flex-start">
25 25 <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span>
26 26 </view>
27 27 </block>
28 28  
29   - <block wx:if="{{aitem.end_time<=newTime}}">
  29 + <!-- <block wx:if="{{aitem.end_time<=newTime}}">
30 30 <view class="rob" style="justify-content: flex-start">
31 31 <span class='s_top_kill gray'>活动已结束</span>
32 32 </view>
... ... @@ -42,7 +42,24 @@
42 42 <span class='s_top_kill gray'>已抢光</span>
43 43 </view>
44 44 </block>
  45 + </block> -->
  46 +
  47 +
  48 + <block wx:if="{{aitem.status == 1}}">
  49 + <view class="rob" style="justify-content: flex-start">
  50 + <span class='s_top_kill'>火热进行</span>
  51 + </view>
  52 + </block>
  53 + <block wx:if="{{aitem.status == 2}}">
  54 + <view class="rob" style="justify-content: flex-start">
  55 + <span class='s_top_kill gray'>已抢光</span>
  56 + </view>
45 57 </block>
  58 + <block wx:if="{{aitem.status == 3}}">
  59 + <view class="rob" style="justify-content: flex-start">
  60 + <span class='s_top_kill gray'>活动已结束</span>
  61 + </view>
  62 + </block>
46 63  
47 64  
48 65  
... ... @@ -81,7 +98,7 @@
81 98 <block wx:for="{{goods_array}}">
82 99 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
83 100 <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> -->
84   - <navigator url="{{aitem.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id )}}" class="s1_gk_a1">
  101 + <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1">
85 102 <view class='one1'>
86 103  
87 104 <view class="o1_img">
... ... @@ -101,25 +118,25 @@
101 118 <view class='sp_jg'>¥{{aitem.price}}</view>
102 119 <view class='sp_jgx'>¥{{aitem.market_price}}</view>
103 120 </view>
104   - <block wx:if="{{aitem.start_time>newTime}}">
  121 + <block wx:if="{{aitem.status == 0}}">
105 122 <view class="rob">
106 123 <view class="wo" style="background-color: #adadad">正在预热</view>
107 124 </view>
108 125 </block>
109 126  
110   - <block wx:if="{{aitem.end_time<newTime}}">
  127 + <block wx:if="{{aitem.status == 3}}">
111 128 <view class="rob">
112 129 <view class="wo" style="background-color: #adadad">已结束</view>
113 130 </view>
114 131 </block>
115 132 <block wx:else>
116   - <block wx:if="{{aitem.start_time<newTime && aitem.goods_num>aitem.buy_num}}">
  133 + <block wx:if="{{aitem.status == 1}}">
117 134 <view class="rob">
118 135 <view class="wo">我要抢</view>
119 136 </view>
120 137 </block>
121 138  
122   - <block wx:if="{{aitem.goods_num<=aitem.buy_num}}">
  139 + <block wx:if="{{aitem.status == 2}}">
123 140 <view class="rob">
124 141 <view class="wo" style="background-color: #adadad">已抢光</view>
125 142 </view>
... ...
components/diy_service/diy_service.js
... ... @@ -38,35 +38,16 @@ Component({
38 38  
39 39 //---------联系客服------------
40 40 contactService: function() {
41   - getApp().getConfig(function(t) {
42   - if (t.store_tel == undefined) {
43   - getApp().request.get("/api/weshop/store/get/" + os.stoid, {
44   - isShowLoading: 1,
45   - data: {},
46   - success: function(rs) {
47   - getApp().globalData.config = rs.data.data;
48   - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
49   - getApp().my_warnning("商家未设置电话", 0, th);
50   - return false;
51   - }
52   - wx.makePhoneCall({ phoneNumber: rs.data.data.store_tel, })
53   - }
54   - })
55   - } else {
56   - wx.makePhoneCall({ phoneNumber: t.store_tel, })
57   - }
58   - });
59   - },
  41 + getApp().con_Service();
  42 + },
60 43  
61 44 //---------联系微信客服------------
62 45 con_weixin:function () {
63   - var url=this.data.sys_switch.weapp_customertype_url;
64   - var id=this.data.sys_switch.weapp_customertype_appid;
65   - wx.openCustomerServiceChat({
66   - extInfo: {url: url},
67   - corpId: id,
68   - success(res) {}
69   - })
  46 + getApp().con_wx(this);
  47 + },
  48 +
  49 + click_contact:function () {
  50 + getApp().globalData.no_clear=1;
70 51 }
71 52 }
72 53 })
... ...
components/diy_service/diy_service.wxml
... ... @@ -8,7 +8,7 @@
8 8 </view>
9 9 </view>
10 10  
11   - <button wx:else class="custom-service" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
  11 + <button wx:else class="custom-service" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
12 12 <view style="text-align: center;">
13 13 <image class="cs-img" src="{{object.img}}"></image>
14 14 <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view>
... ...
components/nav_b/nav_b.wxss
... ... @@ -26,6 +26,9 @@
26 26 color: #ffff;
27 27 font-size: 50rpx;
28 28 background: none;
  29 + display: flex;
  30 + justify-content: center;
  31 + align-items: center;
29 32 }
30 33  
31 34 .box_main .dian image {
... ...
packageA/pages/activity_share/activity_share.js
... ... @@ -125,7 +125,7 @@ Page({
125 125 /**
126 126 * 生命周期函数--监听页面显示
127 127 */
128   - onShow: function () {},
  128 + onShow: function () { getApp().check_can_share(); },
129 129 /**
130 130 * 生命周期函数--监听页面隐藏
131 131 */
... ... @@ -141,9 +141,10 @@ Page({
141 141 /**
142 142 * 用户点击右上角分享
143 143 */
144   - onShareAppMessage: function () {
145   - console.log('abc');
146   - var th = this;
  144 + onShareAppMessage: function () {
  145 + getApp().globalData.no_clear=1;
  146 +
  147 + var th = this;
147 148 //礼包的转发
148 149 if(th.data.currentIndex==3) {
149 150 var lbid=th.data.hui_active.lbId;
... ... @@ -1054,10 +1055,8 @@ Page({
1054 1055 })
1055 1056 return false;
1056 1057 }
1057   - wx.previewImage({
1058   - //将图片预览出来
1059   - urls: [that.data.shareImgPath]
1060   - });
  1058 + getApp().pre_img(that.data.shareImgPath);
  1059 +
1061 1060 //-- 将商品清空 --
1062 1061 th.setData({share_good:null});
1063 1062  
... ...
packageA/pages/addCustomer/addCustomer.js
... ... @@ -26,7 +26,7 @@ Page({
26 26 * 生命周期函数--监听页面显示
27 27 */
28 28 onShow: function () {
29   -
  29 + getApp().check_can_share();
30 30 },
31 31  
32 32 /**
... ... @@ -60,7 +60,7 @@ Page({
60 60 /**
61 61 * 用户点击右上角分享
62 62 */
63   - onShareAppMessage: function () {
64   -
65   - }
  63 + onShareAppMessage: function () {
  64 + getApp().globalData.no_clear=1
  65 + }
66 66 })
67 67 \ No newline at end of file
... ...
packageA/pages/cardDetails/cardDetails.js
... ... @@ -39,6 +39,7 @@ Page({
39 39 * 生命周期函数--监听页面显示
40 40 */
41 41 onShow: function () {
  42 + getApp().check_can_share();
42 43 if(app.globalData.userInfo) {
43 44 if(!this.data.isLogin) {
44 45 this.setData({
... ... @@ -92,7 +93,7 @@ Page({
92 93 /**
93 94 * 用户点击右上角分享
94 95 */
95   - onShareAppMessage: function () {
  96 + onShareAppMessage: function () { getApp().globalData.no_clear=1
96 97  
97 98 }
98 99 })
99 100 \ No newline at end of file
... ...
packageA/pages/cardList/cardList.js
... ... @@ -52,6 +52,7 @@ Page({
52 52 * 生命周期函数--监听页面显示
53 53 */
54 54 onShow: function () {
  55 + getApp().check_can_share();
55 56 let url = '/api/weshop/serviceCard/page';
56 57 let currentQuery = this.data.currentQuery;
57 58 if(app.globalData.userInfo) {
... ... @@ -134,7 +135,7 @@ Page({
134 135 /**
135 136 * 用户点击右上角分享
136 137 */
137   - onShareAppMessage: function () {
  138 + onShareAppMessage: function () { getApp().globalData.no_clear=1
138 139  
139 140 },
140 141  
... ...
packageA/pages/cardList/cardList.wxml
... ... @@ -29,7 +29,7 @@
29 29 </block>
30 30 <!-- 一列和俩列 -->
31 31 <block wx:else>
32   - <view class="pd20 flex-set" style="background-color: #{{object.bg_color}};">
  32 + <view class="pd20 flex-set" style="background-color: {{object.bg_color}};">
33 33 <!-- 1列 2列 -->
34 34 <view wx:for="{{list.pageData}}" class="{{object.column=='1'?'w100':'w50'}} {{index%2==1?'ml':''}} bg-white"
35 35 bindtap="go_goods" data-gid="{{item.id}}"
... ...
packageA/pages/cart2_ser/cart2_ser.js
... ... @@ -484,6 +484,8 @@ Page({
484 484 'price': gg.money,
485 485 'pickup_id': gg.pick_id,
486 486 'pickup_keyid': list[i].keyid,
  487 + 'prom_type': gg.prom_type, //促销活动类型
  488 + 'prom_id': gg.prom_id, //促销活动id
487 489 };
488 490 //--导购分享过来的id--
489 491 if (gg.guide_id) {
... ...
packageA/pages/chongzhi/chongzhi.js
... ... @@ -64,7 +64,7 @@ Page({
64 64 * 生命周期函数--监听页面显示
65 65 */
66 66 onShow: function () {
67   -
  67 + getApp().check_can_share();
68 68 },
69 69  
70 70 /**
... ... @@ -106,7 +106,7 @@ Page({
106 106 /**
107 107 * 用户点击右上角分享
108 108 */
109   - onShareAppMessage: function () {
  109 + onShareAppMessage: function () { getApp().globalData.no_clear=1
110 110  
111 111 },
112 112  
... ...
packageA/pages/chongzhiDetails/chongzhiDetails.js
... ... @@ -105,7 +105,7 @@ Page({
105 105 * 生命周期函数--监听页面显示
106 106 */
107 107 onShow: function () {
108   -
  108 + getApp().check_can_share();
109 109 },
110 110  
111 111 /**
... ... @@ -125,7 +125,7 @@ Page({
125 125 /**
126 126 * 用户点击右上角分享
127 127 */
128   - onShareAppMessage: function () {
  128 + onShareAppMessage: function () { getApp().globalData.no_clear=1
129 129  
130 130 },
131 131  
... ...
packageA/pages/choujiang/choujiang.js
... ... @@ -26,7 +26,7 @@ Page({
26 26 * 生命周期函数--监听页面显示
27 27 */
28 28 onShow: function () {
29   -
  29 + getApp().check_can_share();
30 30 },
31 31  
32 32 /**
... ... @@ -60,7 +60,7 @@ Page({
60 60 /**
61 61 * 用户点击右上角分享
62 62 */
63   - onShareAppMessage: function () {
  63 + onShareAppMessage: function () { getApp().globalData.no_clear=1
64 64  
65 65 }
66 66 })
67 67 \ No newline at end of file
... ...
packageA/pages/details_serviceCard/details_serviceCard.js
... ... @@ -42,6 +42,7 @@ Page({
42 42 * 生命周期函数--监听页面显示
43 43 */
44 44 onShow: function() {
  45 + getApp().check_can_share();
45 46 if (app.globalData.userInfo) {
46 47 if (!this.data.isLogin) {
47 48 this.setData({
... ... @@ -112,7 +113,7 @@ Page({
112 113 * 用户点击右上角分享
113 114 */
114 115 onShareAppMessage: function() {
115   -
  116 + getApp().globalData.no_clear=1
116 117 },
117 118  
118 119  
... ... @@ -163,6 +164,7 @@ Page({
163 164  
164 165 // 联系微信客服
165 166 contact_wx() {
  167 + getApp().globalData.no_clear=1;
166 168 var url = this.data.sys_switch.weapp_customertype_url;
167 169 var id = this.data.sys_switch.weapp_customertype_appid;
168 170 wx.openCustomerServiceChat({
... ... @@ -177,24 +179,7 @@ Page({
177 179  
178 180 // 联系电话客服
179 181 contactService() {
180   - app.getConfig(function(t) {
181   - if (t.store_tel == undefined) {
182   - app.request.get('/api/weshop/store/get/' + os.stoid, {
183   - isShowLoading: 1,
184   - data: {},
185   - success: function(rs) {
186   - app.globalData.config = rs.data.data;
187   - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
188   - app.my_warnning('商家未设置电话', 0, self);
189   - return false;
190   - }
191   - app.confirmBox('请联系客服:' + rs.data.data.store_tel);
192   - }
193   - })
194   - } else {
195   - app.confirmBox('请联系客服:' + t.store_tel);
196   - }
197   - });
  182 + getApp().con_Service();
198 183 },
199 184  
200 185  
... ... @@ -298,7 +283,19 @@ Page({
298 283 if (getApp().globalData.guide_id) {
299 284 newd['guide_id'] = getApp().globalData.guide_id;
300 285 newd['guide_type'] = 0;
301   - }
  286 + };
  287 + // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价
  288 + if(details.list[0].prom_type == 1) {
  289 + newd['prom_type'] = details.list[0].prom_type;
  290 + newd['prom_id'] = details.list[0].prom_id;
  291 + // if(th.data.openSpecModal_flash_normal) {
  292 + // newd['money'] = th.data.data.shop_price;
  293 + // newd['is_pd_normal'] = 1;
  294 + // } else {
  295 + // newd['money'] = th.data.prom_price;
  296 + // };
  297 + };
  298 +
302 299  
303 300 //----先看会员在购物车中是否加入了该商品-----
304 301 app.request.get("/api/weshop/cartService/page", {
... ... @@ -478,9 +475,9 @@ Page({
478 475 });
479 476 },
480 477  
481   -
482   -
483   -
  478 + click_contact:function () {
  479 + getApp().globalData.no_clear=1;
  480 + }
484 481  
485 482  
486 483  
... ...
packageA/pages/details_serviceCard/details_serviceCard.wxml
... ... @@ -57,7 +57,7 @@
57 57 <view class="flex t-c bdt">
58 58 <!-- 客服 -->
59 59 <block>
60   - <button class="f1" wx:if="{{sys_switch.weapp_customertype == 1}}" hover-class="none" open-type="contact"
  60 + <button class="f1" wx:if="{{sys_switch.weapp_customertype == 1}}" hover-class="none" open-type="contact" bindtap="click_contact"
61 61 session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"><text class="iconfont icon-kefu c29f pdr10 fs36"></text>联系客服</button>
62 62 <view class="f1 pd20" wx:elif="{{sys_switch.weapp_customertype== 2}}" bindtap="contact_wx"><text class="iconfont icon-kefu c29f pdr10 fs36"></text>联系客服</view>
63 63 <view class="f1 pd20" wx:else bindtap="contactService"><text class="iconfont icon-kefu c29f pdr10 fs36"></text>联系客服</view>
... ...
packageA/pages/distribution/card/card.js
... ... @@ -38,6 +38,7 @@ Page({
38 38 * 生命周期函数--监听页面显示
39 39 */
40 40 onShow: function () {
  41 + getApp().check_can_share();
41 42 if(app.globalData.userInfo) {
42 43 if(!this.data.isLogin) {
43 44 this.setData({
... ... @@ -92,7 +93,7 @@ Page({
92 93 /**
93 94 * 用户点击右上角分享
94 95 */
95   - onShareAppMessage: function () {
  96 + onShareAppMessage: function () { getApp().globalData.no_clear=1
96 97  
97 98 },
98 99  
... ...
packageA/pages/distribution/commision/commision.js
... ... @@ -74,6 +74,7 @@ Page({
74 74 * 生命周期函数--监听页面显示
75 75 */
76 76 onShow: function () {
  77 + getApp().check_can_share();
77 78  
78 79 if(app.globalData.userInfo) {
79 80 if(!this.data.isLogin) {
... ... @@ -149,7 +150,7 @@ Page({
149 150 /**
150 151 * 用户点击右上角分享
151 152 */
152   - onShareAppMessage: function () {
  153 + onShareAppMessage: function () { getApp().globalData.no_clear=1
153 154  
154 155 },
155 156  
... ...
packageA/pages/distribution/goods/goods.js
... ... @@ -97,6 +97,8 @@ Page({
97 97 * 生命周期函数--监听页面显示
98 98 */
99 99 onShow: function () {
  100 +
  101 + getApp().check_can_share();
100 102 let url = '/api/weshop/goods/page';
101 103 let currentQuery = this.data.currentQuery;
102 104 if(app.globalData.userInfo) {
... ... @@ -264,7 +266,7 @@ Page({
264 266 /**
265 267 * 用户点击右上角分享
266 268 */
267   - onShareAppMessage: function () {
  269 + onShareAppMessage: function () { getApp().globalData.no_clear=1
268 270  
269 271 },
270 272  
... ...
packageA/pages/distribution/myteam/myteam.js
... ... @@ -69,6 +69,7 @@ Page({
69 69 * 生命周期函数--监听页面显示
70 70 */
71 71 onShow: function () {
  72 + getApp().check_can_share();
72 73 if(app.globalData.userInfo) {
73 74 if(!this.data.isLogin) {
74 75 this.setData({
... ... @@ -157,7 +158,7 @@ Page({
157 158 /**
158 159 * 用户点击右上角分享
159 160 */
160   - onShareAppMessage: function () {
  161 + onShareAppMessage: function () { getApp().globalData.no_clear=1
161 162  
162 163 },
163 164  
... ...
packageA/pages/distribution/order/order.js
... ... @@ -78,6 +78,7 @@ Page({
78 78 * 生命周期函数--监听页面显示
79 79 */
80 80 onShow: function () {
  81 + getApp().check_can_share();
81 82 if(app.globalData.userInfo) {
82 83 if(!this.data.isLogin) {
83 84 this.setData({
... ... @@ -141,7 +142,7 @@ Page({
141 142 /**
142 143 * 用户点击右上角分享
143 144 */
144   - onShareAppMessage: function () {
  145 + onShareAppMessage: function () { getApp().globalData.no_clear=1
145 146  
146 147 },
147 148  
... ...
packageA/pages/distribution/rank/rank.js
... ... @@ -67,6 +67,7 @@ Page({
67 67 * 生命周期函数--监听页面显示
68 68 */
69 69 onShow: function () {
  70 + getApp().check_can_share();
70 71 if(app.globalData.userInfo) {
71 72 if(!this.data.isLogin) {
72 73 this.setData({
... ... @@ -151,7 +152,7 @@ Page({
151 152 /**
152 153 * 用户点击右上角分享
153 154 */
154   - onShareAppMessage: function () {
  155 + onShareAppMessage: function () { getApp().globalData.no_clear=1
155 156  
156 157 },
157 158  
... ...
packageA/pages/distribution/rookie/rookie.js
... ... @@ -58,6 +58,7 @@ Page({
58 58 * 生命周期函数--监听页面显示
59 59 */
60 60 onShow: function () {
  61 + getApp().check_can_share();
61 62 if(app.globalData.userInfo instanceof Object) {
62 63 this.setData({
63 64 userInfo: app.globalData.userInfo,
... ... @@ -112,7 +113,7 @@ Page({
112 113 /**
113 114 * 用户点击右上角分享
114 115 */
115   - onShareAppMessage: function () {
  116 + onShareAppMessage: function () { getApp().globalData.no_clear=1
116 117  
117 118 },
118 119  
... ...
packageA/pages/distribution/shop/shop.js
... ... @@ -95,6 +95,8 @@ Page({
95 95 * 生命周期函数--监听页面显示
96 96 */
97 97 onShow: function () {
  98 + getApp().check_can_share();
  99 +
98 100 //自己登录的
99 101 if (app.globalData.userInfo && !this.data.first_leader) {
100 102 if (!this.data.isLogin) {
... ... @@ -316,7 +318,7 @@ Page({
316 318 * 用户点击右上角分享
317 319 *--点击分享事件--分享我的小店
318 320 *--*/
319   - onShareAppMessage: function (t) {
  321 + onShareAppMessage: function (t) { getApp().globalData.no_clear=1;
320 322  
321 323 var th = this;
322 324 var title = "我的小店";
... ...
packageA/pages/goodsInfo/buy_flash_normal.wxml 0 → 100644
  1 +<view bindtap="closeSpecModal_flash_normal" class="cover-layer"></view>
  2 + <view class="spec-model">
  3 + <view class="pding">
  4 + <icon bindtap="closeSpecModal_flash_normal" class="modal-close" color="black" size="22" type="cancel"></icon>
  5 + <view class="spec-goods">
  6 + <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{iurl + (data.image_url ? data.image_url:'miniapp/images/default_g_img.gif')}}" binderror="pop_err_img" data-errorimg="data.img_url"></image>
  7 + <view class="spec-goods-info">
  8 + <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view>
  9 + <view class="flex ai_end xc-val-money">
  10 + <view class="spec-goods-price">
  11 + <text class="fs20">¥</text>{{data.shop_price}}
  12 + <!-- 如果是等级会员,且有等级价 -->
  13 + <!-- <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}} </block> -->
  14 + <!-- <block wx:else>{{sele_g.shop_price}}</block> -->
  15 + </view>
  16 + </view>
  17 +
  18 + <!-- <view class="flex">
  19 + <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
  20 + <block wx:if="{{sales_rules==2}}">
  21 + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>
  22 + <view class="spec-goods-stock" wx:else>可售:0</view>
  23 + </block>
  24 + <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>
  25 + </view> -->
  26 +
  27 +
  28 + </view>
  29 +
  30 + <!-- 选择门店模块 -->
  31 + <view class="flex-space-between address ai_end xc-width ">
  32 +
  33 + <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
  34 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  35 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  36 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  37 +
  38 + </view>
  39 + </view>
  40 +
  41 + <!-- 没有门店的时候 -->
  42 + <view class="flex" bindtap="choice_store" wx:else>
  43 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  44 + <view class="fs30" style="color:black;">选择门店</view>
  45 + </view>
  46 +
  47 + <view class="red-co fs28" bindtap="choice_store" >更多门店<text class="right-arrow"></text></view>
  48 + </view>
  49 + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
  50 + <block wx:else>
  51 + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
  52 + <block wx:else>
  53 + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
  54 + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>
  55 + </block>
  56 + </block>
  57 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view>
  58 +
  59 +
  60 + <!--商品的属性项目-->
  61 + <!-- <view class="xc-goods-attribute">
  62 + <view hidden="{{ismend==1}}" class="spec-name">商品规格</view>
  63 + <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
  64 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-nor="1" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g">
  65 + {{item.gg}}
  66 + </view>
  67 + </view>
  68 + </view> -->
  69 +
  70 + <view class="b_num">
  71 + <view>购买数量</view>
  72 + <view class="count">
  73 + <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view>
  74 + <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
  75 + <view bindtap="addCartNum" class="add">+</view>
  76 + </view>
  77 + </view>
  78 + </view>
  79 +
  80 +
  81 + <!-- 提示再买多少优惠 -->
  82 + <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition}}">
  83 + 再买{{hui_condition.need}}
  84 + <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text>
  85 + <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text>
  86 + <text wx:if="{{hui_condition.past==1}}">,包邮</text>
  87 + <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text>
  88 + <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text>
  89 + <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text>
  90 + <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text>
  91 + <text wx:if="{{hui_condition.zxlb_id>0}}">,送专享礼包</text>
  92 + </view>
  93 +
  94 +
  95 + <!-- 按钮部分 -->
  96 + <view class="spec-cart-btns">
  97 +
  98 + <!-- 根本就找不到门店 -->
  99 + <block wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">
  100 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">配送不匹配</view>
  101 + </block>
  102 + <block wx:else>
  103 + <!-- 根本就找不到门店 -->
  104 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  105 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  106 + </block>
  107 + <block wx:else>
  108 +
  109 +
  110 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  111 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  112 + </block>
  113 + <block wx:else>
  114 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  115 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  116 + </block>
  117 + <block wx:else>
  118 + <block wx:if="{{!def_pick_store}}">
  119 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  120 + </block>
  121 + <block wx:else>
  122 + <block wx:if="{{data.store_count<=0}}">
  123 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  124 + </block>
  125 + <block wx:else>
  126 + <view class="flex jc_sb">
  127 + <view class="spec-cart-btn spec-buy w40" bindtap="addCart"
  128 + data-action="add" style="background-color: #ffb03f;">加入购物车</view>
  129 + <view class="spec-cart-btn spec-buy w40" bindtap="addCart"
  130 + data-action="buy">立即购买</view>
  131 + </view>
  132 + </block>
  133 +
  134 + </block>
  135 + </block>
  136 + </block>
  137 + </block>
  138 + </block>
  139 + </view>
  140 +
  141 + </view>
  142 + </view>
  143 + <view class="clear"></view>
0 144 \ No newline at end of file
... ...
packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -8,6 +8,7 @@ var t = require(&quot;../../../utils/util.js&quot;),
8 8 oo = s.globalData,
9 9 o = s.globalData.setting,
10 10 os = o;
  11 +
11 12 let self = null;
12 13  
13 14 //评价加载更多
... ... @@ -50,7 +51,7 @@ Page({
50 51 supportPageScroll: !1,
51 52 address: {
52 53 address: "",
53   - district: 0
  54 + district: 0,
54 55 },
55 56 shipping: "",
56 57 shippingCost: 0,
... ... @@ -199,15 +200,19 @@ Page({
199 200 sales_rules:1, //默认是线上销售
200 201  
201 202 wait_for_user_store:null,
202   - poster:null, //自定义海报
203   - share_b_img:'', //自定义分享的背景
204   - showPoster: false,
205   - hui_condition:null,
206   - sto_sele_name_1:'',//分享的门店名称
  203 + poster:null, //自定义海报
  204 + share_b_img:'', //自定义分享的背景
  205 + showPoster: false,
  206 + hui_condition:null,
  207 + sto_sele_name_1:'',//分享的门店名称
207 208  
208 209 // 秒杀
209   - prom_st: 1,
  210 + prom_st: null,
210 211 prom_r_null: 0,
  212 +
  213 + hiddenCS: true, //控制客服操作菜单显示和控制
  214 +
  215 + openSpecModal_flash_normal: 0,
211 216 },
212 217  
213 218 //------初始化加载----------
... ... @@ -261,10 +266,10 @@ Page({
261 266 first_leader=gid_str[1];
262 267 }
263 268 //-- 如果有room_id的获取 --
264   - if(gid_str.length>2 && gid_str[2]){
  269 + if(gid_str.length>2 && gid_str[2]) {
265 270 room_id=gid_str[2];
266 271 room_user_share=1;
267   - }
  272 + };
268 273 };
269 274  
270 275 ee.setData({ gid: gid});
... ... @@ -278,14 +283,15 @@ Page({
278 283 }
279 284 })
280 285 }
  286 +
281 287 var c_guide_id=t.c_guide_id;
282 288 if(c_guide_id){
283 289 th.data.c_guide_id=c_guide_id;
284 290 }
285 291  
286   - getApp().getConfig(function(e) {
287   - ee.setData({sto_sele_name_1:e.store_name})
288   - })
  292 + getApp().getConfig(function(e) {
  293 + ee.setData({sto_sele_name_1:e.store_name})
  294 + })
289 295  
290 296 //----获取系统参数-----
291 297 getApp().getConfig2(function (e) {
... ... @@ -309,7 +315,7 @@ Page({
309 315 is_show_gb: 1
310 316 });
311 317 }
312   - console.log(e);
  318 + // console.log(e);
313 319 var json_d = JSON.parse(e.switch_list);
314 320 ee.setData({
315 321 store_config: e,
... ... @@ -318,6 +324,7 @@ Page({
318 324 is_newsales_rules: json_d.is_newsales_rules
319 325 });
320 326 ee.init(gid);
  327 +
321 328 //------几人评价-------
322 329 //n.init(th, "", "comments");
323 330  
... ... @@ -370,7 +377,7 @@ Page({
370 377  
371 378 //获取用户的默认门店
372 379 getApp().get_user_store(function(e) {
373   - if(!e) {
  380 + if(!e) {
374 381 th.data.fir_def_store={}; //赋值空对象
375 382 return false;
376 383 }
... ... @@ -431,7 +438,7 @@ Page({
431 438 appd.lat=that.data.lat;
432 439 appd.lon=that.data.lon;
433 440  
434   - }else{
  441 + } else {
435 442 if (e) {
436 443 e.distance = null;
437 444 that.data.fir_def_store=e;
... ... @@ -449,14 +456,15 @@ Page({
449 456  
450 457 });
451 458  
452   - },
  459 +
  460 + },
453 461  
454 462  
455 463 onReady() {
456   -
457   - setTimeout(()=>{
  464 + // 用于控制保障服务折叠图标的显示
  465 + setTimeout(() => {
458 466 wx.createSelectorQuery().selectAll(".showArea, .hideArea").boundingClientRect(res => {
459   - // console.log('node@@@@@@@', res);
  467 +
460 468 if(res.length != 0) {
461 469 this.setData({
462 470 showFold: res[0].height < res[1].height,
... ... @@ -517,13 +525,14 @@ Page({
517 525  
518 526 if(prom_type) { // 进入商品详情页地址传参有带goods_id、prom_type、prom_id参数, 即从秒杀入口进入
519 527 let prom_id = this.data.options.prom_id;
  528 + // 检查活动是否开始
520 529 this.check_prom(goods_id, prom_type, prom_id);
  530 +
521 531 } else { // 从非秒杀入口进入,地址不带prom_type、prom_id参数
522   - getApp().request.promiseGet('/api/weshop/activitylist/getGoodActInfo', {
  532 + getApp().request.promiseGet('/api/weshop/activitylist/listGoodActInfo2', {
523 533 data: {
524 534 store_id: os.stoid,
525   - goodsidlist: goods_id,
526   - is_detail: 1,
  535 + goods_id: goods_id,
527 536 goods_type: 1,
528 537 user_id: oo.user_id,
529 538 }
... ... @@ -537,20 +546,16 @@ Page({
537 546 let prom_id = result[0].act_id;
538 547 this.setData({
539 548 'options.prom_type': prom_type,
  549 + 'options.prom_id': prom_id,
540 550 });
  551 + // 检查活动是否开始
541 552 this.check_prom(goods_id, prom_type, prom_id);
542 553 } else if(resLength > 1) { //如果数组长度大于1,表示当前商品参加多个活动,以列表形式显示多活动
543 554 this.setData({
544 555 actList: res.data.data,
545 556 });
546 557 };
547   -
548   - // console.log('!!!!!!~~~~~~~~~prom~~~~~~~~~~!!!!!!');
549   -
550   - // this.setData({
551   - // prom,
552   - // });
553   -
  558 +
554 559 };
555 560 });
556 561 };
... ... @@ -662,6 +667,9 @@ Page({
662 667 //---展示---
663 668 // gid 在onload阶段已经保存在this.data中
664 669 onShow: function() {
  670 +
  671 + getApp().check_can_share();
  672 +
665 673 var that=this;
666 674 var ee = this,gid = this.data.gid, i = getApp().request;
667 675 this.data.is_timer = 1;
... ... @@ -669,8 +677,6 @@ Page({
669 677  
670 678  
671 679  
672   -
673   -
674 680  
675 681 i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, {
676 682 failRollback: !0,
... ... @@ -700,6 +706,7 @@ Page({
700 706 that.setData({
701 707 'data.goods_name': t.data.data.serviceName,
702 708 'data.shop_price': t.data.data.money,
  709 + 'data.show_price': t.data.data.show_price,
703 710 'data.validDays': t.data.data.validDays,
704 711 'data.serviceContent': t.data.data.serviceContent,
705 712 'data.image_url': t.data.data.imgUrl,
... ... @@ -744,6 +751,9 @@ Page({
744 751 };
745 752 }
746 753 });
  754 +
  755 +
  756 +
747 757 this.data.enterAddressPage && (this.data.enterAddressPage = !1);
748 758 this.get_sto();
749 759  
... ... @@ -815,26 +825,185 @@ Page({
815 825 activeCategoryId: 1
816 826 });
817 827 },
818   -
819   -
  828 +
  829 + //获取redis中的数量
  830 + async getactLen(func) {
  831 + var r_num = 0,
  832 + prom_type = this.data.prom_type,
  833 + prom_id = this.data.prom_id;
  834 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
  835 + 1: 1
  836 + }).then(res => {
  837 + var em = res;
  838 + if (em.data.code == 0) {
  839 + r_num = em.data.data;
  840 + }
  841 + })
  842 + func(r_num);
  843 + },
  844 +
820 845 //------------加入购物车--------------
821   - addCart: function(t) {
  846 + addCart: async function(t) {
822 847 var th = this;
823 848 var ind = t.currentTarget.dataset.openSpecModal_ind;
824 849 var action= t.currentTarget.dataset.action;
825 850 if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind;
826   -
  851 + // 活动ID
  852 + var prom_id = th.data.prom_id;
827 853 th.setData({
828 854 open_ind_store: ind
829 855 });
830 856  
831   - if(!th.data.sto_sele_name){
  857 + if(!th.data.sto_sele_name) {
832 858 getApp().my_warnning('请选择门店', 1, th, 450);
833 859 return false;
834   - }
  860 + };
  861 +
  862 +
  863 + if(this.data.prom_type == 1) {
  864 +
  865 + this.data.sele_g.viplimited = this.data.sele_g.buy_limit;
  866 +
  867 + // 每人限购数
  868 + th.data.sele_g.viplimited = th.data.sele_g.buy_limit;
  869 +
  870 + //----获取用户活动购买数----
  871 + // 已经付款的单数
  872 + var gd_buy_num = 0;
  873 + await getApp().request.promiseGet("/api/weshop/rechargeServicelist/getUserBuyGoodsNum?store_id="+os.stoid+"&user_id="+getApp().globalData.user_id+"&card_id="+th.data.options.goods_id+"&prom_type="+th.data.options.prom_type+"&prom_id="+th.data.options.prom_id, {
  874 + }).then(res => {
  875 + gd_buy_num = !res.data.data.promcardbuynum ? 0 : res.data.data.promcardbuynum;
  876 + });
  877 +
  878 +
  879 + // 检查redis库存量
  880 + var redisNum = 0;
  881 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/1/" + prom_id, {}).then(res => {
  882 + if (res.data.code == 0) {
  883 + redisNum = !res.data.data ? 0 : res.data.data;
  884 + };
  885 + });
  886 +
  887 + // 获取购物车同款数量 判断是否超库存
  888 + var cartGoodsNum = 0;
  889 + await getApp().request.promiseGet("/api/weshop/cartService/page?store_id="+os.stoid+"&user_id="+oo.user_id+"&service_id="+th.data.data.id+"&pick_id="+th.data.sto_sele_id,
  890 + { }).then(res => {
  891 + if (res.data.data.pageData.length > 0) {
  892 + const tmpObj = res.data.data.pageData[0];
  893 + cartGoodsNum = !tmpObj.goods_num ? 0 : tmpObj.goods_num;
  894 + }
  895 +
  896 + });
  897 +
  898 +
  899 +
  900 + // 有库存的情况下,走秒杀活动流程 否则 走正常购买流程
  901 + // 没有库存,已抢光的情况下,走正常购买流程
  902 + if(redisNum > 0 && !this.data.is_normal) {
  903 + // 输入的数量
  904 + var t = th.data.goodsInputNum;
  905 +
  906 + if (t > redisNum) {
  907 + wx.showToast({
  908 + title: '超出活动库存' + redisNum,
  909 + icon: 'none'
  910 + });
  911 +
  912 + // 开启限购
  913 + if (th.data.sele_g.viplimited > 0) {
  914 +
  915 + let num = th.data.sele_g.viplimited - gd_buy_num;
  916 + if (action !="buy") {
  917 + // 购物车
  918 + if (num > redisNum) {
  919 + th.setData({goodsInputNum: redisNum});
  920 + } else {
  921 + th.setData({goodsInputNum: num});
  922 + }
  923 + } else {
  924 + // 立即购买
  925 + if (num > redisNum) {
  926 + th.setData({goodsInputNum: redisNum});
  927 + } else {
  928 + th.setData({goodsInputNum: num});
  929 + }
  930 + }
  931 +
  932 +
  933 + } else {
  934 + th.setData({goodsInputNum: redisNum});
  935 + }
  936 +
  937 + return false;
  938 + }
  939 +
  940 +
  941 +
  942 + // 跳过<立即购买> 购物车
  943 + if (action !="buy") {
  944 +
  945 + // 输入的数量 + 购物车同款商品的数量
  946 + var maxNum = parseInt(t) + parseInt(cartGoodsNum);
  947 + // 是否开启个人限购
  948 + if (th.data.sele_g.viplimited > 0) {
  949 + if (maxNum + gd_buy_num > th.data.sele_g.buy_limit) {
  950 + wx.showToast({
  951 + title: '超出活动限购数量',
  952 + icon: 'none'
  953 + });
  954 +
  955 + // 可购买数量
  956 + let num = th.data.sele_g.viplimited - gd_buy_num - cartGoodsNum;
  957 + th.setData({goodsInputNum: num < 0 ? 0 : num});
  958 + return false;
  959 + }
  960 +
  961 + }
  962 +
  963 + if (maxNum > redisNum) {
  964 + wx.showToast({
  965 + title: '超出活动库存',
  966 + icon: 'none'
  967 + });
  968 + // 可购买数量
  969 + let num = redisNum - cartGoodsNum;
  970 + th.setData({goodsInputNum: num});
  971 + return false;
  972 + }
  973 +
  974 + } else {
  975 + // 以下为立即购买
  976 + // 是否开启个人限购
  977 + if (th.data.sele_g.viplimited > 0) {
  978 +
  979 + if (t + gd_buy_num > th.data.sele_g.viplimited) {
  980 + wx.showToast({
  981 + title: '超出活动限购数量',
  982 + icon: 'none'
  983 + });
  984 +
  985 + let num = th.data.sele_g.viplimited - gd_buy_num;
  986 + if (num > redisNum) {
  987 + th.setData({goodsInputNum: redisNum});
  988 + } else {
  989 + th.setData({goodsInputNum: num});
  990 + }
  991 + return false;
  992 + }
  993 +
  994 +
  995 + };
  996 +
  997 + }
  998 +
  999 + };
  1000 + };
  1001 +
  1002 +
  1003 +
835 1004  
836 1005  
837   - if(action=="buy"){
  1006 + if(action=="buy"){ // 立即购买
838 1007 //--------------此时操作的数据------------
839 1008 var newd = {
840 1009 id: th.data.data.id,
... ... @@ -850,12 +1019,30 @@ Page({
850 1019 newd['prom_type'] = this.data.prom_type;
851 1020 newd['prom_id'] = this.data.prom_id;
852 1021 newd['prom_price'] = this.data.prom_price;
853   - }
  1022 + };
  1023 +
  1024 + if(this.data.prom_type == 1 && this.data.openSpecModal_flash_normal) {
  1025 + newd['prom_type'] = 0;
  1026 + newd['prom_price'] = this.data.data.shop_price;
  1027 + };
  1028 +
  1029 + // 判断是否为0库存的情况
  1030 + var tmpRedisNum = 0;
  1031 + // 检查redis库存量
  1032 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/1/" + prom_id, {}).then(res => {
  1033 + if (res.data.code == 0) {
  1034 + tmpRedisNum = res.data.data;
  1035 + };
  1036 + });
  1037 + if(this.data.prom_type == 1 && tmpRedisNum == 0) {
  1038 + newd['prom_type'] = 0;
  1039 + newd['prom_price'] = this.data.data.shop_price;
  1040 + };
854 1041  
855 1042 // console.log('newd++++++++', newd);
856 1043 th.buyNow(newd);
857   - } else {
858   -
  1044 + } else { // 购物车
  1045 +
859 1046 var newd = {
860 1047 service_id: th.data.data.id,
861 1048 service_sn:th.data.data.service_sn,
... ... @@ -864,12 +1051,36 @@ Page({
864 1051 pick_id: th.data.sto_sele_id,
865 1052 user_id:oo.user_id,
866 1053 store_id:os.stoid,
867   - money:th.data.data.shop_price
  1054 + money:th.data.data.shop_price,
868 1055 };
869   - if(getApp().globalData.guide_id){
  1056 + if(getApp().globalData.guide_id) {
870 1057 newd['guide_id'] = getApp().globalData.guide_id;
871 1058 newd['guide_type']=0;
872   - }
  1059 + };
  1060 + // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价
  1061 + if(th.data.options.prom_type == 1) {
  1062 + newd['prom_type'] = th.data.options.prom_type;
  1063 + newd['prom_id'] = th.data.options.prom_id;
  1064 + if(th.data.openSpecModal_flash_normal) {
  1065 + newd['money'] = th.data.data.shop_price;
  1066 + newd['is_pd_normal'] = 1;
  1067 + } else {
  1068 + newd['money'] = th.data.prom_price;
  1069 + };
  1070 + };
  1071 +
  1072 + // 判断是否为0库存的情况
  1073 + var tmpRedisNum = 0;
  1074 + // 检查redis库存量
  1075 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/1/" + prom_id, {}).then(res => {
  1076 + if (res.data.code == 0) {
  1077 + tmpRedisNum = res.data.data;
  1078 + };
  1079 + });
  1080 + if(th.data.options.prom_type == 1 && tmpRedisNum == 0) {
  1081 + newd['prom_type'] = 0;
  1082 + newd['money'] = th.data.data.shop_price;
  1083 + };
873 1084  
874 1085 //----先看会员在购物车中是否加入了该商品-----
875 1086 getApp().request.get("/api/weshop/cartService/page", {
... ... @@ -890,6 +1101,18 @@ Page({
890 1101 money: th.data.data.shop_price,
891 1102 store_id: os.stoid,
892 1103 };
  1104 +
  1105 + // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价
  1106 + if(th.data.options.prom_type == 1) {
  1107 + // updata['prom_type'] = th.data.options.prom_type;
  1108 + // updata['prom_id'] = th.data.options.prom_id;
  1109 + if(th.data.openSpecModal_flash_normal) {
  1110 + updata['money'] = th.data.data.shop_price;
  1111 + updata['is_pd_normal'] = 1;
  1112 + } else {
  1113 + updata['money'] = th.data.prom_price;
  1114 + };
  1115 + };
893 1116  
894 1117 if (getApp().globalData.guide_id) {
895 1118 updata['guide_id'] = getApp().globalData.guide_id;
... ... @@ -923,17 +1146,22 @@ Page({
923 1146 }
924 1147 });
925 1148  
926   - }
  1149 + };
  1150 +
  1151 +
  1152 +
927 1153  
928 1154  
  1155 +
  1156 +
929 1157 },
930 1158  
931 1159 //----------立即购买-----------
932 1160 buyNow: function(e) {
933   - getApp().globalData.service_now=e;
934   - wx.redirectTo({
935   - url: "/packageA/pages/cart2_ser/cart2_ser",
936   - });
  1161 + getApp().globalData.service_now=e;
  1162 + wx.redirectTo({
  1163 + url: "/packageA/pages/cart2_ser/cart2_ser",
  1164 + });
937 1165 },
938 1166 //----------增加购买数量-----------
939 1167 addCartNum: function(t) {
... ... @@ -950,21 +1178,155 @@ Page({
950 1178  
951 1179 //------检查数量是不是超出限购------
952 1180 checkCartNum: function(t) {
953   - if(t<=0) return false;
954   - var th = this;
955   - th.setData({goodsInputNum:t})
  1181 +
  1182 + if(this.data.prom_type != 1) {
  1183 + this.setData({goodsInputNum: t});
  1184 + return false;
  1185 + };
  1186 +
  1187 + var th = this;
  1188 +
  1189 + // if(this.data.prom_act.is_shop_buy && this.data.options.prom_type != 1) {
  1190 +
  1191 + if(t == 0) return false;
  1192 + // th.setData({goodsInputNum:t});
  1193 +
  1194 + // if(this.data.options.prom_type == 1 && !this.data.openSpecModal_flash_normal) {
  1195 +
  1196 + this.get_buy_num(this.data.sele_g, async function () {
  1197 + th.data.sele_g.viplimited = th.data.sele_g.buy_limit;
  1198 +
  1199 + //--判断商品是否超出限购--
  1200 + // if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
  1201 + // if(!th.data.prom_act.is_shop_buy) {
  1202 +
  1203 + // if (th.data.sele_g.viplimited > 0) {
  1204 + // var gd_buy_num = th.data.sele_g.buy_num;
  1205 +
  1206 + // if (t + gd_buy_num> th.data.sele_g.viplimited) {
  1207 + // wx.showModal({
  1208 + // title: '超出商品限购',
  1209 + // });
  1210 +
  1211 + // var num = th.data.sele_g.viplimited - gd_buy_num;
  1212 + // if (num <= 0) num = 1;
  1213 + // th.setData({goodsInputNum: num})
  1214 + // return false;
  1215 + // }
  1216 + // };
  1217 +
  1218 +
  1219 + // 单独购买
  1220 + if(th.data.openSpecModal_flash_normal) th.data.is_normal = 1;
  1221 +
  1222 + // 秒杀:判断活动是否抢光
  1223 + if (th.data.sele_g.prom_type == 1 && !th.data.is_normal) {
  1224 + var redis_num = 0;
  1225 + //------判断活动是否抢光-----
  1226 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  1227 + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {
  1228 + 1: 1
  1229 + }).then(res => {
  1230 + redis_num = res.data.data;
  1231 + });
  1232 +
  1233 + if (t > redis_num) {
  1234 + wx.showToast({
  1235 + // title: '超出商品活动库存',
  1236 + title: '超出活动库存',
  1237 + icon: 'none',
  1238 + });
  1239 + th.setData({goodsInputNum: redis_num})
  1240 + return false;
  1241 + }
  1242 + };
  1243 +
  1244 + //--秒杀:判断商品是否超出活动限购--
  1245 + if (th.data.sele_g.viplimited > 0 && !th.data.is_normal && th.data.prom_type == 1) {
  1246 + var gd_buy_num = th.data.promcardbuynum;
  1247 +
  1248 + // 如果限购数量>活动库存数量,增加数量时会先超过库存数量,此时应该提示“超出活动库存”;
  1249 + // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量”
  1250 + if(th.data.sele_g.viplimited > th.data.sele_g.goods_num) {
  1251 +
  1252 + // 计算还可以购买的数量:库存量 - 已购数
  1253 + var num = th.data.sele_g.goods_num - gd_buy_num;
  1254 + if(num < 0) num = 0;
  1255 + if(t > num) {
  1256 + wx.showToast({
  1257 + title: '超出活动库存',
  1258 + icon: 'none',
  1259 + });
  1260 +
  1261 + th.setData({goodsInputNum: num})
  1262 + return false;
  1263 +
  1264 + };
  1265 +
  1266 + } else {
  1267 + if ((t + gd_buy_num> th.data.sele_g.viplimited) && (t<=th.data.sele_g.goods_num)) {
  1268 + wx.showToast({
  1269 + title: '超出活动限购数量',
  1270 + icon: 'none',
  1271 + });
  1272 +
  1273 + var num = th.data.sele_g.viplimited - gd_buy_num;
  1274 + if (num <= 0) num = 1;
  1275 + th.setData({goodsInputNum: num})
  1276 + return false;
  1277 + };
  1278 + };
  1279 +
  1280 +
  1281 +
  1282 + };
  1283 +
  1284 + //--秒杀:判断商品是否超出活动限购--
  1285 + // if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && !th.data.is_normal) {
  1286 + // if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
  1287 + // wx.showModal({
  1288 + // title: '超出商品活动限购',
  1289 + // });
  1290 +
  1291 + // var num = th.data.prom_buy_limit - th.data.prom_buy_num;
  1292 + // if (num < 0) num = 0;
  1293 + // th.setData({goodsInputNum: num})
  1294 + // return false;
  1295 + // };
  1296 + // };
  1297 +
  1298 +
  1299 +
  1300 +
  1301 +
  1302 + // var e = th.data.sele_g.goods_num;
  1303 + var p_type = th.data.prom_type; //&& p_type!=1 && p_type!=4
  1304 + if (th.data.sales_rules == 2 && (p_type != 1 && p_type != 4 && p_type != 6 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) {
  1305 + if (!th.data.def_pick_store) {
  1306 + wx.showModal({title: '请选择门店',});
  1307 + return false;
  1308 + } else {
  1309 + // e = th.data.def_pick_store.CanOutQty;
  1310 + }
  1311 + }
  1312 +
  1313 + th.setData({goodsInputNum: t});
  1314 +
  1315 + });
  1316 +
  1317 +
956 1318 },
957 1319  
958 1320  
959 1321 closeSpecModal: function() {
960 1322 this.setData({
961 1323 openSpecModal: !1,
962   - openSpecModal_pt: !1
  1324 + openSpecModal_pt: !1,
  1325 + openSpecModal_flash_normal: !1,
963 1326 });
964 1327 },
965 1328  
966 1329 openSpecModel: function(t) {
967   - // console.log('****ttttttt***', t);
968 1330 var th=this;
969 1331 var open_store = t.currentTarget.dataset.ind;
970 1332 this.setData({
... ... @@ -982,10 +1344,12 @@ Page({
982 1344 return false;
983 1345 }
984 1346  
985   - var ind = t.currentTarget.dataset.ind;
  1347 + var ind = t.currentTarget.dataset.ind;
  1348 +
986 1349 this.setData({
987 1350 openSpecModal: !0,
988   - openSpecModal_ind: ind,
  1351 + openSpecModal_ind: ind,
  1352 + goodsInputNum: 1,
989 1353 });
990 1354  
991 1355 },
... ... @@ -1045,29 +1409,57 @@ Page({
1045 1409 });
1046 1410 }
1047 1411 }
1048   - },
1049   -
1050   - //---------联系客服------------
1051   - contactService: function() {
1052   - s.getConfig(function(t) {
1053   - if (t.store_tel == undefined) {
1054   - getApp().request.get("/api/weshop/store/get/" + os.stoid, {
1055   - isShowLoading: 1,
1056   - data: {},
1057   - success: function(rs) {
1058   - getApp().globalData.config = rs.data.data;
1059   - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
1060   - getApp().my_warnning("商家未设置电话", 0, th);
1061   - return false;
1062   - }
1063   - s.confirmBox("请联系客服:" + rs.data.data.store_tel);
1064   - }
1065   - })
1066   - } else {
1067   - s.confirmBox("请联系客服:" + t.store_tel);
1068   - }
1069   - });
1070   - },
  1412 + },
  1413 + //---------联系客服------------
  1414 + contactService: function () {
  1415 + this.getTel()
  1416 + .then(() => {
  1417 + if(self.data.store_tel) {
  1418 + wx.showModal({
  1419 + title: '联系客服',
  1420 + content: '客服热线:' + self.data.store_tel,
  1421 + confirmText: '拨打',
  1422 + success(res) {
  1423 + if(res.confirm) {
  1424 + wx.makePhoneCall({
  1425 + phoneNumber: self.data.store_tel,
  1426 + })
  1427 + };
  1428 + },
  1429 + });
  1430 + };
  1431 + });
  1432 + },
  1433 + // 获取客服电话
  1434 + getTel() {
  1435 + return new Promise((resolve, reject) => {
  1436 + s.getConfig(function (t) {
  1437 + if (t.store_tel == undefined) {
  1438 + getApp().request.get("/api/weshop/store/get/" + os.stoid, {
  1439 + isShowLoading: 1,
  1440 + data: {},
  1441 + success: function (rs) {
  1442 + getApp().globalData.config = rs.data.data;
  1443 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  1444 + getApp().my_warnning("商家未设置电话", 0, th);
  1445 + return false;
  1446 + }
  1447 + self.setData({
  1448 + store_tel: rs.data.data.store_tel,
  1449 + });
  1450 + // s.confirmBox("请联系客服:" + rs.data.data.store_tel);
  1451 + }
  1452 + })
  1453 + } else {
  1454 + self.setData({
  1455 + store_tel: t.store_tel,
  1456 + });
  1457 + // s.confirmBox("请联系客服:" + t.store_tel);
  1458 + };
  1459 + resolve();
  1460 + });
  1461 + });
  1462 + },
1071 1463 //-------获取购物车数量----------
1072 1464 requestCardNum: function() {
1073 1465 var t = this;
... ... @@ -1122,10 +1514,12 @@ Page({
1122 1514 title=th.data.prom_act.share_title;
1123 1515 img=th.data.iurl+th.data.prom_act.share_imgurl;
1124 1516 }
  1517 +
  1518 +
1125 1519  
1126 1520  
1127 1521 var url="/packageA/pages/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
1128   - if(getApp().globalData.user_id){
  1522 + if(getApp().globalData.user_id) {
1129 1523 url+="&first_leader="+getApp().globalData.user_id;
1130 1524 }
1131 1525  
... ... @@ -1137,30 +1531,24 @@ Page({
1137 1531 url+="&room_id="+getApp().globalData.room_id+"&room_user_share=1";
1138 1532 }
1139 1533  
  1534 +
1140 1535 var ob={
1141 1536 title: price + "元 " +title,
1142 1537 path:url,
1143 1538 imageUrl: img,
1144   - };
1145   - // if(th.data.prom_type==6){
1146   - // title+='\n'+th.data.prom_act.share_remark;
1147   - // ob.title=title;
1148   - // ob.desc=th.data.prom_act.share_remark;
1149   - // }
1150   -
1151   - //如果是积分购的时候
1152   - // if(th.data.prom_type==4){
1153   - // var name = th.data.prom_act.name;
1154   - // //-- 积分购的 --
1155   - // var pri0 = th.data.prom_act.addmoney;
1156   - // var integral=th.data.prom_act.integral;
1157   - // var text="";
1158   - // if(integral){text=integral+"积分"; }
1159   - // if(pri0 && integral){ text+="+";}
1160   - // if(pri0){ text+="¥"+pri0;}
  1539 + };
1161 1540  
1162   - // ob.title= text+" "+name;
1163   - // }
  1541 + // 如果服务卡参加秒杀活动,且后台设置了分享标题和分享图片
  1542 + if(th.data.prom_type == 1) {
  1543 + if(th.data.sele_g && th.data.sele_g.share_title) {
  1544 + title = th.data.sele_g.share_title;
  1545 + ob.title = title;
  1546 + };
  1547 + if(th.data.sele_g && th.data.sele_g.share_imgurl) {
  1548 + img = th.data.iurl + th.data.sele_g.share_imgurl;
  1549 + ob.imageUrl = img;
  1550 + };
  1551 + };
1164 1552  
1165 1553 return ob;
1166 1554  
... ... @@ -2562,13 +2950,11 @@ Page({
2562 2950 },
2563 2951  
2564 2952 previewImage() {
2565   - wx.previewImage({
2566   - //将图片预览出来
2567   - urls: [this.data.shareImgPath]
2568   - });
  2953 + getApp().pre_img(this.data.shareImgPath);
2569 2954 },
2570 2955  
2571 2956 onShareTimeline() {
  2957 + getApp().globalData.no_clear=1
2572 2958 var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
2573 2959 if(!store_name)
2574 2960 store_name=getApp().globalData.setting.appName;
... ... @@ -2913,45 +3299,51 @@ Page({
2913 3299 isshow: 1,
2914 3300 });
2915 3301 // this.get_sku(os.stoid, this.data.data, gid);
2916   - // this.get_sto();
  3302 + this.get_sto();
2917 3303 // this.check_is_youhui(gid, 1);
2918 3304 this.data.is_normal = 1;
2919 3305 },
2920 3306  
2921 3307  
  3308 + //获取redis中的数量
  3309 + async getactLen(func) {
  3310 + var r_num = 0,
  3311 + prom_type = this.data.prom_type,
  3312 + prom_id = this.data.prom_id;
  3313 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
  3314 + 1: 1
  3315 + }).then(res => {
  3316 + var em = res;
  3317 + if (em.data.code == 0) {
  3318 + r_num = em.data.data;
  3319 + }
  3320 + })
  3321 + func(r_num);
  3322 + },
  3323 +
  3324 +
2922 3325  
2923 3326  
2924 3327 //--------检查是否活动,活动是否开始,或者是否结束-------
2925 3328 async check_prom(gid, prom_type, prom_id) {
2926   - console.log('check_prom');
2927 3329 var ee = this, th = ee;
2928 3330 var user_id = getApp().globalData.user_id;
2929 3331 if (!user_id) user_id = 0;
  3332 +
  3333 + if (prom_type == 1 && prom_id == 0) {
  3334 + this.setData({
  3335 + prom_type: 0, isshow: 1,
  3336 + });
2930 3337  
2931   - // if (prom_type == 3 || prom_type == 0 || prom_type == 5 || prom_type == 7 || prom_type == 9 || prom_type == 10) {
2932   - // this.setData({
2933   - // prom_type: 0, isshow: 1,
2934   - // });
2935   - // return false;
2936   - // }
2937   -
2938   -
2939   -
2940   - // if (prom_type == 1 && prom_id == 0) {
2941   - // this.setData({
2942   - // prom_type: 0, isshow: 1,
2943   - // });
2944   -
2945   - // //获取门店
2946   - // this.get_sto();
2947   - // this.get_sku(o.stoid, this.data.data, gid);
2948   - // this.check_has_flash();
2949   - // this.data.is_normal = 1;
2950   - // this.check_is_youhui(gid, 1);
2951   - // return false;
2952   - // }
  3338 + //获取门店
  3339 + this.get_sto();
  3340 + // this.get_sku(o.stoid, this.data.data, gid);
  3341 + this.check_has_flash();
  3342 + this.data.is_normal = 1;
  3343 + // this.check_is_youhui(gid, 1);
  3344 + return false;
  3345 + }
2953 3346  
2954   - //if (prom_type != 3 && prom_type!=0){
2955 3347 //---判断秒杀----
2956 3348 if (prom_type == 1 && prom_id > 0) {
2957 3349 //-------判断活动是否抢光---------
... ... @@ -2959,15 +3351,23 @@ Page({
2959 3351 1: 1
2960 3352 }).then(res => {
2961 3353 var em = res;
2962   - if (res.data.code == 0) {
2963   - // console.log('!!!!!!res!!!!', res);
2964   - if (res.data.data <= 0) ee.setData({
2965   - prom_r_null: 1
2966   - });
  3354 + if (em.data.code == 0) {
  3355 +
  3356 + if (em.data.data <= 0) {
  3357 + th.setData({
  3358 + prom_r_null: 1,
  3359 + goodsInputNum: res.data.data,
  3360 + });
  3361 +
  3362 + // th.setData({goodsInputNum: redis_num})
  3363 + };
2967 3364 //拿取价格并且判断时间--
2968 3365 getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, {
2969 3366 success: function (t) {
2970   - // console.log('!!!!!!t!!!!', t);
  3367 + th.setData({
  3368 + sele_g: t.data.data,
  3369 + });
  3370 +
2971 3371 if (t.data.code != 0) {
2972 3372 ee.get_normal(gid);
2973 3373 return false;
... ... @@ -2994,7 +3394,6 @@ Page({
2994 3394 var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");
2995 3395  
2996 3396 ee.setData({
2997   - 'data.shop_price': t.data.data.user_price,
2998 3397 prom_price: t.data.data.user_price,
2999 3398 prom_type: 1,
3000 3399 prom_id: prom_id,
... ... @@ -3026,60 +3425,60 @@ Page({
3026 3425 }
3027 3426  
3028 3427 //如果是进行中的话
3029   - // if (endTime1 < newTime) {
3030   - // //-- 获取秒杀活动的多少规格 --
3031   - // ee.get_more_flahs(function (list) {
3032   - // if (list && list.length > 1) {
3033   -
3034   - // var n_item = list[0];
3035   - // var ind = list.findIndex(function (ele) {
3036   - // return ele.goods_id == ee.data.data.goods_id;
3037   - // })
3038   - // if (ind < 0) return false;
3039   - // if (ind > 0) {
3040   - // n_item = JSON.parse(JSON.stringify(list[ind]));
3041   - // list.splice(ind, 1);
3042   - // list.unshift(n_item);
3043   - // }
3044   -
3045   - // ee.data.sele_g.viplimited = n_item.viplimited;
3046   - // ee.data.data.viplimited = n_item.viplimited;
3047   -
3048   - // var gb = 1;
3049   - // //-- 显示多规格 --
3050   - // for (let i in list) {
3051   - // let item = list[i];
3052   - // var gg = "";
3053   - // if (item.goods_spec == "null" || item.goods_spec == null) item.goods_spec = "";
3054   - // if (item.goods_color == "null" || item.goods_color == null) item.goods_color = "";
3055   -
3056   - // if (item.goods_spec != "" && item.goods_color != "") {
3057   - // gg = item.goods_spec + "/" + item.goods_color;
3058   - // } else if (item.goods_spec != "" || item.goods_color != "") {
3059   - // gg = item.goods_spec + item.goods_color;
3060   - // } else {
3061   - // gg = "规格" + gb;
3062   - // gb++;
3063   - // }
3064   - // item.gg = gg;
3065   - // item.prom_id = item.prom_id;
3066   - // item.prom_type = 1;
3067   - // }
3068   -
3069   - // ee.setData({
3070   - // sku_g: list,
3071   - // });
3072   -
3073   - // }
3074   - // })
3075   - // }
  3428 + if (endTime1 < newTime) {
  3429 + //-- 获取秒杀活动的多少规格 --
  3430 + ee.get_more_flash(function (list) {
  3431 + if (list && list.length > 1) {
  3432 +
  3433 + var n_item = list[0];
  3434 + var ind = list.findIndex(function (ele) {
  3435 + return ele.goods_id == ee.data.data.goods_id;
  3436 + })
  3437 + if (ind < 0) return false;
  3438 + if (ind > 0) {
  3439 + n_item = JSON.parse(JSON.stringify(list[ind]));
  3440 + list.splice(ind, 1);
  3441 + list.unshift(n_item);
  3442 + }
  3443 +
  3444 + ee.data.sele_g.viplimited = n_item.viplimited;
  3445 + ee.data.data.viplimited = n_item.viplimited;
  3446 +
  3447 + var gb = 1;
  3448 + //-- 显示多规格 --
  3449 + for (let i in list) {
  3450 + let item = list[i];
  3451 + var gg = "";
  3452 + if (item.goods_spec == "null" || item.goods_spec == null) item.goods_spec = "";
  3453 + if (item.goods_color == "null" || item.goods_color == null) item.goods_color = "";
  3454 +
  3455 + if (item.goods_spec != "" && item.goods_color != "") {
  3456 + gg = item.goods_spec + "/" + item.goods_color;
  3457 + } else if (item.goods_spec != "" || item.goods_color != "") {
  3458 + gg = item.goods_spec + item.goods_color;
  3459 + } else {
  3460 + gg = "规格" + gb;
  3461 + gb++;
  3462 + }
  3463 + item.gg = gg;
  3464 + item.prom_id = item.prom_id;
  3465 + item.prom_type = 1;
  3466 + }
  3467 +
  3468 + ee.setData({
  3469 + sku_g: list,
  3470 + });
  3471 +
  3472 + }
  3473 + })
  3474 + }
3076 3475  
3077 3476 }
3078 3477 });
3079 3478 }
3080 3479 })
3081 3480 }
3082   -
  3481 +
3083 3482 },
3084 3483  
3085 3484  
... ... @@ -3088,61 +3487,744 @@ Page({
3088 3487 let prom_type = e.currentTarget.dataset.promtype;
3089 3488 let prom_id = e.currentTarget.dataset.promid;
3090 3489 let goods_id = this.data.data.goods_id;
3091   - let url = `/packageA/pages/goodsInfo/goodsInfo?goods_id=${goods_id}&prom_type=${prom_type}&prom_id=${prom_id}`;
3092   - // console.log('url~~~~', url);
  3490 + let url = `/packageA/pages/goodsInfo/goodsInfo?goods_id=${goods_id}&prom_type=${prom_type}&prom_id=${prom_id}`;s
3093 3491 getApp().goto(url);
3094 3492 },
3095 3493  
3096 3494  
3097 3495  
3098   -
3099   - //-- 检验商品的活动情况 --
3100   - check_gd_prom_new: function (func) {
3101   - var th = this;
  3496 + //获取更多秒杀
  3497 + get_more_flash: async function (func) {
  3498 + var f_more = false;
3102 3499 var user_id = getApp().globalData.user_id;
3103 3500 if (!user_id) user_id = 0;
3104 3501  
3105   - var url = '/api/weshop/activitylist/listGoodActInfo2';
3106   - var req_d = {
3107   - "store_id": os.stoid,
3108   - "goods_id": this.data.gid,
3109   - "user_id": user_id,
  3502 + var url = "/api/weshop/goods/listSkuFlash?store_id=" + os.stoid + "&goods_id=" + this.data.options.goods_id + "&user_id=" + user_id;
  3503 + //获取秒杀的多规格
  3504 + await getApp().request.promiseGet(url, {}).then(res => {
  3505 + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  3506 + f_more = res.data.data;
  3507 + }
  3508 + })
  3509 + if (!f_more) {
  3510 + func(false);
  3511 + return false;
  3512 + }
  3513 + //-- 秒杀的价格要更新 --
  3514 + for (let i in f_more) {
  3515 +
  3516 + let item = f_more[i];
  3517 + f_more[i].prom_id = item.act_id;
  3518 + f_more[i].prom_type = 1;
  3519 + if (item.goods_id == this.data.data.goods_id) {
  3520 + continue;
  3521 + }
  3522 + var url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + item.act_id;
  3523 + await getApp().request.promiseGet(url, {}).then(rs => {
  3524 + if (rs.data.code == 0) {
  3525 + f_more[i].price = rs.data.data.user_price;
  3526 +
  3527 + }
  3528 + })
  3529 + }
  3530 + func(f_more);
  3531 +
  3532 + },
  3533 +
  3534 +
  3535 +
  3536 +
  3537 +
  3538 +
  3539 + //-------------获取购买数量的总函数----------------
  3540 + get_buy_num: function (gd, func) {
  3541 + // var map = this.data.g_buy_num,
  3542 + var th = this,
  3543 + user_id = getApp().globalData.user_id;
  3544 + if (user_id == null) {
  3545 + // map.set(gd.goods_id, 0);
  3546 + th.setData({
  3547 + // g_buy_num: map,
  3548 + prom_buy_num: 0,
  3549 + });
  3550 + "function" == typeof func && func();
  3551 + return false;
3110 3552 }
3111   - getApp().request.get(url, {
3112   - data: req_d,
3113   - success: function (e) {
3114   - if (e.data.code == 0 && e.data.data && e.data.data.length > 0) {
3115   - var arr = e.data.data;
3116   - var arr2 = arr.filter(function (e) {
3117   - return e.s_time < ut.gettimestamp();
  3553 +
  3554 + // if (map.has(gd.goods_id)) {
  3555 + // "function" == typeof func && func();
  3556 + // } else {
  3557 + //----获取商品购买数----
  3558 + if (th.data.prom_type == 1) {
  3559 + //----获取活动购买数----
  3560 + getApp().request.get("/api/weshop/rechargeServicelist/getUserBuyGoodsNum", {
  3561 + data: {
  3562 + store_id: os.stoid,
  3563 + user_id: user_id,
  3564 + card_id: th.data.options.goods_id,
  3565 + prom_type: th.data.options.prom_type,
  3566 + prom_id: th.data.options.prom_id
  3567 + },
  3568 + //-----获取-----
  3569 + success: function (tt) {
  3570 + if (tt.data.code == 0) {
  3571 + // map.set(gd.goods_id, g_buy_num);
  3572 + th.setData({
  3573 + // g_buy_num: map,
  3574 + promcardbuynum: tt.data.data.promcardbuynum,
  3575 + cardbuynum: tt.data.data.cardbuynum,
  3576 + });
  3577 + "function" == typeof func && func();
  3578 + }
  3579 + }
  3580 + });
  3581 + } else {
  3582 + "function" == typeof func && func();
  3583 + };
  3584 +
  3585 + },
  3586 +
  3587 +
  3588 +
  3589 +
  3590 +
  3591 + // 促销 -> 送礼包 -> 查看详情
  3592 + viewLbDetails(e) {
  3593 + let id = e.currentTarget.dataset.id; // 获取礼包id
  3594 + let url = `/packageA/pages/myGiftDetails/myGiftDetails?btn=0&index=0&id=${id}`; // btn=0 控制跳转到的页面不显示按钮
  3595 + // console.log('myurl', url);
  3596 + getApp().goto(url);
  3597 + },
  3598 +
  3599 + go_more_ladder: function (e) {
  3600 + var prom_id = e.currentTarget.dataset.id;
  3601 + getApp().goto("/pages/goods/goodsList/goodsList?ladder_id=" + prom_id);
  3602 + },
  3603 +
  3604 + getHistoryBuy() {
  3605 + let _this = this;
  3606 + let req_data = {
  3607 + store_id: os.stoid,
  3608 + goods_id: this.data.gid,
  3609 + pay_status: 1,
  3610 + rndid: 1
  3611 + };
  3612 + getApp().request.promiseGet('/api/weshop/ordergoods/list', {
  3613 + data: req_data,
  3614 + })
  3615 + .then(res => {
  3616 + if (t.ajax_ok(res)) {
  3617 + _this.setData({
  3618 + historyBuyInfo: res.data.data.pageData,
  3619 + })
  3620 + }
  3621 + })
  3622 + },
  3623 +
  3624 +
  3625 +
  3626 + //-- 秒杀的普通购买 --
  3627 + openSpecModel_Nor: function () {
  3628 + this.data.g_buy_num = new Map();
  3629 + var th = this;
  3630 + this.setData({open_ind_store: 5, goodsInputNum: 1});//拼团直接给4
  3631 +
  3632 + this.setData({openSpecModal_flash_normal: 1});
  3633 +
  3634 +
  3635 + // if (th.data.sku_g_pt) {
  3636 + // // this.get_sto(1)
  3637 + // this.setData({openSpecModal_flash_normal: 1});
  3638 + // } else {
  3639 + // th.get_sto(1);
  3640 + // th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () {
  3641 + // th.setData({
  3642 + // openSpecModal_flash_normal: 1
  3643 + // });
  3644 + // });
  3645 + // }
  3646 + // this.check_is_youhui(th.data.gid, 1);
  3647 + },
  3648 +
  3649 + closeSpecModal_flash_normal: function () {
  3650 + this.setData({openSpecModal_flash_normal: 0});
  3651 + },
  3652 +
  3653 +
  3654 + //打开客服操作菜单
  3655 + openCS() {
  3656 + // 判断会员状态
  3657 + let user_info = getApp().globalData.userInfo;
  3658 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) {
  3659 + wx.navigateTo({
  3660 + url: '/pages/togoin/togoin',
  3661 + })
  3662 + return false;
  3663 + };
  3664 + // csType/在线客服设置:
  3665 + // 0关闭(如果有设置热线电话,则显示拨打热线电话)、
  3666 + // 1小程序客服、
  3667 + // 2企业微信客服
  3668 + if(this.data.sys_switch) {
  3669 + let csType = this.data.sys_switch.weapp_customertype;
  3670 + if(csType == 0) {
  3671 + // 拨打电话号码
  3672 + this.contactService();
  3673 + } else {
  3674 + this.getTel()
  3675 + .then(() => {
  3676 + self.setData({
  3677 + hiddenCS: false,
  3678 + });
  3679 + });
  3680 + };
  3681 + };
  3682 +
  3683 + },
  3684 +
  3685 + //关闭客服操作菜单
  3686 + closeCS() {
  3687 + this.setData({
  3688 + hiddenCS: true,
  3689 + });
  3690 + },
  3691 +
  3692 +
  3693 +
  3694 +
  3695 +
  3696 +
  3697 +
  3698 + //-- 加入购物的函数 --
  3699 + add_cart_func: function (t) {
  3700 + var i = getApp().request;
  3701 + if (oo.user_id == null) {
  3702 + return s.my_warnning("还未登录!", 0, this);
  3703 + }
  3704 +
  3705 + if (!getApp().globalData.userInfo) {
  3706 + return s.my_warnning("还未登录!", 0, this);
  3707 + }
  3708 +
  3709 + var e = this,
  3710 + th = e,
  3711 + a = 0,
  3712 + o = this.data.sele_g;
  3713 + a = o.goods_id;
  3714 +
  3715 + //----------添加到购物车时,要判断限购数量,--------
  3716 + e.get_buy_num(o, function (ee) {
  3717 + //---判断商品是否超出限购---
  3718 + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
  3719 + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
  3720 + wx.showModal({
  3721 + title: '提示',
  3722 + content: '超出活动限购数量'
  3723 + });
  3724 + return false;
  3725 + }
  3726 + }
  3727 + //---判断商品是否超出活动限购---
  3728 + if ((th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) && !th.data.is_normal) {
  3729 + if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
  3730 + wx.showModal({
  3731 + title: '提示',
  3732 + content: '超出活动限购数量'
  3733 + });
  3734 + return false;
  3735 + }
  3736 + }
  3737 +
  3738 + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);
  3739 + if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)
  3740 + this.setData({
  3741 + sto_sele_name: ""
  3742 + });
  3743 + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
  3744 +
  3745 + //--------------此时操作的数据------------
  3746 + var newd = {
  3747 + goods_id: o.goods_id,
  3748 + goods_num: th.data.goodsInputNum,
  3749 + pick_id: th.data.sto_sele_id,
  3750 + user_id: oo.user_id,
  3751 + store_id: th.data.stoid,
  3752 + goods_price: o.shop_price,
  3753 + member_goods_price: o.shop_price,
  3754 + goods_name: o.goods_name,
  3755 + goods_sn: o.goods_sn,
  3756 + sku: o.sku,
  3757 + prom_id: th.data.sele_g.prom_id,
  3758 + prom_type: th.data.sele_g.prom_type,
  3759 + };
  3760 +
  3761 + //---是不是从收藏夹出来的---
  3762 + if (th.data.c_guide_id) {
  3763 + newd['guide_id'] = th.data.c_guide_id;
  3764 + newd['guide_type'] = 2;
  3765 + if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 3;
  3766 + } else {
  3767 + if (getApp().globalData.guide_id) {
  3768 + newd['guide_id'] = getApp().globalData.guide_id;
  3769 + newd['guide_type'] = 0;
  3770 + if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1;
  3771 + }
  3772 + }
  3773 +
  3774 + //让商品带上房间号
  3775 + //让商品带上房间号
  3776 + if (th.data.sys_switch.is_skuroom_id == 1) {
  3777 + if (th.data.data.goods_id == getApp().globalData.room_goods_id) {
  3778 + newd.room_id = getApp().globalData.room_id;
  3779 + }
  3780 + } else {
  3781 + if (newd.goods_id == getApp().globalData.room_goods_id) newd.room_id = getApp().globalData.room_id;
  3782 + }
  3783 +
  3784 + //如果是积分够,is_integral_normal就要有积分购普通购买字段
  3785 + if (o.prom_type == 4) {
  3786 + newd.is_integral_normal = 1;
  3787 + }
  3788 +
  3789 + //如果有线下取价
  3790 + if (o.offline_price) {
  3791 + newd.offline_price = o.offline_price;
  3792 + newd.pricing_type = o.pricing_type;
  3793 + }
  3794 +
  3795 + //-----如果是秒杀,团购,积分购,拼团-----
  3796 + if (th.data.prom_type == 1 || th.data.prom_type == 2) {
  3797 +
  3798 + if (th.data.openSpecModal_flash_normal) {
  3799 +
  3800 + newd.prom_type = 0;
  3801 + newd.prom_id = 0;
  3802 +
  3803 + //---如果是线下门店销售的时候---
  3804 + if (th.data.sales_rules == 2) {
  3805 + var pick = th.get_pick_from_list(th.data.sto_sele_id)
  3806 + //---通过接口获取门店的线下库存信息--
  3807 + getApp().request.get("/api/weshop/goods/getWareStorages", {
  3808 + data: {
  3809 + storageNos: pick.pickup_no,
  3810 + wareIds: encodeURIComponent(th.data.sele_g.erpwareid),
  3811 + storeId: os.stoid
  3812 + },
  3813 + success: function (res) {
  3814 + if (res.data.code == 0) {
  3815 + if (res.data.data.pageData.length > 0) {
  3816 + var CanOutQty = res.data.data.pageData[0].CanOutQty;
  3817 + if (CanOutQty < e.data.goodsInputNum) {
  3818 + return s.my_warnning("库存不足!", 0, th);
  3819 + }
  3820 + //在调一次接口,读取商品的预出库的数量,lock
  3821 + getApp().request.get("/api/weshop/order/ware/lock/page", {
  3822 + data: {
  3823 + store_id: os.stoid,
  3824 + wareId: th.data.sele_g.goods_id,
  3825 + storageId: pick.pickup_id,
  3826 + pageSize: 1000
  3827 + },
  3828 + success: function (res_data) {
  3829 + if (res_data.data.code == 0 && res_data.data.data.total > 0) {
  3830 +
  3831 + var lock = 0;
  3832 + for (var i in res_data.data.data.pageData) {
  3833 + lock += res_data.data.data.pageData[i].outQty;
  3834 + }
  3835 +
  3836 + if (CanOutQty <= lock) {
  3837 + return s.my_warnning("库存不足!", 0, th);
  3838 + }
  3839 + th.add_cart_next(e, t, a, o, newd, CanOutQty - lock);
  3840 + } else {
  3841 + th.add_cart_next(e, t, a, o, newd, CanOutQty);
  3842 + }
  3843 + }
  3844 + })
  3845 + } else {
  3846 + return s.my_warnning("库存不足!", 0, th);
  3847 + }
  3848 +
  3849 + }
  3850 + }
  3851 + })
  3852 + } else {
  3853 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  3854 + if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  3855 + th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
  3856 + }
  3857 +
  3858 + return false;
  3859 + }
  3860 +
  3861 +
  3862 + newd.goods_price = th.data.prom_price;
  3863 + newd.member_goods_price = th.data.prom_price,
  3864 + newd.prom_type = th.data.prom_type;
  3865 + newd.prom_id = th.data.prom_id;
  3866 +
  3867 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  3868 + if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  3869 +
  3870 + th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
  3871 +
  3872 + } else if (o.prom_type == 7) {
  3873 +
  3874 + //判断进行中的活动,是不是要判断线下库存
  3875 + th.check_zh_acting(function (ee) {
  3876 + newd.prom_id = 0;
  3877 + newd.prom_type = 0;
  3878 + if (ee && th.data.sele_g.act) {
  3879 + newd.prom_id = th.data.sele_g.act.id;
  3880 + newd.prom_type = 7;
  3881 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  3882 + if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  3883 + th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
  3884 + return false;
  3885 + } else {
  3886 + //---如果是线下门店销售的时候---
  3887 + if (th.data.sales_rules == 2) {
  3888 + var pick = th.get_pick_from_list(th.data.sto_sele_id)
  3889 + //---通过接口获取门店的线下库存信息--
  3890 + getApp().request.get("/api/weshop/goods/getWareStorages", {
  3891 + data: {
  3892 + storageNos: pick.pickup_no,
  3893 + wareIds: encodeURIComponent(th.data.sele_g.erpwareid),
  3894 + storeId: os.stoid
  3895 + },
  3896 + success: function (res) {
  3897 + if (res.data.code == 0) {
  3898 + if (res.data.data.pageData.length > 0) {
  3899 + var CanOutQty = res.data.data.pageData[0].CanOutQty;
  3900 + if (CanOutQty < e.data.goodsInputNum) {
  3901 + return s.my_warnning("库存不足!", 0, th);
  3902 + }
  3903 + //在调一次接口,读取商品的预出库的数量,lock
  3904 + getApp().request.get("/api/weshop/order/ware/lock/page", {
  3905 + data: {
  3906 + store_id: os.stoid,
  3907 + wareId: th.data.sele_g.goods_id,
  3908 + storageId: pick.pickup_id,
  3909 + pageSize: 1000
  3910 + },
  3911 + success: function (res_data) {
  3912 + if (res_data.data.code == 0 && res_data.data.data.total > 0) {
  3913 +
  3914 + var lock = 0;
  3915 + for (var i in res_data.data.data.pageData) {
  3916 + lock += res_data.data.data.pageData[i].outQty;
  3917 + }
  3918 +
  3919 + if (CanOutQty <= lock) {
  3920 + return s.my_warnning("库存不足!", 0, th);
  3921 + }
  3922 + th.add_cart_next(e, t, a, o, newd, CanOutQty - lock);
  3923 + } else {
  3924 + th.add_cart_next(e, t, a, o, newd, CanOutQty);
  3925 + }
  3926 + }
  3927 + })
  3928 + } else {
  3929 + return s.my_warnning("库存不足!", 0, th);
  3930 + }
  3931 +
  3932 + }
  3933 + }
  3934 + })
  3935 + } else {
  3936 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  3937 + if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  3938 + th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
  3939 + }
  3940 + }
  3941 + })
  3942 +
  3943 + }
  3944 + else if (th.data.prom_type == 0 || th.data.prom_type == 3 || th.data.prom_type == 4 || th.data.prom_type == 5 || th.data.prom_type == 10) {
  3945 + newd.prom_type = 0;
  3946 + newd.prom_id = 0;
  3947 +
  3948 + if (th.data.prom_type == 10) {
  3949 + newd.prom_type = th.data.prom_type;
  3950 + newd.prom_id = th.data.prom_id;
  3951 + }
  3952 +
  3953 + //---如果是线下门店销售的时候---
  3954 + if (th.data.sales_rules == 2) {
  3955 + var pick = th.get_pick_from_list(th.data.sto_sele_id)
  3956 + //---通过接口获取门店的线下库存信息--
  3957 + getApp().request.get("/api/weshop/goods/getWareStorages", {
  3958 + data: {
  3959 + storageNos: pick.pickup_no,
  3960 + wareIds: encodeURIComponent(th.data.sele_g.erpwareid),
  3961 + storeId: os.stoid
  3962 + },
  3963 + success: function (res) {
  3964 + if (res.data.code == 0) {
  3965 + if (res.data.data.pageData.length > 0) {
  3966 + var CanOutQty = res.data.data.pageData[0].CanOutQty;
  3967 + if (CanOutQty < e.data.goodsInputNum) {
  3968 + return s.my_warnning("库存不足!", 0, th);
  3969 + }
  3970 + //在调一次接口,读取商品的预出库的数量,lock
  3971 + getApp().request.get("/api/weshop/order/ware/lock/page", {
  3972 + data: {
  3973 + store_id: os.stoid,
  3974 + wareId: th.data.sele_g.goods_id,
  3975 + storageId: pick.pickup_id,
  3976 + pageSize: 1000
  3977 + },
  3978 + success: function (res_data) {
  3979 + if (res_data.data.code == 0 && res_data.data.data.total > 0) {
  3980 +
  3981 + var lock = 0;
  3982 + for (var i in res_data.data.data.pageData) {
  3983 + lock += res_data.data.data.pageData[i].outQty;
  3984 + }
  3985 +
  3986 + if (CanOutQty <= lock) {
  3987 + return s.my_warnning("库存不足!", 0, th);
  3988 + }
  3989 + th.add_cart_next(e, t, a, o, newd, CanOutQty - lock);
  3990 + } else {
  3991 + th.add_cart_next(e, t, a, o, newd, CanOutQty);
  3992 + }
  3993 + }
  3994 + })
  3995 + } else {
  3996 + return s.my_warnning("库存不足!", 0, th);
  3997 + }
  3998 +
  3999 + }
  4000 + }
3118 4001 })
3119   - //-- 如果只有一个活动的话 --
3120   - if (arr.length == 1) {
3121   - th.data.prom_type = arr[0].prom_type;
3122   - th.data.prom_id = arr[0].act_id;
  4002 + } else {
  4003 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  4004 + if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  4005 + th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
  4006 + }
  4007 + }
  4008 + })
  4009 + },
  4010 +
  4011 + //---加入购物车的最后一步---
  4012 + add_cart_next(e, t, a, o, newd, CanOutQty) {
  4013 + var th = this, i = getApp().request;
  4014 + //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
  4015 + if ((o.prom_type != 1 || o.prom_id <= 0) && ((o.prom_type != 6 && o.prom_type != 4 && o.prom_type != 2 ) || th.data.is_normal)) {
  4016 + var conf = th.data.bconfig;
  4017 + if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) {
  4018 + var s_list = JSON.parse(conf.switch_list);
  4019 + var now = ut.gettimestamp();
  4020 +
  4021 +
  4022 + var str = getApp().globalData.userInfo['card_expiredate'].replace(/-/g, '/');
  4023 + var end = new Date(str);
  4024 + end = Date.parse(end) / 1000;
  4025 +
  4026 + //--如果后台有开启等级价的功能,而且会员的等级没有过期的情况下--
  4027 + if (parseInt(s_list.rank_switch) == 2 && end > now) {
  4028 + var card_price = o[getApp().globalData.userInfo['card_field']];
  4029 + //如果会员有等级价
  4030 + if (getApp().globalData.userInfo['card_field'] != undefined && getApp().globalData.userInfo['card_field'] != null
  4031 + && getApp().globalData.userInfo['card_field'] != "" && card_price > 0) {
  4032 + newd.goods_price = card_price;
  4033 + newd.member_goods_price = card_price;
3123 4034 }
3124   - //-- 如果只有一个进行中的活动的话 --
3125   - else if (arr2.length == 1) {
3126   - th.data.prom_type = arr2[0].prom_type;
3127   - th.data.prom_id = arr2[0].act_id;
  4035 + }
  4036 + }
  4037 + }
  4038 +
  4039 + //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d);
  4040 + if ("add" == t.currentTarget.dataset.action) {
  4041 +
  4042 + if (th.data.prom_goods) {
  4043 + newd.prom_type = 3;
  4044 + newd.prom_id = th.data.prom_goods[0].prom_id;
  4045 + }
  4046 +
  4047 + //----先看会员在购物车中是否加入了该商品-----
  4048 + i.get("/api/weshop/cart/page", {
  4049 + data: {
  4050 + store_id: e.data.stoid,
  4051 + user_id: oo.user_id,
  4052 + goods_id: a,
  4053 + pick_id: e.data.sto_sele_id,
  4054 + state: 0
  4055 + },
  4056 + success: function (re) {
  4057 +
  4058 + //-------如果购物车中有相关的数据---------
  4059 + if (re.data.data.total > 0) {
  4060 +
  4061 + var item = re.data.data.pageData[0];
  4062 +
  4063 + //判断数量,要看下购物车中有没有该商品
  4064 + if (CanOutQty) {
  4065 + if (item.goods_num + th.data.goodsInputNum > CanOutQty) {
  4066 + return s.my_warnning("库存不足!", 0, th);
  4067 + }
  4068 + } else {
  4069 + if (item.goods_num + th.data.goodsInputNum > o.store_count) {
  4070 + return s.my_warnning("库存不足!", 0, th);
  4071 + }
  4072 + }
  4073 +
  4074 + var updata = {
  4075 + id: item.id,
  4076 + goods_num: e.data.goodsInputNum + item.goods_num,
  4077 + goods_price: newd.goods_price,
  4078 + member_goods_price: newd.goods_price,
  4079 + store_id: th.data.stoid,
  4080 + };
  4081 +
  4082 + //---是不是从收藏夹出来的---
  4083 + if (th.data.c_guide_id) {
  4084 + updata['guide_id'] = th.data.c_guide_id;
  4085 + updata['guide_type'] = 3; //加入购物车之后就变成了3
  4086 + } else {
  4087 + if (getApp().globalData.guide_id) {
  4088 + updata['guide_id'] = getApp().globalData.guide_id;
  4089 + updata['guide_type'] = 0;
  4090 + }
  4091 + }
  4092 +
  4093 + i.put("/api/weshop/cart/update", {
  4094 + data: updata,
  4095 + success: function (t) {
  4096 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  4097 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  4098 + th.setData({
  4099 + cartGoodsNum: c_num
  4100 + });
  4101 + th.closeSpecModal();
  4102 + }
  4103 + });
  4104 + } else {
  4105 +
  4106 +
  4107 + i.post("/api/weshop/cart/save", {
  4108 + data: newd,
  4109 + success: function (t) {
  4110 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  4111 + var c_num = th.data.cartGoodsNum + e.data.goodsInputNum;
  4112 + th.setData({
  4113 + cartGoodsNum: c_num
  4114 + });
  4115 + th.closeSpecModal();
  4116 + }
  4117 + });
3128 4118 }
3129 4119 }
3130   - //-- 调用回调 --
3131   - func();
  4120 + });
  4121 +
  4122 + }
  4123 + else {
  4124 +
  4125 + //这一步主要是要让立即购买 走 购物车的逻辑 参与活动
  4126 + if (newd.prom_type == 10 || newd.prom_type == 7) {
  4127 + //----先看会员在购物车中是否加入了该商品,立即购买的-----
  4128 + getApp().request.get("/api/weshop/cart/page", {
  4129 + data: {
  4130 + store_id: e.data.stoid,
  4131 + user_id: oo.user_id,
  4132 + state: 1
  4133 + },
  4134 + success: function (res) {
  4135 + //-------如果购物车中有相关的数据---------
  4136 + if (res.data.code == 0 && res.data.data.total > 0) {
  4137 + for (let j in res.data.data.pageData) {
  4138 + let item_j = res.data.data.pageData[j];
  4139 + var url = '/api/weshop/cart/del/' + e.data.stoid + '/' + item_j.id;
  4140 + getApp().request.delete(url, {});
  4141 + }
  4142 + }
  4143 + newd.state = 1;
  4144 + getApp().request.post("/api/weshop/cart/save", {
  4145 + data: newd,
  4146 + success: function (t) {
  4147 + th.closeSpecModal();
  4148 + getApp().goto("/pages/cart/cart2/cart2?state=1");
  4149 + }
  4150 + });
  4151 + },
  4152 + })
  4153 + return false;
3132 4154 }
3133   - });
  4155 +
  4156 + if (th.data.prom_goods) {
  4157 + var prom_d = th.data.prom_goods;
  4158 + for (var i in prom_d) {
  4159 + //判断活动有俩种条件,0元 1件
  4160 + var condition_t = prom_d[i].prom_type;
  4161 + switch (condition_t) {
  4162 + case 0: //按钱
  4163 + if (newd.goods_price >= condition_t) {
  4164 + newd.prom_type = 3;
  4165 + newd.prom_id = prom_d[i].prom_id;
  4166 + }
  4167 + break
  4168 + case 1://按购买数量
  4169 + if (newd.goods_num >= condition_t) {
  4170 + newd.prom_type = 3;
  4171 + newd.prom_id = prom_d[i].prom_id;
  4172 + }
  4173 + break;
  4174 + }
  4175 + }
  4176 +
  4177 + }
  4178 +
  4179 + newd['pick_name'] = th.data.sto_sele_name;
  4180 + newd['pick_dis'] = th.data.sto_sele_distr;
  4181 + th.buyNow(newd);
  4182 + }
  4183 + },
  4184 +
  4185 +
  4186 + click_contact:function () {
  4187 + getApp().globalData.no_clear=1;
  4188 + },
  4189 +
  4190 + //打开客服操作菜单
  4191 + openCS() {
  4192 + // csType/在线客服设置:
  4193 + // 0关闭(如果有设置热线电话,则显示拨打热线电话)、
  4194 + // 1小程序客服、
  4195 + // 2企业微信客服
  4196 + let csType = this.data.sys_switch.weapp_customertype;
  4197 + if(csType == 0) {
  4198 + // 获取电话号码
  4199 + this.contactService();
  4200 + } else {
  4201 + this.getTel()
  4202 + .then(() => {
  4203 + self.setData({
  4204 + hiddenCS: false,
  4205 + });
  4206 + });
  4207 +
  4208 + };
3134 4209 },
3135 4210  
  4211 + //关闭客服操作菜单
  4212 + closeCS() {
  4213 + this.setData({
  4214 + hiddenCS: true,
  4215 + });
  4216 + },
3136 4217  
3137 4218  
3138 4219  
3139   -
3140 4220  
3141 4221  
3142 4222  
  4223 +
3143 4224  
3144 4225  
3145 4226  
  4227 +
3146 4228  
3147 4229  
3148 4230  
... ...
packageA/pages/goodsInfo/goodsInfo.wxml
... ... @@ -16,6 +16,7 @@
16 16 <view class="goods-detail">
17 17 <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}">
18 18  
  19 + <!-- 有视频和图片的情况 -->
19 20 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove" wx:if="{{mapurl}}">
20 21 <view class="xc-videos-picture rel">
21 22 <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">
... ... @@ -29,10 +30,11 @@
29 30 <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video>
30 31 </view>
31 32 </swiper-item>
32   - <swiper-item wx:for="{{gallery}}" wx:key="gallery">
33   - <view class="wh100 g_img_box" style="background-image:url({{iurl}}{{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}});"></view>
  33 + <swiper-item wx:for="{{gallery}}" wx:key="gallery" class="sty">
  34 + <view class="wh100 g_img_box" style="background-image:url({{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}});"></view>
34 35 </swiper-item>
35 36 </swiper>
  37 +
36 38 <block wx:if="{{mapurl}}">
37 39 <view wx:if="{{hiddenn==1}}">
38 40 <view class="xc-imageCount">{{current}}/{{gallery.length}}</view>
... ... @@ -48,17 +50,18 @@
48 50 </view>
49 51 </view>
50 52 </block>
  53 +
51 54 </view>
52 55 </view>
53 56  
54 57  
55   -
  58 + <!-- 只有图片的情况 -->
56 59 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove" wx:else>
57 60 <view class="xc-videos-picture rel">
58 61 <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}"
59 62 indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">
60   - <swiper-item>
61   - <image class="wh100" src="{{iurl}}{{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}}"
  63 + <swiper-item class="sty1">
  64 + <image class="wh100" src="{{iurl + (data.image_url?data.image_url:'miniapp/images/default_g_img.gif')}}"
62 65 binderror="bind_bnerr" mode="aspectFit" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image>
63 66 </swiper-item>
64 67 </swiper>
... ... @@ -71,15 +74,13 @@
71 74 <!-- 即将开始 -->
72 75 <image class="secondkill-img" src='{{iurl+"/miniapp/images/blue_ks.png"}}' wx:if="{{prom_st==0}}"></image>
73 76 <!-- 进行中 -->
74   - <image class="secondkill-img" src='{{iurl+"/miniapp/images/red_jx.png"}}' wx:elif="{{prom_st!=0}}"></image>
  77 + <image class="secondkill-img" src='{{iurl+"/miniapp/images/red_jx.png"}}' wx:elif="{{prom_st!=0 && prom_st!=null}}"></image>
75 78 <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image>
76 79 <view class="start fs26 abs" wx:if="{{prom_st==0}}">距活动开始还有</view>
77   - <view class="stop fs26 abs" wx:if="{{prom_st==1 || prom_st==3}}">距活动结束还有</view>
78   - <view class="secview flex abs fs24 xc-miaosha-time">
79   - <block wx:if="djs.day">
80   - <view class='day-val' style="color:{{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">{{djs.day}}</view>
81   - <view class="day white" style="color: {{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">天</view>
82   - </block>
  80 + <view class="stop fs26 abs" wx:elif="{{prom_st==1 || prom_st==3}}">距活动结束还有</view>
  81 + <view class="secview flex abs fs24 xc-miaosha-time" wx:if="{{prom_st!=null}}">
  82 + <view class='day-val' style="color:{{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">{{djs.day}}</view>
  83 + <view class="day white" style="color: {{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">天</view>
83 84 <view class='time-val white t-c' style=" background:{{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">{{djs.hou}}</view>
84 85 <view class="time" style="color: {{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">时</view>
85 86 <view class='time-val white t-c' style=" background:{{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">{{djs.min}}</view>
... ... @@ -90,8 +91,7 @@
90 91 </view>
91 92  
92 93  
93   - <!-- <block> -->
94   -
  94 + <block>
95 95 <view class="goods-price rel">
96 96 <view class="co-red" style="overflow: hidden">
97 97 <view class="market-price" style="overflow: hidden"></view>
... ... @@ -99,21 +99,51 @@
99 99  
100 100 <view>
101 101 <!-- 秒杀价 -->
102   - <!-- <view class="co-red" wx:if="{{options.prom_type == 1}}"><text class="rel yuan fs28">¥</text>{{filters.toFix(prom_price,2)}}</view> -->
  102 + <view class="co-red" wx:if="{{options.prom_type == 1}}"><text class="rel yuan fs28">¥</text>{{filters.toFix(prom_price,2)}}</view>
103 103 <!-- 手店价 -->
104   - <view class="co-red"><text class="rel yuan fs28">¥</text>{{filters.toFix(data.shop_price,2)}}</view>
  104 + <view class="co-red" wx:else><text class="rel yuan fs28">¥</text>{{filters.toFix(data.shop_price,2)}}</view>
  105 + <!-- <view class="word-line fs20 xc-qtunit-price">
  106 + 零售价¥{{filters.toFix(data.market_price,2)}}
  107 + </view> -->
105 108 <view class="goods-title">
106 109 <view class="goods-name elli">{{data.goods_name}}</view>
107 110 </view>
108 111 </view>
109 112  
110   - <view class="goods-num">
  113 +
  114 + <block wx:if="{{prom_type==1}}">
  115 + <view class="goods-num">
  116 + <block>
  117 + <view class="stock">总数量:{{prom_act.goods_num+prom_act.virtual}}件</view>
  118 +
  119 + <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view>
  120 + <view class="stock" wx:else>限购:不限</view>
  121 + <view class="sales">已售:{{prom_act.buy_num+prom_act.virtual}}件</view>
  122 +
  123 + <!-- <block wx:if="{{prom_st==0}}">
  124 + <view class="sales">已购:0件</view>
  125 + </block> -->
  126 +
  127 + <!-- <block wx:else>
  128 + <view class="sales">已购:{{prom_act.buy_num+prom_act.virtual}}件</view>
  129 + </block> -->
  130 + </block>
  131 + <!-- <block wx:else>
  132 + <view class="stock">总数量:{{prom_act.goods_num}}件</view>
  133 + <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view>
  134 + <view class="stock" wx:else>限购:不限</view>
  135 + <view class="sales">已购:{{prom_act.buy_num}}件</view>
  136 + </block> -->
  137 + </view>
  138 + </block>
  139 +
  140 + <view class="goods-num" wx:else>
111 141 <view class="sales">销量:{{data.sales_sum}}</view>
112 142 <view class="sales">有效天数:{{data.validDays?data.validDays:'不限'}}</view>
113 143 </view>
114 144  
115 145 </view>
116   - <!-- </block> -->
  146 + </block>
117 147  
118 148  
119 149  
... ... @@ -186,6 +216,8 @@
186 216 </view>
187 217 </view>
188 218  
  219 +
  220 +
189 221  
190 222 <!-- 保障服务 -->
191 223 <view class="bz_view flex bdt16 ai_c" wx:if="{{store_config.service_bz}}">
... ... @@ -506,7 +538,7 @@
506 538 <view class="join-cart jc_sb ai_c">
507 539  
508 540 <view class="flex">
509   - <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split pdh20" open-type="contact"
  541 + <!-- <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split pdh20" open-type="contact"
510 542 session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
511 543 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
512 544 <view>客服</view>
... ... @@ -521,6 +553,11 @@
521 553 <view wx:else class="custom-service cart-ico new_split pdh20" bindtap="contactService" style="text-align: center">
522 554 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
523 555 <view>客服</view>
  556 + </view> -->
  557 +
  558 + <view class="custom-service cart-ico new_split pdh20" bindtap="openCS">
  559 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  560 + <view>客服</view>
524 561 </view>
525 562  
526 563 <view bindtap="collectGoods" class="custom-service cart-ico new_split t-c pdh20">
... ... @@ -542,44 +579,45 @@
542 579 <view class="flex f1 btn-group">
543 580  
544 581 <!-- 从“秒杀”入口进入购买商品 -->
545   - <!-- <block wx:if="{{options.prom_type == 1}}"> -->
546   - <block wx:if="{{options.prom_type == 1}}">
547   - <block wx:if="{{prom_st==1 && !prom_r_null}}">
548   - <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn f1">加入购物车</view>
549   - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn f1">立即抢购</view>
550   - </block>
551   -
552   - <block wx:if="{{prom_st == 0 && !prom_r_null}}">
553   - <!-- 秒杀预热要单独购买 -->
554   - <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}">
555   - <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn f1">单独购买</view>
556   - <view class="buy-btn cart-btn lanse">即将开始</view>
557   - </block>
558   - <block wx:else>
559   - <view class="buy-btn cart-btn cart-btn-lg lanse set_width f1">即将开始</view>
560   - </block>
561   - </block>
562   -
  582 + <block wx:if="{{options.prom_type == 1}}">
  583 + <!-- 活动正在开始,商品还没抢光 -->
  584 + <block wx:if="{{prom_st==1 && !prom_r_null}}">
  585 + <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn f1">加入购物车</view>
  586 + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn f1">立即抢购</view>
  587 + </block>
563 588  
564   - <block wx:if="{{prom_r_null}}">
  589 + <!-- 活动还没开始,商品还没抢光 -->
  590 + <block wx:if="{{prom_st == 0 && !prom_r_null}}">
  591 + <!-- 秒杀预热要单独购买 -->
  592 + <!-- is_shop_buy支持以原价购买 -->
  593 + <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}">
  594 + <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn f1">单独购买</view>
  595 + <view class="buy-btn cart-btn lanse f1">即将开始</view>
  596 + </block>
  597 + <block wx:else>
  598 + <view class="buy-btn cart-btn cart-btn-lg lanse set_width f1">即将开始</view>
  599 + </block>
  600 + </block>
565 601  
566   - <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}">
567   - <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn f1">单独购买</view>
568   - <view class="buy-btn cart-btn huise f1">已抢光</view>
569   - </block>
570   - <view wx:else class="buy-btn cart-btn cart-btn-lg huise set_width f1">已抢光</view>
571   - </block>
572   -
573   - <block wx:if="{{prom_st==3 && !prom_r_null}}">
574   - <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}">
575   - <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn f1">单独购买</view>
576   - <view class="buy-btn cart-btn huise f1">活动已经结束</view>
577   - </block>
  602 + <!-- 商品已被抢光 -->
  603 + <block wx:if="{{prom_r_null}}">
  604 + <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}">
  605 + <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn f1">单独购买</view>
  606 + <view class="buy-btn cart-btn huise f1">已抢光</view>
  607 + </block>
  608 + <view wx:else class="buy-btn cart-btn cart-btn-lg huise set_width f1">已抢光</view>
  609 + </block>
578 610  
579   - <view wx:else class="buy-btn cart-btn cart-btn-lg huise set_width f1">活动已经结束</view>
580   - </block>
  611 + <!-- 活动已经结束,商品还没抢光 -->
  612 + <block wx:if="{{prom_st==3 && !prom_r_null}}">
  613 + <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}">
  614 + <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn f1">单独购买</view>
  615 + <view class="buy-btn cart-btn huise f1">活动已经结束</view>
  616 + </block>
  617 + <view wx:else class="buy-btn cart-btn cart-btn-lg huise set_width f1">活动已经结束</view>
581 618 </block>
582   - <!-- </block> -->
  619 +
  620 + </block>
583 621  
584 622  
585 623 <!-- 从“我的服务”入口进入购买商品 -->
... ... @@ -587,15 +625,9 @@
587 625 <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn f1">加入购物车</view>
588 626 <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn f1">立即购买</view>
589 627 </block>
590   -
591   -
592   -
  628 +
593 629 </view>
594 630  
595   -
596   -
597   -
598   -
599 631 </view>
600 632  
601 633 <!-- 制作一个圆球导航 -->
... ... @@ -607,28 +639,33 @@
607 639 <view bindtap="closeSpecModal" class="cover-layer"></view>
608 640 <view class="spec-model">
609 641 <view class="pding">
  642 +
610 643 <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon>
  644 +
  645 +
611 646 <view class="spec-goods">
612 647 <image class="wh100 spec-img" src="{{iurl}}{{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}}"
613 648 binderror="pop_err_img" data-errorimg="data.image_url" />
614 649 <view class="spec-goods-info">
615 650 <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view>
616 651 <view class="flex ai_end xc-val-money">
617   - <view class="spec-goods-price"><text class="fs20">¥</text>
618   - <block wx>{{data.shop_price}}</block>
  652 + <view class="spec-goods-price">
  653 + <text class="fs20">¥</text>
  654 + <block wx:if="{{options.prom_type == 1}}">{{prom_price}}</block>
  655 + <block wx:else>{{data.shop_price}}</block>
619 656 </view>
620 657 </view>
621 658 </view>
622 659 </view>
623 660  
  661 +
  662 +
624 663 <!-- 选择门店模块 -->
625 664 <view class="flex-space-between address ai_end xc-width" style="padding-top: 30rpx;">
626 665 <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
627 666 <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
628 667 <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}">
629   - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
630   -
631   - </view>
  668 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}</view>
632 669 </view>
633 670  
634 671 <!-- 没有门店的时候 -->
... ... @@ -639,6 +676,9 @@
639 676  
640 677 <view class="red-co fs28" bindtap="choice_store">更多门店<text class="right-arrow"></text></view>
641 678 </view>
  679 +
  680 +
  681 +
642 682 <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
643 683 <block wx:else>
644 684 <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
... ... @@ -693,10 +733,8 @@
693 733 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
694 734 </block>
695 735 <block wx:else>
696   - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32"
697   - data-action="add">加入购物车</view>
698   - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy"
699   - data-action="buy">
  736 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>
  737 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy">
700 738 {{sele_g.offline_price?"券后购买":"立即购买"}}
701 739 </view>
702 740 </block>
... ... @@ -716,6 +754,7 @@
716 754 {{sele_g.offline_price?"券后购买":"立即购买"}}
717 755 </view>
718 756 </block>
  757 +
719 758 <!-- 普通商品 -->
720 759 <block wx:else>
721 760 <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy {{!sto_sele_name?'gray':''}}"
... ... @@ -723,6 +762,7 @@
723 762 {{sele_g.offline_price?"券后购买":"立即购买"}}
724 763 </view>
725 764 </block>
  765 +
726 766 </block>
727 767 </block>
728 768 </block>
... ... @@ -902,3 +942,36 @@
902 942 </view>
903 943 </view>
904 944 </view>
  945 +
  946 +<!-- 弹起来,购买预热商品的普通购买 -->
  947 +<view hidden="{{!openSpecModal_flash_normal}}">
  948 + <include src="buy_flash_normal.wxml" />
  949 +</view>
  950 +
  951 +
  952 +<!-- 联系客服操作菜单 -->
  953 +<view class="action {{!hiddenCS ? 'active':''}}" hidden="{{hiddenCS}}">
  954 + <view class="pd20 t-c pr">
  955 + <text class="bold">联系客服</text>
  956 + <text class="iconfont icon-guan" bindtap="closeCS"></text>
  957 + </view>
  958 + <!-- 客服热线 -->
  959 + <view class="pd20 bdt fs30 btn2" bindtap="contactService">
  960 + <text class="iconfont icon-dianhua"></text>客服热线:
  961 + <text class="c-red">{{store_tel}}</text>
  962 + </view>
  963 + <!-- 小程序客服 -->
  964 + <block wx:if="{{sys_switch.weapp_customertype == 1}}">
  965 + <button class="pd20 bdt fs30 btn2" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
  966 + <text class="iconfont icon-kefu1"></text>在线客服
  967 + </button>
  968 + </block>
  969 + <!-- 微信客服 -->
  970 + <block wx:elif="{{sys_switch.weapp_customertype == 2}}">
  971 + <view class="pd20 bdt fs30 btn2" bindtap="con_weixin">
  972 + <text class="iconfont icon-kefu1"></text>在线客服
  973 + </view>
  974 + </block>
  975 +</view>
  976 +
  977 +<view class="mask2" bindtap="closeCS"></view>
... ...
packageA/pages/goodsInfo/goodsInfo.wxss
... ... @@ -562,7 +562,7 @@ view.cart-btn-lg {
562 562 .spec-model {
563 563 position: fixed;
564 564 bottom: 0;
565   - z-index: 20;
  565 + z-index: 19;
566 566 background: white;
567 567 width: 100%;
568 568 /* padding: 0 30rpx; */
... ... @@ -2968,3 +2968,5 @@ button.custom-service::after{
2968 2968 left: -1000px;
2969 2969 top: -1000px;
2970 2970 }
  2971 +
  2972 +
... ...
packageA/pages/goods_share/goods_share.js
... ... @@ -123,9 +123,9 @@ Page({
123 123  
124 124 /*** 生命周期函数--监听页面显示***/
125 125 onShow: function () {
  126 + getApp().check_can_share();
126 127 var th=this;
127   -
128   -
  128 +
129 129 if(app.globalData.userInfo) {
130 130 this.setData({
131 131 //用来判断是否是分销商,是分销商才显示分成佣金
... ... @@ -177,7 +177,8 @@ Page({
177 177 /**e
178 178 * 用户点击右上角分享
179 179 */
180   - onShareAppMessage: function () {
  180 + onShareAppMessage: function () {
  181 + getApp().globalData.no_clear=1;
181 182 var th = this;
182 183 var item=this.data.share_good;
183 184 var price = item.shop_price;
... ... @@ -732,10 +733,7 @@ Page({
732 733 })
733 734 return false;
734 735 }
735   - wx.previewImage({
736   - //将图片预览出来
737   - urls: [that.data.shareImgPath]
738   - });
  736 + getApp().pre_img(that.data.shareImgPath);
739 737 wx.hideLoading();
740 738 }
741 739 })
... ...
packageA/pages/hongBao/hongBao.js
... ... @@ -76,10 +76,9 @@ Page({
76 76 */
77 77 onShow: function () {
78 78 console.log('onshow');
  79 + getApp().check_can_share();
79 80  
80   -
81   -
82   -
  81 +
83 82 },
84 83  
85 84 /**
... ... @@ -113,7 +112,7 @@ Page({
113 112 /**
114 113 * 用户点击右上角分享
115 114 */
116   - onShareAppMessage: function () {
  115 + onShareAppMessage: function () { getApp().globalData.no_clear=1
117 116  
118 117 },
119 118  
... ...
packageA/pages/hongBaoDetails/hongBaoDetails.js
... ... @@ -64,7 +64,7 @@ Page({
64 64 * 生命周期函数--监听页面显示
65 65 */
66 66 onShow: function () {
67   -
  67 + getApp().check_can_share();
68 68 },
69 69  
70 70 /**
... ... @@ -98,7 +98,7 @@ Page({
98 98 /**
99 99 * 用户点击右上角分享
100 100 */
101   - onShareAppMessage: function () {
  101 + onShareAppMessage: function () { getApp().globalData.no_clear=1
102 102  
103 103 },
104 104  
... ...
packageA/pages/jfbuy/jfbuy.js
... ... @@ -169,7 +169,7 @@ Page({
169 169 /**
170 170 * 生命周期函数--监听页面显示
171 171 */
172   - onShow: function () {},
  172 + onShow: function () { getApp().check_can_share(); },
173 173 /**
174 174 * 生命周期函数--监听页面隐藏
175 175 */
... ... @@ -187,8 +187,8 @@ Page({
187 187 /**
188 188 * 用户点击右上角分享
189 189 */
190   - onShareAppMessage: function () {
191   -
  190 + onShareAppMessage: function () {
  191 + getApp().globalData.no_clear=1;
192 192 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:'';
193 193  
194 194 var pagePath = this.route; //当前页面url
... ... @@ -270,6 +270,7 @@ Page({
270 270  
271 271  
272 272 onShareTimeline() {
  273 + getApp().globalData.no_clear=1;
273 274 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:'';
274 275  
275 276 var pagePath = this.route; //当前页面url
... ...
packageA/pages/liveStream/liveStream.js
... ... @@ -208,9 +208,10 @@ Page({
208 208 * 生命周期函数--监听页面加载
209 209 */
210 210 onLoad: function (options) {
  211 + self=this;
211 212 getApp().is_Single_page(this,function(){
212 213 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
213   - this.setData({
  214 + self.setData({
214 215 userInfo: data,
215 216 });
216 217 });
... ... @@ -229,6 +230,8 @@ Page({
229 230 * 生命周期函数--监听页面显示
230 231 */
231 232 onShow: function () {
  233 +
  234 + getApp().check_can_share();
232 235 if(app.globalData.userInfo) {
233 236 if(!this.data.isLogin) {
234 237 this.setData({
... ... @@ -247,6 +250,9 @@ Page({
247 250 self.setData({
248 251 living: self.data.list,
249 252 });
  253 +
  254 +
  255 + console.log(self.data.living);
250 256  
251 257 //直播中列表请求完后,请求即将开始列表
252 258 self.getData(true, '/api/weshop/wx/livelist/page', {
... ... @@ -348,7 +354,7 @@ Page({
348 354 /**
349 355 * 用户点击右上角分享
350 356 */
351   - onShareAppMessage: function () {
  357 + onShareAppMessage: function () { getApp().globalData.no_clear=1;
352 358 if (res.from === 'button') {
353 359 // 来自页面内转发按钮
354 360 // console.log(res.target)
... ... @@ -360,6 +366,7 @@ Page({
360 366 },
361 367  
362 368 onShareTimeline: function (res) {
  369 + getApp().globalData.no_clear=1;
363 370 if (res.from === 'button') {
364 371 // 来自页面内转发按钮
365 372 // console.log(res.target)
... ...
packageA/pages/liveStream/liveStream.wxml
... ... @@ -29,7 +29,7 @@
29 29 <block wx:if="{{living.pageData.length > 0}}">
30 30 <view class="title">直播中</view>
31 31 <view class="list">
32   - <block wx:for="{{liveing.pageData}}" wx:key="item">
  32 + <block wx:for="{{living.pageData}}" wx:key="item">
33 33 <view class="list-item" catchtap="clickItem" data-id="{{item.id}}" data-live="ing">
34 34 <view class="list-item-left">
35 35 <image src="{{item.share_img}}" class="item-pic" mode="aspectFit"></image>
... ...
packageA/pages/liveStreamDetails/liveStreamDetails.js
... ... @@ -53,6 +53,11 @@ Page({
53 53  
54 54 // 分享操作表
55 55 clickShare: function () {
  56 +
  57 + if(!getApp().globalData.user_id){
  58 + getApp().goto("/pages/togoin/togoin");
  59 + return false;
  60 + }
56 61 this.setData({
57 62 showActionSheet: !this.data.showActionSheet
58 63 })
... ... @@ -570,7 +575,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un
570 575 * 生命周期函数--监听页面显示
571 576 */
572 577 onShow: function () {
573   -
  578 + getApp().check_can_share();
574 579 },
575 580  
576 581 /**
... ... @@ -605,6 +610,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un
605 610 * 用户点击右上角分享
606 611 */
607 612 onShareAppMessage: function (res) {
  613 + getApp().globalData.clear=1;
608 614 this.setData({
609 615 showActionSheet: 'false'
610 616 })
... ... @@ -625,6 +631,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un
625 631 },
626 632  
627 633 onShareTimeline: function (res) {
  634 + getApp().globalData.no_clear=1;
628 635 if (res.from === 'button') {
629 636 // 来自页面内转发按钮
630 637 console.log(res.target)
... ...
packageA/pages/live_share/live_share.js
... ... @@ -44,7 +44,7 @@ Page({
44 44 * 生命周期函数--监听页面显示
45 45 */
46 46 onShow: function () {
47   -
  47 + getApp().check_can_share();
48 48 },
49 49  
50 50 /**
... ... @@ -71,7 +71,7 @@ Page({
71 71 /**
72 72 * 用户点击右上角分享
73 73 */
74   - onShareAppMessage: function () {
  74 + onShareAppMessage: function () { getApp().globalData.no_clear=1;
75 75 var th=this;
76 76 var id=th.data.hui_active.id;
77 77 var url='/packageA/pages/liveStreamDetails/liveStreamDetails?id=' + id + '&live=ing';
... ...
packageA/pages/myGift/myGift.js
... ... @@ -67,6 +67,8 @@ Page({
67 67 * 生命周期函数--监听页面显示
68 68 */
69 69 onShow: function () {
  70 +
  71 + getApp().check_can_share();
70 72 if(app.globalData.userInfo) {
71 73 if(!this.data.isLogin) {
72 74 this.setData({
... ... @@ -147,7 +149,7 @@ Page({
147 149 /**
148 150 * 用户点击右上角分享
149 151 */
150   - onShareAppMessage: function () {
  152 + onShareAppMessage: function () { getApp().globalData.no_clear=1
151 153  
152 154 },
153 155  
... ...
packageA/pages/myGiftDetails/myGiftDetails.js
... ... @@ -57,6 +57,7 @@ Page({
57 57 * 生命周期函数--监听页面显示
58 58 */
59 59 onShow: function () {
  60 + getApp().check_can_share();
60 61 if(app.globalData.userInfo) {
61 62 if(!this.data.isLogin) {
62 63 this.setData({
... ... @@ -192,7 +193,7 @@ Page({
192 193 /**
193 194 * 用户点击右上角分享
194 195 */
195   - onShareAppMessage: function () {
  196 + onShareAppMessage: function () { getApp().globalData.no_clear=1
196 197  
197 198 },
198 199  
... ...
packageA/pages/my_service/beauty_deta.js
... ... @@ -394,6 +394,7 @@ Page({
394 394 previewImage: function(e) {
395 395 var th = this;
396 396 var current = e.currentTarget.dataset.src;
  397 + getApp().globalData.no_clear=1;
397 398 wx.previewImage({
398 399 current: current, // 当前显示图片的http链接
399 400 urls: [th.data.head_img] // 需要预览的图片http链接列表
... ...
packageA/pages/my_service2/beauty_deta.js
... ... @@ -394,6 +394,7 @@ Page({
394 394 previewImage: function(e) {
395 395 var th = this;
396 396 var current = e.currentTarget.dataset.src;
  397 + getApp().globalData.no_clear=1;
397 398 wx.previewImage({
398 399 current: current, // 当前显示图片的http链接
399 400 urls: [th.data.head_img] // 需要预览的图片http链接列表
... ...
packageA/pages/parseHtml/parseHtml.js
... ... @@ -286,7 +286,7 @@ Page({
286 286 * 生命周期函数--监听页面显示
287 287 */
288 288 onShow: function () {
289   -
  289 + getApp().check_can_share();
290 290 },
291 291  
292 292 /**
... ... @@ -320,7 +320,7 @@ Page({
320 320 /**
321 321 * 用户点击右上角分享
322 322 */
323   - onShareAppMessage: function () {
  323 + onShareAppMessage: function () { getApp().globalData.no_clear=1
324 324  
325 325 },
326 326  
... ...
packageA/pages/profile/profile.js
... ... @@ -688,6 +688,9 @@ Page({
688 688 },
689 689  
690 690 onShow: function() {
  691 +
  692 + getApp().check_can_share();
  693 +
691 694 var e = this;
692 695 if (this.data.is_zy) return false;
693 696 this.wait_for_store_config();
... ... @@ -875,6 +878,7 @@ Page({
875 878  
876 879 //--点击分享事件---
877 880 onShareAppMessage: function(t) {
  881 + getApp().globalData.no_clear=1
878 882 return o.share;
879 883 },
880 884  
... ...
packageA/pages/prom_list/prom_list.js
... ... @@ -162,6 +162,9 @@ Page({
162 162  
163 163 //---展示---
164 164 onShow: function() {
  165 +
  166 + getApp().check_can_share();
  167 +
165 168 var ee=this,th=ee,that=ee;
166 169 var gid = this.data.gid,i = getApp().request;
167 170 ee.data.g_buy_num = new Map();
... ... @@ -711,6 +714,7 @@ Page({
711 714  
712 715 //--点击分享事件---
713 716 onShareAppMessage: function(t) {
  717 + getApp().globalData.no_clear=1
714 718 var curPage=this;
715 719 var pagePath = curPage.route; //当前页面url
716 720 if (pagePath.indexOf('/') != 0) {
... ...
packageA/pages/quan/quan.js
... ... @@ -48,7 +48,7 @@ Page({
48 48 /**
49 49 * 生命周期函数--监听页面显示
50 50 */
51   - onShow: function () { },
  51 + onShow: function () { getApp().check_can_share(); },
52 52  
53 53 /**
54 54 * 生命周期函数--监听页面隐藏
... ... @@ -73,7 +73,7 @@ Page({
73 73 /**
74 74 * 用户点击右上角分享
75 75 */
76   - onShareAppMessage: function () {
  76 + onShareAppMessage: function () { getApp().globalData.no_clear=1;
77 77 var th=this;
78 78 var id=th.data.hui_active.id;
79 79 var url="/packageA/pages/quan_pro/quan_pro?id="+id;
... ...
packageA/pages/service_share/service_share.js
... ... @@ -97,6 +97,8 @@ Page({
97 97  
98 98 /*** 生命周期函数--监听页面显示***/
99 99 onShow: function () {
  100 + getApp().check_can_share();
  101 +
100 102 var th=this;
101 103 getApp().getConfig2(function(rs){
102 104 //计算等级价相关
... ... @@ -141,7 +143,7 @@ Page({
141 143 /**e
142 144 * 用户点击右上角分享
143 145 */
144   - onShareAppMessage: function () {
  146 + onShareAppMessage: function () { getApp().globalData.no_clear=1;
145 147 var th = this;
146 148 var item=this.data.share_good;
147 149 var price = item.money;
... ... @@ -709,10 +711,7 @@ Page({
709 711 })
710 712 return false;
711 713 }
712   - wx.previewImage({
713   - //将图片预览出来
714   - urls: [that.data.shareImgPath]
715   - });
  714 + getApp().pre_img(that.data.shareImgPath);
716 715 wx.hideLoading();
717 716 }
718 717 })
... ...
packageA/pages/text/text.js deleted
1   -// packageA//pages/text/text.js
2   -Page({
3   -
4   - /**
5   - * 页面的初始数据
6   - */
7   - data: {
8   -
9   - },
10   -
11   - /**
12   - * 生命周期函数--监听页面加载
13   - */
14   - onLoad: function (options) {
15   -
16   - },
17   -
18   - /**
19   - * 生命周期函数--监听页面初次渲染完成
20   - */
21   - onReady: function () {
22   -
23   - },
24   -
25   - /**
26   - * 生命周期函数--监听页面显示
27   - */
28   - onShow: function () {
29   -
30   - },
31   -
32   - /**
33   - * 生命周期函数--监听页面隐藏
34   - */
35   - onHide: function () {
36   -
37   - },
38   -
39   - /**
40   - * 生命周期函数--监听页面卸载
41   - */
42   - onUnload: function () {
43   -
44   - },
45   -
46   - /**
47   - * 页面相关事件处理函数--监听用户下拉动作
48   - */
49   - onPullDownRefresh: function () {
50   -
51   - },
52   -
53   - /**
54   - * 页面上拉触底事件的处理函数
55   - */
56   - onReachBottom: function () {
57   -
58   - },
59   -
60   - /**
61   - * 用户点击右上角分享
62   - */
63   - onShareAppMessage: function () {
64   -
65   - }
66   -})
67 0 \ No newline at end of file
packageA/pages/text/text.json deleted
1   -{
2   - "usingComponents": {}
3   -}
4 0 \ No newline at end of file
packageA/pages/text/text.wxml deleted
1   -<!--packageA//pages/text/text.wxml-->
2   -<text>packageA//pages/text/text.wxml</text>
packageA/pages/text/text.wxss deleted
1   -/* packageA//pages/text/text.wxss */
2 0 \ No newline at end of file
packageA/pages/user/my_service2/appment_main.js
... ... @@ -26,7 +26,7 @@ Page({
26 26 * 生命周期函数--监听页面显示
27 27 */
28 28 onShow: function () {
29   -
  29 + getApp().check_can_share();
30 30 },
31 31  
32 32 /**
... ... @@ -60,7 +60,7 @@ Page({
60 60 /**
61 61 * 用户点击右上角分享
62 62 */
63   - onShareAppMessage: function () {
  63 + onShareAppMessage: function () { getApp().globalData.no_clear=1
64 64  
65 65 }
66 66 })
67 67 \ No newline at end of file
... ...
packageB/pages/boxes-details/boxes-details.js
... ... @@ -51,6 +51,8 @@ Page({
51 51 * 生命周期函数--监听页面显示
52 52 */
53 53 onShow: function() {
  54 + getApp().check_can_share();
  55 +
54 56 // console.log('show~~~');
55 57 if (app.globalData.userInfo) {
56 58 if (!this.data.isLogin) {
... ... @@ -124,7 +126,7 @@ Page({
124 126 * 用户点击右上角分享
125 127 */
126 128 onShareAppMessage: function() {
127   -
  129 + getApp().globalData.no_clear=1
128 130 },
129 131  
130 132  
... ...
packageB/pages/boxes-list/boxes-list.js
... ... @@ -9,7 +9,9 @@ Page({
9 9 currentTabIndex: 0,
10 10  
11 11 isLogin: false,
12   - list: null,
  12 + list: {
  13 + pageData: [],
  14 + },
13 15 isLoading: false, // 检测是否已经发送请求,防止重复发送请求
14 16 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
15 17 pageNum: 1, // 当前页数
... ... @@ -103,6 +105,14 @@ Page({
103 105 },
104 106  
105 107 clickTab(e) {
  108 + // 判断会员状态
  109 + let user_info = getApp().globalData.userInfo;
  110 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) {
  111 + wx.navigateTo({
  112 + url: '/pages/togoin/togoin',
  113 + })
  114 + return false;
  115 + };
106 116 this.debounce(this.handleTab.bind(this, e), 200)();
107 117 },
108 118  
... ...
packageB/pages/luckactivity/index/index.js
... ... @@ -69,6 +69,8 @@ Page({
69 69 * 生命周期函数--监听页面显示
70 70 */
71 71 onShow: function () {
  72 + getApp().check_can_share();
  73 +
72 74 if(app.globalData.userInfo) {
73 75 if(!this.data.isLogin) {
74 76 this.setData({
... ... @@ -166,7 +168,7 @@ Page({
166 168 /**
167 169 * 用户点击右上角分享
168 170 */
169   - onShareAppMessage: function () {
  171 + onShareAppMessage: function () { getApp().globalData.no_clear=1
170 172  
171 173 },
172 174  
... ...
packageB/pages/user/Change_phone/Change_phone.js
... ... @@ -211,7 +211,7 @@ Page({
211 211 * 生命周期函数--监听页面显示
212 212 */
213 213 onShow: function() {
214   -
  214 + getApp().check_can_share();
215 215 },
216 216  
217 217 /**
... ... @@ -246,6 +246,6 @@ Page({
246 246 * 用户点击右上角分享
247 247 */
248 248 onShareAppMessage: function() {
249   -
  249 + getApp().globalData.no_clear=1
250 250 }
251 251 })
... ...
packageB/pages/user/add_comment/add_comment.js
... ... @@ -220,6 +220,7 @@ Page({
220 220  
221 221 var imgs = this.data.imgs;
222 222  
  223 + getApp().globalData.no_clear=1;
223 224 wx.chooseImage({
224 225 count: 1, // 默认9
225 226 sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
... ... @@ -259,6 +260,7 @@ Page({
259 260 var index = e.currentTarget.dataset.index;
260 261 //所有图片
261 262 var imgs = this.data.imgs;
  263 + getApp().globalData.no_clear=1;
262 264 wx.previewImage({
263 265 //当前显示图片
264 266 current: imgs[index],
... ...
packageB/pages/user/binding_info/binding_info.js
... ... @@ -26,7 +26,7 @@ Page({
26 26 * 生命周期函数--监听页面显示
27 27 */
28 28 onShow: function () {
29   -
  29 + getApp().check_can_share();
30 30 },
31 31  
32 32 /**
... ... @@ -60,7 +60,7 @@ Page({
60 60 /**
61 61 * 用户点击右上角分享
62 62 */
63   - onShareAppMessage: function () {
  63 + onShareAppMessage: function () { getApp().globalData.no_clear=1
64 64  
65 65 }
66 66 })
67 67 \ No newline at end of file
... ...
packageB/pages/user/buyDetails/buyDetails.js
... ... @@ -40,6 +40,7 @@ Page({
40 40 * 生命周期函数--监听页面显示
41 41 */
42 42 onShow: function () {
  43 + getApp().check_can_share();
43 44 if(app.globalData.userInfo) {
44 45 if(!this.data.isLogin) {
45 46 this.setData({
... ... @@ -106,7 +107,7 @@ Page({
106 107 /**
107 108 * 用户点击右上角分享
108 109 */
109   - onShareAppMessage: function () {
  110 + onShareAppMessage: function () { getApp().globalData.no_clear=1
110 111  
111 112 },
112 113  
... ...
packageB/pages/user/choice_guide/choice_guide.js
... ... @@ -19,6 +19,7 @@ Page({
19 19 onLoad: function(t) {},
20 20  
21 21 onShow: function() {
  22 + getApp().check_can_share();
22 23 this.data.ismore=0;this.data.isload=0;
23 24 this.setData({list:null});
24 25 this.get_list();
... ... @@ -26,6 +27,7 @@ Page({
26 27  
27 28 //--点击分享事件---
28 29 onShareAppMessage: function(t) {
  30 + getApp().globalData.no_clear=1
29 31 return o.share;
30 32 },
31 33 get_list: function() {
... ...
packageB/pages/user/comment/comment.js
... ... @@ -161,6 +161,7 @@ Page({
161 161 } else {
162 162 image = imgArr[index].weapp_img[sindex];
163 163 }
  164 + getApp().globalData.no_clear=1;
164 165 wx.previewImage({
165 166 current: image,
166 167 //当前图片地址
... ...
packageB/pages/user/view_comment/view_comment.js
... ... @@ -112,6 +112,7 @@ Page({
112 112 var iurl = th.data.iurl;
113 113 if (image != "") {
114 114 image = imgArr[0].weapp_img[index];
  115 + getApp().globalData.no_clear=1;
115 116 wx.previewImage({
116 117 current: image,
117 118 //当前图片地址
... ... @@ -119,6 +120,7 @@ Page({
119 120 })
120 121 } else {
121 122 image = imgArr[0].img[index];
  123 + getApp().globalData.no_clear=1;
122 124 wx.previewImage({
123 125 current: iurl + image,
124 126 //当前图片地址
... ...
packageB/pages/video/index.js
... ... @@ -7,6 +7,7 @@ Page({
7 7 },
8 8 bindButtonTap: function() {
9 9 var that = this
  10 + getApp().globalData.no_clear=1;
10 11 wx.chooseVideo({
11 12 sourceType: ['album', 'camera'],
12 13 maxDuration: 60,
... ... @@ -25,6 +26,8 @@ Page({
25 26 })
26 27 },
27 28 onShow:function(){
  29 + getApp().check_can_share();
  30 +
28 31 var goods_list = this.selectComponent("#goods_list"); //组件的id
29 32 goods_list.init();
30 33 setTimeout(function() {
... ... @@ -34,6 +37,7 @@ Page({
34 37  
35 38 //---------分享配置--------
36 39 onShareAppMessage: function (e) {
  40 + getApp().globalData.no_clear=1
37 41 return {
38 42 title: "直播视频回放",
39 43 }
... ...
packageB/pages/zuhegou/index/index.js
... ... @@ -160,6 +160,8 @@ Page({
160 160 * 生命周期函数--监听页面显示
161 161 */
162 162 onShow: function () {
  163 + getApp().check_can_share();
  164 +
163 165 getApp().is_Single_page(this, function () {
164 166 var th = this,
165 167 that = this,
... ... @@ -446,7 +448,7 @@ Page({
446 448 /**
447 449 * 用户点击右上角分享
448 450 */
449   - onShareAppMessage: function () {
  451 + onShareAppMessage: function () { getApp().globalData.no_clear=1;
450 452 var title = this.data.act.name;
451 453 var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id;
452 454 if (getApp().globalData.user_id) {
... ... @@ -465,6 +467,7 @@ Page({
465 467 * 用户分享朋友圈
466 468 */
467 469 onShareTimeline() {
  470 + getApp().globalData.no_clear=1;
468 471 var title = this.data.act.name;
469 472 var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id;
470 473 if (getApp().globalData.user_id) {
... ...
packageB/pages/zuhegou/list/list.js
... ... @@ -65,7 +65,10 @@ Page({
65 65 },
66 66  
67 67  
68   - onShow: function(t) {
  68 + onShow: function(t) {
  69 +
  70 + getApp().check_can_share();
  71 +
69 72 this.data.ismore=1;
70 73 this.data.is_timer=1;
71 74 this.data.currentPage=1;
... ... @@ -198,6 +201,7 @@ Page({
198 201  
199 202 //---------分享配置--------
200 203 onShareAppMessage: function (e) {
  204 + getApp().globalData.no_clear=1
201 205 var curPage=this;
202 206 var pagePath = curPage.route; //当前页面url
203 207 if (pagePath.indexOf('/') != 0) {
... ...
packageB/pages/zuhegou/preindex/index.js
... ... @@ -159,6 +159,8 @@ Page({
159 159 * 生命周期函数--监听页面显示
160 160 */
161 161 onShow: function () {
  162 + getApp().check_can_share();
  163 +
162 164 getApp().is_Single_page(this, function () {
163 165 var th = this,
164 166 that = this,
... ... @@ -447,7 +449,7 @@ Page({
447 449 /**
448 450 * 用户点击右上角分享
449 451 */
450   - onShareAppMessage: function () {
  452 + onShareAppMessage: function () { getApp().globalData.no_clear=1;
451 453 var title = this.data.act.name;
452 454 var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id;
453 455 if (getApp().globalData.user_id) {
... ... @@ -466,6 +468,7 @@ Page({
466 468 * 用户分享朋友圈
467 469 */
468 470 onShareTimeline() {
  471 + getApp().globalData.no_clear=1;
469 472 var title = this.data.act.name;
470 473 var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id;
471 474 if (getApp().globalData.user_id) {
... ...
packageC/pages/goods/distributionCategoryList/index.js
... ... @@ -231,6 +231,8 @@ Page({
231 231 })
232 232 },
233 233 onShow: function () {
  234 +
  235 + getApp().check_can_share();
234 236 if (t.globalData.userInfo) {
235 237 let currentData = {
236 238 store_id: t.globalData.setting.stoid,
... ... @@ -404,6 +406,7 @@ Page({
404 406 },
405 407 //---------分享配置--------
406 408 onShareAppMessage: function (e) {
  409 + getApp().globalData.no_clear=1
407 410  
408 411 var url = "pages/goods/categoryList/categoryList";
409 412 var userInfo = getApp().globalData.userInfo;
... ... @@ -639,9 +642,9 @@ Page({
639 642 //扫一扫
640 643 getScancode: function () {
641 644 // 允许从相机和相册扫码
  645 + getApp().globalData.no_clear=1;
642 646 wx.scanCode({
643 647 success: (res) => {
644   - console.log(res);
645 648 var key_word = res.result;
646 649 wx.navigateBack({
647 650 delta: 1
... ...
packageC/pages/goods/goodsList/goodsList.js
... ... @@ -119,6 +119,11 @@ Page({
119 119 }
120 120 });
121 121 },
  122 +
  123 + onShow:function () {
  124 + getApp().check_can_share();
  125 + },
  126 +
122 127 //设置优惠券的
123 128 set_prom_list: async function (arr) {
124 129 var th = this;
... ... @@ -240,6 +245,7 @@ Page({
240 245 },
241 246 //---------分享配置--------
242 247 onShareAppMessage: function (e) {
  248 + getApp().globalData.no_clear=1
243 249 var curPage = this;
244 250 var pagePath = curPage.route; //当前页面url
245 251 if (pagePath.indexOf('/') != 0) {
... ... @@ -312,4 +318,6 @@ Page({
312 318 },
313 319  
314 320  
  321 +
  322 +
315 323 });
316 324 \ No newline at end of file
... ...
packageC/pages/goods/search/search.js
... ... @@ -31,6 +31,10 @@ Page({
31 31 is_his: 0,
32 32 },
33 33  
  34 + onShow:function () {
  35 + getApp().check_can_share();
  36 + },
  37 +
34 38 onLoad: function (t) {
35 39 this.data.rq_data = t;
36 40  
... ... @@ -235,6 +239,7 @@ Page({
235 239  
236 240 //---------分享配置--------
237 241 onShareAppMessage: function (e) {
  242 + getApp().globalData.no_clear=1
238 243 var curPage = this;
239 244 var pagePath = curPage.route; //当前页面url
240 245 if (pagePath.indexOf('/') != 0) {
... ...
packageC/pages/group_list/group_list.js
... ... @@ -44,6 +44,7 @@ Page({
44 44 * 生命周期函数--监听页面显示
45 45 */
46 46 onShow: function () {
  47 + getApp().check_can_share();
47 48 if(app.globalData.userInfo) {
48 49 if(!this.data.isLogin) {
49 50 this.setData({
... ... @@ -147,7 +148,7 @@ Page({
147 148 /**
148 149 * 用户点击右上角分享
149 150 */
150   - onShareAppMessage: function () {
  151 + onShareAppMessage: function () { getApp().globalData.no_clear=1
151 152  
152 153 },
153 154  
... ...
packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js
... ... @@ -35,6 +35,7 @@ Page({
35 35 },
36 36  
37 37 onShow: function() {
  38 + getApp().check_can_share();
38 39 if(app.globalData.userInfo) {
39 40 if(!this.data.isLogin) {
40 41 this.setData({
... ... @@ -191,6 +192,7 @@ Page({
191 192 * 用户点击右上角分享
192 193 */
193 194 onShareAppMessage: function (e) {
  195 + getApp().globalData.no_clear=1
194 196 var pagePath = this.route; //当前页面url
195 197 if (pagePath.indexOf('/') != 0) {
196 198 pagePath = '/' + pagePath;
... ...
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js
... ... @@ -106,6 +106,7 @@ Page({
106 106 },
107 107  
108 108 onShow: function() {
  109 + getApp().check_can_share();
109 110 this.get_team_info();
110 111 },
111 112  
... ... @@ -972,6 +973,7 @@ Page({
972 973  
973 974 //------ 分享配置 --------
974 975 onShareAppMessage: function (e) {
  976 + getApp().globalData.no_clear=1
975 977 var pagePath = `packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=${this.data.param.goods_id}&prom_type=9&group_id=${this.data.param.group_id}`; //当前页面url
976 978 // console.log('pagePath=====xxxxxx>', pagePath);
977 979 var imgPath = this.data.iurl + this.data.luckyGoInfo.original_img;
... ... @@ -1008,6 +1010,10 @@ Page({
1008 1010 // },
1009 1011  
1010 1012 clickShare() {
  1013 + if(!getApp().globalData.user_id){
  1014 + getApp().goto("/pages/togoin/togoin");
  1015 + return false;
  1016 + }
1011 1017 this.setData({
1012 1018 share_hidden: true,
1013 1019 });
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... ... @@ -8,6 +8,7 @@ var t = require(&quot;../../../../utils/util.js&quot;),
8 8 oo = s.globalData,
9 9 o = s.globalData.setting,
10 10 os = o;
  11 +let self = null;
11 12  
12 13 //评价加载更多
13 14 var more = function (e) {
... ... @@ -281,11 +282,13 @@ Page({
281 282 surplus: 0,
282 283 canBuy: false,
283 284 btnHidden: false,
  285 +
  286 + hiddenCS: true,
284 287 },
285 288  
286 289 //------初始化加载----------
287 290 onLoad: function (t) {
288   -
  291 + self = this;
289 292 // console.log('onload');
290 293 if (t && t.group_id) {
291 294 this.data.group_id = t.group_id;
... ... @@ -753,6 +756,8 @@ Page({
753 756  
754 757 //---展示---
755 758 onShow: async function () {
  759 +
  760 + getApp().check_can_share();
756 761 // console.log('onshow');
757 762 var goods_list = null, th = this, that = this;
758 763 var show_prew_img = this.data.show_prew_img
... ... @@ -2248,24 +2253,37 @@ Page({
2248 2253  
2249 2254 //---------联系客服------------
2250 2255 contactService: function () {
2251   - s.getConfig(function (t) {
2252   - if (t.store_tel == undefined) {
2253   - getApp().request.get("/api/weshop/store/get/" + os.stoid, {
2254   - isShowLoading: 1,
2255   - data: {},
2256   - success: function (rs) {
2257   - getApp().globalData.config = rs.data.data;
2258   - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
2259   - getApp().my_warnning("商家未设置电话", 0, th);
2260   - return false;
2261   - }
2262   - s.confirmBox("请联系客服:" + rs.data.data.store_tel);
2263   - }
2264   - })
2265   - } else {
2266   - s.confirmBox("请联系客服:" + t.store_tel);
2267   - }
2268   - });
  2256 + getApp().com_call(this);
  2257 + },
  2258 + // 获取客服电话
  2259 + getTel() {
  2260 + return new Promise((resolve, reject) => {
  2261 + s.getConfig(function (t) {
  2262 + if (t.store_tel == undefined) {
  2263 + getApp().request.get("/api/weshop/store/get/" + os.stoid, {
  2264 + isShowLoading: 1,
  2265 + data: {},
  2266 + success: function (rs) {
  2267 + getApp().globalData.config = rs.data.data;
  2268 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  2269 + getApp().my_warnning("商家未设置电话", 0, th);
  2270 + return false;
  2271 + }
  2272 + self.setData({
  2273 + store_tel: rs.data.data.store_tel,
  2274 + });
  2275 + // s.confirmBox("请联系客服:" + rs.data.data.store_tel);
  2276 + }
  2277 + })
  2278 + } else {
  2279 + self.setData({
  2280 + store_tel: t.store_tel,
  2281 + });
  2282 + // s.confirmBox("请联系客服:" + t.store_tel);
  2283 + };
  2284 + resolve();
  2285 + });
  2286 + });
2269 2287 },
2270 2288 //-------获取购物车数量----------
2271 2289 requestCardNum: function () {
... ... @@ -2306,11 +2324,7 @@ Page({
2306 2324 b[i] = this.data.iurl + e[i];
2307 2325 }
2308 2326 this.data.show_prew_img = 1;
2309   -
2310   - wx.previewImage({
2311   - current: b[t.currentTarget.dataset.id],
2312   - urls: b
2313   - });
  2327 + getApp().pre_img2(b,t);
2314 2328 },
2315 2329  
2316 2330 previewCommentImgs_w: function (t) {
... ... @@ -2320,21 +2334,16 @@ Page({
2320 2334 b[i] = this.data.iurl + e[i];
2321 2335 }
2322 2336 this.data.show_prew_img = 1;
2323   - wx.previewImage({
2324   - current: b[t.currentTarget.dataset.id],
2325   - urls: b
2326   - });
  2337 + getApp().pre_img2(b,t);
2327 2338 },
2328 2339  
2329 2340 previewGoodsCommentImgs: function (t) {
2330 2341 var e = this,
2331 2342 a = this.data.data.comment[t.currentTarget.dataset.cidx].img;
  2343 + getApp().globalData.no_clear=1;
2332 2344 a = a.map(function (t) {
2333 2345 return e.data.url + t;
2334   - }), wx.previewImage({
2335   - current: a[t.currentTarget.dataset.id],
2336   - urls: a
2337   - });
  2346 + }), getApp().pre_img2(a,t);
2338 2347 this.data.show_prew_img = 1;
2339 2348 },
2340 2349 closePromModal: function () {
... ... @@ -2349,7 +2358,7 @@ Page({
2349 2358 },
2350 2359  
2351 2360 //--点击分享事件---
2352   - onShareAppMessage: function (t) {
  2361 + onShareAppMessage: function (t) { getApp().globalData.no_clear=1;
2353 2362  
2354 2363 // var th = this;
2355 2364 // var price = th.data.sele_g.shop_price;
... ... @@ -6095,11 +6104,8 @@ Page({
6095 6104 },
6096 6105  
6097 6106 previewImage() {
6098   - this.data.show_prew_img = 1;
6099   - wx.previewImage({
6100   - //将图片预览出来
6101   - urls: [this.data.sele_g.original_img]
6102   - });
  6107 + this.data.show_prew_img = 1;
  6108 + getApp().pre_img(this.data.sele_g.original_img);
6103 6109 },
6104 6110  
6105 6111 is_show_more_buy: function () {
... ... @@ -6175,6 +6181,7 @@ Page({
6175 6181 },
6176 6182  
6177 6183 onShareTimeline() {
  6184 + getApp().globalData.no_clear=1;
6178 6185 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
6179 6186 if (!store_name)
6180 6187 store_name = getApp().globalData.setting.appName;
... ... @@ -6192,6 +6199,10 @@ Page({
6192 6199 },
6193 6200  
6194 6201 clickShare() {
  6202 + if(!getApp().globalData.user_id){
  6203 + getApp().goto("/pages/togoin/togoin");
  6204 + return false;
  6205 + }
6195 6206 this.setData({
6196 6207 share_hidden: true,
6197 6208 });
... ... @@ -6327,13 +6338,7 @@ Page({
6327 6338 },
6328 6339  
6329 6340 con_weixin: function () {
6330   - var url = this.data.sys_switch.weapp_customertype_url;
6331   - var id = this.data.sys_switch.weapp_customertype_appid;
6332   - wx.openCustomerServiceChat({
6333   - extInfo: { url: url },
6334   - corpId: id,
6335   - success(res) { }
6336   - })
  6341 + getApp().con_wx(this);
6337 6342 },
6338 6343  
6339 6344  
... ... @@ -6486,6 +6491,7 @@ Page({
6486 6491  
6487 6492 // 预览海报
6488 6493 previewPoster() {
  6494 + getApp().globalData.no_clear=1;
6489 6495 wx.previewImage({
6490 6496 current: this.data.shareImgPath, // 当前显示图片的http链接
6491 6497 urls: [this.data.shareImgPath],// 需要预览的图片http链接列表
... ... @@ -6493,4 +6499,47 @@ Page({
6493 6499 },
6494 6500  
6495 6501  
  6502 + click_contact:function () {
  6503 + getApp().globalData.no_clear=1;
  6504 + },
  6505 +
  6506 + //打开客服操作菜单
  6507 + openCS() {
  6508 + // 判断会员状态
  6509 + let user_info = getApp().globalData.userInfo;
  6510 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) {
  6511 + wx.navigateTo({
  6512 + url: '/pages/togoin/togoin',
  6513 + })
  6514 + return false;
  6515 + };
  6516 + // csType/在线客服设置:
  6517 + // 0关闭(如果有设置热线电话,则显示拨打热线电话)、
  6518 + // 1小程序客服、
  6519 + // 2企业微信客服
  6520 + if(this.data.sys_switch) {
  6521 + let csType = this.data.sys_switch.weapp_customertype;
  6522 + if(csType == 0) {
  6523 + // 拨打电话号码
  6524 + this.contactService();
  6525 + } else {
  6526 + this.getTel()
  6527 + .then(() => {
  6528 + self.setData({
  6529 + hiddenCS: false,
  6530 + });
  6531 + });
  6532 + };
  6533 + };
  6534 +
  6535 + },
  6536 +
  6537 + //关闭客服操作菜单
  6538 + closeCS() {
  6539 + this.setData({
  6540 + hiddenCS: true,
  6541 + });
  6542 + },
  6543 +
  6544 +
6496 6545 });
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
... ... @@ -871,7 +871,7 @@
871 871 <!-- -----------------底部按钮------------------ -->
872 872 <view class="join-cart">
873 873 <!-- bindtap="contactService" -->
874   - <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
  874 + <!-- <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
875 875 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
876 876 <view>客服</view>
877 877 </button>
... ... @@ -884,7 +884,12 @@
884 884 <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">
885 885 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
886 886 <view>客服</view>
887   - </view>
  887 + </view> -->
  888 +
  889 + <view class="custom-service cart-ico new_split" bindtap="openCS">
  890 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  891 + <view>客服</view>
  892 + </view>
888 893  
889 894 <view bindtap="collectGoods" class="custom-service cart-ico new_split">
890 895 <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image>
... ... @@ -1647,4 +1652,7 @@
1647 1652  
1648 1653 <!-- 制作一个圆球导航 -->
1649 1654 <nav_box></nav_box>
  1655 +
  1656 +<include src="../../../../components/com_servicer/com_servicer.wxml"></include>
  1657 +
1650 1658  
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxss
... ... @@ -3115,4 +3115,5 @@ button.custom-service::after{
3115 3115 .popup-content {
3116 3116 max-height: 600rpx;
3117 3117 overflow-y: auto;
3118   - }
3119 3118 \ No newline at end of file
  3119 + }
  3120 +
... ...
packageC/pages/luckyGo/luckyGo_members/luckyGo_members.js
... ... @@ -34,6 +34,7 @@ Page({
34 34 * 生命周期函数--监听页面显示
35 35 */
36 36 onShow: function () {
  37 + getApp().check_can_share();
37 38 if(app.globalData.userInfo) {
38 39 if(!this.data.isLogin) {
39 40 this.setData({
... ... @@ -92,7 +93,7 @@ Page({
92 93 /**
93 94 * 用户点击右上角分享
94 95 */
95   - onShareAppMessage: function () {
  96 + onShareAppMessage: function () { getApp().globalData.no_clear=1
96 97  
97 98 },
98 99  
... ...
packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js
... ... @@ -237,24 +237,7 @@ Page({
237 237 },
238 238 /*-----联系客户------*/
239 239 contactService: function() {
240   - e.getConfig(function(t) {
241   - if (t.store_tel == undefined) {
242   - getApp().request.get("/api/weshop/store/get/" + os.stoid, {
243   - isShowLoading: 1,
244   - data: {},
245   - success: function (rs) {
246   - getApp().globalData.config = rs.data.data;
247   - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
248   - getApp().showWarning("商家未设置电话");
249   - return false;
250   - }
251   - e.confirmBox("请联系客服:" + rs.data.data.store_tel);
252   - }
253   - })
254   - } else {
255   - e.confirmBox("请联系客服:" + t.store_tel);
256   - }
257   - });
  240 + getApp().con_Service();
258 241 },
259 242  
260 243 //--------取消订单---------
... ... @@ -1074,13 +1057,7 @@ Page({
1074 1057 },
1075 1058  
1076 1059 con_weixin:function () {
1077   - var url=this.data.sys_switch.weapp_customertype_url;
1078   - var id=this.data.sys_switch.weapp_customertype_appid;
1079   - wx.openCustomerServiceChat({
1080   - extInfo: {url: url},
1081   - corpId: id,
1082   - success(res) {}
1083   - })
  1060 + getApp().con_wx(this);
1084 1061 },
1085 1062  
1086 1063 //跳转到商品
... ... @@ -1115,6 +1092,11 @@ Page({
1115 1092 // }
1116 1093 // })
1117 1094 },
  1095 +
  1096 +
  1097 + click_contact:function () {
  1098 + getApp().globalData.no_clear=1;
  1099 + }
1118 1100  
1119 1101  
1120 1102  
... ...
packageC/pages/luckyGo/luckyGo_order/luckyGo_order.wxml
... ... @@ -61,7 +61,7 @@
61 61 <view bindtap="checkTeam" class="contact-us check-btn" wx:if="{{optionIsGoup}}">查看拼团详情</view>
62 62 <view>
63 63  
64   - <button wx:if="{{sys_switch.weapp_customertype==1}}" class="contact-us goods-btn" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">联系客服</button>
  64 + <button wx:if="{{sys_switch.weapp_customertype==1}}" class="contact-us goods-btn" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">联系客服</button>
65 65  
66 66 <view wx:elif="{{sys_switch.weapp_customertype==2}}" bindtap="con_weixin" class="contact-us goods-btn">联系客服</view>
67 67 <view wx:else bindtap="contactService" class="contact-us goods-btn">联系客服</view>
... ...
packageC/pages/luckyGo/luckyGo_winners/luckyGo_winners.js
... ... @@ -38,6 +38,7 @@ Page({
38 38 * 生命周期函数--监听页面显示
39 39 */
40 40 onShow: function () {
  41 + getApp().check_can_share();
41 42 if(app.globalData.userInfo) {
42 43 if(!this.data.isLogin) {
43 44 this.setData({
... ... @@ -114,7 +115,7 @@ Page({
114 115 /**
115 116 * 用户点击右上角分享
116 117 */
117   - onShareAppMessage: function () {
  118 + onShareAppMessage: function () { getApp().globalData.no_clear=1
118 119  
119 120 },
120 121  
... ...
packageC/pages/presell/cart/cart.js
... ... @@ -2601,35 +2601,12 @@ Page({
2601 2601  
2602 2602 //---------联系客服------------
2603 2603 contactService: function () {
2604   - getApp().getConfig(function (t) {
2605   - if (t.store_tel == undefined) {
2606   - getApp().request.get("/api/weshop/store/get/" + os.stoid, {
2607   - isShowLoading: 1,
2608   - data: {},
2609   - success: function (rs) {
2610   - getApp().globalData.config = rs.data.data;
2611   - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
2612   - getApp().my_warnning("商家未设置电话", 0, th);
2613   - return false;
2614   - }
2615   - wx.makePhoneCall({ phoneNumber: rs.data.data.store_tel, })
2616   - }
2617   - })
2618   - } else {
2619   - wx.makePhoneCall({ phoneNumber: t.store_tel, })
2620   - }
2621   - });
  2604 + getApp().con_Service();
2622 2605 },
2623 2606  
2624 2607 //---------联系微信客服------------
2625 2608 con_weixin: function () {
2626   - var url = this.data.sys_switch.weapp_customertype_url;
2627   - var id = this.data.sys_switch.weapp_customertype_appid;
2628   - wx.openCustomerServiceChat({
2629   - extInfo: { url: url },
2630   - corpId: id,
2631   - success(res) { }
2632   - })
  2609 + getApp().con_wx(this);
2633 2610 }
2634 2611  
2635 2612  
... ...
packageC/pages/presell/goodsInfo/goodsInfo.js
... ... @@ -17,6 +17,8 @@ var more = function (e) {
17 17 var utils = require('../../../../utils/util.js');
18 18 var regeneratorRuntime = require('../../../../utils/runtime.js');
19 19  
  20 +let self = null;
  21 +
20 22 Page({
21 23 data: {
22 24 start_stop: 2, //秒杀开始 结束 的控制(1正在进行,2即将开始)
... ... @@ -248,10 +250,13 @@ Page({
248 250  
249 251 share_hidden: false,
250 252 pre_arr: null,
  253 +
  254 + hiddenCS: true,
251 255 },
252 256  
253 257 //------初始化加载----------
254 258 onLoad: function (t) {
  259 + self = this;
255 260 var ee = this, that = ee, th = ee,
256 261 pre_id = t.pre_id,
257 262 gid = t.goods_id,
... ... @@ -588,6 +593,7 @@ Page({
588 593  
589 594 //---展示---
590 595 onShow: function () {
  596 + getApp().check_can_share();
591 597 var goods_list = null, th = this, that = this;
592 598  
593 599 //-- 如果是预览图片,页面不重新更新 --
... ... @@ -1430,25 +1436,40 @@ Page({
1430 1436  
1431 1437 //---------联系客服------------
1432 1438 contactService: function () {
1433   - s.getConfig(function (t) {
1434   - if (t.store_tel == undefined) {
1435   - getApp().request.get("/api/weshop/store/get/" + os.stoid, {
1436   - isShowLoading: 1,
1437   - data: {},
1438   - success: function (rs) {
1439   - getApp().globalData.config = rs.data.data;
1440   - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
1441   - getApp().my_warnning("商家未设置电话", 0, th);
1442   - return false;
1443   - }
1444   - s.confirmBox("请联系客服:" + rs.data.data.store_tel);
1445   - }
1446   - })
1447   - } else {
1448   - s.confirmBox("请联系客服:" + t.store_tel);
1449   - }
1450   - });
  1439 + getApp().com_call(this);
1451 1440 },
  1441 +
  1442 + // 获取客服电话
  1443 + getTel() {
  1444 + return new Promise((resolve, reject) => {
  1445 + s.getConfig(function (t) {
  1446 + if (t.store_tel == undefined) {
  1447 + getApp().request.get("/api/weshop/store/get/" + os.stoid, {
  1448 + isShowLoading: 1,
  1449 + data: {},
  1450 + success: function (rs) {
  1451 + getApp().globalData.config = rs.data.data;
  1452 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  1453 + getApp().my_warnning("商家未设置电话", 0, th);
  1454 + return false;
  1455 + }
  1456 + self.setData({
  1457 + store_tel: rs.data.data.store_tel,
  1458 + });
  1459 + // s.confirmBox("请联系客服:" + rs.data.data.store_tel);
  1460 + }
  1461 + })
  1462 + } else {
  1463 + self.setData({
  1464 + store_tel: t.store_tel,
  1465 + });
  1466 + // s.confirmBox("请联系客服:" + t.store_tel);
  1467 + };
  1468 + resolve();
  1469 + });
  1470 + });
  1471 + },
  1472 +
1452 1473 //-------获取购物车数量----------
1453 1474 requestCardNum: function () {
1454 1475 var t = this;
... ... @@ -1488,11 +1509,8 @@ Page({
1488 1509 b[i] = this.data.iurl + e[i];
1489 1510 }
1490 1511 this.data.show_prew_img = 1;
  1512 + getApp().pre_img2(b,t)
1491 1513  
1492   - wx.previewImage({
1493   - current: b[t.currentTarget.dataset.id],
1494   - urls: b
1495   - });
1496 1514 },
1497 1515  
1498 1516 previewCommentImgs_w: function (t) {
... ... @@ -1502,21 +1520,16 @@ Page({
1502 1520 b[i] = this.data.iurl + e[i];
1503 1521 }
1504 1522 this.data.show_prew_img = 1;
1505   - wx.previewImage({
1506   - current: b[t.currentTarget.dataset.id],
1507   - urls: b
1508   - });
  1523 + getApp().pre_img2(b,t)
1509 1524 },
1510 1525  
1511 1526 previewGoodsCommentImgs: function (t) {
1512 1527 var e = this,
1513 1528 a = this.data.data.comment[t.currentTarget.dataset.cidx].img;
  1529 + getApp().globalData.no_clear=1;
1514 1530 a = a.map(function (t) {
1515 1531 return e.data.url + t;
1516   - }), wx.previewImage({
1517   - current: a[t.currentTarget.dataset.id],
1518   - urls: a
1519   - });
  1532 + }), getApp().pre_img2(a,t);
1520 1533 this.data.show_prew_img = 1;
1521 1534 },
1522 1535 closePromModal: function () {
... ... @@ -1531,7 +1544,7 @@ Page({
1531 1544 },
1532 1545  
1533 1546 //--点击分享事件---
1534   - onShareAppMessage: function (t) {
  1547 + onShareAppMessage: function (t) { getApp().globalData.no_clear=1;
1535 1548  
1536 1549 var th = this;
1537 1550 var price = th.data.pre_arr.presell_price;
... ... @@ -3813,14 +3826,12 @@ Page({
3813 3826  
3814 3827 previewImage() {
3815 3828 this.data.show_prew_img = 1;
3816   - wx.previewImage({
3817   - //将图片预览出来
3818   - urls: [this.data.shareImgPath]
3819   - });
  3829 + getApp().pre_img(this.data.shareImgPath);
3820 3830 },
3821 3831  
3822 3832  
3823 3833 onShareTimeline() {
  3834 + getApp().globalData.no_clear=1;
3824 3835 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
3825 3836 if (!store_name)
3826 3837 store_name = getApp().globalData.setting.appName;
... ... @@ -3835,6 +3846,10 @@ Page({
3835 3846 },
3836 3847  
3837 3848 clickShare() {
  3849 + if(!getApp().globalData.user_id){
  3850 + getApp().goto("/pages/togoin/togoin");
  3851 + return false;
  3852 + }
3838 3853 this.setData({ share_hidden: true, });
3839 3854 },
3840 3855  
... ... @@ -4012,21 +4027,59 @@ Page({
4012 4027 },
4013 4028  
4014 4029 con_weixin:function () {
4015   - var url=this.data.sys_switch.weapp_customertype_url;
4016   - var id=this.data.sys_switch.weapp_customertype_appid;
4017   - wx.openCustomerServiceChat({
4018   - extInfo: {url: url},
4019   - corpId: id,
4020   - success(res) {}
4021   - })
  4030 + getApp().con_wx(this);
4022 4031 },
4023 4032  
4024 4033 // 预览海报
4025 4034 previewPoster() {
  4035 + getApp().globalData.no_clear=1;
4026 4036 wx.previewImage({
4027 4037 current: this.data.shareImgPath, // 当前显示图片的http链接
4028 4038 urls: [this.data.shareImgPath] ,// 需要预览的图片http链接列表
4029 4039 });
4030 4040 },
4031 4041  
  4042 +
  4043 + click_contact:function () {
  4044 + getApp().globalData.no_clear=1;
  4045 + },
  4046 +
  4047 + //打开客服操作菜单
  4048 + openCS() {
  4049 + // 判断会员状态
  4050 + let user_info = getApp().globalData.userInfo;
  4051 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) {
  4052 + wx.navigateTo({
  4053 + url: '/pages/togoin/togoin',
  4054 + })
  4055 + return false;
  4056 + };
  4057 + // csType/在线客服设置:
  4058 + // 0关闭(如果有设置热线电话,则显示拨打热线电话)、
  4059 + // 1小程序客服、
  4060 + // 2企业微信客服
  4061 + if(this.data.sys_switch) {
  4062 + let csType = this.data.sys_switch.weapp_customertype;
  4063 + if(csType == 0) {
  4064 + // 拨打电话号码
  4065 + this.contactService();
  4066 + } else {
  4067 + this.getTel()
  4068 + .then(() => {
  4069 + self.setData({
  4070 + hiddenCS: false,
  4071 + });
  4072 + });
  4073 + };
  4074 + };
  4075 +
  4076 + },
  4077 +
  4078 + //关闭客服操作菜单
  4079 + closeCS() {
  4080 + this.setData({
  4081 + hiddenCS: true,
  4082 + });
  4083 + },
  4084 +
4032 4085 });
... ...
packageC/pages/presell/goodsInfo/goodsInfo.wxml
... ... @@ -495,7 +495,7 @@
495 495 <!-- -----------------底部按钮------------------ -->
496 496 <view class="join-cart">
497 497 <!-- bindtap="contactService" -->
498   - <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
  498 + <!-- <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
499 499 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
500 500 <view>客服</view>
501 501 </button>
... ... @@ -508,7 +508,13 @@
508 508 <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">
509 509 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
510 510 <view>客服</view>
511   - </view>
  511 + </view> -->
  512 +
  513 + <view class="custom-service cart-ico new_split" bindtap="openCS">
  514 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  515 + <view>客服</view>
  516 + </view>
  517 +
512 518 <view bindtap="collectGoods" class="custom-service cart-ico new_split">
513 519 <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image>
514 520 <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image>
... ... @@ -949,3 +955,6 @@
949 955 </view>
950 956 </view>
951 957  
  958 +<include src="../../../../components/com_servicer/com_servicer.wxml"/>
  959 +
  960 +
... ...
packageC/pages/presell/pregoodsInfo/goodsInfo.js
... ... @@ -590,6 +590,8 @@ Page({
590 590  
591 591 //---展示---
592 592 onShow: function () {
  593 +
  594 + getApp().check_can_share();
593 595 var goods_list = null, th = this, that = this;
594 596  
595 597 //-- 如果是预览图片,页面不重新更新 --
... ... @@ -1431,24 +1433,7 @@ Page({
1431 1433  
1432 1434 //---------联系客服------------
1433 1435 contactService: function () {
1434   - s.getConfig(function (t) {
1435   - if (t.store_tel == undefined) {
1436   - getApp().request.get("/api/weshop/store/get/" + os.stoid, {
1437   - isShowLoading: 1,
1438   - data: {},
1439   - success: function (rs) {
1440   - getApp().globalData.config = rs.data.data;
1441   - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
1442   - getApp().my_warnning("商家未设置电话", 0, th);
1443   - return false;
1444   - }
1445   - s.confirmBox("请联系客服:" + rs.data.data.store_tel);
1446   - }
1447   - })
1448   - } else {
1449   - s.confirmBox("请联系客服:" + t.store_tel);
1450   - }
1451   - });
  1436 + getApp().con_Service();
1452 1437 },
1453 1438 //-------获取购物车数量----------
1454 1439 requestCardNum: function () {
... ... @@ -1489,11 +1474,7 @@ Page({
1489 1474 b[i] = this.data.iurl + e[i];
1490 1475 }
1491 1476 this.data.show_prew_img = 1;
1492   -
1493   - wx.previewImage({
1494   - current: b[t.currentTarget.dataset.id],
1495   - urls: b
1496   - });
  1477 + getApp().pre_img2(b,t)
1497 1478 },
1498 1479  
1499 1480 previewCommentImgs_w: function (t) {
... ... @@ -1503,21 +1484,16 @@ Page({
1503 1484 b[i] = this.data.iurl + e[i];
1504 1485 }
1505 1486 this.data.show_prew_img = 1;
1506   - wx.previewImage({
1507   - current: b[t.currentTarget.dataset.id],
1508   - urls: b
1509   - });
  1487 + getApp().pre_img2(b,t)
1510 1488 },
1511 1489  
1512 1490 previewGoodsCommentImgs: function (t) {
1513 1491 var e = this,
1514 1492 a = this.data.data.comment[t.currentTarget.dataset.cidx].img;
  1493 + getApp().globalData.no_clear=1;
1515 1494 a = a.map(function (t) {
1516 1495 return e.data.url + t;
1517   - }), wx.previewImage({
1518   - current: a[t.currentTarget.dataset.id],
1519   - urls: a
1520   - });
  1496 + }), getApp().pre_img2(a,t);
1521 1497 this.data.show_prew_img = 1;
1522 1498 },
1523 1499 closePromModal: function () {
... ... @@ -1532,7 +1508,7 @@ Page({
1532 1508 },
1533 1509  
1534 1510 //--点击分享事件---
1535   - onShareAppMessage: function (t) {
  1511 + onShareAppMessage: function (t) { getApp().globalData.no_clear=1;
1536 1512  
1537 1513 var th = this;
1538 1514 var price = th.data.pre_arr.presell_price;
... ... @@ -3814,14 +3790,12 @@ Page({
3814 3790  
3815 3791 previewImage() {
3816 3792 this.data.show_prew_img = 1;
3817   - wx.previewImage({
3818   - //将图片预览出来
3819   - urls: [this.data.shareImgPath]
3820   - });
  3793 + getApp().pre_img(this.data.shareImgPath);
3821 3794 },
3822 3795  
3823 3796  
3824 3797 onShareTimeline() {
  3798 + getApp().globalData.no_clear=1;
3825 3799 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
3826 3800 if (!store_name)
3827 3801 store_name = getApp().globalData.setting.appName;
... ... @@ -3836,7 +3810,11 @@ Page({
3836 3810 },
3837 3811  
3838 3812 clickShare() {
3839   - this.setData({ share_hidden: true, });
  3813 + if(!getApp().globalData.user_id){
  3814 + getApp().goto("/pages/togoin/togoin");
  3815 + return false;
  3816 + }
  3817 + this.setData({ share_hidden: true, });
3840 3818 },
3841 3819  
3842 3820 send() {
... ... @@ -4014,13 +3992,12 @@ Page({
4014 3992 },
4015 3993  
4016 3994 con_weixin:function () {
4017   - var url=this.data.sys_switch.weapp_customertype_url;
4018   - var id=this.data.sys_switch.weapp_customertype_appid;
4019   - wx.openCustomerServiceChat({
4020   - extInfo: {url: url},
4021   - corpId: id,
4022   - success(res) {}
4023   - })
  3995 + getApp().con_wx(this);
  3996 + },
  3997 +
  3998 +
  3999 + click_contact:function () {
  4000 + getApp().globalData.no_clear=1;
4024 4001 }
4025 4002  
4026 4003 });
... ...
packageC/pages/presell/pregoodsInfo/goodsInfo.wxml
... ... @@ -495,7 +495,7 @@
495 495 <!-- -----------------底部按钮------------------ -->
496 496 <view class="join-cart">
497 497 <!-- bindtap="contactService" -->
498   - <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
  498 + <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
499 499 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
500 500 <view>客服</view>
501 501 </button>
... ...
packageD/pages/AI-test-skin/history_record/history_record.js
... ... @@ -304,7 +304,7 @@ Page({
304 304 * 生命周期函数--监听页面显示
305 305 */
306 306 onShow: function () {
307   -
  307 + getApp().check_can_share();
308 308 },
309 309 go_result(e) {
310 310 let id = e.currentTarget.dataset.id;
... ... @@ -344,7 +344,7 @@ Page({
344 344 /**
345 345 * 用户点击右上角分享
346 346 */
347   - onShareAppMessage: function () {
  347 + onShareAppMessage: function () { getApp().globalData.no_clear=1
348 348  
349 349 }
350 350 })
351 351 \ No newline at end of file
... ...
packageD/pages/AI-test-skin/index/aiskin.js
... ... @@ -43,6 +43,7 @@ Page({
43 43 * 生命周期函数--监听页面显示
44 44 */
45 45 onShow: function () {
  46 + getApp().check_can_share();
46 47 this.getHistoryData();
47 48 },
48 49  
... ... @@ -101,7 +102,7 @@ Page({
101 102 /**
102 103 * 用户点击右上角分享
103 104 */
104   - onShareAppMessage: function () {
  105 + onShareAppMessage: function () { getApp().globalData.no_clear=1
105 106  
106 107 },
107 108  
... ...
packageD/pages/AI-test-skin/select_photo/select_photo.js
... ... @@ -52,6 +52,7 @@ Page({
52 52 //-- 重新从相册中选择图片 --
53 53 show_pai_pop: function () {
54 54 var th = this;
  55 + getApp().globalData.no_clear=1;
55 56 //选择和拍照一张图片
56 57 wx.chooseImage({
57 58 count: 1,
... ... @@ -70,6 +71,7 @@ Page({
70 71 //选择图片
71 72 takePhoto() {
72 73 var that = this;
  74 + getApp().globalData.no_clear=1;
73 75 wx.chooseImage({
74 76 count: 1,
75 77 sizeType: ['compressed'],
... ...
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js
... ... @@ -36,6 +36,7 @@ Page({
36 36 * 生命周期函数--监听页面显示
37 37 */
38 38 onShow: function () {
  39 + getApp().check_can_share();
39 40 let th = this;
40 41 setTimeout(() => {
41 42 th.setData({
... ... @@ -68,13 +69,14 @@ Page({
68 69 /**
69 70 * 用户点击右上角分享
70 71 */
71   - onShareAppMessage: function () {
  72 + onShareAppMessage: function () { getApp().globalData.no_clear=1
72 73  
73 74 },
74 75  
75 76 //从相册中选择图片
76 77 show_pai_pop: function () {
77 78 let th = this;
  79 + getApp().globalData.no_clear=1;
78 80 //选择和拍照一张图片
79 81 wx.chooseImage({
80 82 count: 1,
... ... @@ -98,7 +100,8 @@ Page({
98 100 //选择图片
99 101 takePhoto() {
100 102 var that = this;
101   -
  103 + getApp().globalData.no_clear=1;
  104 + that.setData({selecting:1});
102 105 wx.chooseImage({
103 106 count: 1,
104 107 sizeType: ['compressed'],
... ... @@ -118,6 +121,7 @@ Page({
118 121  
119 122 },
120 123 fail(err) {
  124 + that.setData({selecting:0})
121 125 console.log(err);
122 126 }
123 127 })
... ... @@ -143,6 +147,7 @@ Page({
143 147 var that = this;
144 148 //size小于100kb 时 直接转码识别
145 149 if (size < 1024) {
  150 + that.setData({selecting:0})
146 151 getApp().globalData.skin_img_info = {
147 152 path:img,
148 153 size,
... ... @@ -153,12 +158,15 @@ Page({
153 158 return;
154 159 }
155 160  
  161 + wx.showLoading({
  162 + title:'处理中',
  163 + mask: true
  164 + });
156 165 //先获取图片 然后根据长宽 缩小 之后获取图片
157 166 wx.getImageInfo({
158 167 src: img,
159 168 success(res) {
160   - console.log(res.width)
161   - console.log(res.height)
  169 +
162 170 var ratio = size / 1024;
163 171 size1 = size1 / ratio;
164 172 var canvasWidth = res.width //图片原始长宽
... ... @@ -183,7 +191,7 @@ Page({
183 191 destHeight: canvasHeight,
184 192 fileType: 'jpg',
185 193 success: function (res) {
186   - console.log(res.tempFilePath)//最终图片路径
  194 + wx.hideLoading();
187 195 that.setData({
188 196 canvasImgUrl: res.tempFilePath
189 197 });
... ... @@ -195,9 +203,8 @@ Page({
195 203 app.goto(url);
196 204 },
197 205 fail: function (res) {
198   - console.log("缩放图片失败");
199   - console.log(res.errMsg)
200 206 wx.hideLoading();
  207 + that.setData({selecting:0})
201 208 wx.showToast({
202 209 title: '识别图片失败',
203 210 image: '../../utils/img/wrong.png',
... ... @@ -211,9 +218,8 @@ Page({
211 218 }, 1000)) //留一定的时间绘制canvas 否则会报错fail canvas is empty
212 219 },
213 220 fail: function (res) {
214   - console.log("获取图片失败");
215   - console.log(res.errMsg)
216 221 wx.hideLoading();
  222 + that.setData({selecting:0})
217 223 wx.showToast({
218 224 title: '识别图片失败',
219 225 image: '../../utils/img/wrong.png',
... ...
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxml
... ... @@ -55,7 +55,7 @@
55 55  
56 56 <view style="height: 300rpx;background-color: #e7f5fb;">
57 57 <view class="btn_fixed">
58   - <view class="btn" bindtap="takePhoto">准备闭眼拍摄</view>
  58 + <botton disabled="{{selecting}}" class="btn" bindtap="takePhoto">准备闭眼拍摄</botton>
59 59 <view class="notice" style="display:flex;justify-content:center;align-items: center;">
60 60 <text class="iconfont icon-info" style="margin-right: 10rpx;font-size: 26rpx"></text>
61 61 <text>如无闭眼,将导致图片分析失败</text>
... ...
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxss
... ... @@ -103,6 +103,7 @@ page {
103 103 text-align: center;
104 104 border-radius: 50rpx;
105 105 color: #fff;
  106 + display: block;
106 107 }
107 108  
108 109 .btn_fixed {
... ...
packageD/pages/AI-test-skin/success_result/goods.wxml
... ... @@ -9,9 +9,9 @@
9 9 <!-- 显示正确的商品价格 -->
10 10 <view style="display: flex;justify-content: space-between;">
11 11 <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10}}">
12   - <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>
13   - <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
14 12 <text wx:if="{{item.prom_price}}" class="bold">¥{{item.shop_price}}</text>
  13 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  14 +
15 15 </block>
16 16 <block wx:else>
17 17 <block wx:if="{{s_filter.is_has_rank(rank_switch,item)}}">
... ... @@ -36,4 +36,5 @@
36 36  
37 37 <view class="mm"><text class="iconfont icon-gouwuche"></text></view>
38 38 </view>
  39 + <view wx:if="{{item.prom_integral}}"><text style="font-weight: bold;">{{item.prom_integral}}</text>积分</view>
39 40 </view>
40 41 \ No newline at end of file
... ...
packageD/pages/AI-test-skin/success_result/success_result.js
... ... @@ -83,7 +83,29 @@ Page({
83 83 this.init();
84 84 //var face_result=getApp().globalData.face_result;
85 85 //var face_data=face_result.face_list[0];
86   - this.data.id = options.id;
  86 + var id=options.id;
  87 + var first_leader = options.first_leader;
  88 +
  89 + if (id == undefined || id == null || id == "") {
  90 + var gid_str = decodeURIComponent(options.scene);
  91 + gid_str = gid_str.split("_");
  92 + id=gid_str[0];
  93 + if (gid_str.length > 1) {
  94 + first_leader = gid_str[1];
  95 + }
  96 + }
  97 +
  98 + this.data.id=id;
  99 + if (first_leader) {
  100 + console.log("log---".first_leader);
  101 + getApp().globalData.first_leader = first_leader;
  102 + //调用接口判断是不是会员
  103 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + setting.stoid + "/" + first_leader, {}).then(res => {
  104 + if (res.data.code == 0) {
  105 + getApp().globalData.guide_id = res.data.data.id;
  106 + }
  107 + })
  108 + }
87 109  
88 110 //用异步的获取比较准一点
89 111 wx.getSystemInfo({
... ... @@ -280,6 +302,7 @@ Page({
280 302 //-- 获取一下分享要用的图片 --
281 303 th.set_share_img();
282 304 acne.get_goods(th, setting.stoid);
  305 +
283 306 // let { heightRecord, tab } = th.data;
284 307 // tab.forEach(item => {
285 308 // console.log(2);
... ... @@ -457,7 +480,9 @@ Page({
457 480 /**
458 481 * 生命周期函数--监听页面显示
459 482 */
460   - onShow: function () { },
  483 + onShow: function () {
  484 + getApp().check_can_share();
  485 + },
461 486  
462 487 clickTab(e) {
463 488 let { index, tab_id } = e.currentTarget.dataset;
... ... @@ -590,7 +615,15 @@ Page({
590 615 * 用户点击右上角分享
591 616 */
592 617 onShareAppMessage: function () {
  618 + getApp().globalData.no_clear=1;
  619 + var url="packageD/pages/AI-test-skin/success_result/success_result?id="+this.data.id+"&first_leader="+getApp().globalData.user_id;
593 620  
  621 + var ob = {
  622 + title: "测肤报告",
  623 + path: url,
  624 + };
  625 +
  626 + return ob;
594 627 },
595 628  
596 629 //商品页面跳转
... ... @@ -748,8 +781,8 @@ Page({
748 781 }
749 782 ///二微码
750 783 var path3 = setting.url + "/api/wx/open/app/user/getWeAppEwm/" +
751   - setting.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
752   -
  784 + setting.stoid + "?sceneValue=" + scene + "&pageValue=packageD/pages/AI-test-skin/success_result/success_result";
  785 +
753 786 // 读取文件成功则OK--
754 787 wx.getImageInfo({
755 788 src: path3,
... ... @@ -763,21 +796,21 @@ Page({
763 796 context.fillStyle = '#ebf6f8';
764 797 // 灰色实心矩形
765 798 // 1. 语法: x坐标, y坐标, 宽度, 高度
766   - context.fillRect(0, 0, 750 * rpx, 1338 * rpx);
  799 + context.fillRect(0, 0, 750 * rpx, 1320 * rpx);
767 800  
768 801 context.setFontSize(20 * rpx)
769 802 context.setFillStyle("#00d8e9")
770   - context.fillText("官方检测认证", 28 * b * rpx, 80 * b * rpx);
  803 + context.fillText("官方检测认证", 32 * b * rpx, 80 * b * rpx);
771 804  
772 805 //两个底部颜色
773 806 context.fillStyle = '#a7ecf5';
774   - context.fillRect(28 * b * rpx, 136 * b * rpx, 262 * b * rpx, 18 * b * rpx);
775   - context.fillRect(28 * b * rpx, 194 * b * rpx, 262 * b * rpx, 18 * b * rpx);
  807 + context.fillRect(32 * b * rpx, 136 * b * rpx, 262 * b * rpx, 18 * b * rpx);
  808 + context.fillRect(32 * b * rpx, 194 * b * rpx, 262 * b * rpx, 18 * b * rpx);
776 809  
777 810 context.setFontSize(42 * b * rpx)
778 811 context.setFillStyle("#070609")
779   - context.fillText("我的肌底强韧", 30 * b * rpx, 140 * b * rpx);
780   - context.fillText("肌肤鲜活润泽", 30 * b * rpx, 196 * b * rpx);
  812 + context.fillText("我的肌底强韧", 32 * b * rpx, 140 * b * rpx);
  813 + context.fillText("肌肤鲜活润泽", 32 * b * rpx, 196 * b * rpx);
781 814  
782 815 //先画一个圆形
783 816 th.circle(context, 110 * b * rpx, 280 * b * rpx, 140 * b * rpx, "#e7f3f8");
... ... @@ -786,35 +819,35 @@ Page({
786 819 context.drawImage(th.data.share_head, 132 * b * rpx, 310 * b * rpx, 230 * b * rpx, 230 * b * rpx);
787 820  
788 821 //左右俩个框并填充文字
789   - th.darwRoundRect(38 * b * rpx, 340 * b * rpx, 140 * b * rpx, 40 * b * rpx, 20 * b * rpx, context);
790   - th.darwRoundRect(324 * b * rpx, 340 * b * rpx, 140 * b * rpx, 40 * b * rpx, 20 * b * rpx, context);
791   - context.setFontSize(20 * b * rpx)
  822 + th.darwRoundRect(38 * b * rpx, 340 * b * rpx, 120 * b * rpx, 34 * b * rpx, 17 * b * rpx, context);
  823 + th.darwRoundRect(324 * b * rpx, 340 * b * rpx, 120 * b * rpx, 34 * b * rpx, 17 * b * rpx, context);
  824 + context.setFontSize(18 * b * rpx)
792 825 context.setFillStyle("black")
793   - context.fillText("黑眼圈 重度", 50 * b * rpx, 368 * b * rpx);
794   - context.fillText("毛孔 " + th.data.pore_num, 336 * b * rpx, 368 * b * rpx);
  826 + context.fillText("黑眼圈 重度", 50 * b * rpx, 363 * b * rpx);
  827 + context.fillText("毛孔 " + th.data.pore_num, 340 * b * rpx, 363 * b * rpx);
795 828  
796 829 //左右俩个框并填充文字
797   - th.darwRoundRect(40 * b * rpx, 412 * b * rpx, 116 * b * rpx, 40 * b * rpx, 20 * b * rpx, context);
798   - th.darwRoundRect(348 * b * rpx, 412 * b * rpx, 116 * b * rpx, 40 * b * rpx, 20 * b * rpx, context);
  830 + th.darwRoundRect(40 * b * rpx, 412 * b * rpx, 116 * b * rpx, 34 * b * rpx, 17 * b * rpx, context);
  831 + th.darwRoundRect(348 * b * rpx, 412 * b * rpx, 116 * b * rpx, 34 * b * rpx, 17 * b * rpx, context);
799 832 context.setFillStyle("black")
800   - context.fillText("黑头 " + th.data.blackhead_num, 52 * b * rpx, 440 * b * rpx);
801   - context.fillText("色斑 " + th.data.speckle_num, 354 * b * rpx, 440 * b * rpx);
  833 + context.fillText("黑头 " + th.data.blackhead_num, 60 * b * rpx, 434 * b * rpx);
  834 + context.fillText("色斑 " + th.data.speckle_num, 362 * b * rpx, 434 * b * rpx);
802 835  
803 836 //左右俩个框并填充文字
804   - th.darwRoundRect(60 * b * rpx, 484 * b * rpx, 116 * b * rpx, 40 * b * rpx, 20 * b * rpx, context);
805   - th.darwRoundRect(328 * b * rpx, 484 * b * rpx, 116 * b * rpx, 40 * b * rpx, 20 * b * rpx, context);
  837 + th.darwRoundRect(60 * b * rpx, 484 * b * rpx, 116 * b * rpx, 34 * b * rpx, 17 * b * rpx, context);
  838 + th.darwRoundRect(328 * b * rpx, 484 * b * rpx, 116 * b * rpx, 34 * b * rpx, 17 * b * rpx, context);
806 839 context.setFillStyle("black")
807   - context.fillText("皱纹 " + th.data.wrinkle_num, 74 * b * rpx, 510 * b * rpx);
808   - context.fillText("痤疮 " + th.data.acne_num, 344 * b * rpx, 510 * b * rpx);
  840 + context.fillText("皱纹 " + th.data.wrinkle_num, 74 * b * rpx, 506 * b * rpx);
  841 + context.fillText("痤疮 " + th.data.acne_num, 350 * b * rpx, 506 * b * rpx);
809 842  
810 843 //底部的绘制
811 844 th.darwRoundRect(38 * b * rpx, 650 * b * rpx, 430 * b * rpx, 160 * b * rpx, 10 * b * rpx, context);
812 845 //绘制二维码
813 846 context.drawImage(vpath, 60 * b * rpx, 672 * b * rpx, 120 * b * rpx, 120 * b * rpx);
814 847 context.setFillStyle("black")
815   - context.setFontSize(32 * b * rpx)
  848 + context.setFontSize(27 * b * rpx)
816 849 context.fillText("美肤管家AI测肤", 200 * b * rpx, 726 * b * rpx);
817   - context.setFontSize(22 * b * rpx)
  850 + context.setFontSize(19 * b * rpx)
818 851 context.fillText("科学了解皮肤的真实状态", 200 * b * rpx, 766 * b * rpx);
819 852  
820 853 //把画板内容绘制成图片,并回调 画板图片路径
... ... @@ -824,7 +857,7 @@ Page({
824 857 x: 0,
825 858 y: 0,
826 859 width: 750,
827   - height: 1338,
  860 + height: 1320,
828 861 destWidth: 1.4 * 750 * 750 / th.data.screenWidth,
829 862 destHeight: 1.4 * 750 * 750 / th.data.screenWidth,
830 863 canvasId: 'share',
... ...
packageD/pages/AI-test-skin/success_result/success_result.wxml
... ... @@ -378,12 +378,12 @@
378 378  
379 379  
380 380 <!-- 二维码显示页面 -->
381   -<canvas canvas-id='share' style='width:750rpx;height:1338rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas>
  381 +<canvas canvas-id='share' style='width:750rpx;height:1320rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas>
382 382 <!-- 展示分享图 -->
383 383 <view id="share_show" wx:if="{{share_show}}">
384 384 <view class="cover-layer" bindtap="close_share" style="z-index: 77777"></view>
385 385 <view class="share_content">
386   - <view class="sh_close" bindtap="close_share"><text class="iconfont icon-guan"></text></view>
  386 + <view class="sh_close" bindtap="close_share"><text class="iconfont icon-guan" style="font-size: 22rpx;"></text></view>
387 387 <image src="{{shareImgPath}}" style="width: 100%" mode="widthFix"></image>
388 388 <view class="share_save_btn" bindtap="savePic">保存到相册</view>
389 389 </view>
... ... @@ -412,7 +412,7 @@
412 412 </scroll-view>
413 413 </view>
414 414 <view class="close_icon" bindtap="close_yiwen">
415   - <text class="iconfont icon-guan"></text>
  415 + <text class="iconfont icon-guan" ></text>
416 416 </view>
417 417 </view>
418 418 <!-- 提示 -->
... ...
packageD/pages/AI-test-skin/success_result/success_result.wxss
... ... @@ -384,13 +384,15 @@ page {
384 384 font-size: 28rpx;
385 385 }
386 386  
387   -.analyse_classify_foot .product_item {
388   - display: flex;
  387 +.analyse_classify_foot .product_item:nth-child(1) {
389 388 margin-right: 30rpx;
  389 +}
  390 +.analyse_classify_foot .product_item{
  391 + display: flex;
390 392 flex-direction: column;
391 393 border-radius: 30rpx;
392 394 width: 40%;
393   - padding: 5%;
  395 + padding: 5% ;
394 396 background-color: #fff;
395 397 }
396 398  
... ... @@ -592,8 +594,7 @@ page {
592 594 .xc-coupon-frame {
593 595 width: 100%;
594 596 max-height: 560rpx;
595   - overflow: auto;
596   -
  597 + /* overflow: auto; */
597 598 }
598 599  
599 600 .xc-coupon-frame .rel:not(:first-child) {
... ... @@ -727,7 +728,7 @@ page {
727 728 z-index: 999999;
728 729 top: 50%;
729 730 left: 50%;
730   - width: 70%;
  731 + width: 75%;
731 732 transform: translate(-50%, -50%);
732 733 }
733 734  
... ... @@ -742,10 +743,10 @@ page {
742 743  
743 744 .sh_close {
744 745 position: absolute;
745   - right: 20rpx;
746   - top: 20rpx;
747   - width: 70rpx;
748   - height: 70rpx;
  746 + right: 34rpx;
  747 + top: 36rpx;
  748 + width: 65rpx;
  749 + height: 65rpx;
749 750 display: flex;
750 751 justify-content: center;
751 752 align-items: center;
... ...
pages/activity/pind_list/pind_list.js
... ... @@ -65,6 +65,7 @@ Page({
65 65 },
66 66  
67 67 onShow: function (t) {
  68 + getApp().check_can_share();
68 69 this.data.is_timer = 1;
69 70 this.data.currentPage = 1;
70 71 this.data.ismore = 1;
... ... @@ -195,6 +196,7 @@ Page({
195 196  
196 197 //---------分享配置--------
197 198 onShareAppMessage: function (e) {
  199 + getApp().globalData.no_clear=1;
198 200 var curPage = this;
199 201 var pagePath = curPage.route; //当前页面url
200 202 if (pagePath.indexOf('/') != 0) {
... ... @@ -248,6 +250,7 @@ Page({
248 250 },
249 251  
250 252 onShareTimeline() {
  253 + getApp().globalData.no_clear=1;
251 254 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
252 255 if (!store_name)
253 256 store_name = getApp().globalData.setting.appName;
... ...
pages/activity/seckill_list/seckill_list.js
... ... @@ -73,6 +73,7 @@ Page({
73 73  
74 74  
75 75 onShow: function (t) {
  76 + getApp().check_can_share();
76 77 this.data.is_timer = 1;
77 78 this.data.currentPage = 1;
78 79 var th = this;
... ... @@ -233,6 +234,7 @@ Page({
233 234  
234 235 //---------分享配置--------
235 236 onShareAppMessage: function (e) {
  237 + getApp().globalData.no_clear=1;
236 238 var curPage = this;
237 239 var pagePath = curPage.route; //当前页面url
238 240 if (pagePath.indexOf('/') != 0) {
... ... @@ -266,6 +268,7 @@ Page({
266 268 },
267 269  
268 270 onShareTimeline() {
  271 + getApp().globalData.no_clear=1;
269 272 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
270 273 if (!store_name)
271 274 store_name = getApp().globalData.setting.appName;
... ...
pages/cart/cart/cart.js
... ... @@ -69,6 +69,7 @@ Page({
69 69 //每次显示都清空
70 70 this.data.in_zhact_gdmap = {};
71 71  
  72 +
72 73 if (typeof this.getTabBar === 'function' && this.getTabBar()) {
73 74 var index = getApp().getPageIndex(this);
74 75 this.getTabBar().setData({
... ... @@ -1080,8 +1081,20 @@ Page({
1080 1081 goods_num: a,
1081 1082 goods_id: e.goods_id,
1082 1083 id: e.id,
1083   - store_id: oo.stoid
  1084 + store_id: oo.stoid,
1084 1085 };
  1086 + if(e.prom_type) {
  1087 + s.prom_type = e.prom_type;
  1088 + };
  1089 + if(e.prom_id) {
  1090 + s.prom_id = e.prom_id;
  1091 + };
  1092 + if(e.is_pd_normal) {
  1093 + s.is_pd_normal = e.is_pd_normal;
  1094 + };
  1095 + if(e.service_id) {
  1096 + s.card_id = e.service_id;
  1097 + };
1085 1098 th.postCardList_ser(s, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
1086 1099 }
1087 1100 },
... ... @@ -1089,7 +1102,7 @@ Page({
1089 1102 addNum_ser: function (t) {
1090 1103 if (!this.data.is_load) return false;
1091 1104 if (this.data.up_dating == 1) return false;
1092   - this.data.up_dating = 1;
  1105 + // this.data.up_dating = 1;
1093 1106  
1094 1107 var a = t.currentTarget.dataset.item;
1095 1108 var b = t.currentTarget.dataset.pitems;
... ... @@ -1098,18 +1111,31 @@ Page({
1098 1111 var e = {
1099 1112 goods_num: a.goods_num + 1,
1100 1113 id: a.id,
1101   - goods_id: a.goods_id,
1102   - store_id: oo.stoid
  1114 + goods_id: a.service_id,
  1115 + store_id: oo.stoid,
1103 1116 };
  1117 + if(a.prom_type) {
  1118 + e.prom_type = a.prom_type;
  1119 + };
  1120 + if(a.prom_id) {
  1121 + e.prom_id = a.prom_id;
  1122 + };
  1123 + if(a.is_pd_normal) {
  1124 + e.is_pd_normal = a.is_pd_normal;
  1125 + };
  1126 + if(a.service_id) {
  1127 + e.card_id = a.service_id;
  1128 + };
1104 1129 this.postCardList_ser(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
1105 1130  
1106 1131 },
1107 1132 //-------------减数量---------------------
1108 1133 subNum_ser: function (t) {
  1134 +
1109 1135 if (!this.data.is_load) return false;
1110 1136 if (this.data.up_dating == 1) return false;
1111   - this.data.up_dating = 1;
1112   -
  1137 + // this.data.up_dating = 1;
  1138 +
1113 1139 var a = t.currentTarget.dataset.item;
1114 1140 var b = t.currentTarget.dataset.pitems;
1115 1141 a = this.data.service_data[b].goods[a];
... ... @@ -1297,8 +1323,9 @@ Page({
1297 1323 for (var j = 0; j < item.length; j++) {
1298 1324 var txt = "service_data[" + i + "].goods[" + j + "].selected"
1299 1325 e.setData({
1300   - [txt]: !e.data.checkAllToggle,
  1326 + [txt]: !e.data.checkAllToggle ? 1 : 0,
1301 1327 })
  1328 +
1302 1329 if (!e.data.checkAllToggle) {
1303 1330 tfeel += item[j].goods_num * item[j].money;
1304 1331 t_num += item[j].goods_num;
... ... @@ -1509,7 +1536,8 @@ Page({
1509 1536 var e = this,
1510 1537 item = t.currentTarget.dataset.item,
1511 1538 pitems = t.currentTarget.dataset.pitems;
1512   - a = this.data.service_data[pitems].goods[item];
  1539 + a = this.data.service_data[pitems].goods[item]; // 选中的商品
  1540 +
1513 1541 var isok = 1,
1514 1542 fir = 0;
1515 1543 var iarr = e.data.service_data[pitems].goods;
... ... @@ -1541,6 +1569,7 @@ Page({
1541 1569 e.setData({
1542 1570 [txt]: Number(!a.selected),
1543 1571 });
  1572 +
1544 1573 this.doCheckAll();
1545 1574 },
1546 1575  
... ... @@ -1987,17 +2016,204 @@ Page({
1987 2016 },
1988 2017  
1989 2018 //----------------------更新购物数量,加减,调用接口---------------------
1990   - postCardList_ser: function (t, item, pitem) {
  2019 + postCardList_ser: async function (t, item, pitem) {
1991 2020 var e = this,
1992 2021 th = e;
1993 2022 var user_id = getApp().globalData.user_id;
1994 2023 var txt = "service_data[" + pitem + "].goods[" + item + "].goods_num";
  2024 +
1995 2025 e.setData({
1996 2026 [txt]: t.goods_num
1997 2027 });
1998   - e.doCheckAll();
1999   - e.update_cart_ser(t, pitem, item);
  2028 +
  2029 +
  2030 + if(t.prom_type == 1) {
  2031 + var txt = "service_data[" + pitem + "].goods[" + item + "].goods_num";
  2032 + var redis_num = 0;
  2033 +
  2034 + //------判断活动是否抢光-----
  2035 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  2036 + t.store_id + "/" + t.prom_type + "/" + t.prom_id, {
  2037 + 1: 1
  2038 + }).then(res => {
  2039 + redis_num = res.data.data;
  2040 + });
  2041 +
  2042 + // 检测库存
  2043 + if(redis_num == 0) {
  2044 + wx.showToast({
  2045 + title: '超出活动库存',
  2046 + icon: 'none',
  2047 + });
  2048 + th.setData({[txt]: redis_num});
  2049 + await e.doCheckAll();
  2050 + return false;
  2051 + };
  2052 +
  2053 + var buylimit = 0
  2054 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + t.store_id + "/" + getApp().globalData.user_id + "/" + t.prom_id, {
  2055 +
  2056 + }).then(res => {
  2057 + if(res.data.code == 0) {
  2058 +
  2059 + th.data.sele_g = res.data.data;
  2060 + th.data.sele_g.viplimited = res.data.data.buy_limit;
  2061 + buylimit = !res.data.data.buy_limit ? 0 : res.data.data.buy_limit;
  2062 + };
  2063 + });
  2064 +
  2065 + //----获取用户活动购买数----
  2066 + var gd_buy_num = 0;
  2067 + await getApp().request.promiseGet("/api/weshop/rechargeServicelist/getUserBuyGoodsNum?store_id="+t.store_id+"&user_id="+getApp().globalData.user_id+"&card_id="+t.card_id+"&prom_type="+t.prom_type+"&prom_id="+t.prom_id, {
  2068 + }).then(tt => {
  2069 + if (tt.data.code == 0) {
  2070 + gd_buy_num = !tt.data.data.promcardbuynum ? 0 : tt.data.data.promcardbuynum;
  2071 + th.setData({
  2072 + promcardbuynum: !tt.data.data.promcardbuynum ? 0 : tt.data.data.promcardbuynum,
  2073 + cardbuynum: tt.data.data.cardbuynum,
  2074 + });
  2075 + };
  2076 + });
  2077 +
  2078 +
  2079 + if(t.goods_num > redis_num) {
  2080 + wx.showToast({
  2081 + title: '超出活动库存',
  2082 + icon: 'none',
  2083 + });
  2084 + // 开启限购
  2085 + if (buylimit > 0) {
  2086 + let num = buylimit - gd_buy_num;
  2087 + if (num > redis_num) {
  2088 + th.setData({[txt]: redis_num});
  2089 + } else {
  2090 + th.setData({[txt]: num});
  2091 + }
  2092 + } else {
  2093 + th.setData({[txt]: redis_num});
  2094 + }
  2095 +
  2096 + await e.doCheckAll();
  2097 + return false;
  2098 + };
  2099 +
  2100 +
  2101 + //--秒杀:判断商品是否超出活动限购--
  2102 + if (buylimit > 0) {
  2103 +
  2104 + // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量”
  2105 + if(t.goods_num + gd_buy_num > buylimit) {
  2106 + // 计算还可以购买的数量:库存量 - 已购数
  2107 + wx.showToast({
  2108 + title: '超出活动限购',
  2109 + icon: 'none',
  2110 + });
  2111 + let num = buylimit - gd_buy_num;
  2112 + if (num <= 0) num = 1;
  2113 + th.setData({[txt]: num});
  2114 + await e.doCheckAll();
  2115 + return false;
  2116 + };
  2117 +
  2118 + }
  2119 +
  2120 +
  2121 + }
  2122 + await e.doCheckAll();
  2123 + await e.update_cart_ser(t, pitem, item);
  2124 +
  2125 +
2000 2126 },
  2127 +
  2128 +
  2129 + // 检查购物车数量
  2130 + async checkCartNum(t, item, pitem) {
  2131 + var th = this;
  2132 + if(t.is_pd_normal) return false;
  2133 + if (t.prom_type == 1) {
  2134 + var txt = "service_data[" + pitem + "].goods[" + item + "].goods_num";
  2135 + var redis_num = 0;
  2136 +
  2137 + //------判断活动是否抢光-----
  2138 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  2139 + t.store_id + "/" + t.prom_type + "/" + t.prom_id, {
  2140 + 1: 1
  2141 + }).then(res => {
  2142 + redis_num = res.data.data;
  2143 + });
  2144 +
  2145 + // 检测库存
  2146 + if(redis_num == 0) {
  2147 + wx.showToast({
  2148 + title: '超出活动库存',
  2149 + icon: 'none',
  2150 + });
  2151 + th.setData({[txt]: redis_num});
  2152 + return false;
  2153 + };
  2154 +
  2155 + if(t.goods_num > redis_num) {
  2156 + wx.showToast({
  2157 + title: '超出活动库存',
  2158 + icon: 'none',
  2159 + });
  2160 + th.setData({[txt]: redis_num});
  2161 + return false;
  2162 + };
  2163 +
  2164 + // 个人限购
  2165 + //----获取用户活动购买数----
  2166 + await getApp().request.promiseGet("/api/weshop/rechargeServicelist/getUserBuyGoodsNum?store_id="+t.store_id+"&user_id="+getApp().globalData.user_id+"&card_id="+t.goods_id+"&prom_type="+t.prom_type+"&prom_id="+t.prom_id, {
  2167 + }).then(tt => {
  2168 + if (tt.data.code == 0) {
  2169 + th.setData({
  2170 + promcardbuynum: tt.data.data.promcardbuynum,
  2171 + cardbuynum: tt.data.data.cardbuynum,
  2172 + });
  2173 + };
  2174 + });
  2175 +
  2176 +
  2177 +
  2178 + var buylimit = 0
  2179 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + t.store_id + "/" + getApp().globalData.user_id + "/" + t.prom_id, {
  2180 +
  2181 + }).then(res => {
  2182 + if(res.data.code == 0) {
  2183 +
  2184 + th.data.sele_g = res.data.data;
  2185 + th.data.sele_g.viplimited = res.data.data.buy_limit;
  2186 + buylimit = res.data.data.buy_limit;
  2187 + };
  2188 + });
  2189 +
  2190 +
  2191 + //--秒杀:判断商品是否超出活动限购--
  2192 + if (buylimit > 0) {
  2193 +
  2194 + var gd_buy_num = th.data.promcardbuynum;
  2195 +
  2196 + // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量”
  2197 + if(t.goods_num + gd_buy_num > buylimit) {
  2198 + // 计算还可以购买的数量:库存量 - 已购数
  2199 + wx.showToast({
  2200 + title: '超出活动限购',
  2201 + icon: 'none',
  2202 + });
  2203 + th.setData({[txt]: buylimit});
  2204 +
  2205 + };
  2206 +
  2207 + }
  2208 +
  2209 +
  2210 + th.doCheckAll();
  2211 + th.update_cart_ser(t, pitem, item);
  2212 +
  2213 +
  2214 +
  2215 + };
  2216 + },
2001 2217  
2002 2218  
2003 2219  
... ... @@ -2117,6 +2333,8 @@ Page({
2117 2333 //--更新购物车---
2118 2334 update_cart_ser: function (t, pitem, item) {
2119 2335 var e = this;
  2336 +
  2337 + console.log('t===>', t);
2120 2338 getApp().request.put("/api/weshop/cartService/update", {
2121 2339 data: t,
2122 2340 success: async function (ee) {
... ... @@ -2417,19 +2635,20 @@ Page({
2417 2635 }
2418 2636 });
2419 2637 } else {
  2638 +
2420 2639 //-- 开始服务卡的购物车购买 --
2421 2640 for (var i = 0; i < this.data.service_data.length; i++) {
2422 2641 var i_arr = this.data.service_data[i].goods;
  2642 + console.log(i_arr)
  2643 +
2423 2644 for (var j = 0; j < i_arr.length; j++) {
2424   - if (i_arr[j].selected) {
2425   - await rq.promisePut("/api/weshop/cartService/update", {
2426   - data: {
2427   - id: i_arr[j].id,
2428   - selected: 1,
2429   - store_id: oo.stoid
2430   - }
2431   - });
2432   - }
  2645 + await rq.promisePut("/api/weshop/cartService/update", {
  2646 + data: {
  2647 + id: i_arr[j].id,
  2648 + selected: i_arr[j].selected,
  2649 + store_id: oo.stoid
  2650 + }
  2651 + });
2433 2652 }
2434 2653 }
2435 2654 wx.hideLoading();
... ... @@ -2876,6 +3095,14 @@ Page({
2876 3095 getApp().goto(good_url);
2877 3096 }
2878 3097 })
2879   - }
  3098 + },
  3099 +
  3100 +
  3101 +
  3102 +
  3103 +
  3104 +
  3105 +
  3106 +
2880 3107  
2881 3108 });
2882 3109 \ No newline at end of file
... ...
pages/cart/cart2/c_filter.wxs
... ... @@ -45,7 +45,7 @@ var filters = {
45 45 if (ind == 2) return "指定品类";
46 46 if (ind == 11) return "指定用途";
47 47 if (ind == 12) return "指定分类1";
48   - if (ind == 13) return "全场通用";
  48 + if (ind == 13) return "自定义";
49 49 if (ind == 20) return "指定单品";
50 50 return "";
51 51 },
... ...
pages/cart/cart2/cart2.js
... ... @@ -5,10 +5,8 @@ var regeneratorRuntime = require(&#39;../../../utils/runtime.js&#39;);
5 5 var util_pay = require("../../../utils/pay.js");
6 6 var zh_calc = require("zh_calculate.js");
7 7 var ladder_calc = require("ladder_calculate.js");
8   -
9 8 // 防抖函数用定时器
10 9 let timer;
11   -
12 10 Page({
13 11 data: {
14 12 url: t.globalData.setting.url,
... ... @@ -93,13 +91,11 @@ Page({
93 91 is_coupon: 1, //选择券的控制属性
94 92 is_shipping_code: "",//插入用户默认地址
95 93 wu_arr_txt: "", //要更新的物流的字段
96   -
97 94 sales_rules: 1, //默认是显示线上库存
98 95 isget_by_quan: {}, //是否调用了接口获取包邮券
99 96 get_by_quan_list: null, //立即购买的
100 97 get_by_quan_list_cart: {}, //购物车的
101 98 by_quan_list_cart: null, //点击选择的包邮列表
102   -
103 99 //如果是全场包邮了,或者是全场不包邮了,就不要选包邮券
104 100 is_no_by: {},
105 101 is_by: {},
... ... @@ -2347,15 +2343,15 @@ Page({
2347 2343 }
2348 2344 }
2349 2345 })
  2346 + this.setData({
  2347 + submit:1,
  2348 + })
2350 2349 },
2351 2350  
2352 2351 //--------------------提交订单-----------------------
2353 2352 async submit_func() {
2354   - if (this.data.is_summit_ing == 1) return false; //--提交中退出--
2355   - this.data.is_summit_ing = 1;
2356 2353 var th = this, pdata = new Array();
2357 2354 var ff = true;
2358   -
2359 2355 //------------立即购买-------------
2360 2356 if (th.data.is_b_now == 1 && th.data.bn_goods.prom_type != 5) {
2361 2357 if (th.data.bn_exp_type == 0 && th.data.user_addr == null) {
... ... @@ -2981,6 +2977,9 @@ Page({
2981 2977 console.log("index.js wx.request CheckCallUser fail");
2982 2978 },
2983 2979 complete: function () {
  2980 + th.setData({
  2981 + submit:0,
  2982 + })
2984 2983 }
2985 2984 })
2986 2985  
... ... @@ -4370,15 +4369,22 @@ Page({
4370 4369 },
4371 4370 //订阅消息提醒
4372 4371 sendsm: function (func) {
  4372 + let th =this;
4373 4373 var template_id = this.data.template_id;
4374 4374 // //授权订阅
4375 4375 wx.requestSubscribeMessage({
4376 4376 tmplIds: [template_id],
4377 4377 success(res) {
4378 4378 func();
  4379 + th.setData({
  4380 + submit:0,
  4381 + })
4379 4382 },
4380 4383 fail(res) {
4381 4384 func();
  4385 + th.setData({
  4386 + submit:0,
  4387 + })
4382 4388 }
4383 4389 })
4384 4390  
... ...
pages/cart/cart2/cart2.wxml
... ... @@ -455,7 +455,7 @@
455 455 <view class="payable">应付金额:<text class="co-red"><text class="fs24">¥</text>{{formData.order_amount}}</text></view>
456 456 <!-- <view class="co-red big"></view> -->
457 457 </view>
458   - <button class="tips-btn" formType="submit" id="submitOrder" bindtap="requestSubscribe">提交订单</button>
  458 + <button class="tips-btn" formType="submit" id="submitOrder" disabled="{{submit}}" bindtap="requestSubscribe">提交订单</button>
459 459 </view>
460 460 </form>
461 461  
... ...
pages/cart/cart_wk/cart_wk.js
... ... @@ -70,6 +70,7 @@ Page({
70 70 * 生命周期函数--监听页面显示
71 71 */
72 72 onShow: function () {
  73 + getApp().check_can_share();
73 74 var th = this;
74 75 if (th.data.isclose == 0) {
75 76 wx.navigateTo({
... ... @@ -94,7 +95,7 @@ Page({
94 95 /**
95 96 * 用户点击右上角分享
96 97 */
97   - onShareAppMessage: function () { },
  98 + onShareAppMessage: function () { getApp().globalData.no_clear=1 },
98 99 //---------------获取物流---------------
99 100 get_wuliu(func) {
100 101 var th = this,
... ...
pages/distribution/distribution.js
... ... @@ -57,7 +57,8 @@ Page({
57 57 /**
58 58 * 生命周期函数--监听页面显示
59 59 */
60   - onShow: function () {
  60 + onShow: function () {
  61 + getApp().check_can_share();
61 62 if (typeof this.getTabBar === 'function' && this.getTabBar()) {
62 63 this.getTabBar().setData({
63 64 active: 2
... ... @@ -233,7 +234,7 @@ Page({
233 234 /**
234 235 * 用户点击右上角分享
235 236 */
236   - onShareAppMessage: function () {
  237 + onShareAppMessage: function () { getApp().globalData.no_clear=1
237 238  
238 239 },
239 240  
... ...
pages/giftpack/buygiftpack/giftpackbuy.js
... ... @@ -79,6 +79,7 @@ Page({
79 79 this.getList();
80 80 },
81 81 onShow: function () {
  82 + getApp().check_can_share();
82 83 //--先判断会员状态--
83 84 getApp().is_Single_page(this, function () {
84 85 var user_info = getApp().globalData.userInfo;
... ...
pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -73,6 +73,7 @@ Page({
73 73 },
74 74  
75 75 onShow: function () {
  76 + getApp().check_can_share();
76 77 getApp().is_Single_page(this,function () {
77 78 //--先判断会员状态--
78 79 var user_info = getApp().globalData.userInfo;
... ...
pages/giftpack/mygiftpack/mygiftpack.js
... ... @@ -78,6 +78,7 @@ Page({
78 78 this.getList();
79 79 },
80 80 onShow: function () {
  81 + getApp().check_can_share();
81 82 //--先判断会员状态--
82 83 getApp().is_Single_page(this, function () {
83 84 var user_info = getApp().globalData.userInfo;
... ... @@ -163,6 +164,7 @@ Page({
163 164  
164 165 //--- 分享设置 --
165 166 onShareAppMessage: function (e) {
  167 + getApp().globalData.no_clear=1;
166 168 var curPage = this;
167 169 var pagePath = curPage.route; //当前页面url
168 170 if (pagePath.indexOf('/') != 0) {
... ... @@ -176,6 +178,7 @@ Page({
176 178 },
177 179  
178 180 onShareTimeline() {
  181 + getApp().globalData.no_clear=1;
179 182 var curPage = this;
180 183 var pagePath = curPage.route; //当前页面url
181 184 if (pagePath.indexOf('/') != 0) {
... ...
pages/goods/categoryList/categoryList.js
... ... @@ -185,6 +185,7 @@ Page({
185 185 });
186 186 },
187 187 onShow:function(){
  188 + getApp().check_can_share();
188 189  
189 190 if (typeof this.getTabBar === 'function' && this.getTabBar()) {
190 191 var index=getApp().getPageIndex(this);
... ... @@ -627,7 +628,7 @@ Page({
627 628  
628 629 //---------分享配置--------
629 630 onShareAppMessage: function (e) {
630   -
  631 + getApp().globalData.no_clear=1;
631 632 var url="pages/goods/categoryList/categoryList";
632 633 var userInfo=getApp().globalData.userInfo;
633 634 //是分销商才带
... ... @@ -799,6 +800,7 @@ Page({
799 800 //扫一扫
800 801 getScancode:function(){
801 802 var _this = this;
  803 + getApp().globalData.no_clear=1;
802 804 // 允许从相机和相册扫码
803 805 wx.scanCode({
804 806 success: (res) => {
... ... @@ -1058,6 +1060,7 @@ Page({
1058 1060 },
1059 1061  
1060 1062 onShareTimeline(){
  1063 + getApp().globalData.no_clear=1;
1061 1064 var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
1062 1065 if(!store_name)
1063 1066 store_name=getApp().globalData.setting.appName;
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -255,6 +255,7 @@ Page({
255 255 share_hidden: false,
256 256 all_activity_list: null, //所有活动的列表
257 257  
  258 + hiddenCS: true,
258 259 },
259 260  
260 261 //------初始化加载----------
... ... @@ -270,7 +271,11 @@ Page({
270 271 prom_id = t.prom_id; //活动ID
271 272  
272 273 self = this;
273   -
  274 +
  275 +
  276 + console.log("gd onload");
  277 + console.log(t);
  278 +
274 279 //-- 自定义海报 --
275 280 getApp().request.promiseGet("/api/weshop/goods/poster/page", {
276 281 data: {store_id: os.stoid, type: 1, is_use: 1}
... ... @@ -334,8 +339,13 @@ Page({
334 339 this.data.prom_id = prom_id;
335 340 }
336 341 ee.setData({gid: gid});
337   - if (first_leader) {
338   - console.log("log---".first_leader);
  342 +
  343 + console.log("gd onload--2");
  344 + console.log(first_leader);
  345 +
  346 + if(first_leader) {
  347 + console.log("gd onload--3");
  348 + console.log("log---"+first_leader);
339 349 getApp().globalData.first_leader = first_leader;
340 350 //调用接口判断是不是会员
341 351 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
... ... @@ -752,6 +762,9 @@ Page({
752 762  
753 763 //---展示---
754 764 onShow: function () {
  765 +
  766 + getApp().check_can_share();
  767 +
755 768 var goods_list = null, th = this, that = this;
756 769 var show_prew_img = this.data.show_prew_img
757 770 if (show_prew_img) {
... ... @@ -759,6 +772,11 @@ Page({
759 772 return false;
760 773 }
761 774  
  775 + if(this.data.show_video) {
  776 + this.data.show_video=0;
  777 + return false;
  778 + }
  779 +
762 780 //优惠券要实时更新
763 781 getApp().getConfig2(function (e) {
764 782 var json_d = JSON.parse(e.switch_list);
... ... @@ -2280,25 +2298,40 @@ Page({
2280 2298  
2281 2299 //---------联系客服------------
2282 2300 contactService: function () {
2283   - s.getConfig(function (t) {
2284   - if (t.store_tel == undefined) {
2285   - getApp().request.get("/api/weshop/store/get/" + os.stoid, {
2286   - isShowLoading: 1,
2287   - data: {},
2288   - success: function (rs) {
2289   - getApp().globalData.config = rs.data.data;
2290   - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
2291   - getApp().my_warnning("商家未设置电话", 0, th);
2292   - return false;
2293   - }
2294   - s.confirmBox("请联系客服:" + rs.data.data.store_tel);
2295   - }
2296   - })
2297   - } else {
2298   - s.confirmBox("请联系客服:" + t.store_tel);
2299   - }
2300   - });
  2301 + getApp().com_call(this);
2301 2302 },
  2303 +
  2304 + // 获取客服电话
  2305 + getTel() {
  2306 + return new Promise((resolve, reject) => {
  2307 + s.getConfig(function (t) {
  2308 + if (t.store_tel == undefined) {
  2309 + getApp().request.get("/api/weshop/store/get/" + os.stoid, {
  2310 + isShowLoading: 1,
  2311 + data: {},
  2312 + success: function (rs) {
  2313 + getApp().globalData.config = rs.data.data;
  2314 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  2315 + getApp().my_warnning("商家未设置电话", 0, th);
  2316 + return false;
  2317 + }
  2318 + self.setData({
  2319 + store_tel: rs.data.data.store_tel,
  2320 + });
  2321 + // s.confirmBox("请联系客服:" + rs.data.data.store_tel);
  2322 + }
  2323 + })
  2324 + } else {
  2325 + self.setData({
  2326 + store_tel: t.store_tel,
  2327 + });
  2328 + // s.confirmBox("请联系客服:" + t.store_tel);
  2329 + };
  2330 + resolve();
  2331 + });
  2332 + });
  2333 + },
  2334 +
2302 2335 //-------获取购物车数量----------
2303 2336 requestCardNum: function () {
2304 2337 var t = this;
... ... @@ -2338,11 +2371,7 @@ Page({
2338 2371 b[i] = this.data.iurl + e[i];
2339 2372 }
2340 2373 this.data.show_prew_img = 1;
2341   -
2342   - wx.previewImage({
2343   - current: b[t.currentTarget.dataset.id],
2344   - urls: b
2345   - });
  2374 + getApp().pre_img2(b,t)
2346 2375 },
2347 2376  
2348 2377 previewCommentImgs_w: function (t) {
... ... @@ -2352,10 +2381,7 @@ Page({
2352 2381 b[i] = this.data.iurl + e[i];
2353 2382 }
2354 2383 this.data.show_prew_img = 1;
2355   - wx.previewImage({
2356   - current: b[t.currentTarget.dataset.id],
2357   - urls: b
2358   - });
  2384 + getApp().pre_img2(b,t)
2359 2385 },
2360 2386  
2361 2387 previewGoodsCommentImgs: function (t) {
... ... @@ -2363,10 +2389,7 @@ Page({
2363 2389 a = this.data.data.comment[t.currentTarget.dataset.cidx].img;
2364 2390 a = a.map(function (t) {
2365 2391 return e.data.url + t;
2366   - }), wx.previewImage({
2367   - current: a[t.currentTarget.dataset.id],
2368   - urls: a
2369   - });
  2392 + }), getApp().pre_img2(a,t);
2370 2393 this.data.show_prew_img = 1;
2371 2394 },
2372 2395 closePromModal: function () {
... ... @@ -2382,6 +2405,7 @@ Page({
2382 2405  
2383 2406 //--点击分享事件---
2384 2407 onShareAppMessage: function (t) {
  2408 + getApp().globalData.no_clear=1;
2385 2409  
2386 2410 var th = this;
2387 2411 var price = th.data.sele_g.shop_price;
... ... @@ -2440,6 +2464,9 @@ Page({
2440 2464 }
2441 2465 //-- 页面不能刷新 --
2442 2466 this.data.show_prew_img=1;
  2467 +
  2468 + console.log("share..");
  2469 + console.log(ob);
2443 2470 return ob;
2444 2471  
2445 2472 },
... ... @@ -3951,7 +3978,7 @@ Page({
3951 3978 map.set(gd.goods_id, g_buy_num);
3952 3979 th.setData({
3953 3980 g_buy_num: map,
3954   - prom_buy_num: tt.data.data.goodsbuynum,
  3981 + prom_buy_num: tt.data.data.promgoodsbuynum,
3955 3982 });
3956 3983 "function" == typeof func && func();
3957 3984 }
... ... @@ -5911,6 +5938,12 @@ Page({
5911 5938  
5912 5939 wait_for_store_config: function () {
5913 5940 var th = this;
  5941 + //----获取系统参数-----
  5942 + getApp().getConfig2(function (e) {
  5943 + th.setData({
  5944 + bconfig: e,
  5945 + });
  5946 + })
5914 5947 var t_time = setInterval(function () {
5915 5948 if (th.data.bconfig == null) false;
5916 5949 var e = th.data.bconfig;
... ... @@ -6246,10 +6279,7 @@ Page({
6246 6279  
6247 6280 previewImage(e) {
6248 6281 this.data.show_prew_img = 1;
6249   - wx.previewImage({
6250   - //将图片预览出来
6251   - urls: [this.data.sele_g.original_img]
6252   - });
  6282 + getApp().pre_img(this.data.sele_g.original_img);
6253 6283 },
6254 6284  
6255 6285 is_show_more_buy: function () {
... ... @@ -6329,6 +6359,7 @@ Page({
6329 6359 },
6330 6360  
6331 6361 onShareTimeline() {
  6362 + getApp().globalData.no_clear=1;
6332 6363 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
6333 6364 if (!store_name)
6334 6365 store_name = getApp().globalData.setting.appName;
... ... @@ -6346,6 +6377,10 @@ Page({
6346 6377 },
6347 6378  
6348 6379 clickShare() {
  6380 + if(!getApp().globalData.user_id){
  6381 + getApp().goto("/pages/togoin/togoin");
  6382 + return false;
  6383 + }
6349 6384 this.setData({
6350 6385 share_hidden: true,
6351 6386 });
... ... @@ -6499,15 +6534,9 @@ Page({
6499 6534 },
6500 6535  
6501 6536 con_weixin: function () {
6502   - var url = this.data.sys_switch.weapp_customertype_url;
6503   - var id = this.data.sys_switch.weapp_customertype_appid;
6504   - wx.openCustomerServiceChat({
6505   - extInfo: {url: url},
6506   - corpId: id,
6507   - success(res) {
6508   - }
6509   - })
  6537 + getApp().con_wx(this);
6510 6538 },
  6539 +
6511 6540 get_normal(gid){
6512 6541 this.setData({
6513 6542 prom_type: 0,
... ... @@ -6616,11 +6645,62 @@ Page({
6616 6645  
6617 6646 // 预览海报
6618 6647 previewPoster() {
  6648 + getApp().globalData.no_clear=1;
6619 6649 wx.previewImage({
6620 6650 current: this.data.shareImgPath, // 当前显示图片的http链接
6621 6651 urls: [this.data.shareImgPath] ,// 需要预览的图片http链接列表
6622 6652 });
6623 6653 },
  6654 +
  6655 + screenChange:function (e) {
  6656 + let fullScreen = e.detail.fullScreen //值true为进入全屏,false为退出全屏
  6657 + if (fullScreen ){ //退出全屏
  6658 + getApp().globalData.no_clear=1;
  6659 + this.data.show_video=1;
  6660 + }
  6661 + },
  6662 +
  6663 + click_contact:function () {
  6664 + getApp().globalData.no_clear=1;
  6665 + },
  6666 +
  6667 + //打开客服操作菜单
  6668 + openCS() {
  6669 + // 判断会员状态
  6670 + let user_info = getApp().globalData.userInfo;
  6671 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) {
  6672 + wx.navigateTo({
  6673 + url: '/pages/togoin/togoin',
  6674 + })
  6675 + return false;
  6676 + };
  6677 + // csType/在线客服设置:
  6678 + // 0关闭(如果有设置热线电话,则显示拨打热线电话)、
  6679 + // 1小程序客服、
  6680 + // 2企业微信客服
  6681 + if(this.data.sys_switch) {
  6682 + let csType = this.data.sys_switch.weapp_customertype;
  6683 + if(csType == 0) {
  6684 + // 拨打电话号码
  6685 + this.contactService();
  6686 + } else {
  6687 + this.getTel()
  6688 + .then(() => {
  6689 + self.setData({
  6690 + hiddenCS: false,
  6691 + });
  6692 + });
  6693 + };
  6694 + };
  6695 +
  6696 + },
  6697 +
  6698 + //关闭客服操作菜单
  6699 + closeCS() {
  6700 + this.setData({
  6701 + hiddenCS: true,
  6702 + });
  6703 + },
6624 6704  
6625 6705  
6626 6706  
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -42,7 +42,7 @@
42 42 </image>
43 43 </view>
44 44 <view wx:else>
45   - <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video>
  45 + <video bindfullscreenchange="screenChange" class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video>
46 46 </view>
47 47 </swiper-item>
48 48 <swiper-item wx:for="{{gallery}}" wx:key="gallery">
... ... @@ -129,7 +129,7 @@
129 129 </view>
130 130 </view>
131 131  
132   - <!-- <view class="abs white xc-nanber">
  132 + <view class="abs white xc-nanber">
133 133 <text class="fs22">已拼{{prom_act.buy_num}}件</text>
134 134 <view class="flex" style='margin-top:-34rpx'>
135 135 <view class="xc-people-img">
... ... @@ -137,7 +137,7 @@
137 137 </view>
138 138 <view class="t-s fs20 xc-people-val">{{prom_act.ct_num}}人拼</view>
139 139 </view>
140   - </view> -->
  140 + </view>
141 141  
142 142 <!-- 幸运购 -->
143 143 <view class="abs white xc-nanber" wx:if="{{false}}">
... ... @@ -274,6 +274,7 @@
274 274 </view>
275 275 </view>
276 276 <view class="goods-title">
  277 + <image wx:if="{{data.commission > 0}}" style="width: 25rpx;height: 25rpx;margin-right: 6rpx;" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/addmoney.png"></image>
277 278 <view class="goods-name elli">{{data.goods_name}}</view>
278 279 </view>
279 280 <view class="goods-num">
... ... @@ -388,9 +389,11 @@
388 389 </view>
389 390 </view>
390 391 </block>
  392 +
391 393 <!-- 许程商品名字 -->
392 394 <view wx:if="{{prom_type!=1 && prom_type!=2 }}">
393 395 <view class="goods-title">
  396 + <image wx:if="{{data.commission > 0}}" style="width: 25rpx;height: 25rpx;margin-right: 6rpx;" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/addmoney.png"></image>
394 397 <view class="goods-name elli">{{data.goods_name}}</view>
395 398 </view>
396 399 </view>
... ... @@ -1011,7 +1014,7 @@
1011 1014 <!-- -----------------底部按钮------------------ -->
1012 1015 <view class="join-cart">
1013 1016 <!-- bindtap="contactService" -->
1014   - <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
  1017 + <!-- <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
1015 1018 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
1016 1019 <view>客服</view>
1017 1020 </button>
... ... @@ -1024,7 +1027,12 @@
1024 1027 <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">
1025 1028 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
1026 1029 <view>客服</view>
1027   - </view>
  1030 + </view> -->
  1031 +
  1032 + <view class="custom-service cart-ico new_split" bindtap="openCS">
  1033 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  1034 + <view>客服</view>
  1035 + </view>
1028 1036  
1029 1037 <view bindtap="collectGoods" class="custom-service cart-ico new_split">
1030 1038 <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image>
... ... @@ -1702,9 +1710,9 @@
1702 1710 </view>
1703 1711 </view>
1704 1712 <view class="pdt40">
1705   - <view class="pdb20">活动内容</view>
  1713 + <view class="pdb20">活动内容</view>
1706 1714 <view class="popup-content">
1707   - <text class="pdb10">{{prom_act.remark}}</text>
  1715 + <text class="pdb10">{{prom_act.remark?prom_act.remark:'暂无'}}</text>
1708 1716 </view>
1709 1717 </view>
1710 1718  
... ... @@ -1718,3 +1726,5 @@
1718 1726 <view hidden="{{!openSpecModal_flash_normal}}">
1719 1727 <include src="buy_flash_normal.wxml" />
1720 1728 </view>
  1729 +
  1730 +<include src="../../../components/com_servicer/com_servicer.wxml"></include>
... ...
pages/goods/goodsInfo/goodsInfo.wxss
... ... @@ -127,6 +127,8 @@ image {
127 127 .goods-title {
128 128 display: flex;
129 129 justify-content: space-between;
  130 + align-items: center;
  131 + vertical-align: middle;
130 132 /* overflow: hidden; */
131 133 /* height: 108rpx; */
132 134 }
... ... @@ -706,6 +708,7 @@ view.cart-btn-lg {
706 708 color: #d60021;
707 709 font-size: 33rpx;
708 710 font-weight: bold;
  711 + /* display: flex; */
709 712 }
710 713  
711 714 .spec-goods-stock {
... ...
pages/goods/goodsList/goodsList.js
... ... @@ -200,6 +200,10 @@ Page({
200 200 })
201 201 },
202 202  
  203 + onShow:function () {
  204 + getApp().check_can_share();
  205 + },
  206 +
203 207 //设置优惠券的
204 208 set_prom_list:async function(arr){
205 209 var th=this;
... ... @@ -380,6 +384,7 @@ Page({
380 384 },
381 385 //---------分享配置--------
382 386 onShareAppMessage: function (e) {
  387 + getApp().globalData.no_clear=1;
383 388 var curPage=this;
384 389 var pagePath = curPage.route; //当前页面url
385 390 if (pagePath.indexOf('/') != 0) {
... ...
pages/goods/search/search.js
... ... @@ -139,8 +139,11 @@ Page({
139 139 // 获取历史搜索记录
140 140 this.getHistorySearch();
141 141 },
142   -
143   -
  142 +
  143 + onShow:function () {
  144 + getApp().check_can_share();
  145 + },
  146 +
144 147 changeTab: function(t) {
145 148 var ord = t.currentTarget.dataset.href;
146 149 var ad = t.currentTarget.dataset.ad;
... ... @@ -389,6 +392,7 @@ Page({
389 392  
390 393 //---------分享配置--------
391 394 onShareAppMessage: function (e) {
  395 + getApp().globalData.no_clear=1;
392 396 var curPage=this;
393 397 var pagePath = curPage.route; //当前页面url
394 398 if (pagePath.indexOf('/') != 0) {
... ...
pages/index/index/index.js
... ... @@ -84,7 +84,6 @@ Page({
84 84 full_ad: null, //全屏广告
85 85 full_screen: 0, //全屏广告
86 86 is_ok_h5:0, //判断要不要显示关注二维码
87   -
88 87 },
89 88  
90 89 onLoad: async function (tt) {
... ... @@ -223,18 +222,20 @@ Page({
223 222 //如果是自定义模板
224 223 if (this.data.isTemplate) {
225 224 //---先获取会员---
226   - t.getUserFir(function () {
227   - th.is_festival();
228   - var new_nav = th.data.new_nav;
229   - if (new_nav == "") {
230   - th.is_new();
231   - }
232   - // sty
233   - setTimeout(function () {
234   - if (getApp().globalData.user_id) getApp().requestCardNum(th);
235   - }, 500)
  225 + //t.getUserFir(function () {
  226 + if(getApp().globalData.user_id) {
  227 + th.is_festival();
  228 + var new_nav = th.data.new_nav;
  229 + if (new_nav == "") {
  230 + th.is_new();
  231 + }
  232 + // sty
  233 + setTimeout(function () {
  234 + if (getApp().globalData.user_id) getApp().requestCardNum(th);
  235 + }, 500)
  236 + }
236 237  
237   - });
  238 + //});
238 239 } else {
239 240 await this.init_fir();
240 241 wx.setNavigationBarColor({
... ... @@ -291,6 +292,9 @@ Page({
291 292 },
292 293  
293 294 async onShow() {
  295 +
  296 + getApp().check_can_share();
  297 +
294 298 this.getTabBar().setData({
295 299 cartGoodsNum: getApp().globalData.cartGoodsNum
296 300 })
... ... @@ -381,19 +385,46 @@ Page({
381 385 flash_data.forEach(function (val, ind) {
382 386  
383 387 if(val.user_price) val.price=val.user_price;
384   - if (val.start_time > nt) flash_data[ind].status = 0;
385   - else if (val.end_time > nt) flash_data[ind].status = 1;
386   - if (val.buy_num >= val.goods_num) flash_data[ind].status = 2;
  388 + if (val.start_time > nt) {
  389 + flash_data[ind].status = 0;
  390 + } else if (val.end_time > nt) {
  391 + flash_data[ind].status = 1;
  392 + }
  393 +
  394 + if (val.buy_num >= val.goods_num){
  395 + flash_data[ind].status = 2;
  396 + }
387 397 });
388 398  
389   - var arr = new Array();
390   - //--三个三个一组---
391   - for (var i = 0; i < flash_data.length; i += 3) {
392   - arr.push(flash_data.slice(i, i + 3));
  399 + var promisies = [];
  400 + for (const key in flash_data) {
  401 + if (Object.hasOwnProperty.call(flash_data, key)) {
  402 + const val = flash_data[key];
  403 + promisies[key] = getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  404 + os.stoid + "/1/" + val.id,
  405 + {}
  406 + ).then(res => {
  407 + if (res.data.code == 0) {
  408 + if (res.data.data <= 0) flash_data[key].status = 2;
  409 + };
  410 + });
  411 + }
393 412 }
394   - th.setData({
395   - saleGoods: arr
  413 +
  414 + Promise.all(promisies).then(() => {
  415 + var arr = new Array();
  416 + //--三个三个一组---
  417 + for (var i = 0; i < flash_data.length; i += 3) {
  418 + arr.push(flash_data.slice(i, i + 3));
  419 + }
  420 +
  421 + th.setData({
  422 + saleGoods: arr
  423 + });
396 424 });
  425 +
  426 +
  427 +
397 428 }
398 429 });
399 430  
... ... @@ -402,7 +433,7 @@ Page({
402 433  
403 434  
404 435  
405   -
  436 +
406 437  
407 438  
408 439  
... ... @@ -428,29 +459,21 @@ Page({
428 459 var th = this;
429 460  
430 461 var show = getApp().globalData.isLoad_ad;
431   - setTimeout(function () {
432   - //user没有及时更新
433   - var userInfo = getApp().globalData.userInfo;
434   - if (!userInfo || !userInfo.user_id) userInfo = null;
435   - //有加载过一次首页,就显示
436   - if (show || userInfo || getApp().globalData.user_id) {
  462 +
  463 + if(!show){
437 464 setTimeout(function () {
438   - full_screen.get_the_full_screen(th);
439   - }, 800)
440   - //动画效果
  465 + full_screen.get_the_full_screen(th);
  466 + }, 800);
  467 + getApp().globalData.isLoad_ad=1;
441 468 if (!th.data.f_hidden) {
442   - wx.showLoading({
443   - title: '加载中..'
444   - });
445   - setTimeout(function () {
446   - th.setData({ f_hidden: 1 })
447   - wx.hideLoading();
448   - }, 960)
  469 + setTimeout(function () {
  470 + th.setData({ f_hidden: 1 })
  471 + wx.hideLoading();
  472 + }, 960)
449 473 }
450   - } else {
451   - getApp().globalData.isLoad_ad = 1;
452   - }
453   - }, 1500)
  474 + } else {
  475 + th.setData({ f_hidden: 1 })
  476 + }
454 477  
455 478 setTimeout(function () {
456 479 const query = wx.createSelectorQuery();
... ... @@ -483,7 +506,7 @@ Page({
483 506 if (data && data.length > 0) {
484 507 var temp_data = data[0];
485 508 var t_arr = JSON.parse(temp_data.json_str);
486   - console.log(t_arr);
  509 +
487 510 th.setData({
488 511 template_arr: t_arr,
489 512 isTemplate: 1,
... ... @@ -649,19 +672,20 @@ Page({
649 672 });
650 673  
651 674 //---先获取会员---
652   - t.getUserFir(function () {
653   - th.is_festival();
654   - var new_nav = th.data.new_nav;
655   - if (new_nav == "") {
656   - th.is_new();
657   - }
658   -
659   - // sty
660   - setTimeout(function () {
661   - if (getApp().globalData.user_id) getApp().requestCardNum(th);
662   - }, 500)
  675 + //t.getUserFir(function () {
  676 + if(getApp().globalData.user_id) {
  677 + th.is_festival();
  678 + var new_nav = th.data.new_nav;
  679 + if (new_nav == "") {
  680 + th.is_new();
  681 + }
663 682  
664   - });
  683 + // sty
  684 + setTimeout(function () {
  685 + if (getApp().globalData.user_id) getApp().requestCardNum(th);
  686 + }, 500)
  687 + }
  688 + //});
665 689  
666 690 setTimeout(function () {
667 691 var goods_list = th.selectComponent("#goods_list"); //组件的id
... ... @@ -743,6 +767,7 @@ Page({
743 767 });
744 768 },
745 769 onShareAppMessage: function (e) {
  770 + getApp().globalData.no_clear=1;
746 771 var url = "/pages/index/index/index";
747 772 var userInfo = getApp().globalData.userInfo;
748 773 //是分销商才带
... ... @@ -938,6 +963,7 @@ Page({
938 963 //---扫一扫的函数---
939 964 getScancode: function () {
940 965 var _this = this;
  966 + getApp().globalData.no_clear=1;
941 967 // 允许从相机和相册扫码
942 968 wx.scanCode({
943 969 success: (res) => {
... ... @@ -1143,6 +1169,8 @@ Page({
1143 1169  
1144 1170  
1145 1171 onShareTimeline() {
  1172 + getApp().globalData.no_clear=1;
  1173 +
1146 1174 // getApp().getConfig(function(t) {
1147 1175 // return {
1148 1176 // title: '首页-' + getApp().globalData.config.store_name,
... ... @@ -1186,6 +1214,8 @@ Page({
1186 1214 var url=e.currentTarget.dataset.url;
1187 1215 getApp().goto(url);
1188 1216 },
  1217 +
  1218 +
1189 1219  
1190 1220  
1191 1221  
... ...
pages/index/index/index.wxml
... ... @@ -171,14 +171,14 @@
171 171 </navigator>
172 172 <view class="seckill-list">
173 173 <swiper class="s_prom" indicator-dots="{{false}}" bindchange="flashSwiperChange">
174   - <swiper-item wx:for="{{saleGoods}}" wx:key="{{index}}" class="p_swiper" wx:key="saleGoods" style="740rpx !important;padding: 0; margin-left: 10rpx">
  174 + <swiper-item wx:for="{{saleGoods}}" wx:key="{{index}}" class="p_swiper" wx:key="saleGoods" style="padding: 0; margin-left: 10rpx">
175 175 <navigator style="flex-shrink: 0;width: 247rpx" class="nav" hover-class="none" url="{{aitem.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id )}}" wx:for="{{item}}" wx:key="item" wx:for-item="aitem" wx:for-index="aind">
176 176 <view class="imgview">
177 177 <image src="{{url+aitem.original_img}}" mode="aspectFill" lazy-load="true" data-errorimg="saleGoods[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3" data-img="{{aitem.original_img}}"></image>
178 178  
179 179 <image wx:if="{{aitem.status==0}}" class="status_img" src="{{url}}/miniapp/images/miao/yure.png"></image>
180   - <image wx:if="{{aitem.status==1}}" class="status_img" src="{{url}}/miniapp/images/miao/going.png"></image>
181   - <image wx:if="{{aitem.status==2}}" class="status_img" src="{{url}}/miniapp/images/miao/mend.png"></image>
  180 + <image wx:elif="{{aitem.status==1}}" class="status_img" src="{{url}}/miniapp/images/miao/going.png"></image>
  181 + <image wx:else="{{aitem.status==2}}" class="status_img" src="{{url}}/miniapp/images/miao/mend.png"></image>
182 182 </view>
183 183 <view class="ellipsis-2 mar-top10" style="height: 76rpx;">{{aitem.goods_name}}</view>
184 184 <!-- <view class="red-co mar-top10 is_seckill_height"> -->
... ...
pages/team/team_show/team_show.js
... ... @@ -142,6 +142,7 @@ Page({
142 142  
143 143 //显示加载
144 144 onShow:function(){
  145 + getApp().check_can_share();
145 146 var tg_id = this.data.tg_id,th=this;
146 147 this.init(tg_id);
147 148 },
... ... @@ -959,6 +960,7 @@ Page({
959 960  
960 961 //------ 分享配置 --------
961 962 onShareAppMessage: function (e) {
  963 + getApp().globalData.no_clear=1;
962 964 var curPage=this;
963 965 var pagePath = curPage.route; //当前页面url
964 966 if (pagePath.indexOf('/') != 0) {
... ...
pages/team/team_success/team_success.js
... ... @@ -86,6 +86,10 @@ Page({
86 86 }
87 87 })
88 88 },
  89 + onShow:function () {
  90 + getApp().check_can_share();
  91 + },
  92 +
89 93 //关闭展开列表
90 94 click:function(e){
91 95 this.setData({
... ... @@ -817,6 +821,7 @@ Page({
817 821  
818 822 //------ 分享配置 --------
819 823 onShareAppMessage: function (e) {
  824 + getApp().globalData.no_clear=1;
820 825 var th=this;
821 826 var scene=this.data.teamgroup.id;
822 827 var goods_id=this.data.teamlist.goods_id;
... ... @@ -844,6 +849,10 @@ Page({
844 849 },
845 850  
846 851 clickShare() {
  852 + if(!getApp().globalData.user_id){
  853 + getApp().goto("/pages/togoin/togoin");
  854 + return false;
  855 + }
847 856 this.setData({
848 857 share_hidden: true,
849 858 });
... ...
pages/template/index.js
... ... @@ -24,6 +24,7 @@ Page({
24 24 },
25 25  
26 26 async onShow() {
  27 + getApp().check_can_share();
27 28 var th = this;
28 29 await this.init_load();
29 30 //如果是自定义模板
... ... @@ -94,13 +95,14 @@ Page({
94 95 },
95 96  
96 97 onShareAppMessage: function(e) {
97   -
  98 + getApp().globalData.no_clear=1;
98 99 },
99 100  
100 101 /**
101 102 * 用户分享朋友圈
102 103 */
103 104 async onShareTimeline(){
  105 + getApp().globalData.no_clear=1;
104 106 getApp().getConfig(await function(e){
105 107 this.setData({
106 108 store_config:e
... ...
pages/user/Detailed/Detailed.js
... ... @@ -184,7 +184,7 @@ Page({
184 184  
185 185 saveImageToPhotosAlbum: function () {
186 186 if (this.data.imagePath != "") {
187   - wx.previewImage({ urls: [this.data.imagePath], })
  187 + getApp().pre_img(this.data.imagePath);
188 188 return;
189 189 }
190 190  
... ... @@ -372,9 +372,8 @@ Page({
372 372 maskHidden: false,
373 373 canvasHidden: true
374 374 });
375   - wx.previewImage({
376   - urls: [res.tempFilePath],
377   - })
  375 +
  376 + getApp().pre_img(res.tempFilePath);
378 377 if (!res.tempFilePath) {
379 378 wx.showModal({
380 379 title: '提示',
... ...
pages/user/add_address/add_address.js
... ... @@ -37,7 +37,7 @@ Page({
37 37 requestAddressList: function () {
38 38 var e = this;
39 39 t.get(e.data.url + "/api/weshop/useraddress/page", {
40   - data: { store_id: os.stoid, user_id: oo.user_id, page: e.data.curpage, pageSize: 6 },
  40 + data: { store_id: os.stoid, user_id: oo.user_id, page: e.data.curpage, pageSize: 20 },
41 41 success: function (t) {
42 42 e.data.curpage++;
43 43 var arr1 = e.data.addresses;
... ...
pages/user/address_list/address_list.js
... ... @@ -50,7 +50,7 @@ Page({
50 50 var tt = Math.random() * 100
51 51 var e = this;
52 52 t.get(e.data.url + "/api/weshop/useraddress/page", {
53   - data: { store_id: os.stoid, user_id: oo.user_id, page: e.data.curpage, pageSize: 6, t: tt },
  53 + data: { store_id: os.stoid, user_id: oo.user_id, page: e.data.curpage, pageSize: 20, t: tt },
54 54 success: function (t) {
55 55 e.data.curpage++;
56 56 var arr1 = e.data.addresses;
... ... @@ -152,8 +152,10 @@ Page({
152 152 var th=this;
153 153 wx.getSetting({
154 154 success(res) {
155   - console.log("vres.authSetting['scope.address']:", res.authSetting['scope.address'])
  155 + getApp().globalData.no_clear=1;
  156 + console.log("vres.authSetting['scope.address']:", res.authSetting['scope.address']);
156 157 if (res.authSetting['scope.address']) {
  158 + getApp().globalData.no_clear=1;
157 159 wx.chooseAddress({
158 160 success(res) {
159 161 th.save_wx_addr(res);
... ... @@ -162,12 +164,13 @@ Page({
162 164  
163 165 } else {
164 166 if (res.authSetting['scope.address'] == false) {
165   - console.log("222")
  167 + getApp().globalData.no_clear=1;
166 168 wx.openSetting({
167 169 success(res) {}
168 170 })
169 171 } else {
170   -
  172 +
  173 + getApp().globalData.no_clear=1;
171 174 wx.chooseAddress({
172 175 success(res) {
173 176 th.save_wx_addr(res);
... ... @@ -199,5 +202,8 @@ Page({
199 202 }
200 203 })
201 204  
202   - }
  205 + },
  206 +
  207 +
  208 +
203 209 });
204 210 \ No newline at end of file
... ...
pages/user/assistance/assistance.js
... ... @@ -49,6 +49,7 @@ Page({
49 49 * 生命周期函数--监听页面显示
50 50 */
51 51 onShow: function () {
  52 + getApp().check_can_share();
52 53 //--先判断会员状态--
53 54 getApp().is_Single_page(this, function () {
54 55 var user_info = getApp().globalData.userInfo;
... ... @@ -229,6 +230,7 @@ Page({
229 230 },
230 231  
231 232 onShareAppMessage(res) {
  233 + getApp().globalData.no_clear=1;
232 234 if (res.from === 'button') {
233 235 // 来自页面内转发按钮
234 236 console.log(res.target)
... ... @@ -239,6 +241,7 @@ Page({
239 241 },
240 242  
241 243 onShareTimeline() {
  244 + getApp().globalData.no_clear=1;
242 245 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
243 246 if (!store_name)
244 247 store_name = getApp().globalData.setting.appName;
... ...
pages/user/assistance/friend_assistance.js
... ... @@ -54,6 +54,7 @@ Page({
54 54 * 生命周期函数--监听页面显示
55 55 */
56 56 onShow: function() {
  57 + getApp().check_can_share();
57 58 //--先判断会员状态--
58 59 var user_info = getApp().globalData.userInfo;
59 60 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
... ... @@ -171,7 +172,7 @@ Page({
171 172 * 用户点击右上角分享
172 173 */
173 174 onShareAppMessage: function() {
174   -
  175 + getApp().globalData.no_clear=1;
175 176 },
176 177  
177 178 })
... ...
pages/user/assistance/task_assistance.js
... ... @@ -147,7 +147,7 @@ Page({
147 147 * 生命周期函数--监听页面显示
148 148 */
149 149 onShow: function () {
150   -
  150 + getApp().check_can_share();
151 151 //--先判断会员状态--
152 152 var user_info = getApp().globalData.userInfo;
153 153 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
... ... @@ -671,13 +671,14 @@ Page({
671 671 /**
672 672 * 用户点击右上角分享
673 673 */
674   - onShareAppMessage: function () {
  674 + onShareAppMessage: function () { getApp().globalData.no_clear=1
675 675  
676 676 },
677 677  
678 678 preview: function () {
679 679 var th = this;
680 680 var shareImgPath = th.data.shareImgPath;
  681 + getApp().globalData.no_clear=1;
681 682 wx.previewImage({
682 683 url: shareImgPath[0],
683 684 urls: shareImgPath
... ... @@ -920,6 +921,7 @@ Page({
920 921 preview: function () {
921 922 var th = this;
922 923 var shareImgPath = th.data.shareImgPath;
  924 + getApp().globalData.no_clear=1;
923 925 wx.previewImage({
924 926 url: shareImgPath[0],
925 927 urls: shareImgPath
... ...
pages/user/cardinfo/cardinfo.js
... ... @@ -324,12 +324,11 @@ Page({
324 324 */
325 325 saveImageToPhotosAlbum: function () {
326 326 if (this.data.imagePath != "") {
327   - wx.previewImage({
328   - urls: [this.data.imagePath],
329   - })
  327 + getApp().pre_img(this.data.imagePath);
330 328 return;
331 329 }
332   - // if(this.data.is_loading) return false ;
  330 +
  331 + //if(this.data.is_loading) return false ;
333 332 this.data.is_loading=1;
334 333  
335 334 wx.showLoading({
... ... @@ -607,9 +606,7 @@ Page({
607 606 maskHidden: false,
608 607 canvasHidden: true
609 608 });
610   - wx.previewImage({
611   - urls: [res.tempFilePath],
612   - })
  609 + getApp().pre_img(res.tempFilePath);
613 610 if (!res.tempFilePath) {
614 611 wx.showModal({
615 612 title: '提示',
... ...
pages/user/cardinfo/cardinfo.wxml
... ... @@ -19,16 +19,16 @@
19 19 </view>
20 20  
21 21 <view>
22   - <view bindtap="xufei" class="renew fs28" style="background:{{user_card.CardColor}}">立即续费</view>
  22 + <view bindtap="xufei" class="renew fs28" style="background:{{user_card.CardColor}};color:{{user_card.ButtonColor}}">立即续费</view>
23 23 <!-- 判断是不是过期,显示变更按钮,但是要看是不是多件 -->
24 24 <block wx:if="{{is_guoqi}}">
25   - <view wx:if="{{buy_list.length>0}}" bindtap="show_change" class="renew fs28" style="background:{{user_card.CardColor}}">卡类变更</view>
  25 + <view wx:if="{{buy_list.length>0}}" bindtap="show_change" class="renew fs28" style="background:{{user_card.CardColor}};color:{{user_card.ButtonColor}}">卡类变更</view>
26 26 </block>
27 27 <block wx:else>
28 28 <!-- 要判断是不是最高级的卡 -->
29   - <view wx:if="{{cardid!=big_card.CardId}}" bindtap="show_change" class="renew fs28" style="background:{{user_card.CardColor}}">卡类升级</view>
  29 + <view wx:if="{{cardid!=big_card.CardId}}" bindtap="show_change" class="renew fs28" style="background:{{user_card.CardColor}};color:{{user_card.ButtonColor}}">卡类升级</view>
30 30 </block>
31   - <view bindtap="goto" class="renew fs28" style="background:{{user_card.CardColor}}" data-url="/packageB/pages/user/buyDetails/buyDetails">购卡明细</view>
  31 + <view bindtap="goto" class="renew fs28" style="background:{{user_card.CardColor}};color:{{user_card.ButtonColor}}" data-url="/packageB/pages/user/buyDetails/buyDetails">购卡明细</view>
32 32 </view>
33 33  
34 34  
... ...
pages/user/deposit/prepaid/msg/msg.js
... ... @@ -30,7 +30,7 @@ Page({
30 30 * 生命周期函数--监听页面显示
31 31 */
32 32 onShow: function () {
33   -
  33 + getApp().check_can_share();
34 34 wx.setNavigationBarTitle({
35 35 title: "支付成功",
36 36 })
... ... @@ -105,7 +105,7 @@ Page({
105 105 /**
106 106 * 用户点击右上角分享
107 107 */
108   - onShareAppMessage: function () {
  108 + onShareAppMessage: function () { getApp().globalData.no_clear=1
109 109  
110 110 }
111 111 })
112 112 \ No newline at end of file
... ...
pages/user/index/filter.wxs
... ... @@ -17,6 +17,8 @@ var is_close = function (name,c_list) {
17 17 map['助力活动']="15";
18 18 map['充值有礼']="16";
19 19 map['幸运大转盘']="17";
  20 + map['幸运购']="18";
  21 + map['AI测肤']="20";
20 22 var index=map[name];
21 23  
22 24 //我的权益要判断5,和11
... ...
pages/user/index/index.js
... ... @@ -11,6 +11,7 @@ const {
11 11 qrcode
12 12 } = require('../../../utils/index.js');
13 13 var ut = require("../../../utils/util.js");
  14 +let self = null;
14 15  
15 16 Page({
16 17 /**
... ... @@ -44,7 +45,7 @@ Page({
44 45 ad_img:"",
45 46 add_card_data:'', //等级卡的内容
46 47  
47   -
  48 + hiddenCS: true,
48 49 },
49 50 goto_nav: function(e) {
50 51 var th = this;
... ... @@ -60,7 +61,8 @@ Page({
60 61 /**
61 62 * 生命周期函数--监听页面加载
62 63 */
63   - onLoad: function(options) {
  64 + onLoad: function(options) {
  65 + self = this;
64 66 var th=this;
65 67 getApp().request.get("/api/weshop/ad/page?pid=401&store_id=" + os.stoid, {
66 68 data: {
... ... @@ -82,6 +84,7 @@ Page({
82 84 * 生命周期函数--监听页面显示
83 85 */
84 86 onShow: function() {
  87 + getApp().check_can_share();
85 88 //看一下小程序是不是过期了
86 89 getApp().getConfig2(function(config2){
87 90 if(config2 && config2.is_overdue==1){
... ... @@ -502,7 +505,7 @@ Page({
502 505 /**
503 506 * 用户点击右上角分享
504 507 */
505   - onShareAppMessage: function() {},
  508 + onShareAppMessage: function() { getApp().globalData.no_clear=1; },
506 509  
507 510 //------卡片的显示和关闭--------
508 511 show_tc: function() {
... ... @@ -703,26 +706,44 @@ Page({
703 706  
704 707 //---------联系客服------------
705 708 contactService: function() {
706   - var s = getApp();
707   - s.getConfig(function(t) {
708   - if (t.store_tel == undefined) {
709   - getApp().request.get("/api/weshop/store/get/" + os.stoid, {
710   - isShowLoading: 1,
711   - data: {},
712   - success: function(rs) {
713   - getApp().globalData.config = rs.data.data;
714   - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
715   - getApp().showWarning("商家未设置电话");
716   - return false;
717   - }
718   - s.confirmBox("请联系客服:" + rs.data.data.store_tel);
719   - }
720   - })
721   - } else {
722   - s.confirmBox("请联系客服:" + t.store_tel);
723   - }
724   - });
725   - },
  709 + getApp().com_call(this);
  710 + },
  711 +
  712 + // 获取客服热线
  713 + getTel() {
  714 + return new Promise((resolve, reject) => {
  715 + var self = this;
  716 + var s = getApp();
  717 + s.getConfig(function(t) {
  718 + if (t.store_tel == undefined) {
  719 + getApp().request.get("/api/weshop/store/get/" + os.stoid, {
  720 + isShowLoading: 1,
  721 + data: {},
  722 + success: function(rs) {
  723 + getApp().globalData.config = rs.data.data;
  724 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  725 + getApp().showWarning("商家未设置电话");
  726 + return false;
  727 + } else {
  728 + self.setData({
  729 + store_tel: rs.data.data.store_tel,
  730 + });
  731 + // s.confirmBox("客服热线:" + rs.data.data.store_tel);
  732 + };
  733 +
  734 + }
  735 + })
  736 + } else {
  737 + self.setData({
  738 + store_tel: t.store_tel,
  739 + });
  740 + // s.confirmBox("客服热线:" + t.store_tel);
  741 + }
  742 + resolve();
  743 + });
  744 + });
  745 + },
  746 +
726 747  
727 748 go_info: function() {
728 749 getApp().goto("/pages/user/userinfo/userinfo");
... ... @@ -859,13 +880,7 @@ Page({
859 880 },
860 881  
861 882 con_weixin:function () {
862   - var url=this.data.sys_switch.weapp_customertype_url;
863   - var id=this.data.sys_switch.weapp_customertype_appid;
864   - wx.openCustomerServiceChat({
865   - extInfo: {url: url},
866   - corpId: id,
867   - success(res) {}
868   - })
  883 + getApp().con_wx(this);
869 884 },
870 885  
871 886 //初始话按钮图标
... ... @@ -902,7 +917,50 @@ Page({
902 917 }
903 918 })
904 919 this.setData({user_tool:d_list});
905   - }
  920 + },
  921 +
  922 +
  923 + click_contact:function () {
  924 + getApp().globalData.no_clear=1;
  925 + },
  926 +
  927 + //打开客服操作菜单
  928 + openCS() {
  929 + // 判断会员状态
  930 + let user_info = getApp().globalData.userInfo;
  931 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) {
  932 + wx.navigateTo({
  933 + url: '/pages/togoin/togoin',
  934 + })
  935 + return false;
  936 + };
  937 + // csType/在线客服设置:
  938 + // 0关闭(如果有设置热线电话,则显示拨打热线电话)、
  939 + // 1小程序客服、
  940 + // 2企业微信客服
  941 + if(this.data.sys_switch) {
  942 + let csType = this.data.sys_switch.weapp_customertype;
  943 + if(csType == 0) {
  944 + // 拨打电话号码
  945 + this.contactService();
  946 + } else {
  947 + this.getTel()
  948 + .then(() => {
  949 + self.setData({
  950 + hiddenCS: false,
  951 + });
  952 + });
  953 + };
  954 + };
  955 +
  956 + },
  957 +
  958 + //关闭客服操作菜单
  959 + closeCS() {
  960 + this.setData({
  961 + hiddenCS: true,
  962 + });
  963 + },
906 964  
907 965  
908 966  
... ...
pages/user/index/index.wxml
... ... @@ -261,7 +261,7 @@
261 261 <!-- 没有链接地址的时候 -->
262 262 <block wx:else>
263 263 <block wx:if="{{item.name=='联系客服'}}">
264   - <button class="item t-c" wx:if="{{sys_switch.weapp_customertype==1}}" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
  264 + <!-- <button class="item t-c" wx:if="{{sys_switch.weapp_customertype==1}}" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
265 265 <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
266 266 <view class="fs26">联系客服</view>
267 267 </button>
... ... @@ -274,7 +274,12 @@
274 274 <view class="item t-c" bindtap="contactService" wx:else>
275 275 <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
276 276 <view class="fs26">联系客服</view>
277   - </view>
  277 + </view> -->
  278 +
  279 + <view class="item t-c" bindtap="openCS">
  280 + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
  281 + <view class="fs26">联系客服</view>
  282 + </view>
278 283  
279 284 </block>
280 285 <block wx:elif="{{item.name=='收入卡包'}}">
... ... @@ -346,4 +351,7 @@
346 351 </view>
347 352 </view>
348 353  
349   -<pop_txt id="pop_txt"></pop_txt>
350 354 \ No newline at end of file
  355 +<pop_txt id="pop_txt"></pop_txt>
  356 +
  357 +
  358 +<include src="../../../components/com_servicer/com_servicer.wxml"/>
... ...
pages/user/index/index.wxss
... ... @@ -739,4 +739,13 @@ button::after{ border: 0}
739 739  
740 740 .c-5 {
741 741 color: #555;
742   -}
743 742 \ No newline at end of file
  743 +}
  744 +
  745 +
  746 +
  747 +.action .icon-guan {
  748 + left: auto !important;
  749 + right: 20rpx !important;
  750 +}
  751 +
  752 +
... ...
pages/user/integral/integral.js
... ... @@ -307,6 +307,7 @@ Page({
307 307 * 生命周期函数--监听页面显示
308 308 */
309 309 onShow: function () {
  310 + getApp().check_can_share();
310 311 //--先判断会员状态--
311 312 var user_info = getApp().globalData.userInfo;
312 313 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
... ... @@ -350,7 +351,7 @@ Page({
350 351 /**
351 352 * 用户点击右上角分享
352 353 */
353   - onShareAppMessage: function () {
  354 + onShareAppMessage: function () { getApp().globalData.no_clear=1
354 355  
355 356 },
356 357  
... ...
pages/user/integral/msg/msg.js
... ... @@ -30,6 +30,7 @@ Page({
30 30 * 生命周期函数--监听页面显示
31 31 */
32 32 onShow: function () {
  33 + getApp().check_can_share();
33 34  
34 35 wx.setNavigationBarTitle({
35 36 title: "支付成功",
... ... @@ -104,7 +105,7 @@ Page({
104 105 /**
105 106 * 用户点击右上角分享
106 107 */
107   - onShareAppMessage: function () {
  108 + onShareAppMessage: function () { getApp().globalData.no_clear=1
108 109  
109 110 }
110 111 })
111 112 \ No newline at end of file
... ...
pages/user/member/bring/bring.js
... ... @@ -328,6 +328,7 @@ Page({
328 328 * 生命周期函数--监听页面显示
329 329 */
330 330 onShow: function() {
  331 + getApp().check_can_share();
331 332 var th=this;
332 333 this.weixin();
333 334 this.setData({
... ... @@ -407,6 +408,6 @@ Page({
407 408 * 用户点击右上角分享
408 409 */
409 410 onShareAppMessage: function() {
410   -
  411 + getApp().globalData.no_clear=1;
411 412 }
412 413 })
413 414 \ No newline at end of file
... ...
pages/user/member/bring/msg/msg.js
... ... @@ -30,6 +30,7 @@ Page({
30 30 * 生命周期函数--监听页面显示
31 31 */
32 32 onShow: function () {
  33 + getApp().check_can_share();
33 34 this.countDown();
34 35 },
35 36 countDown: function () {
... ... @@ -99,7 +100,7 @@ Page({
99 100 /**
100 101 * 用户点击右上角分享
101 102 */
102   - onShareAppMessage: function () {
  103 + onShareAppMessage: function () { getApp().globalData.no_clear=1
103 104  
104 105 }
105 106 })
106 107 \ No newline at end of file
... ...
pages/user/member/menber.js
... ... @@ -20,6 +20,7 @@ Page({
20 20 * 生命周期函数--监听页面显示
21 21 */
22 22 onShow: function () {
  23 + getApp().check_can_share();
23 24 var th=this;
24 25 //--先判断会员状态--
25 26 var user_info = getApp().globalData.userInfo;
... ... @@ -154,7 +155,7 @@ Page({
154 155 /**
155 156 * 用户点击右上角分享
156 157 */
157   - onShareAppMessage: function () {
  158 + onShareAppMessage: function () { getApp().globalData.no_clear=1
158 159  
159 160 }
160 161 })
161 162 \ No newline at end of file
... ...
pages/user/my_service/beauty_deta.js
... ... @@ -393,6 +393,7 @@ Page({
393 393 previewImage: function (e) {
394 394 var th = this;
395 395 var current = e.currentTarget.dataset.src;
  396 + getApp().globalData.no_clear=1;
396 397 wx.previewImage({
397 398 current: current, // 当前显示图片的http链接
398 399 urls: [th.data.head_img] // 需要预览的图片http链接列表
... ...
pages/user/order_detail/order_detail.js
... ... @@ -253,24 +253,7 @@ Page({
253 253 },
254 254 /*-----联系客户------*/
255 255 contactService: function() {
256   - e.getConfig(function(t) {
257   - if (t.store_tel == undefined) {
258   - getApp().request.get("/api/weshop/store/get/" + os.stoid, {
259   - isShowLoading: 1,
260   - data: {},
261   - success: function (rs) {
262   - getApp().globalData.config = rs.data.data;
263   - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
264   - getApp().showWarning("商家未设置电话");
265   - return false;
266   - }
267   - e.confirmBox("请联系客服:" + rs.data.data.store_tel);
268   - }
269   - })
270   - } else {
271   - e.confirmBox("请联系客服:" + t.store_tel);
272   - }
273   - });
  256 + getApp().con_Service();
274 257 },
275 258  
276 259 //--------取消订单---------
... ... @@ -1632,13 +1615,7 @@ Page({
1632 1615 },
1633 1616  
1634 1617 con_weixin:function () {
1635   - var url=this.data.sys_switch.weapp_customertype_url;
1636   - var id=this.data.sys_switch.weapp_customertype_appid;
1637   - wx.openCustomerServiceChat({
1638   - extInfo: {url: url},
1639   - corpId: id,
1640   - success(res) {}
1641   - })
  1618 + getApp().con_wx(this);
1642 1619 },
1643 1620  
1644 1621 //跳转到商品
... ... @@ -1675,6 +1652,12 @@ Page({
1675 1652 getApp().goto(good_url);
1676 1653 }
1677 1654 })
  1655 + },
  1656 +
  1657 +
  1658 +
  1659 + click_contact:function () {
  1660 + getApp().globalData.no_clear=1;
1678 1661 }
1679 1662  
1680 1663  
... ...
pages/user/order_detail/order_detail.wxml
... ... @@ -54,7 +54,7 @@
54 54 <view bindtap="checkTeam" class="contact-us check-btn" wx:if="{{optionIsGoup}}">查看拼团详情</view>
55 55 <view>
56 56  
57   - <button wx:if="{{sys_switch.weapp_customertype==1}}" class="contact-us goods-btn" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">联系客服</button>
  57 + <button wx:if="{{sys_switch.weapp_customertype==1}}" class="contact-us goods-btn" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">联系客服</button>
58 58  
59 59 <view wx:elif="{{sys_switch.weapp_customertype==2}}" bindtap="con_weixin" class="contact-us goods-btn">联系客服</view>
60 60 <view wx:else bindtap="contactService" class="contact-us goods-btn">联系客服</view>
... ... @@ -77,7 +77,10 @@
77 77  
78 78 <view class="item" wx:if="{{order.order_prom_type!=5}}">
79 79 <view>配送方式</view>
80   - <view>{{(order.shipping_name!=''&& order.shipping_name!=null) ?order.shipping_name:'自提'}}</view>
  80 + <view wx:if="{{order.pt_status<4 && order.is_zsorder==4}}">
  81 + --
  82 + </view>
  83 + <view wx:else>{{(order.shipping_name!=''&& order.shipping_name!=null) ?order.shipping_name:'自提'}}</view>
81 84 </view>
82 85 <view class="item">
83 86 <view>买家留言</view>
... ...
pages/user/order_list/order_list.js
... ... @@ -2258,7 +2258,7 @@ Page({
2258 2258 //------调起支付框--------
2259 2259 weixinPay: function(n, success, fail) {
2260 2260 if (!n) return false;
2261   - let order_id = item.order_id;
  2261 + // let order_id = item.order_id;
2262 2262 wx.requestPayment({
2263 2263 timeStamp: String(n.timeStamp),
2264 2264 nonceStr: n.nonceStr,
... ...
pages/user/plus/plus.wxml
... ... @@ -23,7 +23,7 @@
23 23 <view class="fs36">{{item.CardName}}</view>
24 24 <view class="fs24 Membership_remarks">开通会员卡仅{{item.CardFee}}元</view>
25 25 </view>
26   - <view class="Opening fs28 xc-black" data-ind="{{index}}" style="background:{{item.CardColor}}" bindtap="Opening">立即购买
  26 + <view class="Opening fs28 xc-black" data-ind="{{index}}" style="background:{{item.CardColor}};color:{{item.ButtonColor}}" bindtap="Opening">立即购买
27 27 </view>
28 28  
29 29 </view>
... ...
pages/user/return_goods_info/return_goods_info.js
... ... @@ -158,6 +158,7 @@ Page({
158 158 },
159 159 previewImgs: function(e) {
160 160 var t = this, r = this.data.return_goods.imgs;
  161 + getApp().globalData.no_clear=1;
161 162 r = r.map(function(e) {
162 163 return t.data.url + e;
163 164 }), wx.previewImage({
... ...
pages/user/user_spsy/user_spsy.js
... ... @@ -41,8 +41,7 @@ Page({
41 41 * 生命周期函数--监听页面显示
42 42 */
43 43 onShow: function () {
44   -
45   -
  44 + getApp().check_can_share();
46 45 },
47 46 async getQrCode(FormId,GradeId) {
48 47 const res = await getApp().request.promiseGet("/api/weshop/users/grade/wares/code/get", {
... ... @@ -116,7 +115,7 @@ Page({
116 115 /**
117 116 * 用户点击右上角分享
118 117 */
119   - onShareAppMessage: function () {
  118 + onShareAppMessage: function () { getApp().globalData.no_clear=1
120 119  
121 120 },
122 121  
... ...
pages/user/userinfo/userinfo.js
... ... @@ -740,6 +740,7 @@ Page({
740 740 },
741 741  
742 742 onShow: function() {
  743 + getApp().check_can_share();
743 744 var e = this;
744 745 if (this.data.is_zy) return false;
745 746 this.wait_for_store_config();
... ... @@ -834,6 +835,7 @@ Page({
834 835 changeAvatar: function() {
835 836 return false;
836 837 var r = this;
  838 + getApp().globalData.no_clear=1;
837 839 wx.chooseImage({
838 840 count: 1,
839 841 sizeType: ["compressed", "original"],
... ... @@ -996,6 +998,7 @@ Page({
996 998  
997 999 //--点击分享事件---
998 1000 onShareAppMessage: function(t) {
  1001 + getApp().globalData.no_clear=1;
999 1002 return o.share;
1000 1003 },
1001 1004  
... ...
pages/user/userqy/userqy.js
... ... @@ -53,6 +53,7 @@ Page({
53 53 * 生命周期函数--监听页面显示
54 54 */
55 55 onShow: async function () {
  56 + getApp().check_can_share();
56 57 wx.showLoading();
57 58 var cz_val=0,backClass=null,qy_list=null,gradeId=null,gradeEndDate=null,need_money=0,g_qy_list=null,GradeName='',cur_g_num=0;
58 59 var gl_data=getApp().globalData;
... ... @@ -158,7 +159,7 @@ Page({
158 159 /**
159 160 * 用户点击右上角分享
160 161 */
161   - onShareAppMessage: function () {
  162 + onShareAppMessage: function () { getApp().globalData.no_clear=1
162 163  
163 164 },
164 165 //--新品使用--
... ...
pages/user/userqy/userqy.wxml
... ... @@ -29,10 +29,10 @@
29 29 <view class='li rel'>
30 30 <image class="vip-img li1 {{currentItemId == index ? 'selected' : ''}}" src="{{item.ImageUrl}}">
31 31 <image class="vip-huangguan abs " src="{{iurl}}/miniapp/images/userqy/user_userqy_huang.png"> </image>
32   - <view class="white emerald abs">{{item.GradeName}}</view>
  32 + <view class="white emerald abs" style="color:#{{item.FontColor}};">{{item.GradeName}}</view>
33 33  
34 34 <!-- 上部分的文字判断 -->
35   - <view class=" abs white discounts four-level-word" wx:if="{{cz_val<item.BuyGradeSum && gradeId!=item.Id}}">
  35 + <view class=" abs white discounts four-level-word" wx:if="{{cz_val<item.BuyGradeSum && gradeId!=item.Id}}" style="color:#{{item.FontColor}};">
36 36 <block wx:if="{{index!=backClass.length-1}}">
37 37 [{{item.GradeName}}]365天累计成长值≥{{backClass[index+1].BuyGradeSum }}可升级[{{ backClass[index+1].GradeName}}]
38 38 </block>
... ... @@ -40,21 +40,21 @@
40 40 [{{item.GradeName}}]365天累计成长值≥{{item.BuyGradeSum }}可保级
41 41 </block>
42 42 </view>
43   - <view class=" abs white discounts four-level-word" wx:if="{{gradeId==item.Id}}">会员将在{{filter.replace_time2(gradeEndDate)}}到期,<text wx:if="{{need_money>0}}">365天累计成长值≥{{need_money}}可升级[{{ backClass[index+1].GradeName}}]</text><text wx:else >[{{item.GradeName}}]365天累计成长值≥{{item.BuyGradeSum}}可保级</text>
  43 + <view class=" abs white discounts four-level-word" wx:if="{{gradeId==item.Id}}" style="color:#{{item.FontColor}};">会员将在{{filter.replace_time2(gradeEndDate)}}到期,<text wx:if="{{need_money>0}}">365天累计成长值≥{{need_money}}可升级[{{ backClass[index+1].GradeName}}]</text><text wx:else >[{{item.GradeName}}]365天累计成长值≥{{item.BuyGradeSum}}可保级</text>
44 44 </view>
45   - <view class=" abs white discounts four-level-word" wx:if="{{gradeId!=item.Id && cz_val>item.BuyGradeSum }}">
  45 + <view class=" abs white discounts four-level-word" wx:if="{{gradeId!=item.Id && cz_val>item.BuyGradeSum }}" style="color:#{{item.FontColor}};">
46 46 [{{item.GradeName}}]365天累计成长值≥{{backClass[index+1].BuyGradeSum }}可升级[{{ backClass[index+1].GradeName}}]
47 47 </view>
48 48  
49 49 <!-- 下部分的文字判断 -->
50   - <view wx:if="{{cz_val>item.BuyGradeSum && gradeId!=item.Id }}" class=" abs white money four-level-word">
  50 + <view wx:if="{{cz_val>item.BuyGradeSum && gradeId!=item.Id }}" class=" abs white money four-level-word" style="color:#{{item.FontColor}};">
51 51 加入会员尽享优惠
52 52 </view>
53 53  
54   - <view wx:if="{{cz_val<item.BuyGradeSum && gradeId!=item.Id }}" class=" abs white money four-level-word">
  54 + <view wx:if="{{cz_val<item.BuyGradeSum && gradeId!=item.Id }}" class=" abs white money four-level-word" style="color:#{{item.FontColor}};">
55 55 距离{{item.GradeName}}还需{{ filter.pInt(item.BuyGradeSum-cz_val)}}成长值
56 56 </view>
57   - <view wx:if="{{gradeId==item.Id}}" class=" abs white money four-level-word new curword">
  57 + <view wx:if="{{gradeId==item.Id}}" class=" abs white money four-level-word new curword" style="color:#{{item.FontColor}};">
58 58 <view class="rel">
59 59 <view class='text'></view>
60 60 <text class='text2 abs'>您当前是此会员</text>
... ...
utils/selectFiles.js
1 1 module.exports = {
2 2 selectPhotos: function(e, s, o) {
  3 + getApp().globalData.no_clear=1;
3 4 if (void 0 === e[s]) {
4 5 var c = 5 - e.length;
5 6 c > 0 && wx.chooseImage({
... ...
utils/wxParse/html2json.js
... ... @@ -54,6 +54,8 @@ module.exports = {
54 54 e;
55 55 }, {})), "img" === s.tag) {
56 56 s.imgIndex = i.images.length;
  57 + if(!s.attr) return false;
  58 + if(!s.attr.src) return false;
57 59 var d = s.attr.src;
58 60 "" == d[0] && d.splice(0, 1), d = l.urlToHttpUrl(d, n), s.attr.src = d, s.from = a,
59 61 i.images.push(s), i.imageUrls.push(d);
... ...
utils/wxParse/wxParse.js
... ... @@ -16,6 +16,7 @@ function t(e, t, a) {
16 16 function a(e) {
17 17 var t = this, a = e.target.dataset.src, i = e.target.dataset.from;
18 18 t.data.show_prew_img=1;
  19 + getApp().globalData.no_clear=1;
19 20 void 0 !== i && i.length > 0 && wx.previewImage({
20 21 current: a,
21 22 urls: t.data[i].imageUrls,
... ...