Merged
Merge Request #978 · created by 后端研发-苏明海


Dev


From dev into test

Merged by 后端研发-苏明海

1 participants












Too many changes.

To preserve performance only 100 of 150 files are displayed.

app.js
@@ -51,7 +51,7 @@ App({ @@ -51,7 +51,7 @@ App({
51 config: null, //门店参数 51 config: null, //门店参数
52 config2: null, //门店配置 52 config2: null, //门店配置
53 code: null, 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 buy_now: null, 55 buy_now: null,
56 picklist: null, //门店列表 56 picklist: null, //门店列表
57 wuliuprice: null, //物流价格表 57 wuliuprice: null, //物流价格表
@@ -205,6 +205,7 @@ App({ @@ -205,6 +205,7 @@ App({
205 this.getConfig(); 205 this.getConfig();
206 }, 206 },
207 207
  208 +
208 //---初始化第三方---- 209 //---初始化第三方----
209 initExt: function () { 210 initExt: function () {
210 var tt = t; 211 var tt = t;
@@ -671,20 +672,29 @@ App({ @@ -671,20 +672,29 @@ App({
671 672
672 //清空登录时候缓存的值 673 //清空登录时候缓存的值
673 onHide: function () { 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,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 @import './utils/weapp-icon.wxss'; 1 @import './utils/weapp-icon.wxss';
2 @import "./utils/wxParse/wxParse.wxss"; 2 @import "./utils/wxParse/wxParse.wxss";
  3 +@import './components/com_servicer/com_servicer.wxss';
3 4
4 .pdt4 { 5 .pdt4 {
5 padding-top: 4rpx; 6 padding-top: 4rpx;
@@ -743,11 +744,20 @@ background: #ffe3e2; @@ -743,11 +744,20 @@ background: #ffe3e2;
743 /* 图标字体(ty) */ 744 /* 图标字体(ty) */
744 @font-face { 745 @font-face {
745 font-family: 'iconfont'; /* Project id 2054717 */ 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 .icon-infofill:before { 761 .icon-infofill:before {
752 content: "\e6e6"; 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 \ No newline at end of file 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 \ No newline at end of file 52 \ No newline at end of file
components/diy_scan/diy_scan.js
@@ -26,6 +26,7 @@ Component({ @@ -26,6 +26,7 @@ Component({
26 //-- 扫描成功之后 -- 26 //-- 扫描成功之后 --
27 getScancode:function(){ 27 getScancode:function(){
28 var _this = this; 28 var _this = this;
  29 + getApp().globalData.no_clear=1;
29 //-- 允许从相机和相册扫码 -- 30 //-- 允许从相机和相册扫码 --
30 wx.scanCode({ 31 wx.scanCode({
31 success: (res) => { 32 success: (res) => {
components/diy_seckill/diy_seckill.js
@@ -78,23 +78,26 @@ Component({ @@ -78,23 +78,26 @@ Component({
78 // 这里是一个自定义方法 78 // 这里是一个自定义方法
79 customMethod: function () { }, 79 customMethod: function () { },
80 init: function (g_id) { 80 init: function (g_id) {
81 - var th = this, app = getApp(), goodsidlist = ""; 81 + var th = this, app = getApp(), goodsidlist = "", idlist = "";
82 if (g_id.data_type == 2) { 82 if (g_id.data_type == 2) {
83 if (g_id.data && g_id.data.length > 0) { 83 if (g_id.data && g_id.data.length > 0) {
84 //--先把商品ID串起来-- 84 //--先把商品ID串起来--
85 g_id.data.forEach(function (val, ind) { 85 g_id.data.forEach(function (val, ind) {
86 var item = {}; 86 var item = {};
87 goodsidlist += val.goodsid + ","; 87 goodsidlist += val.goodsid + ",";
  88 + idlist += val.flashid + ",";
88 }) 89 })
89 goodsidlist = ut.sub_last(goodsidlist); 90 goodsidlist = ut.sub_last(goodsidlist);
  91 + idlist = ut.sub_last(idlist);
90 92
91 var user_id=getApp().globalData.user_id; 93 var user_id=getApp().globalData.user_id;
92 if(!user_id){ user_id=0;} 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 var goodslist = res.data.data; 102 var goodslist = res.data.data;
100 //就算是添加的活动已经过期,就要用最新的进行中活动 103 //就算是添加的活动已经过期,就要用最新的进行中活动
@@ -153,16 +156,51 @@ Component({ @@ -153,16 +156,51 @@ Component({
153 for(let i in all_array){ 156 for(let i in all_array){
154 let item=all_array[i]; 157 let item=all_array[i];
155 if(item.user_price) item.price=item.user_price; 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 th.data.timer = setInterval(function () { 205 th.data.timer = setInterval(function () {
168 th.countDown2(th); 206 th.countDown2(th);
components/diy_seckill/diy_seckill.wxml
@@ -16,17 +16,17 @@ @@ -16,17 +16,17 @@
16 <swiper-item class="s_it" wx:for="{{goods_array}}"> 16 <swiper-item class="s_it" wx:for="{{goods_array}}">
17 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> 17 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
18 <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> --> 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 <view class='one'> 20 <view class='one'>
21 <view class='sp_top'> 21 <view class='sp_top'>
22 <view class='po'></view> 22 <view class='po'></view>
23 - <block wx:if="{{aitem.start_time>newTime}}"> 23 + <block wx:if="{{aitem.status == 0}}">
24 <view class="rob" style="justify-content: flex-start"> 24 <view class="rob" style="justify-content: flex-start">
25 <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span> 25 <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span>
26 </view> 26 </view>
27 </block> 27 </block>
28 28
29 - <block wx:if="{{aitem.end_time<=newTime}}"> 29 + <!-- <block wx:if="{{aitem.end_time<=newTime}}">
30 <view class="rob" style="justify-content: flex-start"> 30 <view class="rob" style="justify-content: flex-start">
31 <span class='s_top_kill gray'>活动已结束</span> 31 <span class='s_top_kill gray'>活动已结束</span>
32 </view> 32 </view>
@@ -42,7 +42,24 @@ @@ -42,7 +42,24 @@
42 <span class='s_top_kill gray'>已抢光</span> 42 <span class='s_top_kill gray'>已抢光</span>
43 </view> 43 </view>
44 </block> 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 </block> 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,7 +98,7 @@
81 <block wx:for="{{goods_array}}"> 98 <block wx:for="{{goods_array}}">
82 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> 99 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
83 <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> --> 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 <view class='one1'> 102 <view class='one1'>
86 103
87 <view class="o1_img"> 104 <view class="o1_img">
@@ -101,25 +118,25 @@ @@ -101,25 +118,25 @@
101 <view class='sp_jg'>¥{{aitem.price}}</view> 118 <view class='sp_jg'>¥{{aitem.price}}</view>
102 <view class='sp_jgx'>¥{{aitem.market_price}}</view> 119 <view class='sp_jgx'>¥{{aitem.market_price}}</view>
103 </view> 120 </view>
104 - <block wx:if="{{aitem.start_time>newTime}}"> 121 + <block wx:if="{{aitem.status == 0}}">
105 <view class="rob"> 122 <view class="rob">
106 <view class="wo" style="background-color: #adadad">正在预热</view> 123 <view class="wo" style="background-color: #adadad">正在预热</view>
107 </view> 124 </view>
108 </block> 125 </block>
109 126
110 - <block wx:if="{{aitem.end_time<newTime}}"> 127 + <block wx:if="{{aitem.status == 3}}">
111 <view class="rob"> 128 <view class="rob">
112 <view class="wo" style="background-color: #adadad">已结束</view> 129 <view class="wo" style="background-color: #adadad">已结束</view>
113 </view> 130 </view>
114 </block> 131 </block>
115 <block wx:else> 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 <view class="rob"> 134 <view class="rob">
118 <view class="wo">我要抢</view> 135 <view class="wo">我要抢</view>
119 </view> 136 </view>
120 </block> 137 </block>
121 138
122 - <block wx:if="{{aitem.goods_num<=aitem.buy_num}}"> 139 + <block wx:if="{{aitem.status == 2}}">
123 <view class="rob"> 140 <view class="rob">
124 <view class="wo" style="background-color: #adadad">已抢光</view> 141 <view class="wo" style="background-color: #adadad">已抢光</view>
125 </view> 142 </view>
components/diy_service/diy_service.js
@@ -38,35 +38,16 @@ Component({ @@ -38,35 +38,16 @@ Component({
38 38
39 //---------联系客服------------ 39 //---------联系客服------------
40 contactService: function() { 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 con_weixin:function () { 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,7 +8,7 @@
8 </view> 8 </view>
9 </view> 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 <view style="text-align: center;"> 12 <view style="text-align: center;">
13 <image class="cs-img" src="{{object.img}}"></image> 13 <image class="cs-img" src="{{object.img}}"></image>
14 <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view> 14 <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view>
components/nav_b/nav_b.wxss
@@ -26,6 +26,9 @@ @@ -26,6 +26,9 @@
26 color: #ffff; 26 color: #ffff;
27 font-size: 50rpx; 27 font-size: 50rpx;
28 background: none; 28 background: none;
  29 + display: flex;
  30 + justify-content: center;
  31 + align-items: center;
29 } 32 }
30 33
31 .box_main .dian image { 34 .box_main .dian image {
packageA/pages/activity_share/activity_share.js
@@ -125,7 +125,7 @@ Page({ @@ -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,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 if(th.data.currentIndex==3) { 149 if(th.data.currentIndex==3) {
149 var lbid=th.data.hui_active.lbId; 150 var lbid=th.data.hui_active.lbId;
@@ -1054,10 +1055,8 @@ Page({ @@ -1054,10 +1055,8 @@ Page({
1054 }) 1055 })
1055 return false; 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 th.setData({share_good:null}); 1061 th.setData({share_good:null});
1063 1062
packageA/pages/addCustomer/addCustomer.js
@@ -26,7 +26,7 @@ Page({ @@ -26,7 +26,7 @@ Page({
26 * 生命周期函数--监听页面显示 26 * 生命周期函数--监听页面显示
27 */ 27 */
28 onShow: function () { 28 onShow: function () {
29 - 29 + getApp().check_can_share();
30 }, 30 },
31 31
32 /** 32 /**
@@ -60,7 +60,7 @@ Page({ @@ -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 \ No newline at end of file 67 \ No newline at end of file
packageA/pages/cardDetails/cardDetails.js
@@ -39,6 +39,7 @@ Page({ @@ -39,6 +39,7 @@ Page({
39 * 生命周期函数--监听页面显示 39 * 生命周期函数--监听页面显示
40 */ 40 */
41 onShow: function () { 41 onShow: function () {
  42 + getApp().check_can_share();
42 if(app.globalData.userInfo) { 43 if(app.globalData.userInfo) {
43 if(!this.data.isLogin) { 44 if(!this.data.isLogin) {
44 this.setData({ 45 this.setData({
@@ -92,7 +93,7 @@ Page({ @@ -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 \ No newline at end of file 100 \ No newline at end of file
packageA/pages/cardList/cardList.js
@@ -52,6 +52,7 @@ Page({ @@ -52,6 +52,7 @@ Page({
52 * 生命周期函数--监听页面显示 52 * 生命周期函数--监听页面显示
53 */ 53 */
54 onShow: function () { 54 onShow: function () {
  55 + getApp().check_can_share();
55 let url = '/api/weshop/serviceCard/page'; 56 let url = '/api/weshop/serviceCard/page';
56 let currentQuery = this.data.currentQuery; 57 let currentQuery = this.data.currentQuery;
57 if(app.globalData.userInfo) { 58 if(app.globalData.userInfo) {
@@ -134,7 +135,7 @@ Page({ @@ -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,7 +29,7 @@
29 </block> 29 </block>
30 <!-- 一列和俩列 --> 30 <!-- 一列和俩列 -->
31 <block wx:else> 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 <!-- 1列 2列 --> 33 <!-- 1列 2列 -->
34 <view wx:for="{{list.pageData}}" class="{{object.column=='1'?'w100':'w50'}} {{index%2==1?'ml':''}} bg-white" 34 <view wx:for="{{list.pageData}}" class="{{object.column=='1'?'w100':'w50'}} {{index%2==1?'ml':''}} bg-white"
35 bindtap="go_goods" data-gid="{{item.id}}" 35 bindtap="go_goods" data-gid="{{item.id}}"
packageA/pages/cart2_ser/cart2_ser.js
@@ -484,6 +484,8 @@ Page({ @@ -484,6 +484,8 @@ Page({
484 'price': gg.money, 484 'price': gg.money,
485 'pickup_id': gg.pick_id, 485 'pickup_id': gg.pick_id,
486 'pickup_keyid': list[i].keyid, 486 'pickup_keyid': list[i].keyid,
  487 + 'prom_type': gg.prom_type, //促销活动类型
  488 + 'prom_id': gg.prom_id, //促销活动id
487 }; 489 };
488 //--导购分享过来的id-- 490 //--导购分享过来的id--
489 if (gg.guide_id) { 491 if (gg.guide_id) {
packageA/pages/chongzhi/chongzhi.js
@@ -64,7 +64,7 @@ Page({ @@ -64,7 +64,7 @@ Page({
64 * 生命周期函数--监听页面显示 64 * 生命周期函数--监听页面显示
65 */ 65 */
66 onShow: function () { 66 onShow: function () {
67 - 67 + getApp().check_can_share();
68 }, 68 },
69 69
70 /** 70 /**
@@ -106,7 +106,7 @@ Page({ @@ -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,7 +105,7 @@ Page({
105 * 生命周期函数--监听页面显示 105 * 生命周期函数--监听页面显示
106 */ 106 */
107 onShow: function () { 107 onShow: function () {
108 - 108 + getApp().check_can_share();
109 }, 109 },
110 110
111 /** 111 /**
@@ -125,7 +125,7 @@ Page({ @@ -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,7 +26,7 @@ Page({
26 * 生命周期函数--监听页面显示 26 * 生命周期函数--监听页面显示
27 */ 27 */
28 onShow: function () { 28 onShow: function () {
29 - 29 + getApp().check_can_share();
30 }, 30 },
31 31
32 /** 32 /**
@@ -60,7 +60,7 @@ Page({ @@ -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 \ No newline at end of file 67 \ No newline at end of file
packageA/pages/details_serviceCard/details_serviceCard.js
@@ -42,6 +42,7 @@ Page({ @@ -42,6 +42,7 @@ Page({
42 * 生命周期函数--监听页面显示 42 * 生命周期函数--监听页面显示
43 */ 43 */
44 onShow: function() { 44 onShow: function() {
  45 + getApp().check_can_share();
45 if (app.globalData.userInfo) { 46 if (app.globalData.userInfo) {
46 if (!this.data.isLogin) { 47 if (!this.data.isLogin) {
47 this.setData({ 48 this.setData({
@@ -112,7 +113,7 @@ Page({ @@ -112,7 +113,7 @@ Page({
112 * 用户点击右上角分享 113 * 用户点击右上角分享
113 */ 114 */
114 onShareAppMessage: function() { 115 onShareAppMessage: function() {
115 - 116 + getApp().globalData.no_clear=1
116 }, 117 },
117 118
118 119
@@ -163,6 +164,7 @@ Page({ @@ -163,6 +164,7 @@ Page({
163 164
164 // 联系微信客服 165 // 联系微信客服
165 contact_wx() { 166 contact_wx() {
  167 + getApp().globalData.no_clear=1;
166 var url = this.data.sys_switch.weapp_customertype_url; 168 var url = this.data.sys_switch.weapp_customertype_url;
167 var id = this.data.sys_switch.weapp_customertype_appid; 169 var id = this.data.sys_switch.weapp_customertype_appid;
168 wx.openCustomerServiceChat({ 170 wx.openCustomerServiceChat({
@@ -177,24 +179,7 @@ Page({ @@ -177,24 +179,7 @@ Page({
177 179
178 // 联系电话客服 180 // 联系电话客服
179 contactService() { 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,7 +283,19 @@ Page({
298 if (getApp().globalData.guide_id) { 283 if (getApp().globalData.guide_id) {
299 newd['guide_id'] = getApp().globalData.guide_id; 284 newd['guide_id'] = getApp().globalData.guide_id;
300 newd['guide_type'] = 0; 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 app.request.get("/api/weshop/cartService/page", { 301 app.request.get("/api/weshop/cartService/page", {
@@ -478,9 +475,9 @@ 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,7 +57,7 @@
57 <view class="flex t-c bdt"> 57 <view class="flex t-c bdt">
58 <!-- 客服 --> 58 <!-- 客服 -->
59 <block> 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 session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"><text class="iconfont icon-kefu c29f pdr10 fs36"></text>联系客服</button> 61 session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"><text class="iconfont icon-kefu c29f pdr10 fs36"></text>联系客服</button>
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> 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 <view class="f1 pd20" wx:else bindtap="contactService"><text class="iconfont icon-kefu c29f pdr10 fs36"></text>联系客服</view> 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,6 +38,7 @@ Page({
38 * 生命周期函数--监听页面显示 38 * 生命周期函数--监听页面显示
39 */ 39 */
40 onShow: function () { 40 onShow: function () {
  41 + getApp().check_can_share();
41 if(app.globalData.userInfo) { 42 if(app.globalData.userInfo) {
42 if(!this.data.isLogin) { 43 if(!this.data.isLogin) {
43 this.setData({ 44 this.setData({
@@ -92,7 +93,7 @@ Page({ @@ -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,6 +74,7 @@ Page({
74 * 生命周期函数--监听页面显示 74 * 生命周期函数--监听页面显示
75 */ 75 */
76 onShow: function () { 76 onShow: function () {
  77 + getApp().check_can_share();
77 78
78 if(app.globalData.userInfo) { 79 if(app.globalData.userInfo) {
79 if(!this.data.isLogin) { 80 if(!this.data.isLogin) {
@@ -149,7 +150,7 @@ Page({ @@ -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,6 +97,8 @@ Page({
97 * 生命周期函数--监听页面显示 97 * 生命周期函数--监听页面显示
98 */ 98 */
99 onShow: function () { 99 onShow: function () {
  100 +
  101 + getApp().check_can_share();
100 let url = '/api/weshop/goods/page'; 102 let url = '/api/weshop/goods/page';
101 let currentQuery = this.data.currentQuery; 103 let currentQuery = this.data.currentQuery;
102 if(app.globalData.userInfo) { 104 if(app.globalData.userInfo) {
@@ -264,7 +266,7 @@ Page({ @@ -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,6 +69,7 @@ Page({
69 * 生命周期函数--监听页面显示 69 * 生命周期函数--监听页面显示
70 */ 70 */
71 onShow: function () { 71 onShow: function () {
  72 + getApp().check_can_share();
72 if(app.globalData.userInfo) { 73 if(app.globalData.userInfo) {
73 if(!this.data.isLogin) { 74 if(!this.data.isLogin) {
74 this.setData({ 75 this.setData({
@@ -157,7 +158,7 @@ Page({ @@ -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,6 +78,7 @@ Page({
78 * 生命周期函数--监听页面显示 78 * 生命周期函数--监听页面显示
79 */ 79 */
80 onShow: function () { 80 onShow: function () {
  81 + getApp().check_can_share();
81 if(app.globalData.userInfo) { 82 if(app.globalData.userInfo) {
82 if(!this.data.isLogin) { 83 if(!this.data.isLogin) {
83 this.setData({ 84 this.setData({
@@ -141,7 +142,7 @@ Page({ @@ -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,6 +67,7 @@ Page({
67 * 生命周期函数--监听页面显示 67 * 生命周期函数--监听页面显示
68 */ 68 */
69 onShow: function () { 69 onShow: function () {
  70 + getApp().check_can_share();
70 if(app.globalData.userInfo) { 71 if(app.globalData.userInfo) {
71 if(!this.data.isLogin) { 72 if(!this.data.isLogin) {
72 this.setData({ 73 this.setData({
@@ -151,7 +152,7 @@ Page({ @@ -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,6 +58,7 @@ Page({
58 * 生命周期函数--监听页面显示 58 * 生命周期函数--监听页面显示
59 */ 59 */
60 onShow: function () { 60 onShow: function () {
  61 + getApp().check_can_share();
61 if(app.globalData.userInfo instanceof Object) { 62 if(app.globalData.userInfo instanceof Object) {
62 this.setData({ 63 this.setData({
63 userInfo: app.globalData.userInfo, 64 userInfo: app.globalData.userInfo,
@@ -112,7 +113,7 @@ Page({ @@ -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,6 +95,8 @@ Page({
95 * 生命周期函数--监听页面显示 95 * 生命周期函数--监听页面显示
96 */ 96 */
97 onShow: function () { 97 onShow: function () {
  98 + getApp().check_can_share();
  99 +
98 //自己登录的 100 //自己登录的
99 if (app.globalData.userInfo && !this.data.first_leader) { 101 if (app.globalData.userInfo && !this.data.first_leader) {
100 if (!this.data.isLogin) { 102 if (!this.data.isLogin) {
@@ -316,7 +318,7 @@ Page({ @@ -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 var th = this; 323 var th = this;
322 var title = "我的小店"; 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 \ No newline at end of file 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,6 +8,7 @@ var t = require(&quot;../../../utils/util.js&quot;),
8 oo = s.globalData, 8 oo = s.globalData,
9 o = s.globalData.setting, 9 o = s.globalData.setting,
10 os = o; 10 os = o;
  11 +
11 let self = null; 12 let self = null;
12 13
13 //评价加载更多 14 //评价加载更多
@@ -50,7 +51,7 @@ Page({ @@ -50,7 +51,7 @@ Page({
50 supportPageScroll: !1, 51 supportPageScroll: !1,
51 address: { 52 address: {
52 address: "", 53 address: "",
53 - district: 0 54 + district: 0,
54 }, 55 },
55 shipping: "", 56 shipping: "",
56 shippingCost: 0, 57 shippingCost: 0,
@@ -199,15 +200,19 @@ Page({ @@ -199,15 +200,19 @@ Page({
199 sales_rules:1, //默认是线上销售 200 sales_rules:1, //默认是线上销售
200 201
201 wait_for_user_store:null, 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 prom_r_null: 0, 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,10 +266,10 @@ Page({
261 first_leader=gid_str[1]; 266 first_leader=gid_str[1];
262 } 267 }
263 //-- 如果有room_id的获取 -- 268 //-- 如果有room_id的获取 --
264 - if(gid_str.length>2 && gid_str[2]){ 269 + if(gid_str.length>2 && gid_str[2]) {
265 room_id=gid_str[2]; 270 room_id=gid_str[2];
266 room_user_share=1; 271 room_user_share=1;
267 - } 272 + };
268 }; 273 };
269 274
270 ee.setData({ gid: gid}); 275 ee.setData({ gid: gid});
@@ -278,14 +283,15 @@ Page({ @@ -278,14 +283,15 @@ Page({
278 } 283 }
279 }) 284 })
280 } 285 }
  286 +
281 var c_guide_id=t.c_guide_id; 287 var c_guide_id=t.c_guide_id;
282 if(c_guide_id){ 288 if(c_guide_id){
283 th.data.c_guide_id=c_guide_id; 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 getApp().getConfig2(function (e) { 297 getApp().getConfig2(function (e) {
@@ -309,7 +315,7 @@ Page({ @@ -309,7 +315,7 @@ Page({
309 is_show_gb: 1 315 is_show_gb: 1
310 }); 316 });
311 } 317 }
312 - console.log(e); 318 + // console.log(e);
313 var json_d = JSON.parse(e.switch_list); 319 var json_d = JSON.parse(e.switch_list);
314 ee.setData({ 320 ee.setData({
315 store_config: e, 321 store_config: e,
@@ -318,6 +324,7 @@ Page({ @@ -318,6 +324,7 @@ Page({
318 is_newsales_rules: json_d.is_newsales_rules 324 is_newsales_rules: json_d.is_newsales_rules
319 }); 325 });
320 ee.init(gid); 326 ee.init(gid);
  327 +
321 //------几人评价------- 328 //------几人评价-------
322 //n.init(th, "", "comments"); 329 //n.init(th, "", "comments");
323 330
@@ -370,7 +377,7 @@ Page({ @@ -370,7 +377,7 @@ Page({
370 377
371 //获取用户的默认门店 378 //获取用户的默认门店
372 getApp().get_user_store(function(e) { 379 getApp().get_user_store(function(e) {
373 - if(!e) { 380 + if(!e) {
374 th.data.fir_def_store={}; //赋值空对象 381 th.data.fir_def_store={}; //赋值空对象
375 return false; 382 return false;
376 } 383 }
@@ -431,7 +438,7 @@ Page({ @@ -431,7 +438,7 @@ Page({
431 appd.lat=that.data.lat; 438 appd.lat=that.data.lat;
432 appd.lon=that.data.lon; 439 appd.lon=that.data.lon;
433 440
434 - }else{ 441 + } else {
435 if (e) { 442 if (e) {
436 e.distance = null; 443 e.distance = null;
437 that.data.fir_def_store=e; 444 that.data.fir_def_store=e;
@@ -449,14 +456,15 @@ Page({ @@ -449,14 +456,15 @@ Page({
449 456
450 }); 457 });
451 458
452 - }, 459 +
  460 + },
453 461
454 462
455 onReady() { 463 onReady() {
456 -  
457 - setTimeout(()=>{ 464 + // 用于控制保障服务折叠图标的显示
  465 + setTimeout(() => {
458 wx.createSelectorQuery().selectAll(".showArea, .hideArea").boundingClientRect(res => { 466 wx.createSelectorQuery().selectAll(".showArea, .hideArea").boundingClientRect(res => {
459 - // console.log('node@@@@@@@', res); 467 +
460 if(res.length != 0) { 468 if(res.length != 0) {
461 this.setData({ 469 this.setData({
462 showFold: res[0].height < res[1].height, 470 showFold: res[0].height < res[1].height,
@@ -517,13 +525,14 @@ Page({ @@ -517,13 +525,14 @@ Page({
517 525
518 if(prom_type) { // 进入商品详情页地址传参有带goods_id、prom_type、prom_id参数, 即从秒杀入口进入 526 if(prom_type) { // 进入商品详情页地址传参有带goods_id、prom_type、prom_id参数, 即从秒杀入口进入
519 let prom_id = this.data.options.prom_id; 527 let prom_id = this.data.options.prom_id;
  528 + // 检查活动是否开始
520 this.check_prom(goods_id, prom_type, prom_id); 529 this.check_prom(goods_id, prom_type, prom_id);
  530 +
521 } else { // 从非秒杀入口进入,地址不带prom_type、prom_id参数 531 } else { // 从非秒杀入口进入,地址不带prom_type、prom_id参数
522 - getApp().request.promiseGet('/api/weshop/activitylist/getGoodActInfo', { 532 + getApp().request.promiseGet('/api/weshop/activitylist/listGoodActInfo2', {
523 data: { 533 data: {
524 store_id: os.stoid, 534 store_id: os.stoid,
525 - goodsidlist: goods_id,  
526 - is_detail: 1, 535 + goods_id: goods_id,
527 goods_type: 1, 536 goods_type: 1,
528 user_id: oo.user_id, 537 user_id: oo.user_id,
529 } 538 }
@@ -537,20 +546,16 @@ Page({ @@ -537,20 +546,16 @@ Page({
537 let prom_id = result[0].act_id; 546 let prom_id = result[0].act_id;
538 this.setData({ 547 this.setData({
539 'options.prom_type': prom_type, 548 'options.prom_type': prom_type,
  549 + 'options.prom_id': prom_id,
540 }); 550 });
  551 + // 检查活动是否开始
541 this.check_prom(goods_id, prom_type, prom_id); 552 this.check_prom(goods_id, prom_type, prom_id);
542 } else if(resLength > 1) { //如果数组长度大于1,表示当前商品参加多个活动,以列表形式显示多活动 553 } else if(resLength > 1) { //如果数组长度大于1,表示当前商品参加多个活动,以列表形式显示多活动
543 this.setData({ 554 this.setData({
544 actList: res.data.data, 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,6 +667,9 @@ Page({
662 //---展示--- 667 //---展示---
663 // gid 在onload阶段已经保存在this.data中 668 // gid 在onload阶段已经保存在this.data中
664 onShow: function() { 669 onShow: function() {
  670 +
  671 + getApp().check_can_share();
  672 +
665 var that=this; 673 var that=this;
666 var ee = this,gid = this.data.gid, i = getApp().request; 674 var ee = this,gid = this.data.gid, i = getApp().request;
667 this.data.is_timer = 1; 675 this.data.is_timer = 1;
@@ -669,8 +677,6 @@ Page({ @@ -669,8 +677,6 @@ Page({
669 677
670 678
671 679
672 -  
673 -  
674 680
675 i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, { 681 i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, {
676 failRollback: !0, 682 failRollback: !0,
@@ -700,6 +706,7 @@ Page({ @@ -700,6 +706,7 @@ Page({
700 that.setData({ 706 that.setData({
701 'data.goods_name': t.data.data.serviceName, 707 'data.goods_name': t.data.data.serviceName,
702 'data.shop_price': t.data.data.money, 708 'data.shop_price': t.data.data.money,
  709 + 'data.show_price': t.data.data.show_price,
703 'data.validDays': t.data.data.validDays, 710 'data.validDays': t.data.data.validDays,
704 'data.serviceContent': t.data.data.serviceContent, 711 'data.serviceContent': t.data.data.serviceContent,
705 'data.image_url': t.data.data.imgUrl, 712 'data.image_url': t.data.data.imgUrl,
@@ -744,6 +751,9 @@ Page({ @@ -744,6 +751,9 @@ Page({
744 }; 751 };
745 } 752 }
746 }); 753 });
  754 +
  755 +
  756 +
747 this.data.enterAddressPage && (this.data.enterAddressPage = !1); 757 this.data.enterAddressPage && (this.data.enterAddressPage = !1);
748 this.get_sto(); 758 this.get_sto();
749 759
@@ -815,26 +825,185 @@ Page({ @@ -815,26 +825,185 @@ Page({
815 activeCategoryId: 1 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 var th = this; 847 var th = this;
823 var ind = t.currentTarget.dataset.openSpecModal_ind; 848 var ind = t.currentTarget.dataset.openSpecModal_ind;
824 var action= t.currentTarget.dataset.action; 849 var action= t.currentTarget.dataset.action;
825 if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind; 850 if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind;
826 - 851 + // 活动ID
  852 + var prom_id = th.data.prom_id;
827 th.setData({ 853 th.setData({
828 open_ind_store: ind 854 open_ind_store: ind
829 }); 855 });
830 856
831 - if(!th.data.sto_sele_name){ 857 + if(!th.data.sto_sele_name) {
832 getApp().my_warnning('请选择门店', 1, th, 450); 858 getApp().my_warnning('请选择门店', 1, th, 450);
833 return false; 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 var newd = { 1008 var newd = {
840 id: th.data.data.id, 1009 id: th.data.data.id,
@@ -850,12 +1019,30 @@ Page({ @@ -850,12 +1019,30 @@ Page({
850 newd['prom_type'] = this.data.prom_type; 1019 newd['prom_type'] = this.data.prom_type;
851 newd['prom_id'] = this.data.prom_id; 1020 newd['prom_id'] = this.data.prom_id;
852 newd['prom_price'] = this.data.prom_price; 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 // console.log('newd++++++++', newd); 1042 // console.log('newd++++++++', newd);
856 th.buyNow(newd); 1043 th.buyNow(newd);
857 - } else {  
858 - 1044 + } else { // 购物车
  1045 +
859 var newd = { 1046 var newd = {
860 service_id: th.data.data.id, 1047 service_id: th.data.data.id,
861 service_sn:th.data.data.service_sn, 1048 service_sn:th.data.data.service_sn,
@@ -864,12 +1051,36 @@ Page({ @@ -864,12 +1051,36 @@ Page({
864 pick_id: th.data.sto_sele_id, 1051 pick_id: th.data.sto_sele_id,
865 user_id:oo.user_id, 1052 user_id:oo.user_id,
866 store_id:os.stoid, 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 newd['guide_id'] = getApp().globalData.guide_id; 1057 newd['guide_id'] = getApp().globalData.guide_id;
871 newd['guide_type']=0; 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 getApp().request.get("/api/weshop/cartService/page", { 1086 getApp().request.get("/api/weshop/cartService/page", {
@@ -890,6 +1101,18 @@ Page({ @@ -890,6 +1101,18 @@ Page({
890 money: th.data.data.shop_price, 1101 money: th.data.data.shop_price,
891 store_id: os.stoid, 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 if (getApp().globalData.guide_id) { 1117 if (getApp().globalData.guide_id) {
895 updata['guide_id'] = getApp().globalData.guide_id; 1118 updata['guide_id'] = getApp().globalData.guide_id;
@@ -923,17 +1146,22 @@ Page({ @@ -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 buyNow: function(e) { 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 addCartNum: function(t) { 1167 addCartNum: function(t) {
@@ -950,21 +1178,155 @@ Page({ @@ -950,21 +1178,155 @@ Page({
950 1178
951 //------检查数量是不是超出限购------ 1179 //------检查数量是不是超出限购------
952 checkCartNum: function(t) { 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 closeSpecModal: function() { 1321 closeSpecModal: function() {
960 this.setData({ 1322 this.setData({
961 openSpecModal: !1, 1323 openSpecModal: !1,
962 - openSpecModal_pt: !1 1324 + openSpecModal_pt: !1,
  1325 + openSpecModal_flash_normal: !1,
963 }); 1326 });
964 }, 1327 },
965 1328
966 openSpecModel: function(t) { 1329 openSpecModel: function(t) {
967 - // console.log('****ttttttt***', t);  
968 var th=this; 1330 var th=this;
969 var open_store = t.currentTarget.dataset.ind; 1331 var open_store = t.currentTarget.dataset.ind;
970 this.setData({ 1332 this.setData({
@@ -982,10 +1344,12 @@ Page({ @@ -982,10 +1344,12 @@ Page({
982 return false; 1344 return false;
983 } 1345 }
984 1346
985 - var ind = t.currentTarget.dataset.ind; 1347 + var ind = t.currentTarget.dataset.ind;
  1348 +
986 this.setData({ 1349 this.setData({
987 openSpecModal: !0, 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,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 requestCardNum: function() { 1464 requestCardNum: function() {
1073 var t = this; 1465 var t = this;
@@ -1122,10 +1514,12 @@ Page({ @@ -1122,10 +1514,12 @@ Page({
1122 title=th.data.prom_act.share_title; 1514 title=th.data.prom_act.share_title;
1123 img=th.data.iurl+th.data.prom_act.share_imgurl; 1515 img=th.data.iurl+th.data.prom_act.share_imgurl;
1124 } 1516 }
  1517 +
  1518 +
1125 1519
1126 1520
1127 var url="/packageA/pages/goodsInfo/goodsInfo?goods_id=" + th.data.gid; 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 url+="&first_leader="+getApp().globalData.user_id; 1523 url+="&first_leader="+getApp().globalData.user_id;
1130 } 1524 }
1131 1525
@@ -1137,30 +1531,24 @@ Page({ @@ -1137,30 +1531,24 @@ Page({
1137 url+="&room_id="+getApp().globalData.room_id+"&room_user_share=1"; 1531 url+="&room_id="+getApp().globalData.room_id+"&room_user_share=1";
1138 } 1532 }
1139 1533
  1534 +
1140 var ob={ 1535 var ob={
1141 title: price + "元 " +title, 1536 title: price + "元 " +title,
1142 path:url, 1537 path:url,
1143 imageUrl: img, 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 return ob; 1553 return ob;
1166 1554
@@ -2562,13 +2950,11 @@ Page({ @@ -2562,13 +2950,11 @@ Page({
2562 }, 2950 },
2563 2951
2564 previewImage() { 2952 previewImage() {
2565 - wx.previewImage({  
2566 - //将图片预览出来  
2567 - urls: [this.data.shareImgPath]  
2568 - }); 2953 + getApp().pre_img(this.data.shareImgPath);
2569 }, 2954 },
2570 2955
2571 onShareTimeline() { 2956 onShareTimeline() {
  2957 + getApp().globalData.no_clear=1
2572 var store_name=getApp().globalData.config?getApp().globalData.config.store_name:''; 2958 var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
2573 if(!store_name) 2959 if(!store_name)
2574 store_name=getApp().globalData.setting.appName; 2960 store_name=getApp().globalData.setting.appName;
@@ -2913,45 +3299,51 @@ Page({ @@ -2913,45 +3299,51 @@ Page({
2913 isshow: 1, 3299 isshow: 1,
2914 }); 3300 });
2915 // this.get_sku(os.stoid, this.data.data, gid); 3301 // this.get_sku(os.stoid, this.data.data, gid);
2916 - // this.get_sto(); 3302 + this.get_sto();
2917 // this.check_is_youhui(gid, 1); 3303 // this.check_is_youhui(gid, 1);
2918 this.data.is_normal = 1; 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 async check_prom(gid, prom_type, prom_id) { 3328 async check_prom(gid, prom_type, prom_id) {
2926 - console.log('check_prom');  
2927 var ee = this, th = ee; 3329 var ee = this, th = ee;
2928 var user_id = getApp().globalData.user_id; 3330 var user_id = getApp().globalData.user_id;
2929 if (!user_id) user_id = 0; 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 if (prom_type == 1 && prom_id > 0) { 3348 if (prom_type == 1 && prom_id > 0) {
2957 //-------判断活动是否抢光--------- 3349 //-------判断活动是否抢光---------
@@ -2959,15 +3351,23 @@ Page({ @@ -2959,15 +3351,23 @@ Page({
2959 1: 1 3351 1: 1
2960 }).then(res => { 3352 }).then(res => {
2961 var em = res; 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 getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, { 3365 getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, {
2969 success: function (t) { 3366 success: function (t) {
2970 - // console.log('!!!!!!t!!!!', t); 3367 + th.setData({
  3368 + sele_g: t.data.data,
  3369 + });
  3370 +
2971 if (t.data.code != 0) { 3371 if (t.data.code != 0) {
2972 ee.get_normal(gid); 3372 ee.get_normal(gid);
2973 return false; 3373 return false;
@@ -2994,7 +3394,6 @@ Page({ @@ -2994,7 +3394,6 @@ Page({
2994 var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss"); 3394 var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");
2995 3395
2996 ee.setData({ 3396 ee.setData({
2997 - 'data.shop_price': t.data.data.user_price,  
2998 prom_price: t.data.data.user_price, 3397 prom_price: t.data.data.user_price,
2999 prom_type: 1, 3398 prom_type: 1,
3000 prom_id: prom_id, 3399 prom_id: prom_id,
@@ -3026,60 +3425,60 @@ Page({ @@ -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,61 +3487,744 @@ Page({
3088 let prom_type = e.currentTarget.dataset.promtype; 3487 let prom_type = e.currentTarget.dataset.promtype;
3089 let prom_id = e.currentTarget.dataset.promid; 3488 let prom_id = e.currentTarget.dataset.promid;
3090 let goods_id = this.data.data.goods_id; 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 getApp().goto(url); 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 var user_id = getApp().globalData.user_id; 3499 var user_id = getApp().globalData.user_id;
3103 if (!user_id) user_id = 0; 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,6 +16,7 @@
16 <view class="goods-detail"> 16 <view class="goods-detail">
17 <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}"> 17 <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}">
18 18
  19 + <!-- 有视频和图片的情况 -->
19 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove" wx:if="{{mapurl}}"> 20 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove" wx:if="{{mapurl}}">
20 <view class="xc-videos-picture rel"> 21 <view class="xc-videos-picture rel">
21 <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange"> 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,10 +30,11 @@
29 <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video> 30 <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video>
30 </view> 31 </view>
31 </swiper-item> 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 </swiper-item> 35 </swiper-item>
35 </swiper> 36 </swiper>
  37 +
36 <block wx:if="{{mapurl}}"> 38 <block wx:if="{{mapurl}}">
37 <view wx:if="{{hiddenn==1}}"> 39 <view wx:if="{{hiddenn==1}}">
38 <view class="xc-imageCount">{{current}}/{{gallery.length}}</view> 40 <view class="xc-imageCount">{{current}}/{{gallery.length}}</view>
@@ -48,17 +50,18 @@ @@ -48,17 +50,18 @@
48 </view> 50 </view>
49 </view> 51 </view>
50 </block> 52 </block>
  53 +
51 </view> 54 </view>
52 </view> 55 </view>
53 56
54 57
55 - 58 + <!-- 只有图片的情况 -->
56 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove" wx:else> 59 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove" wx:else>
57 <view class="xc-videos-picture rel"> 60 <view class="xc-videos-picture rel">
58 <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" 61 <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}"
59 indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange"> 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 binderror="bind_bnerr" mode="aspectFit" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image> 65 binderror="bind_bnerr" mode="aspectFit" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image>
63 </swiper-item> 66 </swiper-item>
64 </swiper> 67 </swiper>
@@ -71,15 +74,13 @@ @@ -71,15 +74,13 @@
71 <!-- 即将开始 --> 74 <!-- 即将开始 -->
72 <image class="secondkill-img" src='{{iurl+"/miniapp/images/blue_ks.png"}}' wx:if="{{prom_st==0}}"></image> 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 <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image> 78 <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image>
76 <view class="start fs26 abs" wx:if="{{prom_st==0}}">距活动开始还有</view> 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 <view class='time-val white t-c' style=" background:{{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">{{djs.hou}}</view> 84 <view class='time-val white t-c' style=" background:{{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">{{djs.hou}}</view>
84 <view class="time" style="color: {{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">时</view> 85 <view class="time" style="color: {{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">时</view>
85 <view class='time-val white t-c' style=" background:{{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">{{djs.min}}</view> 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,8 +91,7 @@
90 </view> 91 </view>
91 92
92 93
93 - <!-- <block> -->  
94 - 94 + <block>
95 <view class="goods-price rel"> 95 <view class="goods-price rel">
96 <view class="co-red" style="overflow: hidden"> 96 <view class="co-red" style="overflow: hidden">
97 <view class="market-price" style="overflow: hidden"></view> 97 <view class="market-price" style="overflow: hidden"></view>
@@ -99,21 +99,51 @@ @@ -99,21 +99,51 @@
99 99
100 <view> 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 <view class="goods-title"> 108 <view class="goods-title">
106 <view class="goods-name elli">{{data.goods_name}}</view> 109 <view class="goods-name elli">{{data.goods_name}}</view>
107 </view> 110 </view>
108 </view> 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 <view class="sales">销量:{{data.sales_sum}}</view> 141 <view class="sales">销量:{{data.sales_sum}}</view>
112 <view class="sales">有效天数:{{data.validDays?data.validDays:'不限'}}</view> 142 <view class="sales">有效天数:{{data.validDays?data.validDays:'不限'}}</view>
113 </view> 143 </view>
114 144
115 </view> 145 </view>
116 - <!-- </block> --> 146 + </block>
117 147
118 148
119 149
@@ -186,6 +216,8 @@ @@ -186,6 +216,8 @@
186 </view> 216 </view>
187 </view> 217 </view>
188 218
  219 +
  220 +
189 221
190 <!-- 保障服务 --> 222 <!-- 保障服务 -->
191 <view class="bz_view flex bdt16 ai_c" wx:if="{{store_config.service_bz}}"> 223 <view class="bz_view flex bdt16 ai_c" wx:if="{{store_config.service_bz}}">
@@ -506,7 +538,7 @@ @@ -506,7 +538,7 @@
506 <view class="join-cart jc_sb ai_c"> 538 <view class="join-cart jc_sb ai_c">
507 539
508 <view class="flex"> 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 session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> 542 session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
511 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 543 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
512 <view>客服</view> 544 <view>客服</view>
@@ -521,6 +553,11 @@ @@ -521,6 +553,11 @@
521 <view wx:else class="custom-service cart-ico new_split pdh20" bindtap="contactService" style="text-align: center"> 553 <view wx:else class="custom-service cart-ico new_split pdh20" bindtap="contactService" style="text-align: center">
522 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 554 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
523 <view>客服</view> 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 </view> 561 </view>
525 562
526 <view bindtap="collectGoods" class="custom-service cart-ico new_split t-c pdh20"> 563 <view bindtap="collectGoods" class="custom-service cart-ico new_split t-c pdh20">
@@ -542,44 +579,45 @@ @@ -542,44 +579,45 @@
542 <view class="flex f1 btn-group"> 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 </block> 618 </block>
582 - <!-- </block> --> 619 +
  620 + </block>
583 621
584 622
585 <!-- 从“我的服务”入口进入购买商品 --> 623 <!-- 从“我的服务”入口进入购买商品 -->
@@ -587,15 +625,9 @@ @@ -587,15 +625,9 @@
587 <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn f1">加入购物车</view> 625 <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn f1">加入购物车</view>
588 <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn f1">立即购买</view> 626 <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn f1">立即购买</view>
589 </block> 627 </block>
590 -  
591 -  
592 - 628 +
593 </view> 629 </view>
594 630
595 -  
596 -  
597 -  
598 -  
599 </view> 631 </view>
600 632
601 <!-- 制作一个圆球导航 --> 633 <!-- 制作一个圆球导航 -->
@@ -607,28 +639,33 @@ @@ -607,28 +639,33 @@
607 <view bindtap="closeSpecModal" class="cover-layer"></view> 639 <view bindtap="closeSpecModal" class="cover-layer"></view>
608 <view class="spec-model"> 640 <view class="spec-model">
609 <view class="pding"> 641 <view class="pding">
  642 +
610 <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon> 643 <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon>
  644 +
  645 +
611 <view class="spec-goods"> 646 <view class="spec-goods">
612 <image class="wh100 spec-img" src="{{iurl}}{{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}}" 647 <image class="wh100 spec-img" src="{{iurl}}{{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}}"
613 binderror="pop_err_img" data-errorimg="data.image_url" /> 648 binderror="pop_err_img" data-errorimg="data.image_url" />
614 <view class="spec-goods-info"> 649 <view class="spec-goods-info">
615 <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view> 650 <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view>
616 <view class="flex ai_end xc-val-money"> 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 </view> 656 </view>
620 </view> 657 </view>
621 </view> 658 </view>
622 </view> 659 </view>
623 660
  661 +
  662 +
624 <!-- 选择门店模块 --> 663 <!-- 选择门店模块 -->
625 <view class="flex-space-between address ai_end xc-width" style="padding-top: 30rpx;"> 664 <view class="flex-space-between address ai_end xc-width" style="padding-top: 30rpx;">
626 <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> 665 <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
627 <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> 666 <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
628 <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> 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 </view> 669 </view>
633 670
634 <!-- 没有门店的时候 --> 671 <!-- 没有门店的时候 -->
@@ -639,6 +676,9 @@ @@ -639,6 +676,9 @@
639 676
640 <view class="red-co fs28" bindtap="choice_store">更多门店<text class="right-arrow"></text></view> 677 <view class="red-co fs28" bindtap="choice_store">更多门店<text class="right-arrow"></text></view>
641 </view> 678 </view>
  679 +
  680 +
  681 +
642 <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> 682 <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
643 <block wx:else> 683 <block wx:else>
644 <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> 684 <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
@@ -693,10 +733,8 @@ @@ -693,10 +733,8 @@
693 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> 733 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
694 </block> 734 </block>
695 <block wx:else> 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 {{sele_g.offline_price?"券后购买":"立即购买"}} 738 {{sele_g.offline_price?"券后购买":"立即购买"}}
701 </view> 739 </view>
702 </block> 740 </block>
@@ -716,6 +754,7 @@ @@ -716,6 +754,7 @@
716 {{sele_g.offline_price?"券后购买":"立即购买"}} 754 {{sele_g.offline_price?"券后购买":"立即购买"}}
717 </view> 755 </view>
718 </block> 756 </block>
  757 +
719 <!-- 普通商品 --> 758 <!-- 普通商品 -->
720 <block wx:else> 759 <block wx:else>
721 <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy {{!sto_sele_name?'gray':''}}" 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,6 +762,7 @@
723 {{sele_g.offline_price?"券后购买":"立即购买"}} 762 {{sele_g.offline_price?"券后购买":"立即购买"}}
724 </view> 763 </view>
725 </block> 764 </block>
  765 +
726 </block> 766 </block>
727 </block> 767 </block>
728 </block> 768 </block>
@@ -902,3 +942,36 @@ @@ -902,3 +942,36 @@
902 </view> 942 </view>
903 </view> 943 </view>
904 </view> 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,7 +562,7 @@ view.cart-btn-lg {
562 .spec-model { 562 .spec-model {
563 position: fixed; 563 position: fixed;
564 bottom: 0; 564 bottom: 0;
565 - z-index: 20; 565 + z-index: 19;
566 background: white; 566 background: white;
567 width: 100%; 567 width: 100%;
568 /* padding: 0 30rpx; */ 568 /* padding: 0 30rpx; */
@@ -2968,3 +2968,5 @@ button.custom-service::after{ @@ -2968,3 +2968,5 @@ button.custom-service::after{
2968 left: -1000px; 2968 left: -1000px;
2969 top: -1000px; 2969 top: -1000px;
2970 } 2970 }
  2971 +
  2972 +
packageA/pages/goods_share/goods_share.js
@@ -123,9 +123,9 @@ Page({ @@ -123,9 +123,9 @@ Page({
123 123
124 /*** 生命周期函数--监听页面显示***/ 124 /*** 生命周期函数--监听页面显示***/
125 onShow: function () { 125 onShow: function () {
  126 + getApp().check_can_share();
126 var th=this; 127 var th=this;
127 -  
128 - 128 +
129 if(app.globalData.userInfo) { 129 if(app.globalData.userInfo) {
130 this.setData({ 130 this.setData({
131 //用来判断是否是分销商,是分销商才显示分成佣金 131 //用来判断是否是分销商,是分销商才显示分成佣金
@@ -177,7 +177,8 @@ Page({ @@ -177,7 +177,8 @@ Page({
177 /**e 177 /**e
178 * 用户点击右上角分享 178 * 用户点击右上角分享
179 */ 179 */
180 - onShareAppMessage: function () { 180 + onShareAppMessage: function () {
  181 + getApp().globalData.no_clear=1;
181 var th = this; 182 var th = this;
182 var item=this.data.share_good; 183 var item=this.data.share_good;
183 var price = item.shop_price; 184 var price = item.shop_price;
@@ -732,10 +733,7 @@ Page({ @@ -732,10 +733,7 @@ Page({
732 }) 733 })
733 return false; 734 return false;
734 } 735 }
735 - wx.previewImage({  
736 - //将图片预览出来  
737 - urls: [that.data.shareImgPath]  
738 - }); 736 + getApp().pre_img(that.data.shareImgPath);
739 wx.hideLoading(); 737 wx.hideLoading();
740 } 738 }
741 }) 739 })
packageA/pages/hongBao/hongBao.js
@@ -76,10 +76,9 @@ Page({ @@ -76,10 +76,9 @@ Page({
76 */ 76 */
77 onShow: function () { 77 onShow: function () {
78 console.log('onshow'); 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,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,7 +64,7 @@ Page({
64 * 生命周期函数--监听页面显示 64 * 生命周期函数--监听页面显示
65 */ 65 */
66 onShow: function () { 66 onShow: function () {
67 - 67 + getApp().check_can_share();
68 }, 68 },
69 69
70 /** 70 /**
@@ -98,7 +98,7 @@ Page({ @@ -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,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,8 +187,8 @@ Page({
187 /** 187 /**
188 * 用户点击右上角分享 188 * 用户点击右上角分享
189 */ 189 */
190 - onShareAppMessage: function () {  
191 - 190 + onShareAppMessage: function () {
  191 + getApp().globalData.no_clear=1;
192 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:''; 192 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:'';
193 193
194 var pagePath = this.route; //当前页面url 194 var pagePath = this.route; //当前页面url
@@ -270,6 +270,7 @@ Page({ @@ -270,6 +270,7 @@ Page({
270 270
271 271
272 onShareTimeline() { 272 onShareTimeline() {
  273 + getApp().globalData.no_clear=1;
273 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:''; 274 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:'';
274 275
275 var pagePath = this.route; //当前页面url 276 var pagePath = this.route; //当前页面url
packageA/pages/liveStream/liveStream.js
@@ -208,9 +208,10 @@ Page({ @@ -208,9 +208,10 @@ Page({
208 * 生命周期函数--监听页面加载 208 * 生命周期函数--监听页面加载
209 */ 209 */
210 onLoad: function (options) { 210 onLoad: function (options) {
  211 + self=this;
211 getApp().is_Single_page(this,function(){ 212 getApp().is_Single_page(this,function(){
212 app.isLogin().then(function(data) {//进入页面前已经授权登录成功 213 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
213 - this.setData({ 214 + self.setData({
214 userInfo: data, 215 userInfo: data,
215 }); 216 });
216 }); 217 });
@@ -229,6 +230,8 @@ Page({ @@ -229,6 +230,8 @@ Page({
229 * 生命周期函数--监听页面显示 230 * 生命周期函数--监听页面显示
230 */ 231 */
231 onShow: function () { 232 onShow: function () {
  233 +
  234 + getApp().check_can_share();
232 if(app.globalData.userInfo) { 235 if(app.globalData.userInfo) {
233 if(!this.data.isLogin) { 236 if(!this.data.isLogin) {
234 this.setData({ 237 this.setData({
@@ -247,6 +250,9 @@ Page({ @@ -247,6 +250,9 @@ Page({
247 self.setData({ 250 self.setData({
248 living: self.data.list, 251 living: self.data.list,
249 }); 252 });
  253 +
  254 +
  255 + console.log(self.data.living);
250 256
251 //直播中列表请求完后,请求即将开始列表 257 //直播中列表请求完后,请求即将开始列表
252 self.getData(true, '/api/weshop/wx/livelist/page', { 258 self.getData(true, '/api/weshop/wx/livelist/page', {
@@ -348,7 +354,7 @@ Page({ @@ -348,7 +354,7 @@ Page({
348 /** 354 /**
349 * 用户点击右上角分享 355 * 用户点击右上角分享
350 */ 356 */
351 - onShareAppMessage: function () { 357 + onShareAppMessage: function () { getApp().globalData.no_clear=1;
352 if (res.from === 'button') { 358 if (res.from === 'button') {
353 // 来自页面内转发按钮 359 // 来自页面内转发按钮
354 // console.log(res.target) 360 // console.log(res.target)
@@ -360,6 +366,7 @@ Page({ @@ -360,6 +366,7 @@ Page({
360 }, 366 },
361 367
362 onShareTimeline: function (res) { 368 onShareTimeline: function (res) {
  369 + getApp().globalData.no_clear=1;
363 if (res.from === 'button') { 370 if (res.from === 'button') {
364 // 来自页面内转发按钮 371 // 来自页面内转发按钮
365 // console.log(res.target) 372 // console.log(res.target)
packageA/pages/liveStream/liveStream.wxml
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 <block wx:if="{{living.pageData.length > 0}}"> 29 <block wx:if="{{living.pageData.length > 0}}">
30 <view class="title">直播中</view> 30 <view class="title">直播中</view>
31 <view class="list"> 31 <view class="list">
32 - <block wx:for="{{liveing.pageData}}" wx:key="item"> 32 + <block wx:for="{{living.pageData}}" wx:key="item">
33 <view class="list-item" catchtap="clickItem" data-id="{{item.id}}" data-live="ing"> 33 <view class="list-item" catchtap="clickItem" data-id="{{item.id}}" data-live="ing">
34 <view class="list-item-left"> 34 <view class="list-item-left">
35 <image src="{{item.share_img}}" class="item-pic" mode="aspectFit"></image> 35 <image src="{{item.share_img}}" class="item-pic" mode="aspectFit"></image>
packageA/pages/liveStreamDetails/liveStreamDetails.js
@@ -53,6 +53,11 @@ Page({ @@ -53,6 +53,11 @@ Page({
53 53
54 // 分享操作表 54 // 分享操作表
55 clickShare: function () { 55 clickShare: function () {
  56 +
  57 + if(!getApp().globalData.user_id){
  58 + getApp().goto("/pages/togoin/togoin");
  59 + return false;
  60 + }
56 this.setData({ 61 this.setData({
57 showActionSheet: !this.data.showActionSheet 62 showActionSheet: !this.data.showActionSheet
58 }) 63 })
@@ -570,7 +575,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un @@ -570,7 +575,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un
570 * 生命周期函数--监听页面显示 575 * 生命周期函数--监听页面显示
571 */ 576 */
572 onShow: function () { 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,6 +610,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un
605 * 用户点击右上角分享 610 * 用户点击右上角分享
606 */ 611 */
607 onShareAppMessage: function (res) { 612 onShareAppMessage: function (res) {
  613 + getApp().globalData.clear=1;
608 this.setData({ 614 this.setData({
609 showActionSheet: 'false' 615 showActionSheet: 'false'
610 }) 616 })
@@ -625,6 +631,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un @@ -625,6 +631,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un
625 }, 631 },
626 632
627 onShareTimeline: function (res) { 633 onShareTimeline: function (res) {
  634 + getApp().globalData.no_clear=1;
628 if (res.from === 'button') { 635 if (res.from === 'button') {
629 // 来自页面内转发按钮 636 // 来自页面内转发按钮
630 console.log(res.target) 637 console.log(res.target)
packageA/pages/live_share/live_share.js
@@ -44,7 +44,7 @@ Page({ @@ -44,7 +44,7 @@ Page({
44 * 生命周期函数--监听页面显示 44 * 生命周期函数--监听页面显示
45 */ 45 */
46 onShow: function () { 46 onShow: function () {
47 - 47 + getApp().check_can_share();
48 }, 48 },
49 49
50 /** 50 /**
@@ -71,7 +71,7 @@ Page({ @@ -71,7 +71,7 @@ Page({
71 /** 71 /**
72 * 用户点击右上角分享 72 * 用户点击右上角分享
73 */ 73 */
74 - onShareAppMessage: function () { 74 + onShareAppMessage: function () { getApp().globalData.no_clear=1;
75 var th=this; 75 var th=this;
76 var id=th.data.hui_active.id; 76 var id=th.data.hui_active.id;
77 var url='/packageA/pages/liveStreamDetails/liveStreamDetails?id=' + id + '&live=ing'; 77 var url='/packageA/pages/liveStreamDetails/liveStreamDetails?id=' + id + '&live=ing';
packageA/pages/myGift/myGift.js
@@ -67,6 +67,8 @@ Page({ @@ -67,6 +67,8 @@ Page({
67 * 生命周期函数--监听页面显示 67 * 生命周期函数--监听页面显示
68 */ 68 */
69 onShow: function () { 69 onShow: function () {
  70 +
  71 + getApp().check_can_share();
70 if(app.globalData.userInfo) { 72 if(app.globalData.userInfo) {
71 if(!this.data.isLogin) { 73 if(!this.data.isLogin) {
72 this.setData({ 74 this.setData({
@@ -147,7 +149,7 @@ Page({ @@ -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,6 +57,7 @@ Page({
57 * 生命周期函数--监听页面显示 57 * 生命周期函数--监听页面显示
58 */ 58 */
59 onShow: function () { 59 onShow: function () {
  60 + getApp().check_can_share();
60 if(app.globalData.userInfo) { 61 if(app.globalData.userInfo) {
61 if(!this.data.isLogin) { 62 if(!this.data.isLogin) {
62 this.setData({ 63 this.setData({
@@ -192,7 +193,7 @@ Page({ @@ -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,6 +394,7 @@ Page({
394 previewImage: function(e) { 394 previewImage: function(e) {
395 var th = this; 395 var th = this;
396 var current = e.currentTarget.dataset.src; 396 var current = e.currentTarget.dataset.src;
  397 + getApp().globalData.no_clear=1;
397 wx.previewImage({ 398 wx.previewImage({
398 current: current, // 当前显示图片的http链接 399 current: current, // 当前显示图片的http链接
399 urls: [th.data.head_img] // 需要预览的图片http链接列表 400 urls: [th.data.head_img] // 需要预览的图片http链接列表
packageA/pages/my_service2/beauty_deta.js
@@ -394,6 +394,7 @@ Page({ @@ -394,6 +394,7 @@ Page({
394 previewImage: function(e) { 394 previewImage: function(e) {
395 var th = this; 395 var th = this;
396 var current = e.currentTarget.dataset.src; 396 var current = e.currentTarget.dataset.src;
  397 + getApp().globalData.no_clear=1;
397 wx.previewImage({ 398 wx.previewImage({
398 current: current, // 当前显示图片的http链接 399 current: current, // 当前显示图片的http链接
399 urls: [th.data.head_img] // 需要预览的图片http链接列表 400 urls: [th.data.head_img] // 需要预览的图片http链接列表
packageA/pages/parseHtml/parseHtml.js
@@ -286,7 +286,7 @@ Page({ @@ -286,7 +286,7 @@ Page({
286 * 生命周期函数--监听页面显示 286 * 生命周期函数--监听页面显示
287 */ 287 */
288 onShow: function () { 288 onShow: function () {
289 - 289 + getApp().check_can_share();
290 }, 290 },
291 291
292 /** 292 /**
@@ -320,7 +320,7 @@ Page({ @@ -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,6 +688,9 @@ Page({
688 }, 688 },
689 689
690 onShow: function() { 690 onShow: function() {
  691 +
  692 + getApp().check_can_share();
  693 +
691 var e = this; 694 var e = this;
692 if (this.data.is_zy) return false; 695 if (this.data.is_zy) return false;
693 this.wait_for_store_config(); 696 this.wait_for_store_config();
@@ -875,6 +878,7 @@ Page({ @@ -875,6 +878,7 @@ Page({
875 878
876 //--点击分享事件--- 879 //--点击分享事件---
877 onShareAppMessage: function(t) { 880 onShareAppMessage: function(t) {
  881 + getApp().globalData.no_clear=1
878 return o.share; 882 return o.share;
879 }, 883 },
880 884
packageA/pages/prom_list/prom_list.js
@@ -162,6 +162,9 @@ Page({ @@ -162,6 +162,9 @@ Page({
162 162
163 //---展示--- 163 //---展示---
164 onShow: function() { 164 onShow: function() {
  165 +
  166 + getApp().check_can_share();
  167 +
165 var ee=this,th=ee,that=ee; 168 var ee=this,th=ee,that=ee;
166 var gid = this.data.gid,i = getApp().request; 169 var gid = this.data.gid,i = getApp().request;
167 ee.data.g_buy_num = new Map(); 170 ee.data.g_buy_num = new Map();
@@ -711,6 +714,7 @@ Page({ @@ -711,6 +714,7 @@ Page({
711 714
712 //--点击分享事件--- 715 //--点击分享事件---
713 onShareAppMessage: function(t) { 716 onShareAppMessage: function(t) {
  717 + getApp().globalData.no_clear=1
714 var curPage=this; 718 var curPage=this;
715 var pagePath = curPage.route; //当前页面url 719 var pagePath = curPage.route; //当前页面url
716 if (pagePath.indexOf('/') != 0) { 720 if (pagePath.indexOf('/') != 0) {
packageA/pages/quan/quan.js
@@ -48,7 +48,7 @@ Page({ @@ -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,7 +73,7 @@ Page({
73 /** 73 /**
74 * 用户点击右上角分享 74 * 用户点击右上角分享
75 */ 75 */
76 - onShareAppMessage: function () { 76 + onShareAppMessage: function () { getApp().globalData.no_clear=1;
77 var th=this; 77 var th=this;
78 var id=th.data.hui_active.id; 78 var id=th.data.hui_active.id;
79 var url="/packageA/pages/quan_pro/quan_pro?id="+id; 79 var url="/packageA/pages/quan_pro/quan_pro?id="+id;
packageA/pages/service_share/service_share.js
@@ -97,6 +97,8 @@ Page({ @@ -97,6 +97,8 @@ Page({
97 97
98 /*** 生命周期函数--监听页面显示***/ 98 /*** 生命周期函数--监听页面显示***/
99 onShow: function () { 99 onShow: function () {
  100 + getApp().check_can_share();
  101 +
100 var th=this; 102 var th=this;
101 getApp().getConfig2(function(rs){ 103 getApp().getConfig2(function(rs){
102 //计算等级价相关 104 //计算等级价相关
@@ -141,7 +143,7 @@ Page({ @@ -141,7 +143,7 @@ Page({
141 /**e 143 /**e
142 * 用户点击右上角分享 144 * 用户点击右上角分享
143 */ 145 */
144 - onShareAppMessage: function () { 146 + onShareAppMessage: function () { getApp().globalData.no_clear=1;
145 var th = this; 147 var th = this;
146 var item=this.data.share_good; 148 var item=this.data.share_good;
147 var price = item.money; 149 var price = item.money;
@@ -709,10 +711,7 @@ Page({ @@ -709,10 +711,7 @@ Page({
709 }) 711 })
710 return false; 712 return false;
711 } 713 }
712 - wx.previewImage({  
713 - //将图片预览出来  
714 - urls: [that.data.shareImgPath]  
715 - }); 714 + getApp().pre_img(that.data.shareImgPath);
716 wx.hideLoading(); 715 wx.hideLoading();
717 } 716 }
718 }) 717 })
packageA/pages/user/my_service2/appment_main.js
@@ -26,7 +26,7 @@ Page({ @@ -26,7 +26,7 @@ Page({
26 * 生命周期函数--监听页面显示 26 * 生命周期函数--监听页面显示
27 */ 27 */
28 onShow: function () { 28 onShow: function () {
29 - 29 + getApp().check_can_share();
30 }, 30 },
31 31
32 /** 32 /**
@@ -60,7 +60,7 @@ Page({ @@ -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 \ No newline at end of file 67 \ No newline at end of file
packageB/pages/boxes-details/boxes-details.js
@@ -51,6 +51,8 @@ Page({ @@ -51,6 +51,8 @@ Page({
51 * 生命周期函数--监听页面显示 51 * 生命周期函数--监听页面显示
52 */ 52 */
53 onShow: function() { 53 onShow: function() {
  54 + getApp().check_can_share();
  55 +
54 // console.log('show~~~'); 56 // console.log('show~~~');
55 if (app.globalData.userInfo) { 57 if (app.globalData.userInfo) {
56 if (!this.data.isLogin) { 58 if (!this.data.isLogin) {
@@ -124,7 +126,7 @@ Page({ @@ -124,7 +126,7 @@ Page({
124 * 用户点击右上角分享 126 * 用户点击右上角分享
125 */ 127 */
126 onShareAppMessage: function() { 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,7 +9,9 @@ Page({
9 currentTabIndex: 0, 9 currentTabIndex: 0,
10 10
11 isLogin: false, 11 isLogin: false,
12 - list: null, 12 + list: {
  13 + pageData: [],
  14 + },
13 isLoading: false, // 检测是否已经发送请求,防止重复发送请求 15 isLoading: false, // 检测是否已经发送请求,防止重复发送请求
14 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 16 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
15 pageNum: 1, // 当前页数 17 pageNum: 1, // 当前页数
@@ -103,6 +105,14 @@ Page({ @@ -103,6 +105,14 @@ Page({
103 }, 105 },
104 106
105 clickTab(e) { 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 this.debounce(this.handleTab.bind(this, e), 200)(); 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,6 +69,8 @@ Page({
69 * 生命周期函数--监听页面显示 69 * 生命周期函数--监听页面显示
70 */ 70 */
71 onShow: function () { 71 onShow: function () {
  72 + getApp().check_can_share();
  73 +
72 if(app.globalData.userInfo) { 74 if(app.globalData.userInfo) {
73 if(!this.data.isLogin) { 75 if(!this.data.isLogin) {
74 this.setData({ 76 this.setData({
@@ -166,7 +168,7 @@ Page({ @@ -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,7 +211,7 @@ Page({
211 * 生命周期函数--监听页面显示 211 * 生命周期函数--监听页面显示
212 */ 212 */
213 onShow: function() { 213 onShow: function() {
214 - 214 + getApp().check_can_share();
215 }, 215 },
216 216
217 /** 217 /**
@@ -246,6 +246,6 @@ Page({ @@ -246,6 +246,6 @@ Page({
246 * 用户点击右上角分享 246 * 用户点击右上角分享
247 */ 247 */
248 onShareAppMessage: function() { 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,6 +220,7 @@ Page({
220 220
221 var imgs = this.data.imgs; 221 var imgs = this.data.imgs;
222 222
  223 + getApp().globalData.no_clear=1;
223 wx.chooseImage({ 224 wx.chooseImage({
224 count: 1, // 默认9 225 count: 1, // 默认9
225 sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 226 sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
@@ -259,6 +260,7 @@ Page({ @@ -259,6 +260,7 @@ Page({
259 var index = e.currentTarget.dataset.index; 260 var index = e.currentTarget.dataset.index;
260 //所有图片 261 //所有图片
261 var imgs = this.data.imgs; 262 var imgs = this.data.imgs;
  263 + getApp().globalData.no_clear=1;
262 wx.previewImage({ 264 wx.previewImage({
263 //当前显示图片 265 //当前显示图片
264 current: imgs[index], 266 current: imgs[index],
packageB/pages/user/binding_info/binding_info.js
@@ -26,7 +26,7 @@ Page({ @@ -26,7 +26,7 @@ Page({
26 * 生命周期函数--监听页面显示 26 * 生命周期函数--监听页面显示
27 */ 27 */
28 onShow: function () { 28 onShow: function () {
29 - 29 + getApp().check_can_share();
30 }, 30 },
31 31
32 /** 32 /**
@@ -60,7 +60,7 @@ Page({ @@ -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 \ No newline at end of file 67 \ No newline at end of file
packageB/pages/user/buyDetails/buyDetails.js
@@ -40,6 +40,7 @@ Page({ @@ -40,6 +40,7 @@ Page({
40 * 生命周期函数--监听页面显示 40 * 生命周期函数--监听页面显示
41 */ 41 */
42 onShow: function () { 42 onShow: function () {
  43 + getApp().check_can_share();
43 if(app.globalData.userInfo) { 44 if(app.globalData.userInfo) {
44 if(!this.data.isLogin) { 45 if(!this.data.isLogin) {
45 this.setData({ 46 this.setData({
@@ -106,7 +107,7 @@ Page({ @@ -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,6 +19,7 @@ Page({
19 onLoad: function(t) {}, 19 onLoad: function(t) {},
20 20
21 onShow: function() { 21 onShow: function() {
  22 + getApp().check_can_share();
22 this.data.ismore=0;this.data.isload=0; 23 this.data.ismore=0;this.data.isload=0;
23 this.setData({list:null}); 24 this.setData({list:null});
24 this.get_list(); 25 this.get_list();
@@ -26,6 +27,7 @@ Page({ @@ -26,6 +27,7 @@ Page({
26 27
27 //--点击分享事件--- 28 //--点击分享事件---
28 onShareAppMessage: function(t) { 29 onShareAppMessage: function(t) {
  30 + getApp().globalData.no_clear=1
29 return o.share; 31 return o.share;
30 }, 32 },
31 get_list: function() { 33 get_list: function() {
packageB/pages/user/comment/comment.js
@@ -161,6 +161,7 @@ Page({ @@ -161,6 +161,7 @@ Page({
161 } else { 161 } else {
162 image = imgArr[index].weapp_img[sindex]; 162 image = imgArr[index].weapp_img[sindex];
163 } 163 }
  164 + getApp().globalData.no_clear=1;
164 wx.previewImage({ 165 wx.previewImage({
165 current: image, 166 current: image,
166 //当前图片地址 167 //当前图片地址
packageB/pages/user/view_comment/view_comment.js
@@ -112,6 +112,7 @@ Page({ @@ -112,6 +112,7 @@ Page({
112 var iurl = th.data.iurl; 112 var iurl = th.data.iurl;
113 if (image != "") { 113 if (image != "") {
114 image = imgArr[0].weapp_img[index]; 114 image = imgArr[0].weapp_img[index];
  115 + getApp().globalData.no_clear=1;
115 wx.previewImage({ 116 wx.previewImage({
116 current: image, 117 current: image,
117 //当前图片地址 118 //当前图片地址
@@ -119,6 +120,7 @@ Page({ @@ -119,6 +120,7 @@ Page({
119 }) 120 })
120 } else { 121 } else {
121 image = imgArr[0].img[index]; 122 image = imgArr[0].img[index];
  123 + getApp().globalData.no_clear=1;
122 wx.previewImage({ 124 wx.previewImage({
123 current: iurl + image, 125 current: iurl + image,
124 //当前图片地址 126 //当前图片地址
packageB/pages/video/index.js
@@ -7,6 +7,7 @@ Page({ @@ -7,6 +7,7 @@ Page({
7 }, 7 },
8 bindButtonTap: function() { 8 bindButtonTap: function() {
9 var that = this 9 var that = this
  10 + getApp().globalData.no_clear=1;
10 wx.chooseVideo({ 11 wx.chooseVideo({
11 sourceType: ['album', 'camera'], 12 sourceType: ['album', 'camera'],
12 maxDuration: 60, 13 maxDuration: 60,
@@ -25,6 +26,8 @@ Page({ @@ -25,6 +26,8 @@ Page({
25 }) 26 })
26 }, 27 },
27 onShow:function(){ 28 onShow:function(){
  29 + getApp().check_can_share();
  30 +
28 var goods_list = this.selectComponent("#goods_list"); //组件的id 31 var goods_list = this.selectComponent("#goods_list"); //组件的id
29 goods_list.init(); 32 goods_list.init();
30 setTimeout(function() { 33 setTimeout(function() {
@@ -34,6 +37,7 @@ Page({ @@ -34,6 +37,7 @@ Page({
34 37
35 //---------分享配置-------- 38 //---------分享配置--------
36 onShareAppMessage: function (e) { 39 onShareAppMessage: function (e) {
  40 + getApp().globalData.no_clear=1
37 return { 41 return {
38 title: "直播视频回放", 42 title: "直播视频回放",
39 } 43 }
packageB/pages/zuhegou/index/index.js
@@ -160,6 +160,8 @@ Page({ @@ -160,6 +160,8 @@ Page({
160 * 生命周期函数--监听页面显示 160 * 生命周期函数--监听页面显示
161 */ 161 */
162 onShow: function () { 162 onShow: function () {
  163 + getApp().check_can_share();
  164 +
163 getApp().is_Single_page(this, function () { 165 getApp().is_Single_page(this, function () {
164 var th = this, 166 var th = this,
165 that = this, 167 that = this,
@@ -446,7 +448,7 @@ Page({ @@ -446,7 +448,7 @@ Page({
446 /** 448 /**
447 * 用户点击右上角分享 449 * 用户点击右上角分享
448 */ 450 */
449 - onShareAppMessage: function () { 451 + onShareAppMessage: function () { getApp().globalData.no_clear=1;
450 var title = this.data.act.name; 452 var title = this.data.act.name;
451 var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id; 453 var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id;
452 if (getApp().globalData.user_id) { 454 if (getApp().globalData.user_id) {
@@ -465,6 +467,7 @@ Page({ @@ -465,6 +467,7 @@ Page({
465 * 用户分享朋友圈 467 * 用户分享朋友圈
466 */ 468 */
467 onShareTimeline() { 469 onShareTimeline() {
  470 + getApp().globalData.no_clear=1;
468 var title = this.data.act.name; 471 var title = this.data.act.name;
469 var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id; 472 var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id;
470 if (getApp().globalData.user_id) { 473 if (getApp().globalData.user_id) {
packageB/pages/zuhegou/list/list.js
@@ -65,7 +65,10 @@ Page({ @@ -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 this.data.ismore=1; 72 this.data.ismore=1;
70 this.data.is_timer=1; 73 this.data.is_timer=1;
71 this.data.currentPage=1; 74 this.data.currentPage=1;
@@ -198,6 +201,7 @@ Page({ @@ -198,6 +201,7 @@ Page({
198 201
199 //---------分享配置-------- 202 //---------分享配置--------
200 onShareAppMessage: function (e) { 203 onShareAppMessage: function (e) {
  204 + getApp().globalData.no_clear=1
201 var curPage=this; 205 var curPage=this;
202 var pagePath = curPage.route; //当前页面url 206 var pagePath = curPage.route; //当前页面url
203 if (pagePath.indexOf('/') != 0) { 207 if (pagePath.indexOf('/') != 0) {
packageB/pages/zuhegou/preindex/index.js
@@ -159,6 +159,8 @@ Page({ @@ -159,6 +159,8 @@ Page({
159 * 生命周期函数--监听页面显示 159 * 生命周期函数--监听页面显示
160 */ 160 */
161 onShow: function () { 161 onShow: function () {
  162 + getApp().check_can_share();
  163 +
162 getApp().is_Single_page(this, function () { 164 getApp().is_Single_page(this, function () {
163 var th = this, 165 var th = this,
164 that = this, 166 that = this,
@@ -447,7 +449,7 @@ Page({ @@ -447,7 +449,7 @@ Page({
447 /** 449 /**
448 * 用户点击右上角分享 450 * 用户点击右上角分享
449 */ 451 */
450 - onShareAppMessage: function () { 452 + onShareAppMessage: function () { getApp().globalData.no_clear=1;
451 var title = this.data.act.name; 453 var title = this.data.act.name;
452 var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id; 454 var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id;
453 if (getApp().globalData.user_id) { 455 if (getApp().globalData.user_id) {
@@ -466,6 +468,7 @@ Page({ @@ -466,6 +468,7 @@ Page({
466 * 用户分享朋友圈 468 * 用户分享朋友圈
467 */ 469 */
468 onShareTimeline() { 470 onShareTimeline() {
  471 + getApp().globalData.no_clear=1;
469 var title = this.data.act.name; 472 var title = this.data.act.name;
470 var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id; 473 var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id;
471 if (getApp().globalData.user_id) { 474 if (getApp().globalData.user_id) {
packageC/pages/goods/distributionCategoryList/index.js
@@ -231,6 +231,8 @@ Page({ @@ -231,6 +231,8 @@ Page({
231 }) 231 })
232 }, 232 },
233 onShow: function () { 233 onShow: function () {
  234 +
  235 + getApp().check_can_share();
234 if (t.globalData.userInfo) { 236 if (t.globalData.userInfo) {
235 let currentData = { 237 let currentData = {
236 store_id: t.globalData.setting.stoid, 238 store_id: t.globalData.setting.stoid,
@@ -404,6 +406,7 @@ Page({ @@ -404,6 +406,7 @@ Page({
404 }, 406 },
405 //---------分享配置-------- 407 //---------分享配置--------
406 onShareAppMessage: function (e) { 408 onShareAppMessage: function (e) {
  409 + getApp().globalData.no_clear=1
407 410
408 var url = "pages/goods/categoryList/categoryList"; 411 var url = "pages/goods/categoryList/categoryList";
409 var userInfo = getApp().globalData.userInfo; 412 var userInfo = getApp().globalData.userInfo;
@@ -639,9 +642,9 @@ Page({ @@ -639,9 +642,9 @@ Page({
639 //扫一扫 642 //扫一扫
640 getScancode: function () { 643 getScancode: function () {
641 // 允许从相机和相册扫码 644 // 允许从相机和相册扫码
  645 + getApp().globalData.no_clear=1;
642 wx.scanCode({ 646 wx.scanCode({
643 success: (res) => { 647 success: (res) => {
644 - console.log(res);  
645 var key_word = res.result; 648 var key_word = res.result;
646 wx.navigateBack({ 649 wx.navigateBack({
647 delta: 1 650 delta: 1
packageC/pages/goods/goodsList/goodsList.js
@@ -119,6 +119,11 @@ Page({ @@ -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 set_prom_list: async function (arr) { 128 set_prom_list: async function (arr) {
124 var th = this; 129 var th = this;
@@ -240,6 +245,7 @@ Page({ @@ -240,6 +245,7 @@ Page({
240 }, 245 },
241 //---------分享配置-------- 246 //---------分享配置--------
242 onShareAppMessage: function (e) { 247 onShareAppMessage: function (e) {
  248 + getApp().globalData.no_clear=1
243 var curPage = this; 249 var curPage = this;
244 var pagePath = curPage.route; //当前页面url 250 var pagePath = curPage.route; //当前页面url
245 if (pagePath.indexOf('/') != 0) { 251 if (pagePath.indexOf('/') != 0) {
@@ -312,4 +318,6 @@ Page({ @@ -312,4 +318,6 @@ Page({
312 }, 318 },
313 319
314 320
  321 +
  322 +
315 }); 323 });
316 \ No newline at end of file 324 \ No newline at end of file
packageC/pages/goods/search/search.js
@@ -31,6 +31,10 @@ Page({ @@ -31,6 +31,10 @@ Page({
31 is_his: 0, 31 is_his: 0,
32 }, 32 },
33 33
  34 + onShow:function () {
  35 + getApp().check_can_share();
  36 + },
  37 +
34 onLoad: function (t) { 38 onLoad: function (t) {
35 this.data.rq_data = t; 39 this.data.rq_data = t;
36 40
@@ -235,6 +239,7 @@ Page({ @@ -235,6 +239,7 @@ Page({
235 239
236 //---------分享配置-------- 240 //---------分享配置--------
237 onShareAppMessage: function (e) { 241 onShareAppMessage: function (e) {
  242 + getApp().globalData.no_clear=1
238 var curPage = this; 243 var curPage = this;
239 var pagePath = curPage.route; //当前页面url 244 var pagePath = curPage.route; //当前页面url
240 if (pagePath.indexOf('/') != 0) { 245 if (pagePath.indexOf('/') != 0) {
packageC/pages/group_list/group_list.js
@@ -44,6 +44,7 @@ Page({ @@ -44,6 +44,7 @@ Page({
44 * 生命周期函数--监听页面显示 44 * 生命周期函数--监听页面显示
45 */ 45 */
46 onShow: function () { 46 onShow: function () {
  47 + getApp().check_can_share();
47 if(app.globalData.userInfo) { 48 if(app.globalData.userInfo) {
48 if(!this.data.isLogin) { 49 if(!this.data.isLogin) {
49 this.setData({ 50 this.setData({
@@ -147,7 +148,7 @@ Page({ @@ -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,6 +35,7 @@ Page({
35 }, 35 },
36 36
37 onShow: function() { 37 onShow: function() {
  38 + getApp().check_can_share();
38 if(app.globalData.userInfo) { 39 if(app.globalData.userInfo) {
39 if(!this.data.isLogin) { 40 if(!this.data.isLogin) {
40 this.setData({ 41 this.setData({
@@ -191,6 +192,7 @@ Page({ @@ -191,6 +192,7 @@ Page({
191 * 用户点击右上角分享 192 * 用户点击右上角分享
192 */ 193 */
193 onShareAppMessage: function (e) { 194 onShareAppMessage: function (e) {
  195 + getApp().globalData.no_clear=1
194 var pagePath = this.route; //当前页面url 196 var pagePath = this.route; //当前页面url
195 if (pagePath.indexOf('/') != 0) { 197 if (pagePath.indexOf('/') != 0) {
196 pagePath = '/' + pagePath; 198 pagePath = '/' + pagePath;
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js
@@ -106,6 +106,7 @@ Page({ @@ -106,6 +106,7 @@ Page({
106 }, 106 },
107 107
108 onShow: function() { 108 onShow: function() {
  109 + getApp().check_can_share();
109 this.get_team_info(); 110 this.get_team_info();
110 }, 111 },
111 112
@@ -972,6 +973,7 @@ Page({ @@ -972,6 +973,7 @@ Page({
972 973
973 //------ 分享配置 -------- 974 //------ 分享配置 --------
974 onShareAppMessage: function (e) { 975 onShareAppMessage: function (e) {
  976 + getApp().globalData.no_clear=1
975 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 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 // console.log('pagePath=====xxxxxx>', pagePath); 978 // console.log('pagePath=====xxxxxx>', pagePath);
977 var imgPath = this.data.iurl + this.data.luckyGoInfo.original_img; 979 var imgPath = this.data.iurl + this.data.luckyGoInfo.original_img;
@@ -1008,6 +1010,10 @@ Page({ @@ -1008,6 +1010,10 @@ Page({
1008 // }, 1010 // },
1009 1011
1010 clickShare() { 1012 clickShare() {
  1013 + if(!getApp().globalData.user_id){
  1014 + getApp().goto("/pages/togoin/togoin");
  1015 + return false;
  1016 + }
1011 this.setData({ 1017 this.setData({
1012 share_hidden: true, 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,6 +8,7 @@ var t = require(&quot;../../../../utils/util.js&quot;),
8 oo = s.globalData, 8 oo = s.globalData,
9 o = s.globalData.setting, 9 o = s.globalData.setting,
10 os = o; 10 os = o;
  11 +let self = null;
11 12
12 //评价加载更多 13 //评价加载更多
13 var more = function (e) { 14 var more = function (e) {
@@ -281,11 +282,13 @@ Page({ @@ -281,11 +282,13 @@ Page({
281 surplus: 0, 282 surplus: 0,
282 canBuy: false, 283 canBuy: false,
283 btnHidden: false, 284 btnHidden: false,
  285 +
  286 + hiddenCS: true,
284 }, 287 },
285 288
286 //------初始化加载---------- 289 //------初始化加载----------
287 onLoad: function (t) { 290 onLoad: function (t) {
288 - 291 + self = this;
289 // console.log('onload'); 292 // console.log('onload');
290 if (t && t.group_id) { 293 if (t && t.group_id) {
291 this.data.group_id = t.group_id; 294 this.data.group_id = t.group_id;
@@ -753,6 +756,8 @@ Page({ @@ -753,6 +756,8 @@ Page({
753 756
754 //---展示--- 757 //---展示---
755 onShow: async function () { 758 onShow: async function () {
  759 +
  760 + getApp().check_can_share();
756 // console.log('onshow'); 761 // console.log('onshow');
757 var goods_list = null, th = this, that = this; 762 var goods_list = null, th = this, that = this;
758 var show_prew_img = this.data.show_prew_img 763 var show_prew_img = this.data.show_prew_img
@@ -2248,24 +2253,37 @@ Page({ @@ -2248,24 +2253,37 @@ Page({
2248 2253
2249 //---------联系客服------------ 2254 //---------联系客服------------
2250 contactService: function () { 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 requestCardNum: function () { 2289 requestCardNum: function () {
@@ -2306,11 +2324,7 @@ Page({ @@ -2306,11 +2324,7 @@ Page({
2306 b[i] = this.data.iurl + e[i]; 2324 b[i] = this.data.iurl + e[i];
2307 } 2325 }
2308 this.data.show_prew_img = 1; 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 previewCommentImgs_w: function (t) { 2330 previewCommentImgs_w: function (t) {
@@ -2320,21 +2334,16 @@ Page({ @@ -2320,21 +2334,16 @@ Page({
2320 b[i] = this.data.iurl + e[i]; 2334 b[i] = this.data.iurl + e[i];
2321 } 2335 }
2322 this.data.show_prew_img = 1; 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 previewGoodsCommentImgs: function (t) { 2340 previewGoodsCommentImgs: function (t) {
2330 var e = this, 2341 var e = this,
2331 a = this.data.data.comment[t.currentTarget.dataset.cidx].img; 2342 a = this.data.data.comment[t.currentTarget.dataset.cidx].img;
  2343 + getApp().globalData.no_clear=1;
2332 a = a.map(function (t) { 2344 a = a.map(function (t) {
2333 return e.data.url + t; 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 this.data.show_prew_img = 1; 2347 this.data.show_prew_img = 1;
2339 }, 2348 },
2340 closePromModal: function () { 2349 closePromModal: function () {
@@ -2349,7 +2358,7 @@ Page({ @@ -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 // var th = this; 2363 // var th = this;
2355 // var price = th.data.sele_g.shop_price; 2364 // var price = th.data.sele_g.shop_price;
@@ -6095,11 +6104,8 @@ Page({ @@ -6095,11 +6104,8 @@ Page({
6095 }, 6104 },
6096 6105
6097 previewImage() { 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 is_show_more_buy: function () { 6111 is_show_more_buy: function () {
@@ -6175,6 +6181,7 @@ Page({ @@ -6175,6 +6181,7 @@ Page({
6175 }, 6181 },
6176 6182
6177 onShareTimeline() { 6183 onShareTimeline() {
  6184 + getApp().globalData.no_clear=1;
6178 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; 6185 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
6179 if (!store_name) 6186 if (!store_name)
6180 store_name = getApp().globalData.setting.appName; 6187 store_name = getApp().globalData.setting.appName;
@@ -6192,6 +6199,10 @@ Page({ @@ -6192,6 +6199,10 @@ Page({
6192 }, 6199 },
6193 6200
6194 clickShare() { 6201 clickShare() {
  6202 + if(!getApp().globalData.user_id){
  6203 + getApp().goto("/pages/togoin/togoin");
  6204 + return false;
  6205 + }
6195 this.setData({ 6206 this.setData({
6196 share_hidden: true, 6207 share_hidden: true,
6197 }); 6208 });
@@ -6327,13 +6338,7 @@ Page({ @@ -6327,13 +6338,7 @@ Page({
6327 }, 6338 },
6328 6339
6329 con_weixin: function () { 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,6 +6491,7 @@ Page({
6486 6491
6487 // 预览海报 6492 // 预览海报
6488 previewPoster() { 6493 previewPoster() {
  6494 + getApp().globalData.no_clear=1;
6489 wx.previewImage({ 6495 wx.previewImage({
6490 current: this.data.shareImgPath, // 当前显示图片的http链接 6496 current: this.data.shareImgPath, // 当前显示图片的http链接
6491 urls: [this.data.shareImgPath],// 需要预览的图片http链接列表 6497 urls: [this.data.shareImgPath],// 需要预览的图片http链接列表
@@ -6493,4 +6499,47 @@ Page({ @@ -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,7 +871,7 @@
871 <!-- -----------------底部按钮------------------ --> 871 <!-- -----------------底部按钮------------------ -->
872 <view class="join-cart"> 872 <view class="join-cart">
873 <!-- bindtap="contactService" --> 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 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 875 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
876 <view>客服</view> 876 <view>客服</view>
877 </button> 877 </button>
@@ -884,7 +884,12 @@ @@ -884,7 +884,12 @@
884 <view wx:else class="custom-service cart-ico new_split" bindtap="contactService"> 884 <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">
885 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 885 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
886 <view>客服</view> 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 <view bindtap="collectGoods" class="custom-service cart-ico new_split"> 894 <view bindtap="collectGoods" class="custom-service cart-ico new_split">
890 <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image> 895 <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image>
@@ -1647,4 +1652,7 @@ @@ -1647,4 +1652,7 @@
1647 1652
1648 <!-- 制作一个圆球导航 --> 1653 <!-- 制作一个圆球导航 -->
1649 <nav_box></nav_box> 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,4 +3115,5 @@ button.custom-service::after{
3115 .popup-content { 3115 .popup-content {
3116 max-height: 600rpx; 3116 max-height: 600rpx;
3117 overflow-y: auto; 3117 overflow-y: auto;
3118 - }  
3119 \ No newline at end of file 3118 \ No newline at end of file
  3119 + }
  3120 +
packageC/pages/luckyGo/luckyGo_members/luckyGo_members.js
@@ -34,6 +34,7 @@ Page({ @@ -34,6 +34,7 @@ Page({
34 * 生命周期函数--监听页面显示 34 * 生命周期函数--监听页面显示
35 */ 35 */
36 onShow: function () { 36 onShow: function () {
  37 + getApp().check_can_share();
37 if(app.globalData.userInfo) { 38 if(app.globalData.userInfo) {
38 if(!this.data.isLogin) { 39 if(!this.data.isLogin) {
39 this.setData({ 40 this.setData({
@@ -92,7 +93,7 @@ Page({ @@ -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,24 +237,7 @@ Page({
237 }, 237 },
238 /*-----联系客户------*/ 238 /*-----联系客户------*/
239 contactService: function() { 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,13 +1057,7 @@ Page({
1074 }, 1057 },
1075 1058
1076 con_weixin:function () { 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,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,7 +61,7 @@
61 <view bindtap="checkTeam" class="contact-us check-btn" wx:if="{{optionIsGoup}}">查看拼团详情</view> 61 <view bindtap="checkTeam" class="contact-us check-btn" wx:if="{{optionIsGoup}}">查看拼团详情</view>
62 <view> 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 <view wx:elif="{{sys_switch.weapp_customertype==2}}" bindtap="con_weixin" class="contact-us goods-btn">联系客服</view> 66 <view wx:elif="{{sys_switch.weapp_customertype==2}}" bindtap="con_weixin" class="contact-us goods-btn">联系客服</view>
67 <view wx:else bindtap="contactService" class="contact-us goods-btn">联系客服</view> 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,6 +38,7 @@ Page({
38 * 生命周期函数--监听页面显示 38 * 生命周期函数--监听页面显示
39 */ 39 */
40 onShow: function () { 40 onShow: function () {
  41 + getApp().check_can_share();
41 if(app.globalData.userInfo) { 42 if(app.globalData.userInfo) {
42 if(!this.data.isLogin) { 43 if(!this.data.isLogin) {
43 this.setData({ 44 this.setData({
@@ -114,7 +115,7 @@ Page({ @@ -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,35 +2601,12 @@ Page({
2601 2601
2602 //---------联系客服------------ 2602 //---------联系客服------------
2603 contactService: function () { 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 con_weixin: function () { 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,6 +17,8 @@ var more = function (e) {
17 var utils = require('../../../../utils/util.js'); 17 var utils = require('../../../../utils/util.js');
18 var regeneratorRuntime = require('../../../../utils/runtime.js'); 18 var regeneratorRuntime = require('../../../../utils/runtime.js');
19 19
  20 +let self = null;
  21 +
20 Page({ 22 Page({
21 data: { 23 data: {
22 start_stop: 2, //秒杀开始 结束 的控制(1正在进行,2即将开始) 24 start_stop: 2, //秒杀开始 结束 的控制(1正在进行,2即将开始)
@@ -248,10 +250,13 @@ Page({ @@ -248,10 +250,13 @@ Page({
248 250
249 share_hidden: false, 251 share_hidden: false,
250 pre_arr: null, 252 pre_arr: null,
  253 +
  254 + hiddenCS: true,
251 }, 255 },
252 256
253 //------初始化加载---------- 257 //------初始化加载----------
254 onLoad: function (t) { 258 onLoad: function (t) {
  259 + self = this;
255 var ee = this, that = ee, th = ee, 260 var ee = this, that = ee, th = ee,
256 pre_id = t.pre_id, 261 pre_id = t.pre_id,
257 gid = t.goods_id, 262 gid = t.goods_id,
@@ -588,6 +593,7 @@ Page({ @@ -588,6 +593,7 @@ Page({
588 593
589 //---展示--- 594 //---展示---
590 onShow: function () { 595 onShow: function () {
  596 + getApp().check_can_share();
591 var goods_list = null, th = this, that = this; 597 var goods_list = null, th = this, that = this;
592 598
593 //-- 如果是预览图片,页面不重新更新 -- 599 //-- 如果是预览图片,页面不重新更新 --
@@ -1430,25 +1436,40 @@ Page({ @@ -1430,25 +1436,40 @@ Page({
1430 1436
1431 //---------联系客服------------ 1437 //---------联系客服------------
1432 contactService: function () { 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 requestCardNum: function () { 1474 requestCardNum: function () {
1454 var t = this; 1475 var t = this;
@@ -1488,11 +1509,8 @@ Page({ @@ -1488,11 +1509,8 @@ Page({
1488 b[i] = this.data.iurl + e[i]; 1509 b[i] = this.data.iurl + e[i];
1489 } 1510 }
1490 this.data.show_prew_img = 1; 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 previewCommentImgs_w: function (t) { 1516 previewCommentImgs_w: function (t) {
@@ -1502,21 +1520,16 @@ Page({ @@ -1502,21 +1520,16 @@ Page({
1502 b[i] = this.data.iurl + e[i]; 1520 b[i] = this.data.iurl + e[i];
1503 } 1521 }
1504 this.data.show_prew_img = 1; 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 previewGoodsCommentImgs: function (t) { 1526 previewGoodsCommentImgs: function (t) {
1512 var e = this, 1527 var e = this,
1513 a = this.data.data.comment[t.currentTarget.dataset.cidx].img; 1528 a = this.data.data.comment[t.currentTarget.dataset.cidx].img;
  1529 + getApp().globalData.no_clear=1;
1514 a = a.map(function (t) { 1530 a = a.map(function (t) {
1515 return e.data.url + t; 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 this.data.show_prew_img = 1; 1533 this.data.show_prew_img = 1;
1521 }, 1534 },
1522 closePromModal: function () { 1535 closePromModal: function () {
@@ -1531,7 +1544,7 @@ Page({ @@ -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 var th = this; 1549 var th = this;
1537 var price = th.data.pre_arr.presell_price; 1550 var price = th.data.pre_arr.presell_price;
@@ -3813,14 +3826,12 @@ Page({ @@ -3813,14 +3826,12 @@ Page({
3813 3826
3814 previewImage() { 3827 previewImage() {
3815 this.data.show_prew_img = 1; 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 onShareTimeline() { 3833 onShareTimeline() {
  3834 + getApp().globalData.no_clear=1;
3824 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; 3835 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
3825 if (!store_name) 3836 if (!store_name)
3826 store_name = getApp().globalData.setting.appName; 3837 store_name = getApp().globalData.setting.appName;
@@ -3835,6 +3846,10 @@ Page({ @@ -3835,6 +3846,10 @@ Page({
3835 }, 3846 },
3836 3847
3837 clickShare() { 3848 clickShare() {
  3849 + if(!getApp().globalData.user_id){
  3850 + getApp().goto("/pages/togoin/togoin");
  3851 + return false;
  3852 + }
3838 this.setData({ share_hidden: true, }); 3853 this.setData({ share_hidden: true, });
3839 }, 3854 },
3840 3855
@@ -4012,21 +4027,59 @@ Page({ @@ -4012,21 +4027,59 @@ Page({
4012 }, 4027 },
4013 4028
4014 con_weixin:function () { 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 previewPoster() { 4034 previewPoster() {
  4035 + getApp().globalData.no_clear=1;
4026 wx.previewImage({ 4036 wx.previewImage({
4027 current: this.data.shareImgPath, // 当前显示图片的http链接 4037 current: this.data.shareImgPath, // 当前显示图片的http链接
4028 urls: [this.data.shareImgPath] ,// 需要预览的图片http链接列表 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,7 +495,7 @@
495 <!-- -----------------底部按钮------------------ --> 495 <!-- -----------------底部按钮------------------ -->
496 <view class="join-cart"> 496 <view class="join-cart">
497 <!-- bindtap="contactService" --> 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 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 499 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
500 <view>客服</view> 500 <view>客服</view>
501 </button> 501 </button>
@@ -508,7 +508,13 @@ @@ -508,7 +508,13 @@
508 <view wx:else class="custom-service cart-ico new_split" bindtap="contactService"> 508 <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">
509 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 509 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
510 <view>客服</view> 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 <view bindtap="collectGoods" class="custom-service cart-ico new_split"> 518 <view bindtap="collectGoods" class="custom-service cart-ico new_split">
513 <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image> 519 <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image>
514 <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image> 520 <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image>
@@ -949,3 +955,6 @@ @@ -949,3 +955,6 @@
949 </view> 955 </view>
950 </view> 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,6 +590,8 @@ Page({
590 590
591 //---展示--- 591 //---展示---
592 onShow: function () { 592 onShow: function () {
  593 +
  594 + getApp().check_can_share();
593 var goods_list = null, th = this, that = this; 595 var goods_list = null, th = this, that = this;
594 596
595 //-- 如果是预览图片,页面不重新更新 -- 597 //-- 如果是预览图片,页面不重新更新 --
@@ -1431,24 +1433,7 @@ Page({ @@ -1431,24 +1433,7 @@ Page({
1431 1433
1432 //---------联系客服------------ 1434 //---------联系客服------------
1433 contactService: function () { 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 requestCardNum: function () { 1439 requestCardNum: function () {
@@ -1489,11 +1474,7 @@ Page({ @@ -1489,11 +1474,7 @@ Page({
1489 b[i] = this.data.iurl + e[i]; 1474 b[i] = this.data.iurl + e[i];
1490 } 1475 }
1491 this.data.show_prew_img = 1; 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 previewCommentImgs_w: function (t) { 1480 previewCommentImgs_w: function (t) {
@@ -1503,21 +1484,16 @@ Page({ @@ -1503,21 +1484,16 @@ Page({
1503 b[i] = this.data.iurl + e[i]; 1484 b[i] = this.data.iurl + e[i];
1504 } 1485 }
1505 this.data.show_prew_img = 1; 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 previewGoodsCommentImgs: function (t) { 1490 previewGoodsCommentImgs: function (t) {
1513 var e = this, 1491 var e = this,
1514 a = this.data.data.comment[t.currentTarget.dataset.cidx].img; 1492 a = this.data.data.comment[t.currentTarget.dataset.cidx].img;
  1493 + getApp().globalData.no_clear=1;
1515 a = a.map(function (t) { 1494 a = a.map(function (t) {
1516 return e.data.url + t; 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 this.data.show_prew_img = 1; 1497 this.data.show_prew_img = 1;
1522 }, 1498 },
1523 closePromModal: function () { 1499 closePromModal: function () {
@@ -1532,7 +1508,7 @@ Page({ @@ -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 var th = this; 1513 var th = this;
1538 var price = th.data.pre_arr.presell_price; 1514 var price = th.data.pre_arr.presell_price;
@@ -3814,14 +3790,12 @@ Page({ @@ -3814,14 +3790,12 @@ Page({
3814 3790
3815 previewImage() { 3791 previewImage() {
3816 this.data.show_prew_img = 1; 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 onShareTimeline() { 3797 onShareTimeline() {
  3798 + getApp().globalData.no_clear=1;
3825 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; 3799 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
3826 if (!store_name) 3800 if (!store_name)
3827 store_name = getApp().globalData.setting.appName; 3801 store_name = getApp().globalData.setting.appName;
@@ -3836,7 +3810,11 @@ Page({ @@ -3836,7 +3810,11 @@ Page({
3836 }, 3810 },
3837 3811
3838 clickShare() { 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 send() { 3820 send() {
@@ -4014,13 +3992,12 @@ Page({ @@ -4014,13 +3992,12 @@ Page({
4014 }, 3992 },
4015 3993
4016 con_weixin:function () { 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,7 +495,7 @@
495 <!-- -----------------底部按钮------------------ --> 495 <!-- -----------------底部按钮------------------ -->
496 <view class="join-cart"> 496 <view class="join-cart">
497 <!-- bindtap="contactService" --> 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 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 499 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
500 <view>客服</view> 500 <view>客服</view>
501 </button> 501 </button>
packageD/pages/AI-test-skin/history_record/history_record.js
@@ -304,7 +304,7 @@ Page({ @@ -304,7 +304,7 @@ Page({
304 * 生命周期函数--监听页面显示 304 * 生命周期函数--监听页面显示
305 */ 305 */
306 onShow: function () { 306 onShow: function () {
307 - 307 + getApp().check_can_share();
308 }, 308 },
309 go_result(e) { 309 go_result(e) {
310 let id = e.currentTarget.dataset.id; 310 let id = e.currentTarget.dataset.id;
@@ -344,7 +344,7 @@ Page({ @@ -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 \ No newline at end of file 351 \ No newline at end of file
packageD/pages/AI-test-skin/index/aiskin.js
@@ -43,6 +43,7 @@ Page({ @@ -43,6 +43,7 @@ Page({
43 * 生命周期函数--监听页面显示 43 * 生命周期函数--监听页面显示
44 */ 44 */
45 onShow: function () { 45 onShow: function () {
  46 + getApp().check_can_share();
46 this.getHistoryData(); 47 this.getHistoryData();
47 }, 48 },
48 49
@@ -101,7 +102,7 @@ Page({ @@ -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,6 +52,7 @@ Page({
52 //-- 重新从相册中选择图片 -- 52 //-- 重新从相册中选择图片 --
53 show_pai_pop: function () { 53 show_pai_pop: function () {
54 var th = this; 54 var th = this;
  55 + getApp().globalData.no_clear=1;
55 //选择和拍照一张图片 56 //选择和拍照一张图片
56 wx.chooseImage({ 57 wx.chooseImage({
57 count: 1, 58 count: 1,
@@ -70,6 +71,7 @@ Page({ @@ -70,6 +71,7 @@ Page({
70 //选择图片 71 //选择图片
71 takePhoto() { 72 takePhoto() {
72 var that = this; 73 var that = this;
  74 + getApp().globalData.no_clear=1;
73 wx.chooseImage({ 75 wx.chooseImage({
74 count: 1, 76 count: 1,
75 sizeType: ['compressed'], 77 sizeType: ['compressed'],
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js
@@ -36,6 +36,7 @@ Page({ @@ -36,6 +36,7 @@ Page({
36 * 生命周期函数--监听页面显示 36 * 生命周期函数--监听页面显示
37 */ 37 */
38 onShow: function () { 38 onShow: function () {
  39 + getApp().check_can_share();
39 let th = this; 40 let th = this;
40 setTimeout(() => { 41 setTimeout(() => {
41 th.setData({ 42 th.setData({
@@ -68,13 +69,14 @@ Page({ @@ -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 show_pai_pop: function () { 77 show_pai_pop: function () {
77 let th = this; 78 let th = this;
  79 + getApp().globalData.no_clear=1;
78 //选择和拍照一张图片 80 //选择和拍照一张图片
79 wx.chooseImage({ 81 wx.chooseImage({
80 count: 1, 82 count: 1,
@@ -98,7 +100,8 @@ Page({ @@ -98,7 +100,8 @@ Page({
98 //选择图片 100 //选择图片
99 takePhoto() { 101 takePhoto() {
100 var that = this; 102 var that = this;
101 - 103 + getApp().globalData.no_clear=1;
  104 + that.setData({selecting:1});
102 wx.chooseImage({ 105 wx.chooseImage({
103 count: 1, 106 count: 1,
104 sizeType: ['compressed'], 107 sizeType: ['compressed'],
@@ -118,6 +121,7 @@ Page({ @@ -118,6 +121,7 @@ Page({
118 121
119 }, 122 },
120 fail(err) { 123 fail(err) {
  124 + that.setData({selecting:0})
121 console.log(err); 125 console.log(err);
122 } 126 }
123 }) 127 })
@@ -143,6 +147,7 @@ Page({ @@ -143,6 +147,7 @@ Page({
143 var that = this; 147 var that = this;
144 //size小于100kb 时 直接转码识别 148 //size小于100kb 时 直接转码识别
145 if (size < 1024) { 149 if (size < 1024) {
  150 + that.setData({selecting:0})
146 getApp().globalData.skin_img_info = { 151 getApp().globalData.skin_img_info = {
147 path:img, 152 path:img,
148 size, 153 size,
@@ -153,12 +158,15 @@ Page({ @@ -153,12 +158,15 @@ Page({
153 return; 158 return;
154 } 159 }
155 160
  161 + wx.showLoading({
  162 + title:'处理中',
  163 + mask: true
  164 + });
156 //先获取图片 然后根据长宽 缩小 之后获取图片 165 //先获取图片 然后根据长宽 缩小 之后获取图片
157 wx.getImageInfo({ 166 wx.getImageInfo({
158 src: img, 167 src: img,
159 success(res) { 168 success(res) {
160 - console.log(res.width)  
161 - console.log(res.height) 169 +
162 var ratio = size / 1024; 170 var ratio = size / 1024;
163 size1 = size1 / ratio; 171 size1 = size1 / ratio;
164 var canvasWidth = res.width //图片原始长宽 172 var canvasWidth = res.width //图片原始长宽
@@ -183,7 +191,7 @@ Page({ @@ -183,7 +191,7 @@ Page({
183 destHeight: canvasHeight, 191 destHeight: canvasHeight,
184 fileType: 'jpg', 192 fileType: 'jpg',
185 success: function (res) { 193 success: function (res) {
186 - console.log(res.tempFilePath)//最终图片路径 194 + wx.hideLoading();
187 that.setData({ 195 that.setData({
188 canvasImgUrl: res.tempFilePath 196 canvasImgUrl: res.tempFilePath
189 }); 197 });
@@ -195,9 +203,8 @@ Page({ @@ -195,9 +203,8 @@ Page({
195 app.goto(url); 203 app.goto(url);
196 }, 204 },
197 fail: function (res) { 205 fail: function (res) {
198 - console.log("缩放图片失败");  
199 - console.log(res.errMsg)  
200 wx.hideLoading(); 206 wx.hideLoading();
  207 + that.setData({selecting:0})
201 wx.showToast({ 208 wx.showToast({
202 title: '识别图片失败', 209 title: '识别图片失败',
203 image: '../../utils/img/wrong.png', 210 image: '../../utils/img/wrong.png',
@@ -211,9 +218,8 @@ Page({ @@ -211,9 +218,8 @@ Page({
211 }, 1000)) //留一定的时间绘制canvas 否则会报错fail canvas is empty 218 }, 1000)) //留一定的时间绘制canvas 否则会报错fail canvas is empty
212 }, 219 },
213 fail: function (res) { 220 fail: function (res) {
214 - console.log("获取图片失败");  
215 - console.log(res.errMsg)  
216 wx.hideLoading(); 221 wx.hideLoading();
  222 + that.setData({selecting:0})
217 wx.showToast({ 223 wx.showToast({
218 title: '识别图片失败', 224 title: '识别图片失败',
219 image: '../../utils/img/wrong.png', 225 image: '../../utils/img/wrong.png',
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxml
@@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
55 55
56 <view style="height: 300rpx;background-color: #e7f5fb;"> 56 <view style="height: 300rpx;background-color: #e7f5fb;">
57 <view class="btn_fixed"> 57 <view class="btn_fixed">
58 - <view class="btn" bindtap="takePhoto">准备闭眼拍摄</view> 58 + <botton disabled="{{selecting}}" class="btn" bindtap="takePhoto">准备闭眼拍摄</botton>
59 <view class="notice" style="display:flex;justify-content:center;align-items: center;"> 59 <view class="notice" style="display:flex;justify-content:center;align-items: center;">
60 <text class="iconfont icon-info" style="margin-right: 10rpx;font-size: 26rpx"></text> 60 <text class="iconfont icon-info" style="margin-right: 10rpx;font-size: 26rpx"></text>
61 <text>如无闭眼,将导致图片分析失败</text> 61 <text>如无闭眼,将导致图片分析失败</text>
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxss
@@ -103,6 +103,7 @@ page { @@ -103,6 +103,7 @@ page {
103 text-align: center; 103 text-align: center;
104 border-radius: 50rpx; 104 border-radius: 50rpx;
105 color: #fff; 105 color: #fff;
  106 + display: block;
106 } 107 }
107 108
108 .btn_fixed { 109 .btn_fixed {
packageD/pages/AI-test-skin/success_result/goods.wxml
@@ -9,9 +9,9 @@ @@ -9,9 +9,9 @@
9 <!-- 显示正确的商品价格 --> 9 <!-- 显示正确的商品价格 -->
10 <view style="display: flex;justify-content: space-between;"> 10 <view style="display: flex;justify-content: space-between;">
11 <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10}}"> 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 <text wx:if="{{item.prom_price}}" class="bold">¥{{item.shop_price}}</text> 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 </block> 15 </block>
16 <block wx:else> 16 <block wx:else>
17 <block wx:if="{{s_filter.is_has_rank(rank_switch,item)}}"> 17 <block wx:if="{{s_filter.is_has_rank(rank_switch,item)}}">
@@ -36,4 +36,5 @@ @@ -36,4 +36,5 @@
36 36
37 <view class="mm"><text class="iconfont icon-gouwuche"></text></view> 37 <view class="mm"><text class="iconfont icon-gouwuche"></text></view>
38 </view> 38 </view>
  39 + <view wx:if="{{item.prom_integral}}"><text style="font-weight: bold;">{{item.prom_integral}}</text>积分</view>
39 </view> 40 </view>
40 \ No newline at end of file 41 \ No newline at end of file
packageD/pages/AI-test-skin/success_result/success_result.js
@@ -83,7 +83,29 @@ Page({ @@ -83,7 +83,29 @@ Page({
83 this.init(); 83 this.init();
84 //var face_result=getApp().globalData.face_result; 84 //var face_result=getApp().globalData.face_result;
85 //var face_data=face_result.face_list[0]; 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 wx.getSystemInfo({ 111 wx.getSystemInfo({
@@ -280,6 +302,7 @@ Page({ @@ -280,6 +302,7 @@ Page({
280 //-- 获取一下分享要用的图片 -- 302 //-- 获取一下分享要用的图片 --
281 th.set_share_img(); 303 th.set_share_img();
282 acne.get_goods(th, setting.stoid); 304 acne.get_goods(th, setting.stoid);
  305 +
283 // let { heightRecord, tab } = th.data; 306 // let { heightRecord, tab } = th.data;
284 // tab.forEach(item => { 307 // tab.forEach(item => {
285 // console.log(2); 308 // console.log(2);
@@ -457,7 +480,9 @@ Page({ @@ -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 clickTab(e) { 487 clickTab(e) {
463 let { index, tab_id } = e.currentTarget.dataset; 488 let { index, tab_id } = e.currentTarget.dataset;
@@ -590,7 +615,15 @@ Page({ @@ -590,7 +615,15 @@ Page({
590 * 用户点击右上角分享 615 * 用户点击右上角分享
591 */ 616 */
592 onShareAppMessage: function () { 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,8 +781,8 @@ Page({
748 } 781 }
749 ///二微码 782 ///二微码
750 var path3 = setting.url + "/api/wx/open/app/user/getWeAppEwm/" + 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 // 读取文件成功则OK-- 786 // 读取文件成功则OK--
754 wx.getImageInfo({ 787 wx.getImageInfo({
755 src: path3, 788 src: path3,
@@ -763,21 +796,21 @@ Page({ @@ -763,21 +796,21 @@ Page({
763 context.fillStyle = '#ebf6f8'; 796 context.fillStyle = '#ebf6f8';
764 // 灰色实心矩形 797 // 灰色实心矩形
765 // 1. 语法: x坐标, y坐标, 宽度, 高度 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 context.setFontSize(20 * rpx) 801 context.setFontSize(20 * rpx)
769 context.setFillStyle("#00d8e9") 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 context.fillStyle = '#a7ecf5'; 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 context.setFontSize(42 * b * rpx) 810 context.setFontSize(42 * b * rpx)
778 context.setFillStyle("#070609") 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 th.circle(context, 110 * b * rpx, 280 * b * rpx, 140 * b * rpx, "#e7f3f8"); 816 th.circle(context, 110 * b * rpx, 280 * b * rpx, 140 * b * rpx, "#e7f3f8");
@@ -786,35 +819,35 @@ Page({ @@ -786,35 +819,35 @@ Page({
786 context.drawImage(th.data.share_head, 132 * b * rpx, 310 * b * rpx, 230 * b * rpx, 230 * b * rpx); 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 context.setFillStyle("black") 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 context.setFillStyle("black") 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 context.setFillStyle("black") 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 th.darwRoundRect(38 * b * rpx, 650 * b * rpx, 430 * b * rpx, 160 * b * rpx, 10 * b * rpx, context); 844 th.darwRoundRect(38 * b * rpx, 650 * b * rpx, 430 * b * rpx, 160 * b * rpx, 10 * b * rpx, context);
812 //绘制二维码 845 //绘制二维码
813 context.drawImage(vpath, 60 * b * rpx, 672 * b * rpx, 120 * b * rpx, 120 * b * rpx); 846 context.drawImage(vpath, 60 * b * rpx, 672 * b * rpx, 120 * b * rpx, 120 * b * rpx);
814 context.setFillStyle("black") 847 context.setFillStyle("black")
815 - context.setFontSize(32 * b * rpx) 848 + context.setFontSize(27 * b * rpx)
816 context.fillText("美肤管家AI测肤", 200 * b * rpx, 726 * b * rpx); 849 context.fillText("美肤管家AI测肤", 200 * b * rpx, 726 * b * rpx);
817 - context.setFontSize(22 * b * rpx) 850 + context.setFontSize(19 * b * rpx)
818 context.fillText("科学了解皮肤的真实状态", 200 * b * rpx, 766 * b * rpx); 851 context.fillText("科学了解皮肤的真实状态", 200 * b * rpx, 766 * b * rpx);
819 852
820 //把画板内容绘制成图片,并回调 画板图片路径 853 //把画板内容绘制成图片,并回调 画板图片路径
@@ -824,7 +857,7 @@ Page({ @@ -824,7 +857,7 @@ Page({
824 x: 0, 857 x: 0,
825 y: 0, 858 y: 0,
826 width: 750, 859 width: 750,
827 - height: 1338, 860 + height: 1320,
828 destWidth: 1.4 * 750 * 750 / th.data.screenWidth, 861 destWidth: 1.4 * 750 * 750 / th.data.screenWidth,
829 destHeight: 1.4 * 750 * 750 / th.data.screenWidth, 862 destHeight: 1.4 * 750 * 750 / th.data.screenWidth,
830 canvasId: 'share', 863 canvasId: 'share',
packageD/pages/AI-test-skin/success_result/success_result.wxml
@@ -378,12 +378,12 @@ @@ -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 <view id="share_show" wx:if="{{share_show}}"> 383 <view id="share_show" wx:if="{{share_show}}">
384 <view class="cover-layer" bindtap="close_share" style="z-index: 77777"></view> 384 <view class="cover-layer" bindtap="close_share" style="z-index: 77777"></view>
385 <view class="share_content"> 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 <image src="{{shareImgPath}}" style="width: 100%" mode="widthFix"></image> 387 <image src="{{shareImgPath}}" style="width: 100%" mode="widthFix"></image>
388 <view class="share_save_btn" bindtap="savePic">保存到相册</view> 388 <view class="share_save_btn" bindtap="savePic">保存到相册</view>
389 </view> 389 </view>
@@ -412,7 +412,7 @@ @@ -412,7 +412,7 @@
412 </scroll-view> 412 </scroll-view>
413 </view> 413 </view>
414 <view class="close_icon" bindtap="close_yiwen"> 414 <view class="close_icon" bindtap="close_yiwen">
415 - <text class="iconfont icon-guan"></text> 415 + <text class="iconfont icon-guan" ></text>
416 </view> 416 </view>
417 </view> 417 </view>
418 <!-- 提示 --> 418 <!-- 提示 -->
packageD/pages/AI-test-skin/success_result/success_result.wxss
@@ -384,13 +384,15 @@ page { @@ -384,13 +384,15 @@ page {
384 font-size: 28rpx; 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 margin-right: 30rpx; 388 margin-right: 30rpx;
  389 +}
  390 +.analyse_classify_foot .product_item{
  391 + display: flex;
390 flex-direction: column; 392 flex-direction: column;
391 border-radius: 30rpx; 393 border-radius: 30rpx;
392 width: 40%; 394 width: 40%;
393 - padding: 5%; 395 + padding: 5% ;
394 background-color: #fff; 396 background-color: #fff;
395 } 397 }
396 398
@@ -592,8 +594,7 @@ page { @@ -592,8 +594,7 @@ page {
592 .xc-coupon-frame { 594 .xc-coupon-frame {
593 width: 100%; 595 width: 100%;
594 max-height: 560rpx; 596 max-height: 560rpx;
595 - overflow: auto;  
596 - 597 + /* overflow: auto; */
597 } 598 }
598 599
599 .xc-coupon-frame .rel:not(:first-child) { 600 .xc-coupon-frame .rel:not(:first-child) {
@@ -727,7 +728,7 @@ page { @@ -727,7 +728,7 @@ page {
727 z-index: 999999; 728 z-index: 999999;
728 top: 50%; 729 top: 50%;
729 left: 50%; 730 left: 50%;
730 - width: 70%; 731 + width: 75%;
731 transform: translate(-50%, -50%); 732 transform: translate(-50%, -50%);
732 } 733 }
733 734
@@ -742,10 +743,10 @@ page { @@ -742,10 +743,10 @@ page {
742 743
743 .sh_close { 744 .sh_close {
744 position: absolute; 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 display: flex; 750 display: flex;
750 justify-content: center; 751 justify-content: center;
751 align-items: center; 752 align-items: center;
pages/activity/pind_list/pind_list.js
@@ -65,6 +65,7 @@ Page({ @@ -65,6 +65,7 @@ Page({
65 }, 65 },
66 66
67 onShow: function (t) { 67 onShow: function (t) {
  68 + getApp().check_can_share();
68 this.data.is_timer = 1; 69 this.data.is_timer = 1;
69 this.data.currentPage = 1; 70 this.data.currentPage = 1;
70 this.data.ismore = 1; 71 this.data.ismore = 1;
@@ -195,6 +196,7 @@ Page({ @@ -195,6 +196,7 @@ Page({
195 196
196 //---------分享配置-------- 197 //---------分享配置--------
197 onShareAppMessage: function (e) { 198 onShareAppMessage: function (e) {
  199 + getApp().globalData.no_clear=1;
198 var curPage = this; 200 var curPage = this;
199 var pagePath = curPage.route; //当前页面url 201 var pagePath = curPage.route; //当前页面url
200 if (pagePath.indexOf('/') != 0) { 202 if (pagePath.indexOf('/') != 0) {
@@ -248,6 +250,7 @@ Page({ @@ -248,6 +250,7 @@ Page({
248 }, 250 },
249 251
250 onShareTimeline() { 252 onShareTimeline() {
  253 + getApp().globalData.no_clear=1;
251 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; 254 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
252 if (!store_name) 255 if (!store_name)
253 store_name = getApp().globalData.setting.appName; 256 store_name = getApp().globalData.setting.appName;
pages/activity/seckill_list/seckill_list.js
@@ -73,6 +73,7 @@ Page({ @@ -73,6 +73,7 @@ Page({
73 73
74 74
75 onShow: function (t) { 75 onShow: function (t) {
  76 + getApp().check_can_share();
76 this.data.is_timer = 1; 77 this.data.is_timer = 1;
77 this.data.currentPage = 1; 78 this.data.currentPage = 1;
78 var th = this; 79 var th = this;
@@ -233,6 +234,7 @@ Page({ @@ -233,6 +234,7 @@ Page({
233 234
234 //---------分享配置-------- 235 //---------分享配置--------
235 onShareAppMessage: function (e) { 236 onShareAppMessage: function (e) {
  237 + getApp().globalData.no_clear=1;
236 var curPage = this; 238 var curPage = this;
237 var pagePath = curPage.route; //当前页面url 239 var pagePath = curPage.route; //当前页面url
238 if (pagePath.indexOf('/') != 0) { 240 if (pagePath.indexOf('/') != 0) {
@@ -266,6 +268,7 @@ Page({ @@ -266,6 +268,7 @@ Page({
266 }, 268 },
267 269
268 onShareTimeline() { 270 onShareTimeline() {
  271 + getApp().globalData.no_clear=1;
269 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; 272 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
270 if (!store_name) 273 if (!store_name)
271 store_name = getApp().globalData.setting.appName; 274 store_name = getApp().globalData.setting.appName;
pages/cart/cart/cart.js
@@ -69,6 +69,7 @@ Page({ @@ -69,6 +69,7 @@ Page({
69 //每次显示都清空 69 //每次显示都清空
70 this.data.in_zhact_gdmap = {}; 70 this.data.in_zhact_gdmap = {};
71 71
  72 +
72 if (typeof this.getTabBar === 'function' && this.getTabBar()) { 73 if (typeof this.getTabBar === 'function' && this.getTabBar()) {
73 var index = getApp().getPageIndex(this); 74 var index = getApp().getPageIndex(this);
74 this.getTabBar().setData({ 75 this.getTabBar().setData({
@@ -1080,8 +1081,20 @@ Page({ @@ -1080,8 +1081,20 @@ Page({
1080 goods_num: a, 1081 goods_num: a,
1081 goods_id: e.goods_id, 1082 goods_id: e.goods_id,
1082 id: e.id, 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 th.postCardList_ser(s, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); 1098 th.postCardList_ser(s, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
1086 } 1099 }
1087 }, 1100 },
@@ -1089,7 +1102,7 @@ Page({ @@ -1089,7 +1102,7 @@ Page({
1089 addNum_ser: function (t) { 1102 addNum_ser: function (t) {
1090 if (!this.data.is_load) return false; 1103 if (!this.data.is_load) return false;
1091 if (this.data.up_dating == 1) return false; 1104 if (this.data.up_dating == 1) return false;
1092 - this.data.up_dating = 1; 1105 + // this.data.up_dating = 1;
1093 1106
1094 var a = t.currentTarget.dataset.item; 1107 var a = t.currentTarget.dataset.item;
1095 var b = t.currentTarget.dataset.pitems; 1108 var b = t.currentTarget.dataset.pitems;
@@ -1098,18 +1111,31 @@ Page({ @@ -1098,18 +1111,31 @@ Page({
1098 var e = { 1111 var e = {
1099 goods_num: a.goods_num + 1, 1112 goods_num: a.goods_num + 1,
1100 id: a.id, 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 this.postCardList_ser(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); 1129 this.postCardList_ser(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
1105 1130
1106 }, 1131 },
1107 //-------------减数量--------------------- 1132 //-------------减数量---------------------
1108 subNum_ser: function (t) { 1133 subNum_ser: function (t) {
  1134 +
1109 if (!this.data.is_load) return false; 1135 if (!this.data.is_load) return false;
1110 if (this.data.up_dating == 1) return false; 1136 if (this.data.up_dating == 1) return false;
1111 - this.data.up_dating = 1;  
1112 - 1137 + // this.data.up_dating = 1;
  1138 +
1113 var a = t.currentTarget.dataset.item; 1139 var a = t.currentTarget.dataset.item;
1114 var b = t.currentTarget.dataset.pitems; 1140 var b = t.currentTarget.dataset.pitems;
1115 a = this.data.service_data[b].goods[a]; 1141 a = this.data.service_data[b].goods[a];
@@ -1297,8 +1323,9 @@ Page({ @@ -1297,8 +1323,9 @@ Page({
1297 for (var j = 0; j < item.length; j++) { 1323 for (var j = 0; j < item.length; j++) {
1298 var txt = "service_data[" + i + "].goods[" + j + "].selected" 1324 var txt = "service_data[" + i + "].goods[" + j + "].selected"
1299 e.setData({ 1325 e.setData({
1300 - [txt]: !e.data.checkAllToggle, 1326 + [txt]: !e.data.checkAllToggle ? 1 : 0,
1301 }) 1327 })
  1328 +
1302 if (!e.data.checkAllToggle) { 1329 if (!e.data.checkAllToggle) {
1303 tfeel += item[j].goods_num * item[j].money; 1330 tfeel += item[j].goods_num * item[j].money;
1304 t_num += item[j].goods_num; 1331 t_num += item[j].goods_num;
@@ -1509,7 +1536,8 @@ Page({ @@ -1509,7 +1536,8 @@ Page({
1509 var e = this, 1536 var e = this,
1510 item = t.currentTarget.dataset.item, 1537 item = t.currentTarget.dataset.item,
1511 pitems = t.currentTarget.dataset.pitems; 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 var isok = 1, 1541 var isok = 1,
1514 fir = 0; 1542 fir = 0;
1515 var iarr = e.data.service_data[pitems].goods; 1543 var iarr = e.data.service_data[pitems].goods;
@@ -1541,6 +1569,7 @@ Page({ @@ -1541,6 +1569,7 @@ Page({
1541 e.setData({ 1569 e.setData({
1542 [txt]: Number(!a.selected), 1570 [txt]: Number(!a.selected),
1543 }); 1571 });
  1572 +
1544 this.doCheckAll(); 1573 this.doCheckAll();
1545 }, 1574 },
1546 1575
@@ -1987,17 +2016,204 @@ Page({ @@ -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 var e = this, 2020 var e = this,
1992 th = e; 2021 th = e;
1993 var user_id = getApp().globalData.user_id; 2022 var user_id = getApp().globalData.user_id;
1994 var txt = "service_data[" + pitem + "].goods[" + item + "].goods_num"; 2023 var txt = "service_data[" + pitem + "].goods[" + item + "].goods_num";
  2024 +
1995 e.setData({ 2025 e.setData({
1996 [txt]: t.goods_num 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,6 +2333,8 @@ Page({
2117 //--更新购物车--- 2333 //--更新购物车---
2118 update_cart_ser: function (t, pitem, item) { 2334 update_cart_ser: function (t, pitem, item) {
2119 var e = this; 2335 var e = this;
  2336 +
  2337 + console.log('t===>', t);
2120 getApp().request.put("/api/weshop/cartService/update", { 2338 getApp().request.put("/api/weshop/cartService/update", {
2121 data: t, 2339 data: t,
2122 success: async function (ee) { 2340 success: async function (ee) {
@@ -2417,19 +2635,20 @@ Page({ @@ -2417,19 +2635,20 @@ Page({
2417 } 2635 }
2418 }); 2636 });
2419 } else { 2637 } else {
  2638 +
2420 //-- 开始服务卡的购物车购买 -- 2639 //-- 开始服务卡的购物车购买 --
2421 for (var i = 0; i < this.data.service_data.length; i++) { 2640 for (var i = 0; i < this.data.service_data.length; i++) {
2422 var i_arr = this.data.service_data[i].goods; 2641 var i_arr = this.data.service_data[i].goods;
  2642 + console.log(i_arr)
  2643 +
2423 for (var j = 0; j < i_arr.length; j++) { 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 wx.hideLoading(); 2654 wx.hideLoading();
@@ -2876,6 +3095,14 @@ Page({ @@ -2876,6 +3095,14 @@ Page({
2876 getApp().goto(good_url); 3095 getApp().goto(good_url);
2877 } 3096 }
2878 }) 3097 })
2879 - } 3098 + },
  3099 +
  3100 +
  3101 +
  3102 +
  3103 +
  3104 +
  3105 +
  3106 +
2880 3107
2881 }); 3108 });
2882 \ No newline at end of file 3109 \ No newline at end of file