Commit 2b0f4b419044f0ea978d44e2938bb073c121237e

Authored by 后端研发-苏明海
2 parents 92b7f01b 4b69d423

Merge branch 'test' into 'qa'

Test

See merge request !844
Showing 69 changed files with 5259 additions and 944 deletions
app.json
@@ -157,7 +157,8 @@ @@ -157,7 +157,8 @@
157 { 157 {
158 "root": "packageC/", 158 "root": "packageC/",
159 "name":"pack3", 159 "name":"pack3",
160 - "pages": [ 160 + "pages": [
  161 + "pages/group_list/group_list",
161 "pages/presell/list/list", 162 "pages/presell/list/list",
162 "pages/presell/cart/cart", 163 "pages/presell/cart/cart",
163 "pages/presell/cart/cart2", 164 "pages/presell/cart/cart2",
@@ -165,7 +166,9 @@ @@ -165,7 +166,9 @@
165 "pages/presell/goodsInfo/goodsInfo", 166 "pages/presell/goodsInfo/goodsInfo",
166 "pages/goods/distributionCategoryList/index", 167 "pages/goods/distributionCategoryList/index",
167 "pages/goods/goodsList/goodsList", 168 "pages/goods/goodsList/goodsList",
168 - "pages/payForAnother/payForAnother" 169 + "pages/payForAnother/payForAnother",
  170 + "pages/luckyGo/luckyGo_list/luckyGo_list",
  171 + "pages/luckyGo/luckyGo_details/luckyGo_details"
169 ] 172 ]
170 } 173 }
171 174
app.wxss
@@ -4,6 +4,9 @@ @@ -4,6 +4,9 @@
4 .pdt4 { 4 .pdt4 {
5 padding-top: 4rpx; 5 padding-top: 4rpx;
6 } 6 }
  7 +.pdt6 {
  8 + padding-top: 6rpx;
  9 +}
7 .pd10 { 10 .pd10 {
8 padding: 10rpx; 11 padding: 10rpx;
9 } 12 }
@@ -37,6 +40,9 @@ @@ -37,6 +40,9 @@
37 .pdt12 { 40 .pdt12 {
38 padding-top: 12rpx; 41 padding-top: 12rpx;
39 } 42 }
  43 +.pdt16 {
  44 + padding-top: 16rpx;
  45 +}
40 .pdb10 { 46 .pdb10 {
41 padding-bottom: 10rpx; 47 padding-bottom: 10rpx;
42 } 48 }
@@ -49,6 +55,9 @@ @@ -49,6 +55,9 @@
49 .pdl30 { 55 .pdl30 {
50 padding-left: 30rpx; 56 padding-left: 30rpx;
51 } 57 }
  58 +.pdl60 {
  59 + padding-left: 60rpx;
  60 +}
52 .pdr10 { 61 .pdr10 {
53 padding-right: 10rpx; 62 padding-right: 10rpx;
54 } 63 }
@@ -137,9 +146,7 @@ @@ -137,9 +146,7 @@
137 color: #c7c7c7; 146 color: #c7c7c7;
138 } 147 }
139 148
140 -.c-7b {  
141 - color: #7b7b7b;  
142 -} 149 +
143 150
144 .c-d { 151 .c-d {
145 color: #ddd; 152 color: #ddd;
@@ -708,9 +715,9 @@ background: #ffe3e2; @@ -708,9 +715,9 @@ background: #ffe3e2;
708 /* 图标字体(ty) */ 715 /* 图标字体(ty) */
709 @font-face { 716 @font-face {
710 font-family: 'iconfont'; /* Project id 2054717 */ 717 font-family: 'iconfont'; /* Project id 2054717 */
711 - src: url('//at.alicdn.com/t/font_2054717_hsngh9ootwv.woff2?t=1632559813006') format('woff2'),  
712 - url('//at.alicdn.com/t/font_2054717_hsngh9ootwv.woff?t=1632559813006') format('woff'),  
713 - url('//at.alicdn.com/t/font_2054717_hsngh9ootwv.ttf?t=1632559813006') format('truetype'); 718 + src: url('//at.alicdn.com/t/font_2054717_kwrwze5y6c.woff2?t=1635844276600') format('woff2'),
  719 + url('//at.alicdn.com/t/font_2054717_kwrwze5y6c.woff?t=1635844276600') format('woff'),
  720 + url('//at.alicdn.com/t/font_2054717_kwrwze5y6c.ttf?t=1635844276600') format('truetype');
714 } 721 }
715 722
716 .iconfont { 723 .iconfont {
@@ -721,6 +728,19 @@ background: #ffe3e2; @@ -721,6 +728,19 @@ background: #ffe3e2;
721 -moz-osx-font-smoothing: grayscale; 728 -moz-osx-font-smoothing: grayscale;
722 } 729 }
723 730
  731 +.icon-luck:before {
  732 + content: "\e621";
  733 +}
  734 +
  735 +.icon-shizhong:before {
  736 + content: "\e74f";
  737 +}
  738 +
  739 +.icon-dingwei:before {
  740 + content: "\e6b4";
  741 +}
  742 +
  743 +
724 .icon-fenlei:before { 744 .icon-fenlei:before {
725 content: "\e628"; 745 content: "\e628";
726 } 746 }
components/diy_goodsGroup/diy_goodsGroup.js
@@ -151,6 +151,9 @@ Component({ @@ -151,6 +151,9 @@ Component({
151 index = 0, 151 index = 0,
152 gdata = []; 152 gdata = [];
153 153
  154 + var user_id=getApp().globalData.user_id;
  155 + if(!user_id) user_id=0;
  156 +
154 //--初始化卡类-- 157 //--初始化卡类--
155 th.card_init(); 158 th.card_init();
156 var os=getApp().globalData.setting; 159 var os=getApp().globalData.setting;
@@ -162,8 +165,10 @@ Component({ @@ -162,8 +165,10 @@ Component({
162 for (var i = 0; i < g_id.length; i++) { 165 for (var i = 0; i < g_id.length; i++) {
163 str += g_id[i].goodsid + ","; 166 str += g_id[i].goodsid + ",";
164 } 167 }
165 - str=str.substring(0, str.length - 1); 168 + str=str.substring(0, str.length - 1);
  169 +
166 await app.request.get("/api/weshop/goods/getgoodslistOrdby?store_id=" + os.stoid + "&goodsidlist=" + str, { 170 await app.request.get("/api/weshop/goods/getgoodslistOrdby?store_id=" + os.stoid + "&goodsidlist=" + str, {
  171 + data:{user_id:user_id},
167 isShowLoading:false, 172 isShowLoading:false,
168 success: function(res) { 173 success: function(res) {
169 th.data.loading=0; 174 th.data.loading=0;
@@ -218,6 +223,10 @@ Component({ @@ -218,6 +223,10 @@ Component({
218 if(th.data.is_hot) r_data.is_hot=th.data.is_hot; 223 if(th.data.is_hot) r_data.is_hot=th.data.is_hot;
219 if(th.data.is_new) r_data.is_new=th.data.is_new; 224 if(th.data.is_new) r_data.is_new=th.data.is_new;
220 225
  226 + var user_id=getApp().globalData.user_id;
  227 + if(!user_id) user_id=0;
  228 + r_data.user_id=user_id;
  229 +
221 await app.request.promiseGet("/api/weshop/goods/page", { 230 await app.request.promiseGet("/api/weshop/goods/page", {
222 data:r_data 231 data:r_data
223 }).then(res => { 232 }).then(res => {
@@ -245,6 +254,7 @@ Component({ @@ -245,6 +254,7 @@ Component({
245 isonsale: 1, 254 isonsale: 1,
246 orderField: "sort", 255 orderField: "sort",
247 orderType: 'asc', 256 orderType: 'asc',
  257 + user_id:user_id
248 } 258 }
249 }).then(res => { 259 }).then(res => {
250 th.data.loading=0; 260 th.data.loading=0;
components/diy_goodsGroup/diy_goodsGroup.wxml
@@ -17,10 +17,18 @@ @@ -17,10 +17,18 @@
17 <view class='zs_goods {{g_filter.get_border_type(object.big_order_type)}}'> 17 <view class='zs_goods {{g_filter.get_border_type(object.big_order_type)}}'>
18 <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" class="s1_gk_a1"> 18 <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" class="s1_gk_a1">
19 <view class='zs_top rel'> 19 <view class='zs_top rel'>
20 - <image class='zs_t_img' src="{{item.goods_img}}"  
21 - data-errorimg="goods_array[{{index}}].goods_img"  
22 - binderror="bind_bnerr3" lazy-load="true"  
23 - ></image> 20 +
  21 + <block wx:if="{{object.big_order_type==3}}">
  22 + <view style="position: relative; width: 100%; height: 100%">
  23 + <image class='zs_t_img' src="{{object.pic_back}}" data-errorimg="object.pic_back" lazy-load="true"
  24 + binderror="bind_bnerr3"></image>
  25 + <image class="n_box" style="top: {{object.top}}%;left:{{object.left}}%;width: {{object.width}}%;height: {{object.width}}%" src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" binderror="bind_bnerr3"></image>
  26 + </view>
  27 + </block>
  28 + <block wx:else>
  29 + <image class='zs_t_img' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img"
  30 + binderror="bind_bnerr3" lazy-load="true" ></image>
  31 + </block>
24 32
25 <block wx:if="{{object.goodicon==3}}"> 33 <block wx:if="{{object.goodicon==3}}">
26 <image class='{{g_filter.get_class(object.column,object.position)}}' src='{{object.customicon}}'></image> 34 <image class='{{g_filter.get_class(object.column,object.position)}}' src='{{object.customicon}}'></image>
@@ -166,8 +174,20 @@ @@ -166,8 +174,20 @@
166 <view class="zs_goods_ban"> 174 <view class="zs_goods_ban">
167 <view class='zs_goods_2l'> 175 <view class='zs_goods_2l'>
168 <view class='zs_top_2l rel'> 176 <view class='zs_top_2l rel'>
169 - <image class='zs_t_img_2l' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" 177 +
  178 + <block wx:if="{{object.big_order_type==3}}">
  179 + <view style="position: relative; width: 100%; height: 100%">
  180 + <image class='zs_t_img_2l' src="{{object.pic_back}}" data-errorimg="object.pic_back" lazy-load="true"
  181 + binderror="bind_bnerr3"></image>
  182 + <image class="n_box" style="top: {{object.top}}%;left:{{object.left}}%;width: {{object.width}}%;height: {{object.width}}%" src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true"
  183 + binderror="bind_bnerr3"></image>
  184 + </view>
  185 + </block>
  186 + <block wx:else>
  187 + <image class='zs_t_img_2l' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true"
170 binderror="bind_bnerr3"></image> 188 binderror="bind_bnerr3"></image>
  189 + </block>
  190 +
171 <block wx:if="{{object.goodicon==3}}"> 191 <block wx:if="{{object.goodicon==3}}">
172 <image class='{{g_filter.get_class(object.column,object.position)}}' 192 <image class='{{g_filter.get_class(object.column,object.position)}}'
173 src='{{object.customicon}}'></image> 193 src='{{object.customicon}}'></image>
@@ -312,9 +332,20 @@ @@ -312,9 +332,20 @@
312 <view class="zs_goods_wai_san" > 332 <view class="zs_goods_wai_san" >
313 <view class="zs_goods_san"> 333 <view class="zs_goods_san">
314 <view class='zs_goods_3l {{g_filter.get_border_type(object.big_order_type)}}'> 334 <view class='zs_goods_3l {{g_filter.get_border_type(object.big_order_type)}}'>
315 - <view class='zs_top_3l rel'>  
316 - <image class='zs_t_img_3l' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" 335 + <view class='zs_top_3l rel'>
  336 + <block wx:if="{{object.big_order_type==3}}">
  337 + <view style="position: relative; width: 100%; height: 100%">
  338 + <image class='zs_t_img_3l' src="{{object.pic_back}}" data-errorimg="object.pic_back" lazy-load="true"
  339 + binderror="bind_bnerr3"></image>
  340 + <image class="n_box" style="top: {{object.top}}%;left:{{object.left}}%;width: {{object.width}}%;height: {{object.width}}%" src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true"
  341 + binderror="bind_bnerr3"></image>
  342 + </view>
  343 + </block>
  344 + <block wx:else>
  345 + <image class='zs_t_img_3l' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true"
317 binderror="bind_bnerr3"></image> 346 binderror="bind_bnerr3"></image>
  347 + </block>
  348 +
318 <block wx:if="{{object.goodicon==3}}"> 349 <block wx:if="{{object.goodicon==3}}">
319 <image class='{{g_filter.get_class(object.column,object.position)}}' 350 <image class='{{g_filter.get_class(object.column,object.position)}}'
320 src='{{object.customicon}}'></image> 351 src='{{object.customicon}}'></image>
@@ -457,9 +488,18 @@ @@ -457,9 +488,18 @@
457 <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" class="s1_gk_a1"> 488 <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" class="s1_gk_a1">
458 <view class="{{object.noboder==0?'zs_goods_xiao_bottom':'zs_goods_xiao'}}" > 489 <view class="{{object.noboder==0?'zs_goods_xiao_bottom':'zs_goods_xiao'}}" >
459 <view class='zs_top_x'> 490 <view class='zs_top_x'>
460 - <!--<image class='zs_t_img_x'></image>-->  
461 - <block>  
462 - <image class='zs_t_img_x' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" 491 + <block wx:if="{{object.big_order_type==3}}">
  492 + <view style="position: relative; width: 100%; height: 100%">
  493 + <image class='zs_t_img_x' src="{{object.pic_back}}" data-errorimg="object.pic_back" lazy-load="true"
  494 + binderror="bind_bnerr3"></image>
  495 + <image class="n_box" style="top: {{object.top}}%;left:{{object.left}}%;width: {{object.width}}%;height: {{object.width}}%" src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true"
  496 + binderror="bind_bnerr3"></image>
  497 + </view>
  498 + </block>
  499 +
  500 + <block wx:else>
  501 + <image class="zs_t_img_x {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}}"
  502 + src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true"
463 binderror="bind_bnerr3" mode="widthFix" style='max-height:290rpx'></image> 503 binderror="bind_bnerr3" mode="widthFix" style='max-height:290rpx'></image>
464 </block> 504 </block>
465 505
@@ -587,12 +627,8 @@ @@ -587,12 +627,8 @@
587 <view class='wz_red'>¥{{item.shop_price}}</view> 627 <view class='wz_red'>¥{{item.shop_price}}</view>
588 <view class='del'>¥{{item.market_price}}</view> 628 <view class='del'>¥{{item.market_price}}</view>
589 </block> 629 </block>
590 -  
591 - 630 +
592 </block> 631 </block>
593 -  
594 -  
595 -  
596 </view> 632 </view>
597 <view class='zs_wz5_x' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> 633 <view class='zs_wz5_x' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view>
598 </view> 634 </view>
@@ -622,17 +658,30 @@ @@ -622,17 +658,30 @@
622 658
623 659
624 <!--商品展示--> 660 <!--商品展示-->
625 - <swiper class="s_prom" indicator-active-color='red' indicator-dots="false" wx:if="{{object.column==5}}" style="height: {{swiper_hei}}rpx;"> 661 +<swiper class="s_prom" indicator-active-color='red' indicator-dots="false" wx:if="{{object.column==5}}" style="height: {{swiper_hei}}rpx;">
626 <view class="sp"> 662 <view class="sp">
627 <swiper-item class="s_it" wx:for="{{goods_array}}"> 663 <swiper-item class="s_it" wx:for="{{goods_array}}">
628 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> 664 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
629 <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" style="width: 32%" > 665 <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" style="width: 32%" >
630 - <view class='one' style="margin-left: 10rpx"> 666 + <view class="one {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}} " style="margin-left: 10rpx">
631 <view class='sp_top'> 667 <view class='sp_top'>
632 <view class='s_img' style="position: relative; width: 100%"> 668 <view class='s_img' style="position: relative; width: 100%">
633 - <image src="{{aitem.goods_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].goods_img" 669 +
  670 + <block wx:if="{{object.big_order_type==3}}">
  671 + <view style="position: relative; width: 100%; height: 100%">
  672 + <image src="{{object.pic_back}}" data-errorimg="object.pic_back" lazy-load="true"
  673 + binderror="bind_bnerr3"></image>
  674 +
  675 + <image class="n_box" style="top: {{object.top}}%;left:{{object.left}}%;width: {{object.width}}%;height: {{object.width}}%" src="{{aitem.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" binderror="bind_bnerr3"></image>
  676 + </view>
  677 + </block>
  678 +
  679 + <block wx:else>
  680 + <image src="{{aitem.goods_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].goods_img"
634 binderror="bind_bnerr3" lazy-load="true" style="width: 100%"></image> 681 binderror="bind_bnerr3" lazy-load="true" style="width: 100%"></image>
635 - 682 + </block>
  683 +
  684 +
636 <block wx:if="{{object.goodicon==3}}"> 685 <block wx:if="{{object.goodicon==3}}">
637 <image class='{{g_filter.get_class(object.column,object.position)}}' 686 <image class='{{g_filter.get_class(object.column,object.position)}}'
638 src='{{object.customicon}}'></image> 687 src='{{object.customicon}}'></image>
components/diy_goodsGroup/diy_goodsGroup.wxss
@@ -154,6 +154,10 @@ @@ -154,6 +154,10 @@
154 margin-left: 20rpx; 154 margin-left: 20rpx;
155 } 155 }
156 156
  157 +.zs_t_img_x.zj{ border: 1rpx solid #eee;}
  158 +.zs_t_img_x.yj{ border: 1rpx solid #eee;border-radius: 18rpx;}
  159 +
  160 +
157 .zs_center_x { 161 .zs_center_x {
158 width: 100%; 162 width: 100%;
159 min-height: 200rpx; 163 min-height: 200rpx;
@@ -727,8 +731,13 @@ swiper { @@ -727,8 +731,13 @@ swiper {
727 731
728 .one { 732 .one {
729 margin-left: 14rpx; 733 margin-left: 14rpx;
  734 + overflow: hidden;
730 } 735 }
731 736
  737 +.one.zj{ border: 1rpx solid #eee;}
  738 +.one.yj{ border: 1rpx solid #eee; border-radius: 18rpx;}
  739 +
  740 +
732 .sp .sp_top .s_top1_kill { 741 .sp .sp_top .s_top1_kill {
733 position: absolute; 742 position: absolute;
734 background-color: #c4182e; 743 background-color: #c4182e;
@@ -814,5 +823,6 @@ top: 10rpx; @@ -814,5 +823,6 @@ top: 10rpx;
814 position: absolute; 823 position: absolute;
815 right: 0rpx; 824 right: 0rpx;
816 bottom: 10rpx; 825 bottom: 10rpx;
  826 +}
817 827
818 -}  
819 \ No newline at end of file 828 \ No newline at end of file
  829 +.n_box{ position: absolute !important;z-index: 10}
820 \ No newline at end of file 830 \ No newline at end of file
components/diy_seckill/diy_seckill.js
@@ -40,21 +40,22 @@ Component({ @@ -40,21 +40,22 @@ Component({
40 pageLifetimes: { 40 pageLifetimes: {
41 //要处理一下,游客登录后的界面的变化,主要还该是改变会员 41 //要处理一下,游客登录后的界面的变化,主要还该是改变会员
42 show: function () { 42 show: function () {
43 -  
44 - var th = this;  
45 - if (this.data.goods_array.length > 0) {  
46 - th.data.timer = setInterval(function () {  
47 - th.countDown2(th);  
48 - }, 1000);  
49 - } 43 + //会员身份变化
  44 + var th = this;
  45 + var g_id = this.data.object;
  46 + this.init(g_id);
  47 + setTimeout(function () {
  48 + if (th.data.goods_array && th.data.goods_array.length > 0) {
  49 + th.data.timer = setInterval(function () {
  50 + th.countDown2(th);
  51 + }, 1000);
  52 + }
  53 + },600)
50 } 54 }
51 }, 55 },
52 56
53 ready: function () { 57 ready: function () {
54 - console.log("ready");  
55 - // var g_id = this.data.object.data;  
56 var g_id = this.data.object; 58 var g_id = this.data.object;
57 - // console.log(g_id);  
58 this.init(g_id); 59 this.init(g_id);
59 }, 60 },
60 detached() { 61 detached() {
@@ -75,9 +76,12 @@ Component({ @@ -75,9 +76,12 @@ Component({
75 }) 76 })
76 goodsidlist = ut.sub_last(goodsidlist); 77 goodsidlist = ut.sub_last(goodsidlist);
77 78
  79 + var user_id=getApp().globalData.user_id;
  80 + if(!user_id){ user_id=0;}
  81 +
78 //--调用接口,读取秒杀-- 82 //--调用接口,读取秒杀--
79 app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" 83 app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id="
80 - + os.stoid + "&goodsidlist=" + goodsidlist, {}).then(res => { 84 + + os.stoid + "&goodsidlist=" + goodsidlist+"&user_id"+user_id, {}).then(res => {
81 console.log(res); 85 console.log(res);
82 //如果秒杀的数组为空的时候 86 //如果秒杀的数组为空的时候
83 var goodslist = res.data.data; 87 var goodslist = res.data.data;
@@ -94,9 +98,11 @@ Component({ @@ -94,9 +98,11 @@ Component({
94 98
95 //当是默认的情况 99 //当是默认的情况
96 no_gid_set() { 100 no_gid_set() {
97 - console.log(5623); 101 + var user_id=getApp().globalData.user_id;
  102 + if(!user_id){ user_id=0;}
  103 + var req={ store_id: os.stoid, is_end: 0, is_show: 1, timetype: 2,user_id:user_id};
98 getApp().request.promiseGet("/api/ms/flash_sale/spikepage?page=1&pageSize=9", 104 getApp().request.promiseGet("/api/ms/flash_sale/spikepage?page=1&pageSize=9",
99 - { isShowLoading: 1, data: { store_id: os.stoid, is_end: 0, is_show: 1, timetype: 2 } } 105 + { isShowLoading: 1, data:req }
100 ).then(res => { 106 ).then(res => {
101 if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) { 107 if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) {
102 var goodsidlist = res.data.data.pageData; 108 var goodsidlist = res.data.data.pageData;
@@ -115,8 +121,8 @@ Component({ @@ -115,8 +121,8 @@ Component({
115 g_id.forEach(function (val, ind) { 121 g_id.forEach(function (val, ind) {
116 goodslist.forEach(function (vy, indy) { 122 goodslist.forEach(function (vy, indy) {
117 if (val.goodsid == vy.goods_id) { 123 if (val.goodsid == vy.goods_id) {
  124 + if(!vy.id) vy.id=vy.prom_id;
118 all_array.push(vy); 125 all_array.push(vy);
119 - //th.setData({goods_array:arr});  
120 } 126 }
121 }) 127 })
122 }) 128 })
@@ -129,6 +135,11 @@ Component({ @@ -129,6 +135,11 @@ Component({
129 all_array = goodslist; 135 all_array = goodslist;
130 } 136 }
131 137
  138 + for(let i in all_array){
  139 + let item=all_array[i];
  140 + if(item.user_price) item.price=item.user_price;
  141 + }
  142 +
132 var arr = new Array(); 143 var arr = new Array();
133 //--三个三个一组--- 144 //--三个三个一组---
134 for (var i = 0; i < all_array.length; i += 3) { 145 for (var i = 0; i < all_array.length; i += 3) {
components/diy_seckill/diy_seckill.wxml
@@ -15,29 +15,29 @@ @@ -15,29 +15,29 @@
15 <view class='sp' wx:if="{{object.style==1}}"> 15 <view class='sp' wx:if="{{object.style==1}}">
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}}" 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 <view class='one'> 19 <view class='one'>
20 <view class='sp_top'> 20 <view class='sp_top'>
21 <view class='po'></view> 21 <view class='po'></view>
22 <block wx:if="{{aitem.start_time>newTime}}"> 22 <block wx:if="{{aitem.start_time>newTime}}">
23 - <view class="rob"> 23 + <view class="rob" style="justify-content: flex-start">
24 <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span> 24 <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span>
25 </view> 25 </view>
26 </block> 26 </block>
27 27
28 <block wx:if="{{aitem.end_time<=newTime}}"> 28 <block wx:if="{{aitem.end_time<=newTime}}">
29 - <view class="rob"> 29 + <view class="rob" style="justify-content: flex-start">
30 <span class='s_top_kill gray'>活动已结束</span> 30 <span class='s_top_kill gray'>活动已结束</span>
31 </view> 31 </view>
32 </block> 32 </block>
33 <block wx:else> 33 <block wx:else>
34 <block wx:if="{{aitem.start_time<newTime && aitem.goods_num>aitem.buy_num}}"> 34 <block wx:if="{{aitem.start_time<newTime && aitem.goods_num>aitem.buy_num}}">
35 - <view class="rob"> 35 + <view class="rob" style="justify-content: flex-start">
36 <span class='s_top_kill'>火热进行</span> 36 <span class='s_top_kill'>火热进行</span>
37 </view> 37 </view>
38 </block> 38 </block>
39 <block wx:if="{{aitem.goods_num<=aitem.buy_num}}"> 39 <block wx:if="{{aitem.goods_num<=aitem.buy_num}}">
40 - <view class="rob"> 40 + <view class="rob" style="justify-content: flex-start">
41 <span class='s_top_kill gray'>已抢光</span> 41 <span class='s_top_kill gray'>已抢光</span>
42 </view> 42 </view>
43 </block> 43 </block>
@@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
62 </view> 62 </view>
63 63
64 <view class='sp_wz'> 64 <view class='sp_wz'>
65 - <view class='sp_wzi'>{{aitem.title}}</view> 65 + <view class='sp_wzi'>{{aitem.goods_name}}</view>
66 <view class='sp_jg'>¥{{aitem.price}}</view> 66 <view class='sp_jg'>¥{{aitem.price}}</view>
67 <view class='sp_jgx'>¥{{aitem.market_price}}</view> 67 <view class='sp_jgx'>¥{{aitem.market_price}}</view>
68 </view> 68 </view>
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 <view class="sp2" wx:if="{{object.style==2}}"> 77 <view class="sp2" wx:if="{{object.style==2}}">
78 <block wx:for="{{goods_array}}"> 78 <block wx:for="{{goods_array}}">
79 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> 79 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
80 - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" class="s1_gk_a1"> 80 + <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1">
81 <view class='one1'> 81 <view class='one1'>
82 82
83 <view class="o1_img"> 83 <view class="o1_img">
components/diy_seckill/diy_seckill.wxss
@@ -77,13 +77,12 @@ swiper { @@ -77,13 +77,12 @@ swiper {
77 font-size: 24rpx; 77 font-size: 24rpx;
78 height: 38rpx; 78 height: 38rpx;
79 line-height: 38rpx; 79 line-height: 38rpx;
80 - left: 6rpx;  
81 padding: 4rpx 10rpx; 80 padding: 4rpx 10rpx;
82 border-radius: 10rpx; 81 border-radius: 10rpx;
83 z-index: 999; 82 z-index: 999;
84 position: relative; 83 position: relative;
85 - top: -6rpx;  
86 - width: 210rpx; 84 + top: 1rpx;
  85 + width: 110rpx;
87 color: #fff; 86 color: #fff;
88 text-align: center; 87 text-align: center;
89 } 88 }
components/diy_service/diy_service.js
@@ -36,8 +36,8 @@ Component({ @@ -36,8 +36,8 @@ Component({
36 return false; 36 return false;
37 }, 37 },
38 38
39 - //---------联系客服------------  
40 - contactService: function() { 39 + //---------联系客服------------
  40 + contactService: function() {
41 getApp().getConfig(function(t) { 41 getApp().getConfig(function(t) {
42 if (t.store_tel == undefined) { 42 if (t.store_tel == undefined) {
43 getApp().request.get("/api/weshop/store/get/" + os.stoid, { 43 getApp().request.get("/api/weshop/store/get/" + os.stoid, {
@@ -57,5 +57,16 @@ Component({ @@ -57,5 +57,16 @@ Component({
57 } 57 }
58 }); 58 });
59 }, 59 },
  60 +
  61 + //---------联系微信客服------------
  62 + 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 + })
  70 + }
60 } 71 }
61 }) 72 })
components/diy_service/diy_service.wxml
1 <!--有在线客户 和 打电话--> 1 <!--有在线客户 和 打电话-->
2 -<block wx:if="{{sys_switch.weapp_customertype}}"> 2 +<block wx:if="{{sys_switch.weapp_customertype==1}}">
3 <!-- 判断是不是有登录 --> 3 <!-- 判断是不是有登录 -->
4 <view wx:if="{{userInfo}}" class="custom-service" bindtap="go_user" > 4 <view wx:if="{{userInfo}}" class="custom-service" bindtap="go_user" >
5 <view style="text-align: center;"> 5 <view style="text-align: center;">
@@ -14,7 +14,16 @@ @@ -14,7 +14,16 @@
14 <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view> 14 <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view>
15 </view> 15 </view>
16 </button> 16 </button>
17 -</block> 17 +</block>
  18 +
  19 +<block wx:elif="{{sys_switch.weapp_customertype==2}}">
  20 + <view class="custom-service cart-ico new_split" bindtap="con_weixin">
  21 + <view style="text-align: center;">
  22 + <image class="cs-img" src="{{object.img}}"></image>
  23 + <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view>
  24 + </view>
  25 + </view>
  26 +</block>
18 27
19 <block wx:else> 28 <block wx:else>
20 <view class="custom-service cart-ico new_split" bindtap="contactService"> 29 <view class="custom-service cart-ico new_split" bindtap="contactService">
components/goods_list/goods_list.wxml
@@ -4,15 +4,15 @@ @@ -4,15 +4,15 @@
4 <view class="collects"> 4 <view class="collects">
5 <view class="hang "> 5 <view class="hang ">
6 <!-- 商品详情 --> 6 <!-- 商品详情 -->
7 - <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}">  
8 - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}" hover-class="none"> 7 + <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}">
  8 + <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}" hover-class="none">
9 <!-- 商品图⽚ --> 9 <!-- 商品图⽚ -->
10 <image class="sp" src="{{url+item.original_img}}" mode="aspectFill" binderror="bind_bnerr_xc" data-url="{{url+item.original_img}}" data-errorimg="recommend[{{index}}].original_img"></image> 10 <image class="sp" src="{{url+item.original_img}}" mode="aspectFill" binderror="bind_bnerr_xc" data-url="{{url+item.original_img}}" data-errorimg="recommend[{{index}}].original_img"></image>
11 <view class="bottom"> 11 <view class="bottom">
12 <!-- 商品名称 --> 12 <!-- 商品名称 -->
13 <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view> 13 <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view>
14 <!-- 判断是否有活动价 --> 14 <!-- 判断是否有活动价 -->
15 - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> 15 + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}">
16 <view class="pdt10"> 16 <view class="pdt10">
17 <view class="money flex xc-wc" > 17 <view class="money flex xc-wc" >
18 <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text> 18 <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>
components/userqy_pop_up/userqy_pop_up.js
@@ -28,9 +28,4 @@ Component({ @@ -28,9 +28,4 @@ Component({
28 }, 28 },
29 29
30 }, 30 },
31 -  
32 -  
33 -  
34 -  
35 -  
36 }) 31 })
37 \ No newline at end of file 32 \ No newline at end of file
packageA/pages/activity_share/activity_share.js
@@ -167,10 +167,22 @@ Page({ @@ -167,10 +167,22 @@ Page({
167 if(item){ 167 if(item){
168 var price = item.price; 168 var price = item.price;
169 if(!price) price=item.shop_price; 169 if(!price) price=item.shop_price;
170 - 170 + switch(th.data.currentIndex){
  171 + case 0: item.prom_type=1;break;
  172 + case 1: item.prom_type=6;break;
  173 + case 2:
  174 + if(th.data.currentIndex2==1) item.prom_type = 5;
  175 + if(th.data.currentIndex2==2) {
  176 + item.prom_type = 3;
  177 + item.id=item.prom_id;
  178 + }
  179 + break;
  180 + }
  181 + item.prom_id=item.id;
  182 +
171 var title= item.goods_name; 183 var title= item.goods_name;
172 var img=this.data.url+item.original_img; 184 var img=this.data.url+item.original_img;
173 - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; 185 + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id+"&prom_type="+item.prom_type+"&prom_id="+item.prom_id;
174 if(getApp().globalData.user_id){ 186 if(getApp().globalData.user_id){
175 url+="&first_leader="+getApp().globalData.user_id; 187 url+="&first_leader="+getApp().globalData.user_id;
176 } 188 }
@@ -362,6 +374,8 @@ Page({ @@ -362,6 +374,8 @@ Page({
362 page:this.data.currentPage, 374 page:this.data.currentPage,
363 store_id:oo.stoid, 375 store_id:oo.stoid,
364 } 376 }
  377 + var user_id=getApp().globalData.user_id;
  378 + if(!user_id) user_id=0;
365 379
366 switch(th.data.currentIndex){ 380 switch(th.data.currentIndex){
367 case 0: //--秒杀-- 381 case 0: //--秒杀--
@@ -373,7 +387,8 @@ Page({ @@ -373,7 +387,8 @@ Page({
373 } 387 }
374 req_data.is_show=1; 388 req_data.is_show=1;
375 req_data.is_end=0; 389 req_data.is_end=0;
376 - 390 + req_data.user_id=user_id;
  391 +
377 if(th.data.key_str && th.data.key_str.trim()){ 392 if(th.data.key_str && th.data.key_str.trim()){
378 req_data.key_str=th.data.key_str.trim(); 393 req_data.key_str=th.data.key_str.trim();
379 } 394 }
@@ -427,7 +442,15 @@ Page({ @@ -427,7 +442,15 @@ Page({
427 th.data.is_load=0; 442 th.data.is_load=0;
428 if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ 443 if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
429 th.data.currentPage++; 444 th.data.currentPage++;
430 - var data=res.data.data.pageData; 445 + var data=res.data.data.pageData;
  446 +
  447 + if(th.data.currentIndex==0){
  448 + for(let i in data){
  449 + let item=data[i];
  450 + if(item.user_price) item.price=item.price;
  451 + }
  452 + }
  453 +
431 if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});} 454 if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});}
432 var list=th.data.list; 455 var list=th.data.list;
433 list=list.concat(data); 456 list=list.concat(data);
@@ -536,7 +559,26 @@ Page({ @@ -536,7 +559,26 @@ Page({
536 559
537 var app = getApp(); 560 var app = getApp();
538 var unit = that.data.screenWidth / 750 * 1.35; //基础单位, 561 var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
  562 +
  563 + var prom_type=0;
  564 + var prom_id=th.data.share_good.id;
  565 + switch(th.data.currentIndex){
  566 + case 0: prom_type=1;break;
  567 + case 1: prom_type=6;break;
  568 + case 2:
  569 + if(th.data.currentIndex2==1) prom_type = 5;
  570 + if(th.data.currentIndex2==2){
  571 + prom_type = 3;
  572 + prom_id=th.data.share_good.prom_id;
  573 + }
  574 + break;
  575 + }
  576 +
  577 +
  578 +
539 var scene = th.data.share_good.goods_id+""; 579 var scene = th.data.share_good.goods_id+"";
  580 + scene+="."+prom_type+"."+prom_id;
  581 +
540 var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; 582 var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0;
541 if(user_id>0){ 583 if(user_id>0){
542 scene+="_"+user_id; 584 scene+="_"+user_id;
@@ -1118,14 +1160,27 @@ Page({ @@ -1118,14 +1160,27 @@ Page({
1118 this.data.currentPage=1; 1160 this.data.currentPage=1;
1119 this.requestGoodsList(); 1161 this.requestGoodsList();
1120 }, 1162 },
1121 -  
1122 -  
1123 - go_goods:function(e){  
1124 - var index=e.currentTarget.dataset.index;  
1125 - var item=this.data.list[index];  
1126 - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id;  
1127 - getApp().goto(url);  
1128 - }, 1163 +
  1164 +
  1165 + go_goods: function (e) {
  1166 + var index = e.currentTarget.dataset.index;
  1167 + var item = this.data.list[index];
  1168 + var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id;
  1169 +
  1170 + switch(this.data.currentIndex){
  1171 + case 0: item.prom_type = 1;break;
  1172 + case 1: item.prom_type = 6;break;
  1173 + case 2:
  1174 + if(th.data.currentIndex2==1) item.prom_type = 5;
  1175 + if(th.data.currentIndex2==2) item.prom_type = 3;
  1176 + break;
  1177 + }
  1178 +
  1179 + item.prom_id = item.id;
  1180 + url+="&prom_type="+item.prom_type+"&prom_id="+item.prom_id
  1181 +
  1182 + getApp().goto(url);
  1183 + },
1129 1184
1130 go_coll_good:function(e){ 1185 go_coll_good:function(e){
1131 var gid=e.currentTarget.dataset.gid; 1186 var gid=e.currentTarget.dataset.gid;
packageA/pages/chongzhi/g_filter.wxs
1 var is_acting = function(endtime){ 1 var is_acting = function(endtime){
2 - //判断结束时间减去当前时间 ,如果当前时间大于0则为True  
3 - if(endtime=='') return true;  
4 - endtime = endtime.substring(0, 19);  
5 - var reg = getRegExp("-", "g");  
6 - endtime = endtime.replace(reg, '/');  
7 - var bijiao = getDate(endtime) - getDate();  
8 - return bijiao > 0 ? true : false; 2 + //判断结束时间减去当前时间 ,如果当前时间大于0则为True
  3 + endtime=endtime+" 23:59:59";
  4 + if(endtime=='') return true;
  5 + endtime = endtime.substring(0, 19);
  6 + var reg = getRegExp("-", "g");
  7 + endtime = endtime.replace(reg, '/');
  8 + var bijiao = getDate(endtime) - getDate();
  9 + return bijiao >= 0 ? true : false;
9 } 10 }
10 module.exports = { 11 module.exports = {
11 is_acting:is_acting 12 is_acting:is_acting
packageA/pages/distribution/goods/goods.wxml
@@ -75,13 +75,13 @@ @@ -75,13 +75,13 @@
75 75
76 </label> --> 76 </label> -->
77 <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"/> 77 <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"/>
78 - <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> 78 + <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}">
79 <view class="pdr20"><image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load/></view> 79 <view class="pdr20"><image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load/></view>
80 <view class="flex fdc jc_sb"> 80 <view class="flex fdc jc_sb">
81 <view class="ellipsis-2">{{item.goods_name}}</view> 81 <view class="ellipsis-2">{{item.goods_name}}</view>
82 <view> 82 <view>
83 <!-- 判断是否有活动价 --> 83 <!-- 判断是否有活动价 -->
84 - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> 84 + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}">
85 <view class="flex xc-wc ai-center" > 85 <view class="flex xc-wc ai-center" >
86 <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> 86 <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text>
87 <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> 87 <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
@@ -214,7 +214,7 @@ @@ -214,7 +214,7 @@
214 </checkbox-group> 214 </checkbox-group>
215 215
216 <checkbox-group class="fs26 flex pd16 wrap" catchchange="checkboxChange" wx:else> 216 <checkbox-group class="fs26 flex pd16 wrap" catchchange="checkboxChange" wx:else>
217 - <view class="item2 bg-white" wx:for="{{list.pageData}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> 217 + <view class="item2 bg-white" wx:for="{{list.pageData}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}">
218 <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" mode="aspectFit" lazy-load/> 218 <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" mode="aspectFit" lazy-load/>
219 <view class="pd20 fs26 flex jc_sb fdc f1"> 219 <view class="pd20 fs26 flex jc_sb fdc f1">
220 <view class="ellipsis-2">{{item.goods_name}}</view> 220 <view class="ellipsis-2">{{item.goods_name}}</view>
@@ -222,7 +222,7 @@ @@ -222,7 +222,7 @@
222 <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" data-name="checkbox" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"/> 222 <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" data-name="checkbox" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"/>
223 <view> 223 <view>
224 <!-- 判断是否有活动价 --> 224 <!-- 判断是否有活动价 -->
225 - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> 225 + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0 }}">
226 <view class="flex xc-wc ai-center" > 226 <view class="flex xc-wc ai-center" >
227 <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> 227 <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text>
228 <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> 228 <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
packageA/pages/distribution/shop/shop.wxml
@@ -69,14 +69,14 @@ @@ -69,14 +69,14 @@
69 <view class="content"> 69 <view class="content">
70 <view class="fs26" wx:if="{{isShowRow}}"> 70 <view class="fs26" wx:if="{{isShowRow}}">
71 <view class="item bg-white flex ai-center pd20" wx:for="{{list}}"> 71 <view class="item bg-white flex ai-center pd20" wx:for="{{list}}">
72 - <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> 72 + <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}">
73 <view class="img-container pdr20" data-txt="已售:{{item.sales_sum}}"> 73 <view class="img-container pdr20" data-txt="已售:{{item.sales_sum}}">
74 <image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load mode="aspectFit" /> 74 <image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load mode="aspectFit" />
75 </view> 75 </view>
76 <view class="flex fdc jc_sb"> 76 <view class="flex fdc jc_sb">
77 <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view> 77 <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view>
78 <!-- 判断是否有活动价 --> 78 <!-- 判断是否有活动价 -->
79 - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> 79 + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}">
80 <view class="flex xc-wc pdt20"> 80 <view class="flex xc-wc pdt20">
81 <text wx:if="{{item.prom_integral}}"> 81 <text wx:if="{{item.prom_integral}}">
82 <text class="fs30">{{item.prom_integral}}</text> 82 <text class="fs30">{{item.prom_integral}}</text>
@@ -213,14 +213,14 @@ @@ -213,14 +213,14 @@
213 </view> 213 </view>
214 </view> 214 </view>
215 <view class="fs26 flex pd20 wrap" wx:else> 215 <view class="fs26 flex pd20 wrap" wx:else>
216 - <view class="item2 bg-white" wx:for="{{list}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> 216 + <view class="item2 bg-white" wx:for="{{list}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}">
217 <view class="img-container" data-txt="已售:{{item.sales_sum}}"> 217 <view class="img-container" data-txt="已售:{{item.sales_sum}}">
218 <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load="true" /> 218 <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load="true" />
219 </view> 219 </view>
220 <view class="pd20 fs26"> 220 <view class="pd20 fs26">
221 <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view> 221 <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view>
222 <!-- 判断是否有活动价 --> 222 <!-- 判断是否有活动价 -->
223 - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> 223 + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}">
224 <view class="flex xc-wc"> 224 <view class="flex xc-wc">
225 <text wx:if="{{item.prom_integral}}"> 225 <text wx:if="{{item.prom_integral}}">
226 <text class="fs30" style="font-weight: bold;">{{item.prom_integral}}</text> 226 <text class="fs30" style="font-weight: bold;">{{item.prom_integral}}</text>
packageA/pages/goodsInfo/goodsInfo.js
@@ -2209,6 +2209,17 @@ Page({ @@ -2209,6 +2209,17 @@ Page({
2209 flag: !this.data.flag, 2209 flag: !this.data.flag,
2210 }) 2210 })
2211 }, 2211 },
  2212 +
  2213 + //---------联系微信客服------------
  2214 + con_weixin:function () {
  2215 + var url=this.data.sys_switch.weapp_customertype_url;
  2216 + var id=this.data.sys_switch.weapp_customertype_appid;
  2217 + wx.openCustomerServiceChat({
  2218 + extInfo: {url: url},
  2219 + corpId: id,
  2220 + success(res) {}
  2221 + })
  2222 + }
2212 2223
2213 2224
2214 2225
packageA/pages/goodsInfo/goodsInfo.wxml
@@ -160,10 +160,16 @@ @@ -160,10 +160,16 @@
160 <view class="join-cart jc_sb"> 160 <view class="join-cart jc_sb">
161 161
162 <view class="flex"> 162 <view class="flex">
163 - <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split f1" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}" style="text-align: center"> 163 + <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split f1" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}" style="text-align: center">
164 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 164 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
165 <view>客服</view> 165 <view>客服</view>
166 - </button> 166 + </button>
  167 +
  168 + <view wx:elif="{{sys_switch.weapp_customertype==2}}" class="custom-service cart-ico new_split f1" bindtap="con_weixin" style="text-align: center">
  169 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  170 + <view>客服</view>
  171 + </view>
  172 +
167 <view wx:else class="custom-service cart-ico new_split f1" bindtap="contactService" style="text-align: center"> 173 <view wx:else class="custom-service cart-ico new_split f1" bindtap="contactService" style="text-align: center">
168 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 174 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
169 <view>客服</view> 175 <view>客服</view>
packageA/pages/goods_share/goods_share.js
@@ -292,6 +292,11 @@ Page({ @@ -292,6 +292,11 @@ Page({
292 orderField:this.data.orderField, 292 orderField:this.data.orderField,
293 orderType:this.data.orderType, 293 orderType:this.data.orderType,
294 } 294 }
  295 +
  296 + var user_id=getApp().globalData.user_id;
  297 + if(!user_id){ user_id=0;}
  298 + req_data.user_id=user_id;
  299 +
295 if(this.data.key_str && this.data.key_str.trim()){ 300 if(this.data.key_str && this.data.key_str.trim()){
296 var str=this.data.key_str.trim(); 301 var str=this.data.key_str.trim();
297 req_data.key_str=str; 302 req_data.key_str=str;
packageB/pages/user/collect_list/collect_list.wxml
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 <!-- 商品集合 --> 22 <!-- 商品集合 -->
23 <view class="{{editEd?'collects_max colls_max':'collects_max'}}"> 23 <view class="{{editEd?'collects_max colls_max':'collects_max'}}">
24 <navigator class="collect flex-vertical" bindtap="iconClick" data-index="{{index}}" wx:for="{{collects}}" wx:key="{{index}}" 24 <navigator class="collect flex-vertical" bindtap="iconClick" data-index="{{index}}" wx:for="{{collects}}" wx:key="{{index}}"
25 - data-url="{{editEd==0?'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id:''}}"> 25 + data-url="{{editEd==0?'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id+'&prom_type='+item.prom_type+'&prom_id='+item.prom_id:''}}">
26 26
27 <view class="radioCheck iconClick" wx:if="{{editEd}}"> 27 <view class="radioCheck iconClick" wx:if="{{editEd}}">
28 <radio color="rgb(214,1,33)" class="scale" checked="{{item.checked==true?true:false}}"></radio> 28 <radio color="rgb(214,1,33)" class="scale" checked="{{item.checked==true?true:false}}"></radio>
@@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
46 <!-- 优惠价 --> 46 <!-- 优惠价 -->
47 <view class="price flex xc-wc"> 47 <view class="price flex xc-wc">
48 <view class="fs24">¥</view> 48 <view class="fs24">¥</view>
49 - <view class="fs40">{{item.shop_price}}</view> 49 + <view class="fs40">{{item.prom_price?item.prom_price:item.final_price}}</view>
50 </view> 50 </view>
51 <!-- 原价 --> 51 <!-- 原价 -->
52 <view class="flex fs24 line through xc-ash"> 52 <view class="flex fs24 line through xc-ash">
packageB/pages/zuhegou/index/index.js
@@ -124,6 +124,9 @@ Page({ @@ -124,6 +124,9 @@ Page({
124 * 生命周期函数--监听页面加载 124 * 生命周期函数--监听页面加载
125 */ 125 */
126 onLoad: function (options) { 126 onLoad: function (options) {
  127 +
  128 + console.log(options,111);
  129 +
127 self = this; 130 self = this;
128 var the_id = options.id; 131 var the_id = options.id;
129 if(options.title) { 132 if(options.title) {
@@ -131,7 +134,8 @@ Page({ @@ -131,7 +134,8 @@ Page({
131 title: options.title, 134 title: options.title,
132 }); 135 });
133 }; 136 };
134 - var first_leader=''; 137 + var first_leader=options.first_leader;
  138 +
135 //--如果tg_id是空的话,分享回来-- 139 //--如果tg_id是空的话,分享回来--
136 if (the_id == undefined || the_id == null || the_id == "") { 140 if (the_id == undefined || the_id == null || the_id == "") {
137 var gid_str = decodeURIComponent(options.scene); 141 var gid_str = decodeURIComponent(options.scene);
@@ -249,8 +253,7 @@ Page({ @@ -249,8 +253,7 @@ Page({
249 return false; 253 return false;
250 } 254 }
251 255
252 - //获取购物车的内容  
253 - th.get_cart_val(e); 256 +
254 257
255 var ee = JSON.parse(JSON.stringify(e)); 258 var ee = JSON.parse(JSON.stringify(e));
256 var appd = getApp().globalData; 259 var appd = getApp().globalData;
@@ -342,8 +345,13 @@ Page({ @@ -342,8 +345,13 @@ Page({
342 }); 345 });
343 } 346 }
344 } 347 }
  348 + //获取购物车的内容
  349 + th.get_cart_val(e);
345 350
346 }) 351 })
  352 + }else{
  353 + //获取购物车的内容
  354 + th.get_cart_val(e);
347 } 355 }
348 }, 1); 356 }, 1);
349 357
@@ -418,6 +426,18 @@ Page({ @@ -418,6 +426,18 @@ Page({
418 * 用户点击右上角分享 426 * 用户点击右上角分享
419 */ 427 */
420 onShareAppMessage: function () { 428 onShareAppMessage: function () {
  429 + var title = this.data.act.name;
  430 + var url= "/packageB/pages/zuhegou/index/index?id="+this.data.act.id;
  431 + if (getApp().globalData.user_id) {
  432 + url += "&first_leader=" + getApp().globalData.user_id;
  433 + }
  434 + var ob = {
  435 + title:title,
  436 + path: url,
  437 + };
  438 + if(this.data.act.img_url)
  439 + ob.imageUrl=this.data.iurl+this.data.act.img_url;
  440 + return ob;
421 }, 441 },
422 442
423 /** 443 /**
@@ -2004,7 +2024,7 @@ Page({ @@ -2004,7 +2024,7 @@ Page({
2004 await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { 2024 await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
2005 data: { 2025 data: {
2006 store_id: os.stoid, 2026 store_id: os.stoid,
2007 - user_id: user_id, 2027 + user_id: oo.user_id,
2008 goods_id: item_j.goods_id, 2028 goods_id: item_j.goods_id,
2009 prom_type: 7, 2029 prom_type: 7,
2010 prom_id: th.data.act.id 2030 prom_id: th.data.act.id
packageC/pages/group_list/group_list.js 0 → 100644
  1 +var e = getApp(), i = e.request, a = e.globalData.setting,os=a,ut = require("../../../utils/util.js");
  2 +var regeneratorRuntime = require('../../../utils/runtime.js');
  3 +const app = getApp();
  4 +let self = null;
  5 +
  6 +Page({
  7 +
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + // type:1,
  13 + // goodlist: null,
  14 +
  15 + isLogin: false,
  16 + list: null,
  17 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  18 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  19 + pageNum: 1, // 当前页数
  20 + },
  21 +
  22 + /**
  23 + * 生命周期函数--监听页面加载
  24 + */
  25 + onLoad: function (options) {
  26 + self = this;
  27 +
  28 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  29 + self.setData({
  30 + userInfo: data,
  31 + });
  32 + });
  33 + },
  34 +
  35 + /**
  36 + * 生命周期函数--监听页面初次渲染完成
  37 + */
  38 + onReady: function () {
  39 +
  40 + },
  41 +
  42 + /**
  43 + * 生命周期函数--监听页面显示
  44 + */
  45 + onShow: function () {
  46 + if(app.globalData.userInfo) {
  47 + if(!this.data.isLogin) {
  48 + this.setData({
  49 + userInfo: app.globalData.userInfo,
  50 + imghost: app.globalData.setting.imghost,
  51 + isLogin: true,
  52 + });
  53 +
  54 +
  55 + let url = '/api/weshop/goods/groupBuy/page';
  56 + let data = {
  57 + store_id: app.globalData.setting.stoid,
  58 + is_show: 1,
  59 + is_end: 0,
  60 + timetype:1
  61 + };
  62 +
  63 + this.setData({
  64 + list: null,
  65 + pageNum: 1,
  66 + noMore: false,
  67 + });
  68 +
  69 + this.getData(true, url, data).then(function() {
  70 + self.setData({
  71 + currentData: data,
  72 + });
  73 + });
  74 +
  75 + this.data.is_timer=1;
  76 +
  77 + };
  78 +
  79 +
  80 + //设置全局定时器
  81 + this.data.timer = setInterval(function () {
  82 + self.countDown();
  83 + },1000);
  84 +
  85 +
  86 + };
  87 +
  88 + },
  89 +
  90 + /**
  91 + * 生命周期函数--监听页面隐藏
  92 + */
  93 + onHide: function () {
  94 + clearInterval(this.data.timer);
  95 + },
  96 +
  97 + /**
  98 + * 生命周期函数--监听页面卸载
  99 + */
  100 + onUnload: function () {
  101 +
  102 + },
  103 +
  104 + /**
  105 + * 页面相关事件处理函数--监听用户下拉动作
  106 + */
  107 + onPullDownRefresh: function () {
  108 +
  109 + },
  110 +
  111 + /**
  112 + * 页面上拉触底事件的处理函数
  113 + */
  114 + onReachBottom: function () {
  115 + let data = this.data.currentData;
  116 + this.scrollToLower('/api/weshop/goods/groupBuy/page', data);
  117 + },
  118 +
  119 + /**
  120 + * 用户点击右上角分享
  121 + */
  122 + onShareAppMessage: function () {
  123 +
  124 + },
  125 +
  126 +
  127 + /**
  128 + * 请求数据
  129 + */
  130 + getData: function(isInit, url, data) {
  131 + let p = app.request.promiseGet(url, {
  132 + data: data,
  133 + isShowLoading: true,
  134 + })
  135 + .then(function(res) {
  136 + if(res.data.code == 0) {
  137 +
  138 + self.setData({
  139 + isLoading: false
  140 + });
  141 +
  142 + if(isInit) {// 第一次加载
  143 + self.setData({
  144 + list: res.data.data
  145 + });
  146 + } else {
  147 + self.setData({
  148 + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  149 + });
  150 + };
  151 +
  152 + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  153 + self.setData({
  154 + noMore: true
  155 + });
  156 + };
  157 +
  158 + } else {
  159 + self.setData({
  160 + 'list.pageData': []
  161 + });
  162 + };
  163 +
  164 + });
  165 +
  166 + return p;
  167 + },
  168 +
  169 +
  170 + /**
  171 + * 上拉加载
  172 + */
  173 + scrollToLower(url, requestData) {
  174 + // 数据总量
  175 + let total = this.data.list.total;
  176 + // 单页最大数据量
  177 + let pageSize = this.data.list.pageSize;
  178 + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  179 + if((total != 0)&&(total <= pageSize)) {
  180 + this.setData({
  181 + noMore: true
  182 + });
  183 + };
  184 +
  185 + if(!this.data.isLoading && !this.data.noMore) {
  186 + this.setData({
  187 + isLoading: true,
  188 + pageNum: this.data.pageNum + 1
  189 + });
  190 + requestData.page = this.data.pageNum;
  191 + this.getData(false, url, requestData);
  192 + };
  193 + },
  194 +
  195 +
  196 + //---小于10的格式化函数----
  197 + timeFormat(param) {
  198 + return param < 10 ? '0' + param : param;
  199 + },
  200 +
  201 +
  202 + //----倒计时函数-----
  203 + countDown() {
  204 + if(!this.data.is_timer) return false;
  205 + var th=this;
  206 + // 获取当前时间,同时得到活动结束时间数组
  207 + let newTime = ut.gettimestamp();
  208 + var endTimeList = this.data.list.pageData;
  209 + if(endTimeList == null) return null;
  210 + // 对结束时间进行处理渲染到页面
  211 + for(var i = 0; i < endTimeList.length; i++) {
  212 + var o = endTimeList[i];
  213 + var endTime = o.end_time;
  214 + // if(th.data.type==0) endTime = o.start_time;
  215 + let obj = null;
  216 + // 如果活动未结束,对时间进行处理
  217 + if (endTime - newTime > 0) {
  218 + let time = (endTime - newTime);
  219 + // 获取天、时、分、秒
  220 + let day = parseInt(time / (60 * 60 * 24));
  221 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  222 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  223 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  224 + obj = {
  225 + day: this.timeFormat(day), hou: this.timeFormat(hou), min: this.timeFormat(min), sec: this.timeFormat(sec), hide: 1
  226 + }
  227 + } else {
  228 + //活动已结束,全部设置为'00'
  229 + obj = { day: '00', hou: '00', min: '00', sec: '00' }
  230 + }
  231 + var txt ="goodlist["+i+"].djs";
  232 + th.setData({ [txt]: obj});
  233 + }
  234 + },
  235 +
  236 +
  237 +
  238 + //图片失败,默认图片
  239 + bind_bnerr2: function (e) {
  240 + var _errImg = e.target.dataset.errorimg;
  241 + var val = e.target.dataset.val;
  242 + if(val!=undefined && val!=null && val!='null' ){
  243 + var _errObj = {};
  244 + _errObj[_errImg] = "/public/images/default_goods_image_240.gif";
  245 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  246 + }
  247 + },
  248 +
  249 + goto(e) {
  250 + let url = e.target.dataset.url;
  251 + app.goto(url);
  252 + },
  253 +
  254 +
  255 +})
0 \ No newline at end of file 256 \ No newline at end of file
packageC/pages/group_list/group_list.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "团购",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "nodata": "/components/nodata/nodata"
  6 + }
  7 +}
0 \ No newline at end of file 8 \ No newline at end of file
packageC/pages/group_list/group_list.wxml 0 → 100644
  1 +<view class="list">
  2 + <view class="list-item" wx:for="{{list.pageData}}">
  3 + <view class="img-container">
  4 + <image class="img-block" src="{{imghost + item.original_img}}" data-val="{{item.original_img}}"
  5 + data-errorimg="list.pageData[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image>
  6 + </view>
  7 + <view class="mgl20 flex fdc f1 jc_sb">
  8 + <view>
  9 + <view class="fs30">{{item.title}}</view>
  10 + <view class="flex ai_c">
  11 + <view class="fs26 tag">{{item.rebate}}折</view>
  12 + <view class="rmb c-red fs30">{{item.price}}</view>
  13 + <view class="rmb del fs24 c-7b pdl10">{{item.market_price}}</view>
  14 + </view>
  15 + </view>
  16 + <view class="flex jc_sb ai-center c-7b">
  17 + <view class="fs24">
  18 + <view>已售{{item.buy_num}}件</view>
  19 + <view class=""><text class="iconfont icon-shizhong fs24"></text>{{goodlist[index].djs.day}}天{{goodlist[index].djs.hou}}时{{goodlist[index].djs.min}}分{{goodlist[index].djs.sec}}秒</view>
  20 + </view>
  21 + <view class="btn" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=2">去团购</view>
  22 + </view>
  23 + </view>
  24 + </view>
  25 +</view>
  26 +
  27 +<view class="no-more" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">—— 已经到底啦 ——</view>
  28 +<nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata>
packageC/pages/group_list/group_list.wxss 0 → 100644
  1 +page {
  2 + background-color: #f2f2f2;
  3 +}
  4 +
  5 +.list {
  6 + padding-left: 20rpx;
  7 + padding-right: 20rpx;
  8 +}
  9 +
  10 +.list-item {
  11 + background-color: white;
  12 + border-radius: 12rpx;
  13 + margin-top: 20rpx;
  14 + padding: 20rpx;
  15 + display: flex;
  16 +}
  17 +
  18 +.tag {
  19 + background-color: #ff6768;
  20 + color: white;
  21 + font-size: 24rpx;
  22 + padding-left: 10rpx;
  23 + padding-right: 10rpx;
  24 +}
  25 +
  26 +.img-container {
  27 + width: 200rpx;
  28 + height: 200rpx;
  29 +}
  30 +
  31 +.btn {
  32 + background-color: #ff6768;
  33 + color: white;
  34 + padding: 10rpx 30rpx;
  35 + border-radius: 40rpx;
  36 + font-size: 26rpx;
  37 +}
  38 +
  39 +.rmb {
  40 + position: relative;
  41 +}
  42 +
  43 +.rmb::before {
  44 + content: '¥';
  45 + font-size: 24rpx;
  46 +}
  47 +
  48 +.del {
  49 + text-decoration: line-through;
  50 +}
  51 +
  52 +.no-more {
  53 + font-size: 24rpx;
  54 + line-height: 2;
  55 + text-align: center;
  56 + /* margin-top: 10rpx; */
  57 + color: #ccc;
  58 +}
0 \ No newline at end of file 59 \ No newline at end of file
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js 0 → 100644
  1 +var t = require("../../../../utils/util.js"),
  2 + ut = t,
  3 + e = require("../../../../utils/common.js"),
  4 + a = require("../../../../utils/wxParse/wxParse.js"),
  5 + s = getApp(),
  6 + i = s.request,
  7 + rq = i,
  8 + oo = s.globalData,
  9 + o = s.globalData.setting,
  10 + os = o;
  11 + var regeneratorRuntime = require('../../../../utils/runtime.js');
  12 +
  13 +Page({
  14 + data: {
  15 + //activity_type:1,//活动类型 商家1 阶梯2 会员3
  16 + p_status:1,//会员团的详细情况 1是正在行 2是成功 3失败
  17 + sf_length: 1,//人数大于5
  18 +
  19 + erweima:false,
  20 + meng:false,
  21 + zk:true,
  22 + stoid: o.stoid,
  23 + hiddenName: true,
  24 + teamlist:null,
  25 + teamgroup:null,
  26 + goods:null,//商品数据
  27 + pindGoods: null,//拼单数据
  28 + imageurl: o.imghost,
  29 + pay_f:0,//支付是否成功
  30 + order_sn:"",//订单编号
  31 + canvasHidden:false, //画画版
  32 + screenWidth:0,
  33 +
  34 + pd_xx: 0, //弹框
  35 + max_num:0,//最低成团人数
  36 + min_price:0,//最低价格
  37 + is_show:0,//加载完才显示
  38 +
  39 + share_img_localpath:"", //分享图片的本地图片
  40 + share_ewm_localpath: "", //分享的二维码本地图片
  41 + share_head:"", //分享头像的本地图片
  42 +
  43 + iurl:os.imghost,
  44 + ct_price:0,//阶梯团成团价格
  45 + sf_arr:null,
  46 +
  47 + },
  48 + onLoad: function (t) {
  49 + // wx.setNavigationBarTitle({ title: "拼团订单",})
  50 +
  51 + var that=this;
  52 + var th=this;
  53 + //获取用户设备信息,屏幕宽度
  54 + wx.getSystemInfo({
  55 + success: res => {
  56 + that.setData({ screenWidth: res.screenWidth })
  57 + }
  58 + })
  59 + var pay_f = t.payf, order_sn = t.ordersn;
  60 + this.setData({ pay_f: pay_f, order_sn: order_sn});
  61 + this.init(order_sn);
  62 +
  63 + //-- 自定义海报 --
  64 + getApp().request.promiseGet("/api/weshop/goods/poster/page",{
  65 + data:{store_id:os.stoid, type:1, is_use:1 }
  66 + }).then(res=>{
  67 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0] ){
  68 +
  69 + var poster_data=res.data.data.pageData[0];
  70 + var json_str=poster_data.jsonStr;
  71 + if(json_str){
  72 + var json_data=JSON.parse(json_str);
  73 + if(json_data.bg_img){
  74 +
  75 + //-- 把图片那到本地 --
  76 + wx.getImageInfo({
  77 + src:json_data.bg_img,
  78 + success: function(res) {
  79 + var path= res.path;
  80 + th.setData({share_b_img:path})
  81 + },
  82 + fail: function(res) {}
  83 + });
  84 + }
  85 + th.setData({poster:json_data})
  86 + }
  87 + }
  88 + })
  89 + },
  90 + //关闭展开列表
  91 + click:function(e){
  92 + this.setData({
  93 + hiddenName: !this.data.hiddenName,
  94 + zk: !this.data.zk,
  95 + })
  96 + },
  97 + //打开收起拼团列表
  98 + czk:function(e){
  99 + this.setData({
  100 + zk:!this.data.zk,
  101 + hiddenName: !this.data.hiddenName,
  102 + })
  103 + },
  104 + //打开蒙板提示
  105 + cmeng:function(e){
  106 + this.setData({
  107 + meng:!this.data.meng,
  108 + })
  109 + },
  110 +
  111 + //关闭蒙板提示
  112 + cmc:function(e){
  113 + this.setData({
  114 + meng: !this.data.meng,
  115 + })
  116 + },
  117 +//打开二维码提示
  118 + cerweima:function(e){
  119 + this.setData({
  120 + meng: !this.data.meng,
  121 + erweima: !this.data.erweima,
  122 + })
  123 + },
  124 +
  125 + cerc:function(e){
  126 + this.setData({
  127 + erweima: !this.data.erweima,
  128 + meng: !this.data.meng,
  129 + })
  130 + },
  131 +
  132 + async init( order_sn) {
  133 +
  134 + wx.showLoading();
  135 +
  136 + var goods_id = 0,//商品ID,
  137 + pageteam=null,//
  138 + original_img=null ,//商品图片
  139 + order=null,//订单编号
  140 + id = 0,//团购id
  141 + pt_listno = "",//团编号
  142 + pt_prom_id = 0, //活动id
  143 + ee = this,
  144 + team_id = 0,//活动id
  145 + ordertx=[],//头像图片
  146 + share_img=null,//分享图片
  147 + teamlist=null,//活动表
  148 + goods=null,//商品
  149 + teamgroup=null,//活動从表
  150 + max_num=0,//最低价格时的成团人数
  151 + p_status=1;
  152 +
  153 + //--如果商家团的时候---
  154 + await getApp().request.promisePost("/api/weshop/order/pay/vipAutoTuan", {
  155 + data: {orderSn:order_sn,storeId:os.stoid }
  156 + })
  157 +
  158 + //获取order信息根据订单编号order_sn
  159 + await getApp().request.promiseGet("/api/weshop/order/page", {
  160 + data: { store_id: o.stoid, order_sn: order_sn,}
  161 + }).then(res => {
  162 + order = res.data.data.pageData[0];
  163 + pt_prom_id = order.pt_prom_id;
  164 + pt_listno = order.pt_listno;
  165 + })
  166 +
  167 + if (this.data.payf || order.pt_status == 3) p_status = 3; //失败
  168 + if (order.pt_status == 2 || order.pt_status == 4 || order.pt_status == 5)
  169 + p_status = 2; //成功
  170 + if (order.pt_status < 2 && !this.data.payf)
  171 + p_status = 1; //正在进行
  172 + if ( order.pt_status == 6) p_status = 4; //支付尾款失败
  173 +
  174 + //多少人参团头像
  175 + await getApp().request.promiseGet("/api/weshop/order/pagePtList", {
  176 + data: { store_id: o.stoid, pt_listno: pt_listno, }
  177 + }).then(res => {
  178 + ordertx = res.data.data.pageData;
  179 + })
  180 +
  181 +
  182 + var min_price=0;
  183 + //获取活动表的信息根据活动pt_prom_id
  184 + await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + pt_prom_id, {
  185 + data: { }
  186 + }).then(res => {
  187 + if (res.data.code==0){
  188 + teamlist = res.data.data;
  189 + this.setData({teamlist: teamlist});
  190 + //获取当前时间,并且判断剩余时间
  191 + var nt = ut.gettimestamp();
  192 + teamlist.status = 0;
  193 + if (nt >= teamlist.start_time) teamlist.status = 1;
  194 +
  195 + goods_id = res.data.data.goods_id;
  196 + id = res.data.data.id;
  197 + share_img = ee.data.imageurl + res.data.data.share_imgurl;
  198 +
  199 + //----------查看阶梯团------------
  200 + if (teamlist.ct_rylist != "" && teamlist.ct_rylist != null && teamlist.ct_rylist != undefined){
  201 + var ct_rylist = JSON.parse(teamlist.ct_rylist);
  202 + var max=0; var pri=0;
  203 + ct_rylist.forEach(function (val,ind) {
  204 + if(val.rynum>max){
  205 + max=val.rynum;
  206 + pri = val.price;
  207 + }
  208 + })
  209 + max_num=max;
  210 + min_price=pri;
  211 +
  212 + }
  213 +
  214 +
  215 + //获取商品信息
  216 + getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, {
  217 + }).then(res => {
  218 + //商品地址
  219 + original_img = ee.data.imageurl+ res.data.data.original_img,
  220 + goods = res.data.data
  221 +
  222 + ee.setData({goods: goods,image: original_img,})
  223 +
  224 + })
  225 +
  226 + }
  227 + })
  228 +
  229 +
  230 + //只装5个
  231 + var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num;
  232 + if(max_num){
  233 + ct_nun=parseInt(max_num);
  234 + if (ct_nun < ordertx.length) ct_nun = ordertx.length;
  235 + }
  236 +
  237 + if(ct_nun>5) ct_nun=5;
  238 + for(var i=0;i<ct_nun;i++){
  239 + if (i >= ordertx.length) sf_num++
  240 + else
  241 + ordertx2.push(ordertx[i]);
  242 + }
  243 +
  244 + var sf_arr=[];
  245 + for (var i=0;i<sf_num;i++){
  246 + sf_arr.push(i);
  247 + }
  248 +
  249 +
  250 +
  251 +
  252 + //获取活动从表信息team_id:305暂时
  253 + await getApp().request.promiseGet("/api/weshop/teamgroup/page" , {
  254 + data: { store_id: os.stoid, listno: pt_listno, team_id: pt_prom_id }
  255 + }).then(res => {
  256 + teamgroup = res.data.data.pageData[0];
  257 + if (teamgroup){
  258 + var buy_start_date = ut.formatTime(teamgroup.buy_start_date, "yyyy-MM-dd hh:mm:ss");
  259 + teamgroup.buy_start_date=buy_start_date;
  260 + }
  261 + })
  262 +
  263 +
  264 + var ct_price = 0,
  265 + num_0 = ordertx.length;
  266 + if (teamlist.kttype == 3){
  267 + var js_data = JSON.parse(teamlist.ct_rylist);
  268 + js_data.forEach(function (val,ind) {
  269 + if (num_0<=val.rynum && ct_price==0){
  270 + ct_price=val.price;
  271 + }
  272 + })
  273 + if(ct_price==0) ct_price=min_price;
  274 + }
  275 +
  276 + //获取大家都在团信息
  277 + getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1?store_id="+ os.stoid +"&is_end=0&is_show=1" , {
  278 + data:{page:1,pageSize:2}
  279 + }).then(res => {
  280 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  281 + pageteam = res.data.data.pageData;
  282 + ee.setData({pageteam: pageteam,})
  283 + }
  284 +
  285 + })
  286 +
  287 + //--当是成团的时候的操作--
  288 + if(order.pt_status==2 || order.pt_status==4 || order.pt_status==5){
  289 + //设置值
  290 +
  291 + ee.setData({
  292 + ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup, min_price: min_price,
  293 + order: order, share_img: share_img,max_num:max_num,
  294 + pindGoods: teamlist,is_show:1, zk:false,
  295 + hiddenName: false, ct_price:ct_price,p_status:p_status,sf_arr:sf_arr});
  296 +
  297 + //--是否支付了尾款--
  298 + if(order.pt_status==4 || order.pt_status==5){
  299 + ee.setData({is_pay_wk:1});
  300 + }
  301 + }else{
  302 + console.log("239什么鬼", teamlist);
  303 + //设置值
  304 + ee.setData({
  305 + ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup,
  306 + order: order, p_status: p_status, min_price:min_price,
  307 + share_img: share_img, max_num: max_num, pindGoods: teamlist, is_show: 1,
  308 + ct_price: ct_price, p_status: p_status,sf_arr:sf_arr});
  309 + }
  310 +
  311 + wx.hideLoading();
  312 +
  313 + wx.setNavigationBarTitle({
  314 + title: "拼团详情",
  315 + })
  316 +
  317 + ee.countDown2();
  318 +
  319 + //获取分享图片的本地地址
  320 + var path2 = os.imghost + teamlist.share_imgurl;
  321 + wx.getImageInfo({
  322 + src: path2,
  323 + success: function (res) {
  324 + //res.path是网络图片的本地地址
  325 + ee.data.share_img_localpath = res.path;
  326 + },
  327 + fail: function (res) {
  328 + //失败回调
  329 + }
  330 + });
  331 +
  332 +
  333 + },
  334 + //---小于10的格式化函数----
  335 + timeFormat(param) {
  336 + return param < 10 ? '0' + param : param;
  337 + },
  338 + countDown2() {
  339 + var th = this;
  340 + // 获取当前时间,同时得到活动结束时间数组
  341 + var newTime = ut.gettimestamp();
  342 + var o = this.data.teamgroup;
  343 + if(!o) return false;
  344 +
  345 + var endTime = o.kt_end_time;
  346 + if (o.status == 0) endTime = o.start_time;
  347 +
  348 + //看一下,是否要支付尾款
  349 + if(o.team_type==3 && th.data.order.pt_status==2){
  350 + endTime = o.wk_end_time;
  351 + }
  352 +
  353 + let obj = null;
  354 + // 如果活动未结束,对时间进行处理
  355 + if (endTime - newTime > 0) {
  356 + let time = (endTime - newTime);
  357 + // 获取天、时、分、秒
  358 + let day = parseInt(time / (60 * 60 * 24));
  359 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  360 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  361 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  362 + obj = {
  363 + day: this.timeFormat(day),
  364 + hou: this.timeFormat(hou),
  365 + min: this.timeFormat(min),
  366 + sec: this.timeFormat(sec)
  367 + }
  368 + } else {
  369 + //活动已结束,全部设置为'00'
  370 + obj = {
  371 + day: '00',
  372 + hou: '00',
  373 + min: '00',
  374 + sec: '00'
  375 + }
  376 + }
  377 + var txt = "pindGoods.djs";
  378 + th.setData({
  379 + obj: obj
  380 + });
  381 + setTimeout(th.countDown2, 1000);
  382 + },
  383 +
  384 + //--定义的保存图片方法,分享团---
  385 + saveImageToPhotosAlbum: function () {
  386 + //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
  387 + var type=1;
  388 + if(this.data.teamlist.kttype==3) type=2;
  389 +
  390 + wx.showLoading({ title: '生成中...', })
  391 + var that = this, th = that;
  392 + //设置画板显示,才能开始绘图
  393 + that.setData({
  394 + canvasHidden: true,
  395 + })
  396 +
  397 + if(this.data.share_hidden) {
  398 + this.setData({
  399 + share_hidden: false,
  400 + });
  401 + };
  402 +
  403 + var app = getApp();
  404 + var unit = that.data.screenWidth / 750 * 1.35;
  405 + var scene=th.data.teamgroup.id;
  406 + var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0;
  407 + if(user_id>0){
  408 + scene+="_"+user_id;
  409 + }
  410 +
  411 + //二微码
  412 + var path3 = os.url+ "/api/wx/open/app/user/getWeAppEwm/"+
  413 + os.stoid+"?sceneValue="+scene+"&pageValue=pages/team/team_show/team_show";
  414 +
  415 + //读取文件成功则OK--
  416 + wx.getImageInfo({
  417 + src: path3,
  418 + success:function (res) {
  419 + //回调写法
  420 + th.get_head_temp(th.get_goods_temp,function () {
  421 + var vpath = res.path;
  422 + var context = wx.createCanvasContext('share');
  423 +
  424 +
  425 + //先画背景
  426 + var pg_path = "../../../images/share/share_bg.png";
  427 + //-- 如果有自定义海报的时候,判断背景的图片 --
  428 + if(th.data.share_b_img){
  429 + pg_path=th.data.share_b_img;
  430 + }
  431 +
  432 + var share_title=th.data.teamlist.share_title;
  433 + if(!share_title)
  434 + share_title=th.data.teamlist.title;
  435 + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
  436 +
  437 + //-- 是自定义海报的情况下 --
  438 + if(th.data.poster && parseInt(th.data.poster.style)==2){
  439 + //在线上分享人的情况下
  440 + if(parseInt(th.data.poster.show_headpic)){
  441 + //获取坐标
  442 + var x=parseFloat(th.data.poster.head_x)*2;
  443 + var y=parseFloat(th.data.poster.head_y)*2;
  444 + var x1=(x+90) *unit;
  445 + var y1=(y+50) *unit;
  446 + //--昵称---
  447 + context.setFontSize(24 * unit)
  448 + context.setFillStyle("black")
  449 + context.fillText(app.globalData.userInfo.nickname, x1, y1);
  450 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  451 + //强烈推荐 改许程
  452 + var tj_path = "../../../images/share/q_tj.png";
  453 + context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);
  454 + context.setFontSize(16 * unit)
  455 + context.setLineJoin('round'); //交点设置成圆角
  456 + context.setFillStyle("white")
  457 + context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit);
  458 + }
  459 +
  460 + }else{
  461 + //--昵称---
  462 + context.setFontSize(24 * unit)
  463 + context.setFillStyle("black")
  464 + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
  465 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  466 + //强烈推荐
  467 + var tj_path = "../../../images/share/q_tj.png";
  468 + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 110 * unit, 30 * unit);
  469 + context.setFontSize(18 * unit)
  470 + context.setFillStyle("white")
  471 + context.fillText('强烈推荐', 152 * unit + width + 20 * unit, 76 * unit);
  472 + }
  473 +
  474 +
  475 + //---产品名称---
  476 + context.setFontSize(21.3 * unit);
  477 + context.setFillStyle("black");
  478 +
  479 +
  480 +
  481 +
  482 + th.draw_Text(context,share_title,
  483 + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
  484 + //------产品的价格-------
  485 + context.setFontSize(24 * unit)
  486 + context.setFillStyle("red")
  487 +
  488 + var pri0 = th.data.teamlist.price;
  489 + pri0=parseFloat(pri0).toFixed(2);
  490 + var wd1=th.data.screenWidth-ut.measureText(pri0, 31 * unit)-25;
  491 + context.fillText("¥", wd1-15, 180 * unit);
  492 + context.setFontSize(31 * unit)
  493 + context.fillText(pri0, wd1, 180 * unit);
  494 +
  495 + //---市场价划掉---
  496 + context.setFillStyle("gray")
  497 + context.setFontSize(22 * unit)
  498 + pri0= "¥" + parseFloat(th.data.goods.market_price).toFixed(2);
  499 + var wd2=th.data.screenWidth-ut.measureText(pri0, 22 * unit)-25;
  500 + context.fillText(pri0, wd2, 210 * unit);
  501 +
  502 + context.setStrokeStyle('gray')
  503 + context.setLineWidth(1 * unit)
  504 + context.moveTo(wd2-5, 204 * unit)
  505 + context.lineTo(wd2+ut.measureText(pri0, 22 * unit)+5, 204 * unit)
  506 + context.stroke();
  507 + console.log(th.data.share_img_localpath);
  508 +
  509 +
  510 + //---中间大图---
  511 + context.drawImage(th.data.share_img_localpath, 68 * unit, 242 * unit, 410 * unit, 410 * unit);
  512 +
  513 + var g_ct=th.data.teamlist.ct_num-th.data.ordertx.length;
  514 + var wz= "";
  515 + if(g_ct>0) wz="还差"+g_ct+"人成团,";
  516 + else{
  517 + g_ct= th.data.max_num -th.data.ordertx.length;
  518 + if(g_ct>0){
  519 + wz="还差"+g_ct+"人享最低优惠,";
  520 + }else{
  521 + wz="已享受最优惠,";
  522 + }
  523 + }
  524 +
  525 + //-------大图后面就不一样了-----------
  526 + switch (type) {
  527 + case 1://会员团和商家团的展示
  528 + //---画线---
  529 + context.setLineWidth(1 * unit)
  530 + context.moveTo(32 * unit, 670 * unit)
  531 + context.lineTo(520 * unit, 670 * unit)
  532 + context.stroke();
  533 +
  534 + //---文字---
  535 + context.setFontSize(22 * unit)
  536 + context.setFillStyle("black")
  537 + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
  538 +
  539 + //绘制成团图片
  540 + var ct_img ="../../../images/share/ct_num.png";
  541 + context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit);
  542 + var ct_num = th.data.teamlist.ct_num;
  543 + context.setFontSize(14 * unit)
  544 +
  545 + context.setFillStyle("red")
  546 + if(ct_num<10){
  547 + context.fillText(ct_num+"人拼团", 92 * unit, 760 * unit);
  548 + }else{
  549 + context.fillText(ct_num+"人拼团", 86 * unit, 760 * unit);
  550 + }
  551 + context.setFontSize(22 * unit)
  552 + context.fillText("已拼"+th.data.teamlist.buy_num+"份", 166 * unit, 763 * unit);
  553 + context.setFillStyle("gray")
  554 + context.fillText(wz+"快来和我一起拼团吧!", 40 * unit, 826 * unit);
  555 + context.setFillStyle("black")
  556 +
  557 + context.setFontSize(22 * unit)
  558 + context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit);
  559 + //---二维吗图---
  560 + //-- 自定义海报 --
  561 + if(th.data.poster){
  562 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  563 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  564 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
  565 + }else{
  566 + //---二维吗图---
  567 + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
  568 + }
  569 + break
  570 + case 2://阶梯团的展示
  571 + //---画线---
  572 + context.setLineWidth(1 * unit)
  573 + context.moveTo(32 * unit, 670 * unit)
  574 + context.lineTo(520 * unit, 670 * unit)
  575 + context.stroke();
  576 + //---文字---
  577 + context.setFontSize(22 * unit)
  578 + context.setFillStyle("black")
  579 + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
  580 + //---绘制中间阶梯的价格---
  581 + var list= JSON.parse(th.data.teamlist.ct_rylist);
  582 + for(var i=0; i<list.length;i++){
  583 + var item=list[i];
  584 + var wi=i*90*unit;
  585 + context.setFontSize(16 * unit)
  586 + context.setFillStyle("red")
  587 + context.fillText("¥", 40 * unit+wi, 756 * unit);
  588 + context.setFontSize(22 * unit)
  589 + var pri=parseFloat(item.price).toFixed(2);
  590 + context.fillText(pri, 56 * unit+wi, 756 * unit);
  591 + context.setFillStyle("gray")
  592 + context.fillText("满"+item.rynum+"人", 40 * unit+wi, 786 * unit);
  593 + }
  594 +
  595 + //----------------下面部分----------------
  596 + context.setFillStyle("gray")
  597 + context.fillText(wz+"快来和我一起拼团吧!", 40 * unit, 830 * unit);
  598 + context.setFillStyle("black")
  599 + context.setFontSize(22 * unit)
  600 +
  601 + context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit);
  602 + //---二维吗图---
  603 + //-- 自定义海报 --
  604 + if(th.data.poster){
  605 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  606 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  607 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
  608 + }else{
  609 + //---二维吗图---
  610 + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
  611 + }
  612 + break
  613 + }
  614 +
  615 + //--- 如果是自定义海报的时候 ---
  616 + if(th.data.poster && parseInt(th.data.poster.style)==2){
  617 +
  618 + //如果显示会员信息的话
  619 + if(parseInt(th.data.poster.show_headpic)){
  620 + //获取坐标
  621 + var x= parseFloat(th.data.poster.head_x)*2;
  622 + var y=parseFloat(th.data.poster.head_y)*2;
  623 + //---绘制圆形要放在最后----
  624 + context.save();
  625 + context.beginPath();
  626 + var h_x = x* unit;
  627 + var h_y = y * unit;
  628 + var h_r = 40 * unit;
  629 + var cx = h_x + h_r;
  630 + var cy = h_y + h_r;
  631 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  632 + context.closePath();
  633 + context.fill();
  634 + context.clip();
  635 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  636 + context.restore();
  637 + }
  638 +
  639 + }else{
  640 + //---绘制圆形要放在最后----
  641 + context.save();
  642 + context.beginPath();
  643 + var h_x = 60 * unit;
  644 + var h_y = 24 * unit;
  645 + var h_r = 40 * unit;
  646 + var cx = h_x + h_r;
  647 + var cy = h_y + h_r;
  648 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  649 + context.closePath();
  650 + context.fill();
  651 + context.clip();
  652 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  653 + context.restore();
  654 + }
  655 +
  656 + //把画板内容绘制成图片,并回调 画板图片路径
  657 + context.draw(false, function () {
  658 + setTimeout(function () {
  659 + wx.canvasToTempFilePath({
  660 + x: 0, y: 0,
  661 + width: 750,
  662 + height: 1217,
  663 + destWidth: 750 * 750 / that.data.screenWidth,
  664 + destHeight: 1217 * 750 / that.data.screenWidth,
  665 + canvasId: 'share',
  666 + success: function (res) {
  667 +
  668 + that.setData({
  669 + shareImgPath: res.tempFilePath, canvasHidden: false,
  670 + })
  671 + if (!res.tempFilePath) {
  672 + wx.showModal({
  673 + title: '提示',
  674 + content: '图片绘制中,请稍后重试',
  675 + showCancel: false
  676 + })
  677 + return false;
  678 + }
  679 +
  680 + // wx.previewImage({
  681 + // //将图片预览出来
  682 + // urls: [that.data.shareImgPath]
  683 + // });
  684 +
  685 + that.setData({
  686 + showPoster: true,
  687 + });
  688 +
  689 + wx.hideLoading();
  690 + }
  691 + })
  692 + },500)
  693 + });
  694 + });
  695 + }
  696 + });
  697 + },
  698 +
  699 +
  700 + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
  701 + draw_Text: function (ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) {
  702 + var lineWidth = 0;
  703 + var lastSubStrIndex = 0; //每次开始截取的字符串的索引
  704 + var han = 0;
  705 + for (let i = 0; i < str.length; i++) {
  706 + if (han == 2) return;
  707 +
  708 + //lineWidth += ctx.measureText(str[i]).width;
  709 + lineWidth += ut.measureText(str[i], 21.3 * unit);
  710 +
  711 + if (lineWidth > canvasWidth) {
  712 + han++;
  713 + if (han == 2)
  714 + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分
  715 + else
  716 + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight);
  717 +
  718 + initHeight += 22; //22为字体的高度
  719 + lineWidth = 0;
  720 + lastSubStrIndex = i;
  721 + titleHeight += 20;
  722 + }
  723 + if (i == str.length - 1) { //绘制剩余部分
  724 + ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight);
  725 + }
  726 + }
  727 + },
  728 +
  729 + //c点击打开拼团弹窗
  730 + cpd: function() {
  731 + console.log("heheh");
  732 + this.setData({ pd_xx: 1,})
  733 + },
  734 +
  735 + //点击关闭拼团弹窗
  736 + close_pt_xx: function() {
  737 + this.setData({ pd_xx: 0, })
  738 + },
  739 +
  740 + go_goodsinfo:function (e) {
  741 + var gid=e.currentTarget.dataset.gid;
  742 + var url="/pages/goods/goodsInfo/goodsInfo?goods_id="+gid;
  743 + wx.navigateTo({ url: url, }) //跳到非tabbar页
  744 + },
  745 +
  746 + gohome:function () {
  747 + getApp().goto("/pages/index/index/index");
  748 + },
  749 +
  750 + //--获取头像的本地缓存,回调写法--
  751 + get_head_temp:function (tt,func) {
  752 + var ee=this;
  753 + if(ee.data.share_head){
  754 + tt(func);
  755 + return false;
  756 + }
  757 + //---获取分享图片的本地地址,头像和商品图片----
  758 + var path2 = getApp().globalData.userInfo.head_pic;
  759 + if(path2==""){
  760 + ee.data.share_head ="../../../images/share/hui_hear_pic.png";
  761 + tt(func);
  762 + }else {
  763 + path2=path2.replace("http://thirdwx.qlogo.cn","https://wx.qlogo.cn");
  764 + path2=path2.replace("https://thirdwx.qlogo.cn","https://wx.qlogo.cn");
  765 + wx.getImageInfo({
  766 + src: path2,
  767 + success: function (res) {
  768 + //res.path是网络图片的本地地址
  769 + ee.data.share_head = res.path;
  770 + tt(func);;
  771 + },
  772 + fail: function (res) {
  773 + ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
  774 + tt(func);
  775 + }
  776 + });
  777 + }
  778 + },
  779 +
  780 + //--获取商品图片的本地缓存,回调写法--
  781 + get_goods_temp:function (tt) {
  782 + var ee=this;
  783 + if(ee.data.share_img_localpath) {
  784 + tt();
  785 + return false;
  786 + }
  787 + var path2 = os.imghost + ee.data.teamlist.share_imgurl;
  788 + //获取商品是分享图信息
  789 + wx.getImageInfo({
  790 + src: path2,
  791 + success: function (res) {
  792 + //res.path是网络图片的本地地址
  793 + ee.data.share_img_localpath = res.path;
  794 + tt();
  795 + },
  796 + fail: function (res) {
  797 + ee.data.share_img_localpath= "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的
  798 + tt();
  799 + }
  800 + });
  801 + },
  802 +
  803 + go_pay_wk:function(){
  804 + var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.order.order_id;
  805 + getApp().goto(url);
  806 + },
  807 +
  808 + img_show_err:function(e){
  809 + var err_img = e.currentTarget.dataset.err;
  810 + var ob={};
  811 + ob[err_img] = this.data.iurl + "/miniapp/images/default_g_img.gif";
  812 + this.setData(ob);
  813 +
  814 + },
  815 +
  816 + //------ 分享配置 --------
  817 + onShareAppMessage: function (e) {
  818 + var th=this;
  819 + var scene=this.data.teamgroup.id;
  820 + var url="/pages/team/team_show/team_show?tg_id="+scene;
  821 + //--分享图片--
  822 + var img=th.data.iurl+th.data.teamlist.share_imgurl;
  823 + //--把会员分享出去--
  824 + if(getApp().globalData.user_id){
  825 + if(url.indexOf("?")>0)
  826 + url+="&first_leader="+getApp().globalData.user_id;
  827 + else
  828 + url+="?first_leader="+getApp().globalData.user_id;
  829 + }
  830 + // console.log('url+++++>>>>>', url, th.data.teamlist.title);
  831 +
  832 + var share_title=th.data.teamlist.title;
  833 + if(th.data.teamlist.share_title){
  834 + share_title=th.data.teamlist.share_title;
  835 + }
  836 +
  837 + return {
  838 + path:url,
  839 + title: share_title,
  840 + imageUrl: img,
  841 + }
  842 + },
  843 +
  844 + clickShare() {
  845 + this.setData({
  846 + share_hidden: true,
  847 + });
  848 + },
  849 +
  850 + send() {
  851 + this.setData({
  852 + share_hidden:false,
  853 + });
  854 + },
  855 +
  856 + cancel() {
  857 + this.setData({
  858 + share_hidden:false,
  859 + });
  860 + },
  861 +
  862 +
  863 + closePoster() {
  864 + this.setData({
  865 + showPoster: false,
  866 + });
  867 + },
  868 +
  869 +
  870 + // 保存图片到手机
  871 + savePic() {
  872 + console.log('保存图片');
  873 + var self = this;
  874 + // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限
  875 + this.getSetting().then((res) => {
  876 + // 判断用户是否授权了保存到相册的权限,如果没有发起授权
  877 + if (!res.authSetting['scope.writePhotosAlbum']) {
  878 + this.authorize().then(() => {
  879 + // 同意授权后保存下载文件
  880 + this.saveImage(self.data.shareImgPath)
  881 + .then(() => {
  882 + self.setData({
  883 + showPoster: false
  884 + });
  885 + });
  886 + })
  887 + } else {
  888 + // 如果已经授权,保存下载文件
  889 + this.saveImage(self.data.shareImgPath)
  890 + .then(() => {
  891 + self.setData({
  892 + showPoster: false
  893 + });
  894 + });
  895 + }
  896 +
  897 + })
  898 + },
  899 +
  900 +
  901 + // 保存图片到系统相册
  902 + saveImage(saveUrl) {
  903 + var self = this;
  904 + return new Promise((resolve, reject) => {
  905 + wx.saveImageToPhotosAlbum({
  906 + filePath: saveUrl,
  907 + success: (res) => {
  908 + wx.showToast({
  909 + title: '保存成功',
  910 + duration: 1000,
  911 + });
  912 + self.setData({
  913 + showPlaybill: 'true'
  914 + });
  915 + resolve();
  916 + },
  917 + fail: () => {
  918 + wx.showToast({
  919 + title: '保存失败',
  920 + duration: 1000,
  921 + });
  922 + }
  923 + })
  924 + })
  925 + },
  926 +
  927 + // 获取用户已经授予了哪些权限
  928 + getSetting() {
  929 + return new Promise((resolve, reject) => {
  930 + wx.getSetting({
  931 + success: res => {
  932 + resolve(res)
  933 + }
  934 + })
  935 + })
  936 + },
  937 +
  938 + // 发起首次授权请求
  939 + authorize() {
  940 + // isFirst 用来记录是否为首次发起授权,
  941 + // 如果首次授权拒绝后,isFirst赋值为1
  942 + let isFirst = wx.getStorageSync('isFirst') || 0;
  943 + return new Promise((resolve, reject) => {
  944 + wx.authorize({
  945 + scope: 'scope.writePhotosAlbum',
  946 + // 同意授权
  947 + success: () => {
  948 + resolve();
  949 + },
  950 + // 拒绝授权,这里是用户拒绝授权后的回调
  951 + fail: res => {
  952 + if(isFirst === 0) {
  953 + wx.setStorageSync('isFirst', 1);
  954 + wx.showToast({
  955 + title: '保存失败',
  956 + icon: 'none',
  957 + duration: 1000
  958 + })
  959 + } else {
  960 + this.showModal();
  961 + }
  962 + console.log('拒绝授权');
  963 + reject();
  964 + }
  965 + })
  966 + })
  967 + },
  968 +
  969 +
  970 +
  971 +
  972 +})
  973 +
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.json 0 → 100644
  1 +{
  2 + "windom": {
  3 + "navigationBarTitleText": "参团详情",
  4 + "backgroundTextStyle": "light",
  5 + "navigationBarTextStyle": "white",
  6 + "navigationBarBackgroundColor": "#ffffff",
  7 + "backgroundColor": "#eeeeee"
  8 + },
  9 + "usingComponents": {
  10 + "share": "/components/share/share"
  11 + }
  12 +}
0 \ No newline at end of file 13 \ No newline at end of file
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml 0 → 100644
  1 +<wxs module="filters" src="../../../../utils/filter.wxs"></wxs>
  2 +<!---- //文字"-->
  3 +<view>
  4 +
  5 + <view class='center'>
  6 + <view class='cenleft'>
  7 + <image src='{{image}}' binderror='img_show_err' data-err="image"></image>
  8 + </view>
  9 + <view class='cenright'>
  10 + <!----//图片区域---->
  11 + <view class='cenrt'>
  12 + <view class='xc-goods-details ellipsis-2 fs30'>
  13 + {{goods.goods_name}}
  14 + </view>
  15 + </view>
  16 + <view class='cenrcen flex-vertical-between'>
  17 + <view>
  18 + <view class="fs40 xc-wc" style='font-size:40rpx'>
  19 + <span class="fs28 xc-rmbs" style="font-weight:500;">¥</span>{{teamlist.price}}</view>
  20 + <view class="fs22 word-line xc-wc" style="width:172rpx;">
  21 + 零售价¥{{goods.market_price}}
  22 + </view>
  23 + </view>
  24 + <view class="xc-wc fs24">
  25 + <view>
  26 + <view class="">已拼{{teamlist.buy_num}}件</view>
  27 + <view class="flex xc-valframe t-c">
  28 + <view class="xc-frame-img">
  29 + <image class="picture" src="{{iurl}}/miniapp/images/bai-ren.png"></image>
  30 + </view>
  31 + <view class="xc-people-val">
  32 + {{teamlist.ct_num}}人拼
  33 + </view>
  34 + </view>
  35 + </view>
  36 + </view>
  37 + </view>
  38 + </view>
  39 + <view class='clear'></view>
  40 + </view>
  41 + <!----以上商品显示完成---->
  42 +
  43 +
  44 + <view class='body'>
  45 + <!-- 阶梯团 -->
  46 + <view class='bodytop' wx:if="{{teamlist.kttype==3&& p_status==1}}">
  47 + 当前价格
  48 + <text class="xc-wc">¥{{ct_price}}</text>,
  49 + <block wx:if="{{max_num-ordertx.length>0}}">
  50 + <text class="xc-wc">还差{{max_num-ordertx.length}}</text>人享受最低价格<text class="xc-wc">¥{{min_price}}</text>
  51 + </block>
  52 + <block wx:else>
  53 + 该团已经拼购到最低价了哦~
  54 + </block>
  55 + </view>
  56 + <!-- 拼团成功 -->
  57 + <view class="xc-ptcomplete-ladder flex-level fs28" wx:if="{{teamlist.kttype==3&&p_status==2}}">
  58 + <view class="xc-wc">拼团成功</view>,当前价格
  59 + <text class="xc-wc">¥{{ct_price}}</text>
  60 + <view class="xc-img-frame oh">
  61 + <image class="img" src="{{iurl}}/miniapp/images/xc_qtcg.png"></image>
  62 + </view>
  63 + </view>
  64 +
  65 + <view style="height: 20rpx" wx:if="{{teamlist.kttype==3&&p_status==4}}"></view>
  66 +
  67 +
  68 + <!-- 阶梯团失败 -->
  69 + <view class=".xc-fail-ladder flex-level fs28" wx:if="{{pay_f==1 || order.pt_status==3}}">
  70 + <view class="xc-wc">拼团失败</view>
  71 + <view class="xc-img-frame oh" >
  72 + <image class="img" src="{{iurl}}/miniapp/images/xc-qtshibai.png"></image>
  73 + </view>
  74 + </view>
  75 +
  76 + <!-- 会员团和商家团 -->
  77 + <view class='bodytop' wx:if="{{(teamlist.kttype==2 || teamlist.kttype==1) && p_status==1}}">
  78 + 还差
  79 + <text class="xc-wc">{{teamlist.ct_num-ordertx.length}}</text>人成团,组团成功为您节省
  80 + <text class="xc-wc">{{filters.toFix(goods.market_price-teamlist.price,2)}}</text>元
  81 + </view>
  82 + <!-- 拼团成功 -->
  83 + <view class="xc-ptcomplete flex-level fs28" wx:if="{{p_status==2 && (teamlist.kttype==2||teamlist.kttype==1)}}">
  84 + <view class="xc-wc">拼团成功</view>,为您节省
  85 + <text class="xc-wc">{{filters.toFix(goods.market_price-teamlist.price,2)}}</text>元
  86 + <view class="xc-img-frame oh">
  87 + <image class="img" src="{{iurl}}/miniapp/images/xc_qtcg.png"></image>
  88 + </view>
  89 + </view>
  90 +
  91 + <!----//// //头像---->
  92 + <view class="flex_tou">
  93 + <view class='bodyimg flex-level'>
  94 + <view class='d' wx:for="{{ordertx2}}" wx:key>
  95 + <image src='{{item.head_pic}}'></image>
  96 + <span wx:if="{{item.is_pt_tz==1}}">团长</span>
  97 + </view>
  98 + <view class='d' wx:for="{{sf_arr}}" wx:if="{{p_status!=2}}">
  99 + <image src='{{iurl}}/miniapp/images/shafa.png'></image>
  100 + </view>
  101 +
  102 + <view class='xc-ellipsis-img flex-vertical' wx:if="{{ordertx.length>5}}">
  103 + <image class="pictures " src="{{iurl}}/miniapp/images/xc_ellipsis.png"></image>
  104 + </view>
  105 + </view>
  106 + </view>
  107 +
  108 + <view class='bodytime'>
  109 + <!----/ //旁边直线---->
  110 + <view class='bodytimeleft'>
  111 + <view class='xian'></view>
  112 + </view>
  113 +
  114 + <!-- 阶梯团 开始-->
  115 + <view class='bodytimecen' wx:if='{{p_status==1}}'>
  116 + 剩余
  117 +
  118 + <span>{{obj.hou}}</span>:
  119 + <span>{{obj.hou}}</span>:
  120 + <span>{{obj.min}}</span>:
  121 + <span>{{obj.sec}}</span>结束
  122 + </view>
  123 +
  124 + <!-- 阶梯团 成功-->
  125 + <view class='bodytimecen-success' wx:if='{{teamlist.kttype==3&&p_status==2 && is_pay_wk!=1}}'>
  126 + 剩余支付时间:
  127 +
  128 + <span>{{obj.hou}}</span>时
  129 + <span>{{obj.min}}</span>分
  130 + <span>{{obj.sec}}</span>秒
  131 + </view>
  132 +
  133 + <view class='bodytimecen-success' wx:if='{{teamlist.kttype==3&&p_status==4 }}'>
  134 + 拼团已结束
  135 + </view>
  136 +
  137 + <!-- </block> -->
  138 + <!-- 阶梯团失败 -->
  139 + <view class='bodytimecen' wx:if='{{p_status==3}}'>
  140 + 还差
  141 + <text class="xc-wc">{{teamlist.ct_num-ordertx.length}}</text>人参团, 拼团失败。
  142 + </view>
  143 + <!-- 会员团 -->
  144 + <view class='bodytimecen' wx:if='{{(teamlist.kttype==1 || teamlist.kttype==2) && p_status==2}}'>
  145 + 已经有
  146 + <text class="xc-wc">{{ordertx.length}}</text>人参团, 拼团成功。
  147 + </view>
  148 +
  149 + <!----//旁边直线---->
  150 + <view class='bodytimeright'>
  151 + <view class='xian'></view>
  152 + </view>
  153 + </view>
  154 +
  155 + <!-- 阶梯团 -->
  156 + <view class='fs30 xc-green' wx:if='{{teamlist.kttype==3&&p_status==2}}'>
  157 + 拼团成功, 规定时间内支付尾款即发货
  158 + </view>
  159 + <view class="xc-wc fs30 t-c xc-onclik" wx:if="{{p_status==1}}">
  160 + 点击下方按钮分享给小伙伴,可快速成团!
  161 + </view>
  162 +
  163 + <!-- <block wx:if="{{pay_f!=1 && order.pt_status<2}}"> -->
  164 + <!----/ // // // //按钮---->
  165 +
  166 + <view wx:if="{{teamlist.kttype==3}}" class='bodybutton'>
  167 + <!-- 阶梯团 -->
  168 + <button wx:if="{{p_status==1}}" bindtap="clickShare" style='background-color:#fab55a; color:#fff'>
  169 + <!-- <button wx:if="{{p_status==1}}" bindtap="clickShare" bindtap='cmeng' style='background-color:#fab55a; color:#fff'> -->
  170 + 邀请好友参团
  171 + </button>
  172 + <button bindtap="go_pay_wk" style='background-color:#42c780;' wx:if="{{order.pt_status==2 && order.is_zsorder==4 }}">
  173 + 支付尾款
  174 + </button>
  175 + </view>
  176 + <!-- <view wx:elif="{{teamlist.ct_num-ordertx.length>0}}" class='' bindtap='cmeng'> -->
  177 +
  178 + <!--会员团 商家团-->
  179 + <button class="bodybutton" style='background-color:#fab55a; color:#fff' bindtap='clickShare'
  180 + wx:if="{{(teamlist.kttype==2||teamlist.kttype==1)&&p_status==1}}">邀请好友参团</button>
  181 +
  182 + <!-- </view> -->
  183 + <!-- </block> -->
  184 + <view class="xc-home-page-frame">
  185 + <button class="xc-home-page" bindtap='gohome'> 返回首页</button>
  186 + </view>
  187 +
  188 + <view class='zspan' hidden="{{hiddenName}}" bindtap='click'>查看拼团列表
  189 + <view class='down-arrow1'></view>
  190 + </view>
  191 +
  192 + </view>
  193 +
  194 + <!---/ // // // // //展开拼团列表---->
  195 + <view class='bodyfoot'>
  196 + <view class='bodyselect' wx:if="{{zk}}" bindtap='czk'>
  197 + <span>查看拼团列表
  198 + <view class='down-arrow'></view>
  199 + </span>
  200 + </view>
  201 +
  202 + <view class='zhangxi' hidden="{{hiddenName}}" wx:for="{{ordertx}}" wx:for-index="ky">
  203 + <view class='img rel'>
  204 + <view class="xc-list" wx:if="{{item.is_pt_tz}}">
  205 + <span>团长</span>
  206 + </view>
  207 + <image src='{{item.head_pic}}'></image>{{item.nickname}}
  208 + </view>
  209 + <!-- <view class='zssj' wx:if="{{teamlist.kttype==1}}">{{item.add_time_date}}参团</view> -->
  210 + <view class='zssj' wx:if="{{ky==0 &&teamlist.kttype!=1}}">{{item.add_time_date}}
  211 + <text>开团</text>
  212 + </view>
  213 + <view class='zssj' wx:else>{{item.add_time_date}} 参团</view>
  214 + <view class="clear"></view>
  215 + </view>
  216 +
  217 +
  218 + <view class='clear'></view>
  219 + </view>
  220 + <view class='clear'></view>
  221 +
  222 + <!----//大家都在团---->
  223 + <view class='goodslist'>
  224 + <view class='goodslisttop'>
  225 + <!-- <view class='goodslistspan fs24'>大家都在团</view> -->
  226 + <!-- 推荐商品 -->
  227 + <view class="flex-center rel xc-linellae-frame">
  228 + <view class="xc-linellae"></view>
  229 + <view class="abs flex-center xc-recommend-frame ">
  230 + <image class=" xc-recommend" src="{{iurl}}/miniapp/images/diamond.png">
  231 + </image>
  232 + <view class="xc-recommend-word">大家都在团</view>
  233 + </view>
  234 + </view>
  235 + <view class='goodslisttopright'></view>
  236 + </view>
  237 + <view class="changxin">
  238 + <view class='onegoods' wx:for="{{pageteam}}" wx:key="{{index}}" bindtap="go_goodsinfo" data-gid="{{item.goods_id}}">
  239 + <view class='onegoodsimg'>
  240 + <image src="{{imageurl+item.share_imgurl}}"></image>
  241 + </view>
  242 + <view class="xc-buttmo-frame">
  243 + <view class='onegoodsdesc '>
  244 +
  245 + <view class='price flex-vertical-between'>
  246 + <view class='jgleft fs32 flex-center xc-wc'>
  247 + <view class="xc-ping xc-wc fs26 t-c">拼</view>
  248 + <text class="fs20" style='height:39rpx;margin-right:5rpx;margin-left:15rpx;' >¥</text>11.00{{item.price}}
  249 + </view>
  250 + <view class='jgright'>{{item.ct_num}}2
  251 + <span>人参团</span>
  252 + </view>
  253 + </view>
  254 + </view>
  255 + <view class="xc-shuoming ellipsis-2 fs26">
  256 + <text>{{item.goods_name}}</text>
  257 + </view>
  258 + </view>
  259 + </view>
  260 + </view>
  261 + </view>
  262 +</view>
  263 +
  264 +
  265 +
  266 +
  267 +<!--二维码显示页面-->
  268 +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;' wx:if='{{canvasHidden}}'></canvas>
  269 +<!--拼团玩法弹出框-->
  270 +<!----弹起的---->
  271 +<block wx:if="{{pd_xx}}">
  272 + <view class="bview"></view>
  273 + <view class="juzhong">
  274 + <view class="xq">
  275 + <view class="title" bindtap="close_pt_xx">拼团玩法介绍
  276 + <image src="{{iurl}}/miniapp/images/gbi.png" class="close"></image>
  277 + </view>
  278 + <view>1.开团:
  279 + <text class="hs1">选择心仪商品,点击“发起X人团”按钮,付款后即为开团成功;</text>
  280 + </view>
  281 + <view>2.参团:
  282 + <text class="hs1">进入朋友分享的页面,点击“立即参团”按钮,付款后即为参团成功,若多人同时支付,支付成功时间较早的人获得参团资格;</text>
  283 + </view>
  284 + <view>3.成团:
  285 + <text class="hs1">在开团或参团成功后,点击“邀请小伙伴参团”将页面分享给好友,在有效时间内凑齐人数即为成团,此时商家会开始发货;</text>
  286 + </view>
  287 + <view>4.组团失败:
  288 + <text class="hs1">在有效时间内未凑齐人数,即为组团失败,此时付款项会原路退回到支付账户;</text>
  289 + </view>
  290 + <view>5.
  291 + <text class="hs1">组团有效期间内,拼购商品订单不允许取消。 </text>
  292 + </view>
  293 + </view>
  294 + </view>
  295 +</block>
  296 +
  297 +<!-- 分享控件,底部弹出 -->
  298 +<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share>
  299 +
  300 +
  301 +<view wx:if="{{showPoster}}">
  302 + <view class="mask" catchtap="closePoster"></view>
  303 + <view class="poster-container">
  304 + <view class="poster-wrapper">
  305 + <view class="poster">
  306 + <!-- <view class="poster" bindtap="previewImage"> -->
  307 + <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image>
  308 + <view class="btn-close" catchtap="closePoster"><text class="iconfont icon-close"></text></view>
  309 + </view>
  310 + <view class="btn-container">
  311 + <!--<button class="btn-share" open-type="share" bindtap="">微信好友分享</button>-->
  312 + <button class="btn-share" bindtap="savePic">保存到相册</button>
  313 + </view>
  314 + </view>
  315 + </view>
  316 +</view>
  317 +
  318 +
  319 +
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxss 0 → 100644
  1 +page{
  2 + background-color:#eee;
  3 +}
  4 +.top{
  5 + background-color:rgb(216, 230, 220);
  6 + color: rgb(98, 155, 13);
  7 + text-align: center;
  8 + height:120rpx;
  9 + width: 100%;
  10 + padding-top:24rpx;
  11 +}
  12 +
  13 +.center{
  14 + height: 240rpx;
  15 + width: 100%;
  16 + position: relative;
  17 + background:#fff;
  18 +}
  19 +
  20 +.cenleft{
  21 + width: 240rpx;
  22 + height: 100%;
  23 +
  24 + float: left;
  25 + display:flex;
  26 + justify-content: center;
  27 + align-items: center;
  28 +}
  29 +
  30 +.cenleft image{
  31 + background-color:white ;
  32 + width: 200rpx;
  33 + height: 200rpx;
  34 +
  35 +}
  36 +
  37 +
  38 +.cenrt{
  39 + width: 460rpx; margin-top: 10rpx;
  40 +}
  41 +
  42 +.cenright{
  43 + height: 100%;
  44 + width: 460rpx;
  45 +
  46 + float: left;
  47 +}
  48 +
  49 +.cenrtop{
  50 + margin-top: 10rpx;
  51 + background-color: red;
  52 + color: white;
  53 + border-radius:10rpx;
  54 + padding-left: 16rpx;
  55 + width: 140rpx;
  56 + font-size: 32rpx;
  57 + float: left;
  58 + height: 40rpx;
  59 +}
  60 +
  61 +.cenrtoptitle{
  62 + float: left;
  63 + width: 295rpx;
  64 + height: 40rpx;
  65 + margin-left: 12rpx;
  66 + font-size: 28rpx;
  67 + margin-top:12rpx;
  68 +}
  69 +
  70 +.cenrtoptitle>span{
  71 + width: 100%;
  72 + display: inline-block;
  73 + overflow:hidden;
  74 + text-overflow:ellipsis;
  75 + white-space:nowrap
  76 +}
  77 +
  78 +.cenrcen{
  79 + height: 70rpx;
  80 + margin-top: 35rpx;
  81 + width:474rpx;
  82 +}
  83 +.jg{ font-size: 40rpx;
  84 + margin-right: 30rpx;}
  85 +.jgx{
  86 + font-size: 28rpx;
  87 + color: #777;
  88 + text-decoration:line-through;
  89 + margin-left: 20rpx;
  90 +}
  91 +
  92 +.cenrfoot{
  93 + align-content: center;
  94 + text-align: center;
  95 + border: 2rpx solid red;
  96 + border-radius:10rpx;
  97 + color: red;
  98 + float: left;
  99 + font-size: 24rpx;
  100 + padding: 4rpx 16rpx;
  101 +}
  102 +
  103 +.body{
  104 + background-color: white;
  105 + /* min-height:418rpx; */
  106 + width: 100%;
  107 + margin-top: 4rpx;
  108 + border-top:5rpx solid #eee;
  109 + height: auto;
  110 +}
  111 +
  112 +.bodytop{
  113 + background-color: white;
  114 + text-align: center;
  115 + font-size: 28rpx;
  116 + height:100rpx;
  117 + line-height:117rpx;
  118 +
  119 +}
  120 +
  121 +.bodytop span{
  122 + color: red;
  123 +}
  124 +
  125 +
  126 +.bodyimg{
  127 + height:140rpx;
  128 + width:590rpx;
  129 +
  130 +
  131 +
  132 +}
  133 +.bodyimg image{
  134 +
  135 +border-radius:50rpx;
  136 +height: 96rpx;
  137 +width: 96rpx;
  138 +background-color:burlywood;
  139 +margin-top: 30rpx;
  140 + position: absolute;
  141 +
  142 +}
  143 +
  144 +.d{
  145 +width:101rpx;
  146 + height:101rpx;
  147 + display: inline-block;
  148 + margin-right:15rpx;
  149 +
  150 +}
  151 +
  152 +.bodyimg span{
  153 + background-color:#e22b44;
  154 + color: white;
  155 + font-size: 24rpx;
  156 + border-radius:6rpx;
  157 + padding:2rpx 10rpx;
  158 + position: relative;
  159 + top: 0rpx;
  160 + left: 40rpx;
  161 +}
  162 +
  163 +
  164 +
  165 +.bodyspan{
  166 + color: red;
  167 + text-align: center;
  168 + font-size: 26rpx;
  169 +
  170 +}
  171 +
  172 +.bodyselect{
  173 + line-height: 47rpx;
  174 +}
  175 +
  176 +.bodytime{
  177 + height: 88rpx;
  178 + width: 100%;
  179 + display: flex;
  180 + flex-wrap: nowrap;
  181 + margin-left:40rpx;
  182 + align-items:center;
  183 +
  184 +}
  185 +
  186 +.bodytimeleft{
  187 + text-decoration:line-through;
  188 + flex-grow: 1.7;
  189 +}
  190 +
  191 +
  192 +.bodytimecen-success{
  193 + text-align: center;
  194 + flex-grow: 1;
  195 + line-height:75rpx;
  196 + font-size: 30rpx;
  197 + color: #000;
  198 +}
  199 +.bodytimecen-success span{
  200 +
  201 + color: #18ba5f;
  202 + border-radius:7rpx;
  203 + font-size: 30rpx;
  204 + margin: 0 auto;
  205 +
  206 +}
  207 +.bodytimecen{
  208 + text-align: center;
  209 + flex-grow: 1;
  210 +
  211 + font-size: 30rpx;
  212 + color: #000;
  213 +}
  214 +.bodytimecen span{
  215 + background-color: #333333;
  216 + color: white;
  217 + border-radius:7rpx;
  218 + padding-left: 10rpx;
  219 + font-size: 30rpx;
  220 + margin: 0 auto;
  221 + padding-right:10rpx;
  222 + margin-right:5px
  223 +}
  224 +
  225 +
  226 +.bodytimecen span:last-child{
  227 + margin-right: 10rpx;
  228 +}
  229 +
  230 +.bodytimeright{
  231 + flex-grow: 1.7;
  232 + margin-right:72rpx;
  233 +
  234 +}
  235 +
  236 +.bodybutton{
  237 + width: 90%;
  238 + margin: 0 auto;
  239 + text-align: center;
  240 + line-height: 60rpx;
  241 + border-radius:15rpx;
  242 + height: auto;
  243 +}
  244 +
  245 +.bodybutton button{
  246 + height:60rpx;
  247 + width: 100%;
  248 + background-color: #e4374d;
  249 + color: white;
  250 + font-size:26rpx;
  251 + border-radius:12rpx;
  252 +
  253 +}
  254 +
  255 +.bodyfoot{
  256 +
  257 + width: 100%;
  258 + text-align: center;
  259 +
  260 + font-size: 28rpx;
  261 + color: #000;
  262 + background-color: white;
  263 +}
  264 +
  265 +
  266 +
  267 +
  268 +
  269 +.pintuan{
  270 + width: 100%;
  271 + height: 84rpx;
  272 + background-color: white;
  273 + color: black;
  274 + text-align: center;
  275 + font-size:36rpx;
  276 + margin-top: 60rpx;
  277 +}
  278 +
  279 +.pintuanzhou{
  280 +float: left;
  281 +
  282 +line-height: 84rpx;
  283 +width: 220rpx;
  284 +}
  285 +
  286 +.pintuanyou{
  287 + float: right;
  288 + color: rgb(168, 167, 167);
  289 + line-height: 84rpx;
  290 + font-size: 28rpx;
  291 + margin-right: 20rpx;
  292 +}
  293 +
  294 +.onegoods{
  295 + background-color: white;
  296 + width: 345rpx;
  297 + min-height: 490rpx;
  298 + height:auto;
  299 +
  300 + border:2rpx solid #eee;
  301 +
  302 + float: left;
  303 + margin-right:17rpx;
  304 + border-radius:20rpx;
  305 +}
  306 +
  307 +.goodsl{
  308 + background-color: white;
  309 +}
  310 +
  311 +.onegoodsimg{
  312 + width: 100%;
  313 + height: 360rpx;
  314 +}
  315 +
  316 +.onegoodsimg image{
  317 + height: 100%;
  318 + width: 100%;
  319 + border-radius:20rpx 20rpx 0 0;
  320 +
  321 +}
  322 + .xc-buttmo-frame{
  323 + min-height: 103rpx;
  324 + height: auto;
  325 + padding-bottom:15rpx;
  326 +
  327 + }
  328 +.xc-buttmo-frame .onegoodsdesc {
  329 +
  330 + height: 80rpx;
  331 +}
  332 +
  333 +.xc-buttmo-frame .onegoodsdesc .price{
  334 +
  335 + padding-left:10rpx;
  336 + height:85rpx;
  337 +
  338 +}
  339 +.xc-ping{
  340 + border-radius: 50%;
  341 + background: #fff;
  342 + line-height:34rpx;
  343 +width:34rpx;
  344 +height:34rpx;
  345 +font-size:24rpx;
  346 +
  347 +}
  348 +.jgleft{
  349 +border-radius:36rpx;
  350 +height:45rpx;
  351 +line-height:50rpx;
  352 +color:#fff;
  353 +padding-left:7rpx;
  354 +padding-right:24rpx;
  355 +background:#e4374d;
  356 +}
  357 +
  358 +.jgright{
  359 + font-size: 26rpx;
  360 + height:16rpx;
  361 +padding-right:10rpx;
  362 +color:rgb(168, 167, 167);
  363 +}
  364 +
  365 +.jgright span{
  366 + color: rgb(168, 167, 167);
  367 +}
  368 +
  369 +.goodslisttop{
  370 + width: 100%;
  371 +}
  372 +
  373 +.goodslisttop{
  374 + width: 100%;
  375 + margin-top: 5rpx;
  376 + border-bottom: 4rpx solid #eee;
  377 + text-align: center;
  378 +}
  379 +
  380 +.goodslistspan{
  381 +
  382 + margin: 0 auto;
  383 + padding-top: 20rpx;
  384 +}
  385 +
  386 +.xian{
  387 + width: 100%;
  388 + border-bottom: 2rpx solid #eee;
  389 + float: left;
  390 +}
  391 +
  392 +.bodyselect{
  393 + height: 90rpx;
  394 + background-color: white;
  395 + width: 100%;
  396 + line-height:90rpx;
  397 +
  398 +}
  399 +
  400 +
  401 +.changxin{
  402 + overflow: hidden;
  403 + width: 100%;
  404 + padding-left:20rpx;
  405 +
  406 +}
  407 +
  408 +.zhangxi{
  409 + width: 100%;
  410 + background-color:white;
  411 + color: black;
  412 +}
  413 +
  414 +.img{
  415 + height: 100rpx;
  416 + margin-bottom: 0rpx;
  417 + float: left;
  418 + color: black;
  419 + line-height:100rpx;
  420 +display:flex;
  421 +align-items:center;
  422 +
  423 +}
  424 +
  425 +.zhangxi image{
  426 + border-radius:50rpx;
  427 + height: 60rpx;
  428 + width: 60rpx;
  429 + float: left;
  430 +
  431 + background-color: red;
  432 + margin-left: 40rpx;
  433 + margin-right:10rpx;
  434 +
  435 +}
  436 +
  437 +.zhangxi .zssj{
  438 + width: 413rpx;
  439 + margin-left: 28rpx;
  440 + float: right;
  441 + margin-top:32rpx;
  442 +}
  443 +
  444 +.zspan{
  445 + float: left;
  446 + text-align: center;
  447 + display: flex;
  448 + align-items: center;
  449 + justify-content: center;
  450 + height: 48rpx;
  451 + font-size: 28rpx;
  452 + color:#000;
  453 + margin-bottom: 10rpx;
  454 + padding-bottom: 10rpx;
  455 + width: 100%;
  456 + background: #fff;
  457 + border-bottom:3rpx solid #eee;
  458 + margin-top:20rpx;
  459 +
  460 +}
  461 +
  462 +
  463 +
  464 +.mtop{
  465 + text-align: center;
  466 + color: white;
  467 + background-color:rgba(0, 0, 0, .4);
  468 + width: 100%;
  469 + height: 100%;
  470 + position: fixed;
  471 + z-index: 5;top:0;left: 0;
  472 +
  473 +}
  474 +
  475 +.mt1{
  476 + margin-top: 200rpx;
  477 + margin-bottom: 20rpx;
  478 +}
  479 +
  480 +.mts{
  481 + color:#E1E10B;
  482 +}
  483 +
  484 +.mcou{
  485 + font-size: 48rpx;
  486 +
  487 +}
  488 +
  489 +.mfoot{
  490 + width: 100%;
  491 + margin-top: 700rpx;
  492 +}
  493 +
  494 +
  495 +.mbtn{
  496 + margin-top: 60rrpx;
  497 + width: 400rpx;
  498 + background: #666666;
  499 + color: #fff;
  500 + border-radius: 20rpx;
  501 + font-size: 32rpx;
  502 +}
  503 +
  504 +
  505 +
  506 +
  507 +
  508 +
  509 +
  510 +.etop{
  511 + padding-top: 200rpx;
  512 + width: 100%;
  513 + height: 100%;
  514 + position: fixed;
  515 + left: 0rpx;
  516 + top: 0rpx;
  517 + z-index: 12rpx;
  518 +background-color:rgba(0, 0, 0, .4);
  519 +
  520 +}
  521 +
  522 +.emyimage{
  523 + display:flex;
  524 + justify-content: center;
  525 + align-items: center;
  526 +}
  527 +
  528 +
  529 +.emyimage image{
  530 + background-color: red;
  531 + width: 300rpx;
  532 + height: 300rpx;
  533 + margin: 0 auto;
  534 +
  535 +}
  536 +
  537 +.espan{
  538 + font-size: 32rpx;
  539 + margin-top: 10rpx;
  540 +}
  541 +
  542 +.erweima{
  543 + margin-top: 10rpx;
  544 + display: flex;
  545 + width: 100%;
  546 +
  547 +}
  548 +
  549 +.erzhou{
  550 + width: 200rpx;
  551 +
  552 +
  553 + margin-right: 20rpx;
  554 +}
  555 +
  556 +.erzhou image{
  557 + background-color: blanchedalmond;
  558 + width: 200rpx;
  559 + height: 200rpx;
  560 +}
  561 +
  562 +
  563 +.eright{
  564 + width: 500rpx;
  565 + font-size: 32rpx;
  566 +
  567 +}
  568 +
  569 +
  570 +
  571 +.ecc{
  572 + float: right;
  573 + margin-right: 48rpx;
  574 +}
  575 +
  576 +
  577 +.eee{
  578 + padding-top:40rpx;
  579 +
  580 +width:90%;
  581 +height:70%;
  582 +
  583 +padding-left:32rpx;
  584 +margin-left:20rpx;
  585 +
  586 +background-color:white;
  587 +
  588 +}
  589 +
  590 +.clear{
  591 + clear: both;
  592 +}
  593 +
  594 +.down-arrow {
  595 + display: inline-block;
  596 + position: relative;
  597 + width: 40rpx;
  598 + height: 30rpx;
  599 + margin-right: 20rpx;
  600 +}
  601 +
  602 +.down-arrow::after {
  603 + display: inline-block;
  604 + content: " ";
  605 + height: 18rpx;
  606 + width: 18rpx;
  607 + border-width: 0 2rpx 2rpx 0;
  608 + border-color: #000;
  609 + border-style: solid;
  610 + transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
  611 + transform-origin: center;
  612 + transition: transform 0.3s;
  613 + position: absolute;
  614 + top: 50%;
  615 + right: 10rpx;
  616 + margin-top: -10rpx;
  617 +}
  618 +
  619 +.down-arrow1 {
  620 + display: inline-block;
  621 + position: relative;
  622 + width: 40rpx;
  623 + height: 30rpx;
  624 + margin-right: 20rpx;
  625 + margin-top: 12rpx;
  626 +}
  627 +
  628 +.down-arrow1::after {
  629 + display: inline-block;
  630 + content: " ";
  631 + height: 18rpx;
  632 + width: 18rpx;
  633 + border-width: 0 2rpx 2rpx 0;
  634 + border-color: #000;
  635 + border-style: solid;
  636 + transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
  637 + transform-origin: center;
  638 + transition: transform 0.3s;
  639 + position: absolute;
  640 + top: 50%;
  641 + right: 10rpx;
  642 + margin-top: -10rpx;
  643 +}
  644 +
  645 +.down-arrow1::after {
  646 + transform-origin: center;
  647 + transform: rotate(-135deg);
  648 + transition: transform 0.3s;
  649 +}
  650 +
  651 +.bview {
  652 + position: fixed;
  653 + top: 0;
  654 + left: 0;
  655 + width: 100%;
  656 + height: 100%;
  657 + background-color: rgba(0, 0, 0, 0.5);
  658 +}
  659 +
  660 +.juzhong {
  661 + position: fixed;
  662 + top: 0;
  663 + left: 0;
  664 + width: 100%;
  665 + height: 100%;
  666 + display: flex;
  667 + flex-direction: row;
  668 + justify-content: center;
  669 + align-items: center;
  670 +}
  671 +
  672 +.juzhong .xq {
  673 + padding: 0 20rpx;
  674 + background: #fff;
  675 + font-size: 30rpx;
  676 + padding-bottom: 20rpx;
  677 +}
  678 +
  679 +.juzhong .xq .title {
  680 + text-align: center;
  681 + margin: 20rpx 0;
  682 + position: relative;
  683 + height: 50rpx;
  684 +}
  685 +
  686 +.juzhong .xq .hs1 {
  687 + font-size: 28rpx;
  688 + color: #ab8f9e;
  689 +}
  690 +
  691 +.juzhong .xq .title .close {
  692 + position: absolute;
  693 + top: 0;
  694 + right: 0;
  695 + width: 45rpx;
  696 + height: 45rpx;
  697 +}
  698 +
  699 +.pt_qd {
  700 + margin-top: 40rpx;
  701 + height: auto;
  702 +}
  703 +
  704 +.spec-cart-btn.w100 {
  705 + width: 100%;
  706 + margin-left: 0;
  707 + height: 80rpx;
  708 + line-height: 80rpx;
  709 +}
  710 +
  711 +.pt_status_set{
  712 + position: absolute; right: 10rpx; top:50rpx; width: 120rpx; height: 120rpx;
  713 +}
  714 +
  715 +
  716 +
  717 +.xc-goods-details{
  718 +width:479rpx;
  719 +margin-top:20rpx;
  720 +height:77rpx;
  721 +}
  722 +
  723 +.xc-valframe{
  724 + border-radius:7rpx;
  725 +border:1rpx solid;
  726 +margin-top:3rpx;
  727 +}
  728 +.xc-valframe .xc-frame-img{
  729 + width:30rpx;
  730 +height:100%;
  731 +background:#e22b44;
  732 +}
  733 +.xc-valframe .xc-frame-img .picture{
  734 + width:25rpx;
  735 +height:25rpx;
  736 +margin-top:4rpx;
  737 +
  738 +}
  739 +.xc-ellipsis-img{
  740 +width:56rpx;
  741 +height:96rpx;
  742 +
  743 +}
  744 +.xc-ellipsis-img .pictures{
  745 + width:56rpx;height:56rpx;
  746 +}
  747 +.flex_tou{ display: flex; justify-content: center; width: 100%;}
  748 +.xc-ptcomplete{
  749 + width:74%;
  750 +height:105rpx;
  751 +line-height:105rpx;
  752 +float:right;
  753 +
  754 +}
  755 +.xc-ptcomplete .xc-img-frame .img{
  756 + width: 105rpx;
  757 + height: 105rpx;
  758 + float: right;
  759 +}
  760 +.xc-ptcomplete-ladder .xc-img-frame{
  761 + width:201rpx;
  762 + height: 105rpx;
  763 + margin-top:20rpx;
  764 +}
  765 +.xc-ptcomplete-ladder .xc-img-frame .img{
  766 + width: 105rpx;
  767 + height: 105rpx;
  768 + float: right;
  769 + padding-right:6rpx;
  770 +}
  771 +.xc-ptcomplete .xc-img-frame{
  772 + width:190rpx;
  773 + height: 105rpx;
  774 + margin-top:20rpx;
  775 +}
  776 +.xc-ptcomplete .xc-end{
  777 + width:283rpx;
  778 +text-align:right;
  779 +}
  780 +.iw{
  781 +padding-right:33rpx;
  782 +}
  783 +.xc-ptcomplete .xc-img-frames{
  784 + width:360rpx;
  785 +height:105rpx;
  786 +margin-top:20rpx;
  787 +
  788 +}
  789 +.xc-ptcomplete .xc-img-frames .img{
  790 + width: 105rpx;
  791 + height: 105rpx;
  792 + float: right;
  793 + padding-right:6rpx;
  794 +}
  795 +.xc-home-page-frame{
  796 + padding-top:16rpx;
  797 +
  798 +}
  799 +.xc-home-page-frame .xc-home-page{
  800 + background-color: #e22b44;border-radius:15rpx;
  801 +width:90%;
  802 +color:#fff;
  803 +height:60rpx;
  804 +font-size:26rpx;
  805 +line-height:60rpx;
  806 +}
  807 +/* */
  808 +.xc-people-val{
  809 + padding-left:8rpx;
  810 +padding-right:8rpx;
  811 +}
  812 +.xc-onclik{
  813 + width:100%;
  814 +height:70rpx;
  815 +
  816 +}
  817 +.xc-green{
  818 + color: #18ba5f;
  819 + text-align:center;
  820 +flex-grow:1;
  821 +height:90rpx;
  822 +
  823 +
  824 +}
  825 +.xc-ptcomplete-ladder{
  826 + width:74%;
  827 +height:105rpx;
  828 +line-height:105rpx;
  829 +float:right;
  830 +}
  831 +.xc-fail-ladder{
  832 + width:61%;
  833 +height:105rpx;
  834 +line-height:105rpx;
  835 +float:right;
  836 +
  837 +}
  838 +.xc-fail-ladder .xc-img-frame{
  839 + width:61%;
  840 +height:105rpx;
  841 +margin-top:20rpx;
  842 +}
  843 +.xc-fail-ladder .xc-img-frame .img{
  844 + width: 105rpx;
  845 + height: 105rpx;
  846 + float: right;
  847 + padding-right:6rpx;
  848 +}
  849 +.xc-list{
  850 + background-color:#e22b44;
  851 +color:white;
  852 +font-size:17rpx;
  853 +border-radius:6rpx;
  854 +padding:0 5rpx;
  855 +position:absolute;
  856 +top:13rpx;
  857 +left:80rpx;
  858 +width:34rpx;
  859 +line-height:25rpx;
  860 +
  861 +}
  862 +
  863 +.xc-linellae-frame{
  864 + width: 100%;
  865 + height: 60rpx;
  866 + background: #eee;
  867 +}
  868 +.xc-linellae-frame .xc-linellae{
  869 + width: 425rpx;
  870 + height: 1rpx;
  871 + border-bottom: 1rpx solid #a5a5a5;
  872 +}
  873 +.xc-recommend-frame{
  874 +background:#eee;
  875 +width:200rpx;
  876 +height:100%;
  877 +
  878 +}
  879 +.xc-recommend-frame .xc-recommend{
  880 + width: 35rpx;
  881 + height: 27rpx;
  882 + margin-top:7rpx;
  883 +}
  884 +.xc-recommend-frame .xc-recommend-word{
  885 +font-size:26rpx;
  886 +color: #a9a9a9;
  887 +margin-left:5rpx;
  888 +}
  889 +.xc-rmbs{
  890 +
  891 +height:40rpx;
  892 +}
  893 +.xc-shuoming{
  894 + padding-left:10rpx;
  895 +}
  896 +
  897 +
  898 +.poster-container {
  899 + box-sizing: border-box;
  900 + position: fixed;
  901 + top: 50%;
  902 + left: 50%;
  903 + transform: translate(-50%, -50%);
  904 + width: calc(100% - 210rpx);
  905 + z-index: 1000;
  906 +}
  907 +.mask {
  908 + position: fixed;
  909 + top: 0;
  910 + left: 0;
  911 + width: 100%;
  912 + height: 100%;
  913 + z-index: 999;
  914 + background-color: rgba(0,0,0,.4);
  915 +}
  916 +.poster-wrapper {
  917 + width: 100%;
  918 +}
  919 +
  920 +.poster {
  921 + box-sizing: border-box;
  922 + width: 100%;
  923 + height: 905rpx;
  924 + border-radius: 20rpx;
  925 + /* box-shadow: 0 8px 12px #666; */
  926 + position: relative;
  927 + z-index: 999;
  928 + overflow: hidden;
  929 +}
  930 +.poster-img {
  931 + display: block;
  932 + width: 100%;
  933 + height: 100%;
  934 +}
  935 +.btn-container {
  936 + display: flex;
  937 + justify-content: space-around;
  938 +}
  939 +.btn-share {
  940 + display: block;
  941 + background-color: #FE6867;
  942 + color: white;
  943 + border-radius: 8rpx;
  944 + line-height: 80rpx;
  945 + margin-top: 28rpx;
  946 + padding: 0 60rpx;
  947 +}
  948 +
  949 +
  950 +.btn-close {
  951 + /* background-color: rgba(0,0,0,.5); */
  952 + color: #ccc;
  953 + width: 50rpx;
  954 + height: 50rpx;
  955 + line-height: 50rpx;
  956 + text-align: center;
  957 + border-radius: 50%;
  958 + position: absolute;
  959 + right: 20rpx;
  960 + top: 20rpx;
  961 +}
  962 +
  963 +.icon-close {
  964 + font-size: 48rpx;
  965 +}
0 \ No newline at end of file 966 \ No newline at end of file
packageC/pages/luckyGo/luckyGo_list/luckyGo_list.js 0 → 100644
  1 +var t = require("../../../../utils/util.js"),
  2 + ut = t,
  3 + e = require("../../../../utils/common.js"),
  4 + a = require("../../../../utils/wxParse/wxParse.js"),
  5 + s = getApp(),
  6 + i = s.request,
  7 + rq = i,
  8 + oo = s.globalData,
  9 + o = s.globalData.setting,
  10 + os = o;
  11 +var regeneratorRuntime = require('../../../../utils/runtime.js');
  12 +var e = getApp(),oo = e.globalData.setting;
  13 +
  14 +Page({
  15 + data: {
  16 + wu:false,
  17 + imageurl: os.imghost,//有礼派图片地址,
  18 + iurl: os.imghost,//有礼派图片地址,
  19 + pt_state:0,
  20 + order : null,//订单数据
  21 + currentTab: 0,
  22 + current:0,
  23 + ordertx:[],//头像
  24 + baseUrl: "/api/weshop/order/page?1=1",
  25 + resourceUrl: e.globalData.setting.resourceUrl,
  26 + currentPage: 1,
  27 + requestData: null,
  28 + original_img:null,
  29 + timer:null,
  30 +
  31 +
  32 +
  33 +
  34 + tabArr: ['全部','参团中','已团中','未团中'],
  35 + currentTabIndex: 0,
  36 + },
  37 + onLoad: function () {
  38 + this.data.requestData=new Array();
  39 + this.init(0);
  40 + },
  41 + onShow:function(){
  42 + var th=this;
  43 + //设置全局定时器
  44 + th.data.timer=setInterval(function () {
  45 + th.countDown();
  46 + },1000);
  47 + },
  48 +
  49 +
  50 + clickTab(e) {
  51 + this.setData({
  52 + currentTabIndex: e.target.dataset.index,
  53 + });
  54 + },
  55 +
  56 +
  57 + /**
  58 + * 点击tab切换
  59 + */
  60 + swichNav: function (e) {
  61 + this.data.requestData=[];
  62 + this.data.currentPage=1;
  63 + var that = this;
  64 +
  65 + if (that.data.order == null){
  66 + that.setData({
  67 + wu:true
  68 + })
  69 + }
  70 +
  71 + if (this.data.currentTab === e.target.dataset.current) {
  72 + return false;
  73 + } else {
  74 + that.setData({
  75 + currentTab: e.target.dataset.current,
  76 + })
  77 + that.init(e.target.dataset.current);
  78 + }
  79 + },
  80 +
  81 + async init(current) {
  82 + var where="1=1";
  83 + var user_id = getApp().globalData.user_id;
  84 + switch (current){
  85 + case "1":
  86 + where+="&pt_status=1";
  87 + break;
  88 + case "2":
  89 + where += "&pt_ok=1";
  90 + break;
  91 + case "3":
  92 + where += "&pt_status=3";
  93 + break;
  94 + }
  95 +
  96 + var goods_id = 0,//商品ID,
  97 + original_img = [],//商品图片
  98 + ee = this,
  99 + ordertx=[],//头像
  100 + order = null,//订单数据
  101 + goods = null,//商品数据
  102 + users = null,//会员数据
  103 + order_goods=null;//订单商品表
  104 +
  105 + //获取订单表的信息根据活动user_id,pt_prom_id>0 AND pay_time>0
  106 + /*---
  107 + await getApp().request.promiseGet("/api/weshop/order/page?"+where, {
  108 + data: { is_pt:1,store_id: os.stoid, user_id: user_id, pageSize: 6, page: this.data.currentPage,}
  109 + }).then(res => {
  110 + order = res.data.data.pageData;
  111 + this.data.currentPage++;
  112 + })--*/
  113 +
  114 + await getApp().request.promiseGet("/api/weshop/order/pageTuan?"+where, {
  115 + data: { is_pt:1,store_id: os.stoid, user_id: user_id, pageSize: 6, page: this.data.currentPage,}
  116 + }).then(res => {
  117 + order = res.data.data.pageData;
  118 + this.data.currentPage++;
  119 + })
  120 +
  121 +
  122 + wx.showLoading({ title: "加载中"});
  123 + for (i = 0; i < order.length; i++) {
  124 + //获取订单从表信息
  125 + await getApp().request.promiseGet("/api/weshop/ordergoods/pageGoods", {
  126 + data: { store_id: os.stoid, order_id: order[i].order_id }
  127 + }).then(res => {
  128 + order_goods = res.data.data.pageData;
  129 + order[i].order_goods = order_goods;
  130 + order[i].gimage = ee.data.imageurl + order_goods[0].original_img;
  131 + })
  132 +
  133 +
  134 + //获取订单表信息根据上面查询的订单号order[i].pt_listno
  135 + await getApp().request.promiseGet("/api/weshop/order/pagePtList", {
  136 + data: { store_id: os.stoid, pt_listno: order[i].pt_listno,pageSize:60,page:1}
  137 + }).then(res => {
  138 + //console.log("ordertx");
  139 + ordertx = res.data.data.pageData;
  140 + //console.log(ordertx);
  141 + order[i].tx=ordertx;
  142 + })
  143 +
  144 +
  145 +
  146 + if (order[i].is_zsorder== 4) {
  147 + var num = 0;
  148 + var jt_data = JSON.parse(order[i].ct_rylist);
  149 + for (var m in jt_data) {
  150 + if (jt_data[m].rynum > num) num = jt_data[m].rynum;
  151 + }
  152 + order[i].max_ct_num = num;
  153 + }
  154 +
  155 + var sf_num = order[i].ct_num;
  156 + if (order[i].ct_num>=3){ sf_num=3;}
  157 + sf_num=sf_num-ordertx.length;
  158 + if(sf_num>0) {
  159 + var arr = [];
  160 + for(var j=0;j<sf_num;j++){
  161 + arr.push(j);
  162 + }
  163 + order[i].sf_num=arr;
  164 + }
  165 +
  166 + }
  167 + //设置值
  168 + for (var ii = 0; ii < order.length;ii++){
  169 + this.data.requestData.push(order[ii]);
  170 + }
  171 +
  172 + wx.hideLoading();
  173 + ee.setData({ order: this.data.requestData, ordertx: ordertx, isgo:1});
  174 + },
  175 +
  176 + //---滚动到底部加载更多---
  177 + onReachBottom: function () {
  178 + this.init(this.data.currentTab);
  179 + },
  180 +
  181 + resetData: function () {
  182 + n.resetConfig(), this.data.order = null, this.data.currentPage = 1;
  183 + },
  184 +
  185 + //----跳转到拼单success展示-----
  186 + go_team_success:function(e) {
  187 + var order_sn=e.currentTarget.dataset.ordsn;
  188 + wx.navigateTo({
  189 + url: "/pages/team/team_success/team_success?ordersn=" + order_sn,
  190 + });
  191 + },
  192 +
  193 + onHide:function(){
  194 + //--清理定时器--
  195 + clearInterval(this.timer);
  196 + },
  197 +
  198 + //----倒计时函数-----
  199 + countDown() {
  200 + var th=this;
  201 + // 获取当前时间,同时得到活动结束时间数组
  202 + let newTime =ut.gettimestamp();
  203 + var endTimeList = this.data.order;
  204 +
  205 + if(endTimeList==null) return null
  206 + // 对结束时间进行处理渲染到页面
  207 + for (var i = 0; i < endTimeList.length;i++){
  208 + var o = endTimeList[i];
  209 + if(o.kt_end_time==undefined) continue;
  210 + var endTime = o.kt_end_time;
  211 + let obj = null;
  212 + // 如果活动未结束,对时间进行处理
  213 + if (endTime - newTime > 0){
  214 + let time = (endTime - newTime);
  215 + // 获取天、时、分、秒
  216 + let day = parseInt(time / (60 * 60 * 24));
  217 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  218 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  219 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  220 + obj = {
  221 + day: this.timeFormat(day), hou: this.timeFormat(hou), min: this.timeFormat(min), sec: this.timeFormat(sec)
  222 + }
  223 + }else{
  224 + //活动已结束,全部设置为'00'
  225 + obj = { day: '00', hou: '00', min: '00', sec: '00' }
  226 + }
  227 +
  228 + var txt ="order["+i+"].djs";
  229 + th.setData({ [txt]: obj});
  230 + }
  231 + },
  232 + //---小于10的格式化函数----
  233 + timeFormat(param) {
  234 + return param < 10 ? '0' + param : param;
  235 + },
  236 +
  237 + images_err:function(e){
  238 + var txt = e.currentTarget.dataset.err;
  239 + var ob={};
  240 + ob[txt] = this.data.imageurl + "/miniapp/images/default_g_img.gif";
  241 + this.setData(ob);
  242 + }
  243 +
  244 +
  245 +})
  246 +
packageC/pages/luckyGo/luckyGo_list/luckyGo_list.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "幸运购列表",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "nodata": "/components/nodata/nodata"
  6 + }
  7 +}
0 \ No newline at end of file 8 \ No newline at end of file
packageC/pages/luckyGo/luckyGo_list/luckyGo_list.wxml 0 → 100644
  1 +<view class="tab-hd" bindtap="clickTab">
  2 + <view class="tab-hd-item {{currentTabIndex == index ? 'active':''}}" wx:for="{{tabArr}}" data-index="{{index}}">{{item}}</view>
  3 +</view>
  4 +
  5 +<view class="tab-bd">
  6 + <view class="list">
  7 + <view class="list-item">
  8 + <view class="pd20">
  9 + <view class="pdr40 arrow">参团中,还差<text class="c-red">2</text>人</view>
  10 + </view>
  11 + <view class="flex pd20">
  12 + <view class="img-container"><image src="../../../../images/bk.png" class="img-block"></image></view>
  13 + <view>
  14 + <view class="title ellipsis-2">商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称</view>
  15 + <view class="flex ai-center">
  16 + <text class="rmb fs40 c-red">15</text>
  17 + <view class="fs24 del pdl10 c-c7">零售价<text class="rmb">25</text></view>
  18 + </view>
  19 + <view class="c-red fs24">未团中可获得XXXX帮团奖励</view>
  20 + </view>
  21 + </view>
  22 + <view class="flex ai-center pd20 bdt fs24 jc_sb">
  23 + <view>共1件,实付金额:<text class="rmb">15.00</text></view>
  24 + <view class="flex">
  25 + <view class="btn gray">查看订单</view>
  26 + <view class="btn c-red mgl20">邀请好友</view>
  27 + </view>
  28 + </view>
  29 + </view>
  30 +
  31 + <view class="list-item">
  32 + <view class="pd20">
  33 + <view class="pdr40 arrow">已团中,待发货</view>
  34 + </view>
  35 + <view class="flex pd20">
  36 + <view class="img-container"><image src="../../../../images/bk.png" class="img-block"></image></view>
  37 + <view>
  38 + <view class="title ellipsis-2">商品名称商品名称</view>
  39 + <view class="flex ai-center">
  40 + <text class="rmb fs40 c-red">15</text>
  41 + <view class="fs24 del pdl10 c-c7">零售价<text class="rmb">25</text></view>
  42 + </view>
  43 + <view class="c-red fs24">未团中可获得XXXX帮团奖励</view>
  44 + </view>
  45 + </view>
  46 + <view class="flex ai-center pd20 bdt fs24 jc_sb">
  47 + <view>共1件,实付金额:<text class="rmb">15.00</text></view>
  48 + <view class="flex">
  49 + <view class="btn gray">查看订单</view>
  50 + <!-- <view class="btn c-red mgl20">邀请好友</view> -->
  51 + </view>
  52 + </view>
  53 + </view>
  54 +
  55 + <view class="list-item">
  56 + <view class="pd20">
  57 + <view class="pdr40 arrow">未团中,已退款</view>
  58 + </view>
  59 + <view class="flex pd20">
  60 + <view class="img-container"><image src="../../../../images/bk.png" class="img-block"></image></view>
  61 + <view>
  62 + <view class="title ellipsis-2">商品名称商品名称</view>
  63 + <view class="flex ai-center">
  64 + <text class="rmb fs40 c-red">15</text>
  65 + <view class="fs24 del pdl10 c-c7">零售价<text class="rmb">25</text></view>
  66 + </view>
  67 + <view class="c-red fs24">未团中可获得XXXX帮团奖励</view>
  68 + </view>
  69 + </view>
  70 + <view class="flex ai-center pd20 bdt fs24 jc_sb">
  71 + <view>共1件,实付金额:<text class="rmb">15.00</text></view>
  72 + <view class="flex">
  73 + <view class="btn gray">查看订单</view>
  74 + <view class="btn c-red mgl20">查看奖励</view>
  75 + </view>
  76 + </view>
  77 + </view>
  78 +
  79 + </view>
  80 +</view>
  81 +
  82 +
  83 +<view class="popup-container">
  84 + <view class="popup">
  85 + <view class="pd20 flex jc_sb">
  86 + <text class="c-red">帮团奖励</text>
  87 + <text class="iconfont icon-close fs32 c-7b"></text>
  88 + </view>
  89 + <view class="popup-list">
  90 + <view class="popup-list-item">
  91 + <view class="img-container"><image class="img-block" src="../../../../images/bk.png"></image></view>
  92 + <view class="f1">
  93 + <view class="ellipsis-2 popup-title">我是名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称</view>
  94 + <view class="fs24 t-r pdt16 c-7b">数量:<text class="c-red">100</text></view>
  95 + </view>
  96 + </view>
  97 +
  98 + <view class="popup-list-item">
  99 + <view class="img-container"><image class="img-block" src="../../../../images/bk.png"></image></view>
  100 + <view class="f1">
  101 + <view class="ellipsis-2 popup-title">我是名称</view>
  102 + <view class="fs24 t-r pdt16 c-7b">数量:<text class="c-red">11</text></view>
  103 + </view>
  104 + </view>
  105 +
  106 + <view class="popup-list-item">
  107 + <view class="img-container"><image class="img-block" src="../../../../images/bk.png"></image></view>
  108 + <view class="f1">
  109 + <view class="ellipsis-2 popup-title">我是名称</view>
  110 + <view class="fs24 t-r pdt16 c-7b">数量:<text class="c-red">11</text></view>
  111 + </view>
  112 + </view>
  113 +
  114 + <view class="popup-list-item">
  115 + <view class="img-container"><image class="img-block" src="../../../../images/bk.png"></image></view>
  116 + <view class="f1">
  117 + <view class="ellipsis-2 popup-title">我是名称</view>
  118 + <view class="fs24 t-r pdt16 c-7b">数量:<text class="c-red">11</text></view>
  119 + </view>
  120 + </view>
  121 +
  122 + </view>
  123 + </view>
  124 +</view>
  125 +
  126 +
  127 +
  128 +<view class="no-more">—— 已经到底啦 ——</view>
  129 +<nodata nodataContainer="t-c"></nodata>
0 \ No newline at end of file 130 \ No newline at end of file
packageC/pages/luckyGo/luckyGo_list/luckyGo_list.wxss 0 → 100644
  1 +.bdt {
  2 + border-top: 2rpx solid #f5f5f5;
  3 +}
  4 +
  5 +page {
  6 + background-color: #f2f2f2;
  7 +}
  8 +
  9 +.btn {
  10 + border: 2rpx solid #ff6768;
  11 + padding: 10rpx 20rpx;
  12 + border-radius: 40rpx;
  13 +}
  14 +
  15 +.btn.gray {
  16 + border-color: #ccc;
  17 +}
  18 +
  19 +.tab-hd {
  20 + display: flex;
  21 + text-align: center;
  22 + font-size: 28rpx;
  23 + background-color: white;
  24 + position: sticky;
  25 + top: 0;
  26 + z-index: 2;
  27 +}
  28 +
  29 +.tab-hd-item {
  30 + flex-grow: 1;
  31 + padding: 20rpx;
  32 + position: relative;
  33 +}
  34 +
  35 +.tab-hd-item.active {
  36 + color: #ff6768;
  37 +}
  38 +
  39 +.tab-hd-item.active::after {
  40 + content: '';
  41 + position: absolute;
  42 + width: 30%;
  43 + height: 4rpx;
  44 + left: 0;
  45 + right: 0;
  46 + bottom: 0;
  47 + margin: 0 auto;
  48 + background-color: #ff6768;
  49 +}
  50 +
  51 +.title {
  52 + height: 88rpx;
  53 +}
  54 +
  55 +.tab-bd {
  56 + padding-left: 20rpx;
  57 + padding-right: 20rpx;
  58 +}
  59 +
  60 +.list {
  61 + overflow: hidden;
  62 +}
  63 +
  64 +.list-item {
  65 + background-color: white;
  66 + margin-top: 20rpx;
  67 + border-radius: 12rpx;
  68 + font-size: 28rpx;
  69 +}
  70 +
  71 +.arrow {
  72 + position: relative;
  73 +}
  74 +
  75 +.arrow::after {
  76 + font-family: iconfont;
  77 + content: '\e61f';
  78 + position: absolute;
  79 + right: 0;
  80 + color: #ccc;
  81 +}
  82 +
  83 +.img-container {
  84 + width: 200rpx;
  85 + height: 200rpx;
  86 + flex-shrink: 0;
  87 + padding-right: 20rpx;
  88 +}
  89 +
  90 +.rmb::before {
  91 + content: '¥';
  92 + font-size: 24rpx;
  93 +}
  94 +
  95 +.del {
  96 + text-decoration: line-through;
  97 +}
  98 +
  99 +.no-more {
  100 + font-size: 24rpx;
  101 + line-height: 2;
  102 + text-align: center;
  103 + margin-top: 10rpx;
  104 + color: #ccc;
  105 +}
  106 +
  107 +
  108 +.popup-container {
  109 + position: fixed;
  110 + top: 0;
  111 + bottom: 0;
  112 + left: 0;
  113 + right: 0;
  114 + background-color: rgba(0,0,0,.8);
  115 +}
  116 +
  117 +.popup {
  118 + background-color: #FFFAE7;
  119 + position: fixed;
  120 + left: 50%;
  121 + top: 50%;
  122 + transform: translate(-50%, -50%);
  123 + border-radius: 12rpx;
  124 + min-width: 600rpx;
  125 + color: #AF481D;
  126 +}
  127 +
  128 +
  129 +
  130 +.popup-list-item {
  131 + display: flex;
  132 + padding: 20rpx;
  133 +}
  134 +
  135 +.popup-list-item .img-container {
  136 + width: 140rpx;
  137 + height: 140rpx;
  138 +}
  139 +
  140 + .popup-title {
  141 + font-size: 28rpx;
  142 + height: 88rpx;
  143 + }
0 \ No newline at end of file 144 \ No newline at end of file
packageC/pages/presell/cart/cart.js
@@ -656,7 +656,7 @@ Page({ @@ -656,7 +656,7 @@ Page({
656 }) 656 })
657 }else{ 657 }else{
658 th.setData({quan_price:0}); 658 th.setData({quan_price:0});
659 - if(th.data.using_quan[bn_pick].isby==1){ 659 + if(th.data.using_quan && th.data.using_quan[bn_pick] && th.data.using_quan[bn_pick].isby==1){
660 var txt="using_quan["+bn_pick+"]"; 660 var txt="using_quan["+bn_pick+"]";
661 th.setData({[txt]:{}}); 661 th.setData({[txt]:{}});
662 } 662 }
@@ -2529,6 +2529,40 @@ Page({ @@ -2529,6 +2529,40 @@ Page({
2529 }, 2529 },
2530 2530
2531 2531
  2532 + //---------联系客服------------
  2533 + contactService: function() {
  2534 + getApp().getConfig(function(t) {
  2535 + if (t.store_tel == undefined) {
  2536 + getApp().request.get("/api/weshop/store/get/" + os.stoid, {
  2537 + isShowLoading: 1,
  2538 + data: {},
  2539 + success: function(rs) {
  2540 + getApp().globalData.config = rs.data.data;
  2541 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  2542 + getApp().my_warnning("商家未设置电话", 0, th);
  2543 + return false;
  2544 + }
  2545 + wx.makePhoneCall({ phoneNumber: rs.data.data.store_tel, })
  2546 + }
  2547 + })
  2548 + } else {
  2549 + wx.makePhoneCall({ phoneNumber: t.store_tel, })
  2550 + }
  2551 + });
  2552 + },
  2553 +
  2554 + //---------联系微信客服------------
  2555 + con_weixin:function () {
  2556 + var url=this.data.sys_switch.weapp_customertype_url;
  2557 + var id=this.data.sys_switch.weapp_customertype_appid;
  2558 + wx.openCustomerServiceChat({
  2559 + extInfo: {url: url},
  2560 + corpId: id,
  2561 + success(res) {}
  2562 + })
  2563 + }
  2564 +
  2565 +
2532 2566
2533 2567
2534 2568
packageC/pages/presell/cart/cart.wxml
@@ -647,15 +647,20 @@ @@ -647,15 +647,20 @@
647 647
648 <!-- 客服 --> 648 <!-- 客服 -->
649 <view class="kefu-container shadow-1"> 649 <view class="kefu-container shadow-1">
650 - <block wx:if="{{sys_switch.weapp_customertype}}">  
651 - <button wx:if="{{sys_switch.weapp_customertype}}" class="kefu-btn" 650 + <block wx:if="{{sys_switch.weapp_customertype==1}}">
  651 + <button class="kefu-btn"
652 open-type="contact" 652 open-type="contact"
653 session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> 653 session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
654 <text class="iconfont icon-kefu fs60 co-red"></text> 654 <text class="iconfont icon-kefu fs60 co-red"></text>
655 </button> 655 </button>
656 </block> 656 </block>
  657 +
  658 + <block wx:elif="{{sys_switch.weapp_customertype==2}}">
  659 + <text bindtap="con_weixin" class="iconfont icon-kefu fs60 co-red"></text>
  660 + </block>
  661 +
657 <block wx:else> 662 <block wx:else>
658 - <text class="iconfont icon-kefu fs60 co-red"></text> 663 + <text bindtap="contactService" class="iconfont icon-kefu fs60 co-red"></text>
659 </block> 664 </block>
660 </view> 665 </view>
661 666
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -3936,7 +3936,7 @@ Page({ @@ -3936,7 +3936,7 @@ Page({
3936 } 3936 }
3937 3937
3938 var userInfo = getApp().globalData.userInfo; 3938 var userInfo = getApp().globalData.userInfo;
3939 - var pre_data = {store_id: os.stoid, is_end: 0, timetype: 1, isuse: 1, prom_type: 8, prom_id: presell_id}; 3939 + var pre_data = {store_id: os.stoid, is_end: 0, timetype: 1, isuse: 1, prom_type: 8, prom_id: presell_id,pageSize:1000};
3940 if (userInfo) { 3940 if (userInfo) {
3941 pre_data.user_id = userInfo.user_id; 3941 pre_data.user_id = userInfo.user_id;
3942 } 3942 }
@@ -3965,6 +3965,16 @@ Page({ @@ -3965,6 +3965,16 @@ Page({
3965 if (func) { 3965 if (func) {
3966 func(); 3966 func();
3967 } 3967 }
  3968 + },
  3969 +
  3970 + con_weixin:function () {
  3971 + var url=this.data.sys_switch.weapp_customertype_url;
  3972 + var id=this.data.sys_switch.weapp_customertype_appid;
  3973 + wx.openCustomerServiceChat({
  3974 + extInfo: {url: url},
  3975 + corpId: id,
  3976 + success(res) {}
  3977 + })
3968 } 3978 }
3969 3979
3970 }); 3980 });
packageC/pages/presell/goodsInfo/goodsInfo.wxml
@@ -482,10 +482,16 @@ @@ -482,10 +482,16 @@
482 <!-- -----------------底部按钮------------------ --> 482 <!-- -----------------底部按钮------------------ -->
483 <view class="join-cart"> 483 <view class="join-cart">
484 <!-- bindtap="contactService" --> 484 <!-- bindtap="contactService" -->
485 - <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> 485 + <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}}">
486 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 486 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
487 <view>客服</view> 487 <view>客服</view>
488 </button> 488 </button>
  489 +
  490 + <view wx:elif="{{sys_switch.weapp_customertype==2}}" class="custom-service cart-ico new_split" bindtap="con_weixin">
  491 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  492 + <view>客服</view>
  493 + </view>
  494 +
489 <view wx:else class="custom-service cart-ico new_split" bindtap="contactService"> 495 <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">
490 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 496 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
491 <view>客服</view> 497 <view>客服</view>
pages/activity/seckill_list/seckill_list.js
@@ -76,7 +76,7 @@ Page({ @@ -76,7 +76,7 @@ Page({
76 }, 76 },
77 onHide:function(){ 77 onHide:function(){
78 //--清理定时器-- 78 //--清理定时器--
79 - clearInterval(this.timer); 79 + clearInterval(this.data.timer);
80 this.setData({isshow:0}); 80 this.setData({isshow:0});
81 }, 81 },
82 //---小于10的格式化函数---- 82 //---小于10的格式化函数----
@@ -124,9 +124,12 @@ Page({ @@ -124,9 +124,12 @@ Page({
124 var e = this,th=e, i = "/api/ms/flash_sale/spikepage?page=" + e.data.currentPage; 124 var e = this,th=e, i = "/api/ms/flash_sale/spikepage?page=" + e.data.currentPage;
125 var plist=null,alllist=th.data.goodlist; 125 var plist=null,alllist=th.data.goodlist;
126 if(!alllist) alllist=[]; 126 if(!alllist) alllist=[];
  127 + var user_id=getApp().globalData.user_id;
  128 + if(!user_id) user_id=user_id;
  129 + var req={store_id:os.stoid,timetype:th.data.type,is_end:0,is_show:1,user_id:user_id};
127 130
128 await getApp().request.promiseGet(i, 131 await getApp().request.promiseGet(i,
129 - {isShowLoading:1,data:{store_id:os.stoid,timetype:th.data.type,is_end:0,is_show:1}} 132 + {isShowLoading:1,data:req}
130 ).then(res=>{ 133 ).then(res=>{
131 plist=res.data.data.pageData; 134 plist=res.data.data.pageData;
132 console.log("是什么即将开始",plist); 135 console.log("是什么即将开始",plist);
@@ -148,6 +151,8 @@ Page({ @@ -148,6 +151,8 @@ Page({
148 151
149 //--循环读取接口--- 152 //--循环读取接口---
150 for(var i=0;i<plist.length;i++) { 153 for(var i=0;i<plist.length;i++) {
  154 +
  155 + if( plist[i].user_price) plist[i].price= plist[i].user_price;
151 var prom_id = plist[i].id; 156 var prom_id = plist[i].id;
152 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + 157 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
153 os.stoid + "/1/" + prom_id, {} 158 os.stoid + "/1/" + prom_id, {}
pages/activity/seckill_list/seckill_list.wxml
@@ -33,13 +33,13 @@ @@ -33,13 +33,13 @@
33 33
34 <view class="kill-list abs seckill_list"> 34 <view class="kill-list abs seckill_list">
35 <view class="kill-item" wx:for="{{goodlist}}" wx:if="{{item.djs.hide}}" > 35 <view class="kill-item" wx:for="{{goodlist}}" wx:if="{{item.djs.hide}}" >
36 - <navigator class="kill-pic rel" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> 36 + <navigator class="kill-pic rel" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1">
37 <image class="abs xc-miaosha" src="{{url}}/miniapp/images/zms.png"></image> 37 <image class="abs xc-miaosha" src="{{url}}/miniapp/images/zms.png"></image>
38 <image class="wh100" src="{{url+item.original_img}}" data-val="{{item.original_img}}" 38 <image class="wh100" src="{{url+item.original_img}}" data-val="{{item.original_img}}"
39 data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image> 39 data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image>
40 </navigator> 40 </navigator>
41 <view class="kill-cont"> 41 <view class="kill-cont">
42 - <navigator class="goods-name ellipsis-2" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">{{item.title}}</navigator> 42 + <navigator class="goods-name ellipsis-2" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1">{{item.goods_name}}</navigator>
43 <view class="flex-vertical xc-strip-frame"> 43 <view class="flex-vertical xc-strip-frame">
44 <view class="xc-strip-blank rel"> 44 <view class="xc-strip-blank rel">
45 45
@@ -71,9 +71,9 @@ @@ -71,9 +71,9 @@
71 71
72 </view> 72 </view>
73 <view class="kill-btn "> 73 <view class="kill-btn ">
74 - <navigator style="background-color: #059de5;" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:if="{{type==0}}" >即将开始</navigator>  
75 - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:if="{{item.status==1 && type==1}}">马上抢</navigator>  
76 - <navigator class="huise"url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:if="{{item.status==3 && type==1}}">已抢光</navigator> 74 + <navigator style="background-color: #059de5;" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1" wx:if="{{type==0}}" >即将开始</navigator>
  75 + <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1" wx:if="{{item.status==1 && type==1}}">马上抢</navigator>
  76 + <navigator class="huise"url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1" wx:if="{{item.status==3 && type==1}}">已抢光</navigator>
77 </view> 77 </view>
78 </view> 78 </view>
79 </view> 79 </view>
pages/cart/cart/cart.js
@@ -120,15 +120,20 @@ Page({ @@ -120,15 +120,20 @@ Page({
120 } 120 }
121 th.setData({ad_data:narr}); 121 th.setData({ad_data:narr});
122 }else{ 122 }else{
  123 +
  124 + var user_id=getApp().globalData.user_id;
  125 + if(!user_id) user_id=0;
  126 + var req_d= {
  127 + store_id: oo.stoid,
  128 + timetype: 2,
  129 + is_end: 0,
  130 + is_show: 1,
  131 + pageSize: 1,
  132 + user_id:user_id
  133 + }
123 //--获取是否又秒杀活动-- 134 //--获取是否又秒杀活动--
124 getApp().request.promiseGet("/api/ms/flash_sale/spikepage", { 135 getApp().request.promiseGet("/api/ms/flash_sale/spikepage", {
125 - data: {  
126 - store_id: oo.stoid,  
127 - timetype: 2,  
128 - is_end: 0,  
129 - is_show: 1,  
130 - pageSize: 1  
131 - }, 136 + data:req_d,
132 }).then(res => { 137 }).then(res => {
133 if (res.data.code == 0 && res.data.data && res.data.data.pageData.length > 0) { 138 if (res.data.code == 0 && res.data.data && res.data.data.pageData.length > 0) {
134 th.setData({ 139 th.setData({
@@ -150,6 +155,7 @@ Page({ @@ -150,6 +155,7 @@ Page({
150 }, 155 },
151 //-------------获取购物车列表,要安装门店进行分类订单----------- 156 //-------------获取购物车列表,要安装门店进行分类订单-----------
152 getCardList: function() { 157 getCardList: function() {
  158 +
153 var th = this; 159 var th = this;
154 160
155 //要获取会员是不是等级会员 161 //要获取会员是不是等级会员
@@ -185,6 +191,7 @@ Page({ @@ -185,6 +191,7 @@ Page({
185 th.get_cart(); 191 th.get_cart();
186 th.get_ser_cart(); 192 th.get_ser_cart();
187 } 193 }
  194 +
188 195
189 } 196 }
190 }) 197 })
@@ -214,6 +221,7 @@ Page({ @@ -214,6 +221,7 @@ Page({
214 state:0 221 state:0
215 }, 222 },
216 success:async function(su) { 223 success:async function(su) {
  224 + console.log(su,10000);
217 //按门店分类的数组 225 //按门店分类的数组
218 var arr = new Array(), 226 var arr = new Array(),
219 carr = su.data.data.pageData; 227 carr = su.data.data.pageData;
@@ -302,8 +310,11 @@ Page({ @@ -302,8 +310,11 @@ Page({
302 if (item.prom_type == 1) { 310 if (item.prom_type == 1) {
303 var prom = null; 311 var prom = null;
304 var now = ut.gettimestamp(); 312 var now = ut.gettimestamp();
305 - await getApp().request.promiseGet("/api/ms/flash_sale/get/" + os.stoid + "/" + item.prom_id, {}).then(res => {  
306 - if (res.data.code == 0) prom = res.data.data; 313 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + os.stoid +'/'+user_id+ "/" + item.prom_id, {}).then(res => {
  314 + if (res.data.code == 0){
  315 + prom = res.data.data;
  316 + prom.price=prom.user_price;
  317 + }
307 }) 318 })
308 //---如果互动都已经过期,或者还未开始,或者无活动 319 //---如果互动都已经过期,或者还未开始,或者无活动
309 if (!prom || prom.is_end == 1 || prom.end_time < now || prom.start_time > now) { 320 if (!prom || prom.is_end == 1 || prom.end_time < now || prom.start_time > now) {
@@ -331,7 +342,18 @@ Page({ @@ -331,7 +342,18 @@ Page({
331 }) 342 })
332 item.goods_num=cbuy; 343 item.goods_num=cbuy;
333 } 344 }
  345 +
  346 + //价格不对,就要更新一下
  347 + if(good.goods_price!=prom.price){
  348 + good.goods_price=prom.price;
  349 + //-- 购物车更新秒杀价格 --
  350 + var updata1={id: item.id,goods_price:prom.price,store_id:os.stoid,user_id:getApp().globalData.userInfo.user_id };
  351 + getApp().request.put("/api/weshop/cart/update", {
  352 + data: updata1,
  353 + })
  354 + }
334 } 355 }
  356 +
335 //--判断优惠活动有没有过期-- 357 //--判断优惠活动有没有过期--
336 else if (item.prom_type == 3) { 358 else if (item.prom_type == 3) {
337 var isok = 1; 359 var isok = 1;
@@ -366,9 +388,11 @@ Page({ @@ -366,9 +388,11 @@ Page({
366 if(!th.data.zuhe_map[item.prom_id]){ 388 if(!th.data.zuhe_map[item.prom_id]){
367 //如果有组合购 389 //如果有组合购
368 var isok = 1; 390 var isok = 1;
  391 + var is_flag=1;
369 var act=null; 392 var act=null;
370 var url="/api/weshop/prom/zhbuy/get/"+os.stoid+"/"+item.prom_id+"/"+getApp().globalData.userInfo.user_id; 393 var url="/api/weshop/prom/zhbuy/get/"+os.stoid+"/"+item.prom_id+"/"+getApp().globalData.userInfo.user_id;
371 await getApp().request.promiseGet(url, {}).then(res => { 394 await getApp().request.promiseGet(url, {}).then(res => {
  395 + console.log(res,1000);
372 if(res.data.code==0 && res.data.data){ 396 if(res.data.code==0 && res.data.data){
373 if(res.data.data.is_show!=1){ 397 if(res.data.data.is_show!=1){
374 isok=0; 398 isok=0;
@@ -386,12 +410,11 @@ Page({ @@ -386,12 +410,11 @@ Page({
386 isok=0; 410 isok=0;
387 } 411 }
388 act=res.data.data; 412 act=res.data.data;
389 - 413 +
390 }else{ 414 }else{
391 - //未找到商品的活动  
392 - isok = 0;  
393 - }  
394 - 415 + //未找到商品的活动
  416 + is_flag = 0;
  417 + }
395 }) 418 })
396 if (!isok){ 419 if (!isok){
397 var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; 420 var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
@@ -400,7 +423,6 @@ Page({ @@ -400,7 +423,6 @@ Page({
400 continue; 423 continue;
401 } 424 }
402 th.data.zuhe_map[item.prom_id]=act; 425 th.data.zuhe_map[item.prom_id]=act;
403 -  
404 var url1 = "/api/weshop/prom/zhbuyGoods/page"; 426 var url1 = "/api/weshop/prom/zhbuyGoods/page";
405 var req_data = { 427 var req_data = {
406 page: 1, 428 page: 1,
@@ -411,8 +433,17 @@ Page({ @@ -411,8 +433,17 @@ Page({
411 await getApp().request.promiseGet(url1, { 433 await getApp().request.promiseGet(url1, {
412 data: req_data 434 data: req_data
413 }).then(res => { 435 }).then(res => {
  436 + console.log(res,2000);
414 if (ut.ajax_ok(res)) { 437 if (ut.ajax_ok(res)) {
415 var gdlist = res.data.data.pageData; 438 var gdlist = res.data.data.pageData;
  439 + gdlist.forEach(i=>{
  440 + if(item.goods_id==i.goods_id&&!is_flag){
  441 + item.prom_type=0;
  442 + item.prom_type1=0;
  443 + item.prom_id=0;
  444 + item.prom_id1=0
  445 + }
  446 + })
416 th.data.zuhe_map_good[item.prom_id]=gdlist; 447 th.data.zuhe_map_good[item.prom_id]=gdlist;
417 } 448 }
418 }) 449 })
@@ -423,15 +454,21 @@ Page({ @@ -423,15 +454,21 @@ Page({
423 var t_item=gdlist.find(function (ele) { 454 var t_item=gdlist.find(function (ele) {
424 return ele.goods_id==item.goods_id 455 return ele.goods_id==item.goods_id
425 }) 456 })
  457 + if(!t_item){
  458 + var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  459 + getApp().request.delete(url, {});
  460 + th.data.zuhe_map[item.prom_id]=-1;
  461 + continue;
  462 + }
426 item.buyqty=t_item.buyqty; 463 item.buyqty=t_item.buyqty;
427 item.zh_b_num=promgoodsbuynum; 464 item.zh_b_num=promgoodsbuynum;
428 item.act=th.data.zuhe_map[item.prom_id]; 465 item.act=th.data.zuhe_map[item.prom_id];
429 - }else{  
430 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
431 - getApp().request.delete(url, {});  
432 - th.data.zuhe_map[item.prom_id]=-1;  
433 - continue;  
434 - } 466 + }//else{
  467 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  468 + // getApp().request.delete(url, {});
  469 + // th.data.zuhe_map[item.prom_id]=-1;
  470 + // continue;
  471 + // }
435 } 472 }
436 else if(item.prom_type == 0) { 473 else if(item.prom_type == 0) {
437 //如果有优惠活动,要更新活动 474 //如果有优惠活动,要更新活动
@@ -538,7 +575,9 @@ Page({ @@ -538,7 +575,9 @@ Page({
538 } 575 }
539 } 576 }
540 577
541 - 578 + // console.log('AAAAAAAAAAAA', all_num);
  579 + // getApp().globalData.cartGoodsNum = all_num;
  580 +
542 th.setData({ 581 th.setData({
543 requestData: arr, 582 requestData: arr,
544 all_num: all_num, 583 all_num: all_num,
@@ -637,7 +676,7 @@ Page({ @@ -637,7 +676,7 @@ Page({
637 } 676 }
638 } 677 }
639 678
640 - 679 + // console.log('BBBBBB', all_num);
641 th.setData({ 680 th.setData({
642 service_data: arr, 681 service_data: arr,
643 all_num2: all_num, 682 all_num2: all_num,
@@ -748,7 +787,8 @@ Page({ @@ -748,7 +787,8 @@ Page({
748 var a = t.currentTarget.dataset.item; 787 var a = t.currentTarget.dataset.item;
749 var b = t.currentTarget.dataset.pitems; 788 var b = t.currentTarget.dataset.pitems;
750 a = this.data.requestData[b].goods[a]; 789 a = this.data.requestData[b].goods[a];
751 - 790 +
  791 + console.log('add+');
752 if (a.goods_num<a.store_count) { 792 if (a.goods_num<a.store_count) {
753 var e = { 793 var e = {
754 goods_num: a.goods_num + 1, 794 goods_num: a.goods_num + 1,
@@ -756,6 +796,7 @@ Page({ @@ -756,6 +796,7 @@ Page({
756 goods_id: a.goods_id, 796 goods_id: a.goods_id,
757 store_id: oo.stoid 797 store_id: oo.stoid
758 }; 798 };
  799 + // console.log('goods_num', e.goods_num);
759 this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); 800 this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
760 } else { 801 } else {
761 wx.showModal({ 802 wx.showModal({
@@ -834,7 +875,7 @@ Page({ @@ -834,7 +875,7 @@ Page({
834 goods_id: a.goods_id, 875 goods_id: a.goods_id,
835 store_id: oo.stoid 876 store_id: oo.stoid
836 }; 877 };
837 - this.postCardList_ser(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); 878 + // this.postCardList_ser(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
838 879
839 }, 880 },
840 //-------------减数量--------------------- 881 //-------------减数量---------------------
@@ -1368,6 +1409,9 @@ Page({ @@ -1368,6 +1409,9 @@ Page({
1368 }); 1409 });
1369 } 1410 }
1370 } 1411 }
  1412 +
  1413 + // getApp().globalData.cartGoodsNum = all_num;
  1414 + // console.log('CCCCCCC', all_num, getApp().globalData.cartGoodsNum);
1371 1415
1372 this.setData({ 1416 this.setData({
1373 checkAllToggle: ischeck, 1417 checkAllToggle: ischeck,
@@ -1382,14 +1426,14 @@ Page({ @@ -1382,14 +1426,14 @@ Page({
1382 1426
1383 var e = this,th=e; 1427 var e = this,th=e;
1384 var user_id = getApp().globalData.user_id; 1428 var user_id = getApp().globalData.user_id;
1385 - console.log('update');  
1386 - console.log(t); 1429 + // console.log('update');
  1430 + // console.log('9995959595959',t);
1387 rq.get("/api/weshop/goods/get/" + oo.stoid + "/" + t.goods_id, { 1431 rq.get("/api/weshop/goods/get/" + oo.stoid + "/" + t.goods_id, {
1388 isShowLoading: 0, 1432 isShowLoading: 0,
1389 async success(d) { 1433 async success(d) {
1390 var limit = d.data.data.viplimited; 1434 var limit = d.data.data.viplimited;
1391 var store_count = d.data.data.store_count; 1435 var store_count = d.data.data.store_count;
1392 - var wareIds=d.data.data.erpwareid; 1436 + var wareIds = d.data.data.erpwareid;
1393 1437
1394 var goodsinfo = e.data.requestData[pitem].goods[item]; 1438 var goodsinfo = e.data.requestData[pitem].goods[item];
1395 var promgoodsbuynum = 0; 1439 var promgoodsbuynum = 0;
@@ -1412,8 +1456,12 @@ Page({ @@ -1412,8 +1456,12 @@ Page({
1412 th.setData({[txt]:promgoodsbuynum}); 1456 th.setData({[txt]:promgoodsbuynum});
1413 } 1457 }
1414 goodsbuynum = buy_num_data.goodsbuynum; 1458 goodsbuynum = buy_num_data.goodsbuynum;
  1459 +
  1460 +
  1461 + // console.log('goodsbuynum===========', goodsbuynum);
1415 }) 1462 })
1416 1463
  1464 +
1417 1465
1418 var buyed_mum2 = t.goods_num + goodsbuynum; 1466 var buyed_mum2 = t.goods_num + goodsbuynum;
1419 if (buyed_mum2 > limit && limit > 0) { 1467 if (buyed_mum2 > limit && limit > 0) {
@@ -1922,7 +1970,7 @@ Page({ @@ -1922,7 +1970,7 @@ Page({
1922 1970
1923 //如果会员是等级会员,商品有等级价,且不是活动商品 1971 //如果会员是等级会员,商品有等级价,且不是活动商品
1924 if (card_field && val[card_field] > 0 && 1972 if (card_field && val[card_field] > 0 &&
1925 - (val.prom_type == 0 || val.prom_type == 3 || val.prom_type == 4 || val.prom_type == 5 || val.prom_type == 7 || normal_arr[val.goods_id])) { 1973 + ((val.prom_type == 0 && g_arr[i].prom_type==0) || val.prom_type == 3 || val.prom_type == 4 || val.prom_type == 5 || val.prom_type == 7 || normal_arr[val.goods_id])) {
1926 if (g_arr[i].goods_price != val[card_field]) { 1974 if (g_arr[i].goods_price != val[card_field]) {
1927 isok = 0; 1975 isok = 0;
1928 gname = val.goods_name; 1976 gname = val.goods_name;
@@ -2069,7 +2117,11 @@ Page({ @@ -2069,7 +2117,11 @@ Page({
2069 var url = '/api/weshop/cart/delIds/' + oo.stoid + '/' + user_id + "/" + glist; 2117 var url = '/api/weshop/cart/delIds/' + oo.stoid + '/' + user_id + "/" + glist;
2070 getApp().request.delete(url, { 2118 getApp().request.delete(url, {
2071 success: function(t) { 2119 success: function(t) {
  2120 + // console.log('del done1111111111');
2072 th.getCardList(); 2121 th.getCardList();
  2122 + getApp().requestCardNum(th);
  2123 + // console.log('all================', th.data.all_num);
  2124 + // getApp().globalData.cartGoodsNum =
2073 } 2125 }
2074 }); 2126 });
2075 } 2127 }
@@ -2080,10 +2132,12 @@ Page({ @@ -2080,10 +2132,12 @@ Page({
2080 getApp().request.delete(url, { 2132 getApp().request.delete(url, {
2081 success: function(t) { 2133 success: function(t) {
2082 th.getCardList(); 2134 th.getCardList();
  2135 + getApp().requestCardNum(th);
  2136 + console.log('all2================', th.data.all_num);
2083 } 2137 }
2084 }); 2138 });
2085 } 2139 }
2086 - 2140 +
2087 }, 2141 },
2088 //跳到首页 2142 //跳到首页
2089 goto: function(e) { 2143 goto: function(e) {
@@ -2351,6 +2405,28 @@ Page({ @@ -2351,6 +2405,28 @@ Page({
2351 go_url(e){ 2405 go_url(e){
2352 var url=e.currentTarget.dataset.url; 2406 var url=e.currentTarget.dataset.url;
2353 getApp().goto(url); 2407 getApp().goto(url);
  2408 + },
  2409 +
  2410 + //跳转到商品
  2411 + go_gd:function (e) {
  2412 + var gd= e.currentTarget.dataset.gd;
  2413 + var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd;
  2414 + var url="/api/weshop/activitylist/getGoodActInfo";
  2415 + var req_data={
  2416 + store_id:os.stoid,goodsidlist:gd,is_detail:1
  2417 + };
  2418 + //获取秒杀的多规格
  2419 + getApp().request.promiseGet(url, {data:req_data}).then(res=>{
  2420 + if(res.data.code==0 && res.data.data){
  2421 + if(res.data.data.length==1){
  2422 + good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id;
  2423 + }
  2424 + getApp().goto(good_url);
  2425 +
  2426 + }else{
  2427 + getApp().goto(good_url);
  2428 + }
  2429 + })
2354 } 2430 }
2355 2431
2356 }); 2432 });
2357 \ No newline at end of file 2433 \ No newline at end of file
pages/cart/cart/cart.wxml
@@ -56,7 +56,6 @@ @@ -56,7 +56,6 @@
56 <view class="shmd_m"> 56 <view class="shmd_m">
57 <!-- 门店 --> 57 <!-- 门店 -->
58 <!--<radio color="red" bindtap="check_th_all_item" class="order-raido flex-center" checked="{{checkAllToggle||item.selected}}" data-pitems="{{pidx}}"></radio>--> 58 <!--<radio color="red" bindtap="check_th_all_item" class="order-raido flex-center" checked="{{checkAllToggle||item.selected}}" data-pitems="{{pidx}}"></radio>-->
59 -  
60 <icon wx:if="{{checkAllToggle||item.selected}}" class="order-raido flex-center" bindtap="check_th_all_item" data-pitems="{{pidx}}" 59 <icon wx:if="{{checkAllToggle||item.selected}}" class="order-raido flex-center" bindtap="check_th_all_item" data-pitems="{{pidx}}"
61 color="red" size="20" type="success"></icon> 60 color="red" size="20" type="success"></icon>
62 <view wx:else class="icon_no_sele2" bindtap="check_th_all_item" data-pitems="{{pidx}}"></view> 61 <view wx:else class="icon_no_sele2" bindtap="check_th_all_item" data-pitems="{{pidx}}"></view>
@@ -77,7 +76,7 @@ @@ -77,7 +76,7 @@
77 </block> 76 </block>
78 <block wx:else><view class="order-raido flex-vertical " style="width: 45rpx"></view></block> 77 <block wx:else><view class="order-raido flex-vertical " style="width: 45rpx"></view></block>
79 78
80 - <navigator class="goods-img rel" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> 79 + <navigator class="goods-img rel" bindtap="go_gd" data-gd="{{items.goods_id}}">
81 <image class="wh100" src="{{items.original_img}}" binderror="bind_bnerr2" data-errorimg="requestData[{{pidx}}].goods[{{idx}}].original_img" data-url="{{items.original_img}}"></image> 80 <image class="wh100" src="{{items.original_img}}" binderror="bind_bnerr2" data-errorimg="requestData[{{pidx}}].goods[{{idx}}].original_img" data-url="{{items.original_img}}"></image>
82 <block wx:if="{{items.is_gift}}"> 81 <block wx:if="{{items.is_gift}}">
83 <view style="background-color:red" class="abs flex-center fs26" wx:if="{{items.is_gift==1}}">赠品</view> 82 <view style="background-color:red" class="abs flex-center fs26" wx:if="{{items.is_gift==1}}">赠品</view>
@@ -91,8 +90,7 @@ @@ -91,8 +90,7 @@
91 <block wx:if="{{items.prom_type==7}}"> 90 <block wx:if="{{items.prom_type==7}}">
92 <block wx:if="{{items.selected}}"> 91 <block wx:if="{{items.selected}}">
93 <!-- 主要显示限购 --> 92 <!-- 主要显示限购 -->
94 - <text wx:if="{{items.buyqty>0 && items.zh_b_num>0}}" class="abs2">活动剩余可购{{items.buyqty-items.zh_b_num>0?items.buyqty-items.zh_b_num:0}}件</text>  
95 - <text wx:elif="{{items.zhqty>items.goods_num}}" class="abs2">还需购买{{items.zhqty-items.goods_num}}件</text> 93 + <text wx:if="{{items.zhqty>items.goods_num}}" class="abs2">还需购买{{items.zhqty-items.goods_num}}件</text>
96 </block> 94 </block>
97 <block wx:else> 95 <block wx:else>
98 <text wx:if="{{items.zhqty}}" class="abs2">需购买{{items.zhqty}}件</text> 96 <text wx:if="{{items.zhqty}}" class="abs2">需购买{{items.zhqty}}件</text>
@@ -103,7 +101,7 @@ @@ -103,7 +101,7 @@
103 </navigator> 101 </navigator>
104 <view class="goods-cont"> 102 <view class="goods-cont">
105 <view class="goods-name"> 103 <view class="goods-name">
106 - <navigator class="ellipsis-2 fs30" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}">{{items.goods_name}}</navigator> 104 + <navigator bindtap="go_gd" class="ellipsis-2 fs30" data-gd="{{items.goods_id}}">{{items.goods_name}}</navigator>
107 105
108 <view class="specifications ellipsis-1"> 106 <view class="specifications ellipsis-1">
109 <view wx:if="{{items.goods_color || items.goods_spec}}"> 107 <view wx:if="{{items.goods_color || items.goods_spec}}">
@@ -113,6 +111,7 @@ @@ -113,6 +111,7 @@
113 <block wx:if="{{items.is_gift}}"> 111 <block wx:if="{{items.is_gift}}">
114 <view>{{items.goods_num}}件</view> 112 <view>{{items.goods_num}}件</view>
115 </block> 113 </block>
  114 + <view wx:if="{{items.buyqty>0}}" class="fs22 ml10 c-7b">组合限购{{items.buyqty}}件</view>
116 </view> 115 </view>
117 116
118 117
@@ -124,6 +123,7 @@ @@ -124,6 +123,7 @@
124 123
125 <view wx:if="{{items.is_offline}}" class="quan_color flex ai-center"><text>券后 ¥{{g_filter.toFix(items.offline_price,2)}}</text></view> 124 <view wx:if="{{items.is_offline}}" class="quan_color flex ai-center"><text>券后 ¥{{g_filter.toFix(items.offline_price,2)}}</text></view>
126 125
  126 +
127 </view> 127 </view>
128 <view class="count"> 128 <view class="count">
129 <view bindtap="{{items.goods_num <= 1 ? '':'subNum'}}" class="sub fs28 {{items.goods_num <= 1 ? 'active':''}}" data-pitems="{{pidx}}" data-item="{{idx}}">一</view> 129 <view bindtap="{{items.goods_num <= 1 ? '':'subNum'}}" class="sub fs28 {{items.goods_num <= 1 ? 'active':''}}" data-pitems="{{pidx}}" data-item="{{idx}}">一</view>
pages/cart/cart2/cart2.js
@@ -124,6 +124,7 @@ Page({ @@ -124,6 +124,7 @@ Page({
124 in_zhact_gdmap:{}, //不同门店参与同一活动的限购 124 in_zhact_gdmap:{}, //不同门店参与同一活动的限购
125 hid_inp:1, 125 hid_inp:1,
126 user_note:{}, 126 user_note:{},
  127 + zuhe_map_good:{},
127 }, 128 },
128 onLoad: function (t) { 129 onLoad: function (t) {
129 wx.setNavigationBarTitle({title: "填写订单",}) 130 wx.setNavigationBarTitle({title: "填写订单",})
@@ -289,7 +290,6 @@ Page({ @@ -289,7 +290,6 @@ Page({
289 } 290 }
290 291
291 }, 1); 292 }, 1);
292 -  
293 //值在这里换 293 //值在这里换
294 getApp().globalData.plus_buy_back = 0; 294 getApp().globalData.plus_buy_back = 0;
295 }, 295 },
@@ -454,6 +454,7 @@ Page({ @@ -454,6 +454,7 @@ Page({
454 //要把组合购的东西拿出来算一下 454 //要把组合购的东西拿出来算一下
455 if (item1.prom_type == 7) { 455 if (item1.prom_type == 7) {
456 var isok = 1; 456 var isok = 1;
  457 + var is_flag=1;
457 //如果有组合购 458 //如果有组合购
458 var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item1.prom_id+'/'+getApp().globalData.userInfo.user_id; 459 var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item1.prom_id+'/'+getApp().globalData.userInfo.user_id;
459 await getApp().request.promiseGet(url, {}).then(res => { 460 await getApp().request.promiseGet(url, {}).then(res => {
@@ -465,25 +466,45 @@ Page({ @@ -465,25 +466,45 @@ Page({
465 if (ut.gettimestamp() > res.data.data.end_time) { 466 if (ut.gettimestamp() > res.data.data.end_time) {
466 isok = 0; 467 isok = 0;
467 } 468 }
  469 + item1.act = res.data.data;
468 } else { 470 } else {
469 //未找到商品的活动 471 //未找到商品的活动
470 - isok = 0; 472 + is_flag = 0;
471 } 473 }
472 - item1.act = res.data.data;  
473 }) 474 })
474 -  
475 if (!isok) { 475 if (!isok) {
476 getApp().my_warnning("组合购的活动已经过期", 0, th); 476 getApp().my_warnning("组合购的活动已经过期", 0, th);
477 return false; 477 return false;
478 } 478 }
479 - 479 + var url1 = "/api/weshop/prom/zhbuyGoods/page";
  480 + var req_data = {
  481 + page: 1,
  482 + pageSize: 2000,
  483 + store_id: os.stoid,
  484 + zh_id: item1.prom_id,
  485 + }
  486 + await getApp().request.promiseGet(url1, {
  487 + data: req_data
  488 + }).then(res => {
  489 + if (ut.ajax_ok(res)) {
  490 + var gdlist = res.data.data.pageData;
  491 + gdlist.forEach(i=>{
  492 + if(item1.goods_id==i.goods_id&&!is_flag){
  493 + item1.prom_type=0;
  494 + item1.prom_type1=0;
  495 + item1.prom_id=0;
  496 + item1.prom_id1=0
  497 + }
  498 + })
  499 + th.data.zuhe_map_good[item1.prom_id]=gdlist;
  500 + }
  501 + })
480 } 502 }
481 } 503 }
482 504
483 //在分组的时候,就不要再调用接口,await 505 //在分组的时候,就不要再调用接口,await
484 for (var i = 0; i < carr.length; i++) { 506 for (var i = 0; i < carr.length; i++) {
485 var item = carr[i]; 507 var item = carr[i];
486 -  
487 //-- 如果是等级会员注册返回 -- 508 //-- 如果是等级会员注册返回 --
488 if (is_card_back) { 509 if (is_card_back) {
489 th.data.card_name = th.data.userinfo.card_field; 510 th.data.card_name = th.data.userinfo.card_field;
@@ -667,22 +688,26 @@ Page({ @@ -667,22 +688,26 @@ Page({
667 //存储不同活动的商品列表 688 //存储不同活动的商品列表
668 u_item.zh_prom_goods = {}; 689 u_item.zh_prom_goods = {};
669 for (let var1 in obj) { 690 for (let var1 in obj) {
670 - var h_item = obj[var1];  
671 - var gdlist = null;  
672 - var url1 = "/api/weshop/prom/zhbuyGoods/page";  
673 - var req_data = {  
674 - page: 1,  
675 - pageSize: 2000,  
676 - store_id: os.stoid,  
677 - zh_id: h_item.prom_id,  
678 - }  
679 - await getApp().request.promiseGet(url1, {  
680 - data: req_data  
681 - }).then(res => {  
682 - if (ut.ajax_ok(res)) {  
683 - gdlist = res.data.data.pageData;  
684 - }  
685 - }) 691 + var h_item=obj[var1];
  692 + var gdlist= th.data.zuhe_map_good[h_item.prom_id];
  693 + //获取活动需要的商品列表
  694 + // u_item.zh_prom_goods[h_item.prom_id]=gdlist;
  695 + // var h_item = obj[var1];
  696 + // var gdlist = null;
  697 + // var url1 = "/api/weshop/prom/zhbuyGoods/page";
  698 + // var req_data = {
  699 + // page: 1,
  700 + // pageSize: 2000,
  701 + // store_id: os.stoid,
  702 + // zh_id: h_item.prom_id,
  703 + // }
  704 + // await getApp().request.promiseGet(url1, {
  705 + // data: req_data
  706 + // }).then(res => {
  707 + // if (ut.ajax_ok(res)) {
  708 + // gdlist = res.data.data.pageData;
  709 + // }
  710 + // })
686 //获取活动需要的商品列表 711 //获取活动需要的商品列表
687 u_item.zh_prom_goods[h_item.prom_id] = {gdlist: gdlist, act: h_item.act}; 712 u_item.zh_prom_goods[h_item.prom_id] = {gdlist: gdlist, act: h_item.act};
688 } 713 }
@@ -780,6 +805,10 @@ Page({ @@ -780,6 +805,10 @@ Page({
780 } 805 }
781 } 806 }
782 807
  808 +
  809 + gd.prom_type=gg.prom_type;
  810 + gd.prom_id=gg.prom_id;
  811 +
783 switch (gd.prom_type) { 812 switch (gd.prom_type) {
784 case 0: 813 case 0:
785 case 2: 814 case 2:
@@ -948,22 +977,23 @@ Page({ @@ -948,22 +977,23 @@ Page({
948 break; 977 break;
949 case 1: //---秒杀----- 978 case 1: //---秒杀-----
950 var quanlist = null; 979 var quanlist = null;
951 - getApp().request.get("/api/weshop/activitylist/getSJGoodsPrice/" + gd.store_id  
952 - + "/" + gd.goods_id + "/1/" + gd.prom_id, { 980 + getApp().request.get("/api/weshop/activitylist/getSJGoodsPriceNew/" + gd.store_id
  981 + + "/" + gd.goods_id + "/1/" + gd.prom_id+"/"+app.globalData.user_id, {
953 success: async function (tt) { 982 success: async function (tt) {
954 if (tt.data.code == 0) { 983 if (tt.data.code == 0) {
955 - t.data.data.shop_price = tt.data.data.prom_price; 984 + //t.data.data.shop_price = tt.data.data.prom_price;
  985 + t.data.data.shop_price = tt.data.data.prom_user_price;
  986 + th.data.ckeck_quan_price=0;
956 } else { 987 } else {
957 t.data.data.prom_id = 0; 988 t.data.data.prom_id = 0;
958 t.data.data.prom_type = 0; 989 t.data.data.prom_type = 0;
959 -  
960 th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num; 990 th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num;
961 th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + ""; 991 th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + "";
962 th.data.check_quan_ware_list = t.data.data.erpwareid + ""; 992 th.data.check_quan_ware_list = t.data.data.erpwareid + "";
963 } 993 }
964 994
965 th.setData({ 995 th.setData({
966 - bn_goods: t.data.data, 996 + bn_goods: gd,
967 bn_pickname: gg.pick_name, 997 bn_pickname: gg.pick_name,
968 bn_exp_type: et, 998 bn_exp_type: et,
969 index: m_wind, 999 index: m_wind,
@@ -3810,6 +3840,11 @@ Page({ @@ -3810,6 +3840,11 @@ Page({
3810 var index = e.currentTarget.dataset.index; 3840 var index = e.currentTarget.dataset.index;
3811 var txt = "cartlist[" + index + "].focus"; 3841 var txt = "cartlist[" + index + "].focus";
3812 this.setData({[txt]:0}) 3842 this.setData({[txt]:0})
  3843 + },
  3844 +
  3845 + go_url:function (e) {
  3846 + var url = e.currentTarget.dataset.url;
  3847 + getApp().goto(url);
3813 } 3848 }
3814 3849
3815 3850
pages/cart/cart2/cart2.wxml
@@ -78,26 +78,21 @@ @@ -78,26 +78,21 @@
78 </view> 78 </view>
79 <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> 79 <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items">
80 <!----商品图片-----> 80 <!----商品图片----->
81 - <view class="goods-img" style="position: relative"> 81 + <view class="goods-img" style="position: relative; overflow: hidden" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}&prom_type={{items.prom_type}}&prom_id={{items.prom_id}}">
82 <image wx:if="{{items.is_gift}}" src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> 82 <image wx:if="{{items.is_gift}}" src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image>
  83 + <text class="zuhe" wx:if="{{items.prom_type==7}}">组合购</text>
83 <image class="wh100 bdr14" src="{{items.original_img}}" binderror='cart_set_err' data-err='cartlist[{{pidx}}].goods[{{idx}}].original_img'></image> 84 <image class="wh100 bdr14" src="{{items.original_img}}" binderror='cart_set_err' data-err='cartlist[{{pidx}}].goods[{{idx}}].original_img'></image>
84 </view> 85 </view>
85 <!----商品名称规格----> 86 <!----商品名称规格---->
86 - <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> 87 + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}&prom_type={{items.prom_type}}&prom_id={{items.prom_id}}" >
87 <view class="goods-name ellipsis-2">{{items.goods_name}}</view> 88 <view class="goods-name ellipsis-2">{{items.goods_name}}</view>
88 <!-- 商品属性 --> 89 <!-- 商品属性 -->
89 <view class="flex-vertical fs28 color-gray n_guige"> 90 <view class="flex-vertical fs28 color-gray n_guige">
90 <view class="goods-color"> 91 <view class="goods-color">
91 <block><text>{{filters.show_gui_ge(items.goods_spec,items.goods_color)}}</text></block> 92 <block><text>{{filters.show_gui_ge(items.goods_spec,items.goods_color)}}</text></block>
92 - <!--<block wx:if="{{!items.goods_spec && !items.goods_color}}"><text>规格1</text></block>-->  
93 - <!--<block wx:else>-->  
94 - <!--<text wx:if="{{items.goods_spec!=''}}">{{items.goods_spec}}<text wx:if="{{items.goods_color}}">/</text></text>-->  
95 - <!--<text wx:if="{{items.goods_color}}">{{items.goods_color}}</text>-->  
96 - <!--</block>-->  
97 </view> 93 </view>
98 </view> 94 </view>
99 95
100 -  
101 <!-----商品名称规格------> 96 <!-----商品名称规格------>
102 <view class="order-num flex-space-between"> 97 <view class="order-num flex-space-between">
103 <view class="co-red">¥<text class="fs36">{{filters.toFix(items.goods_price,2)}}</text></view> 98 <view class="co-red">¥<text class="fs36">{{filters.toFix(items.goods_price,2)}}</text></view>
@@ -255,10 +250,10 @@ @@ -255,10 +250,10 @@
255 <!-- <view>门店:{{bn_pickname}}</view> --> 250 <!-- <view>门店:{{bn_pickname}}</view> -->
256 </view> 251 </view>
257 <view class="order-detail"> 252 <view class="order-detail">
258 - <view class="goods-img"> 253 + <view class="goods-img" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}&prom_type={{bn_goods.prom_type}}&prom_id={{bn_goods.prom_id}}">
259 <image class="wh100 bdr14" src="{{bn_goods.original_img}}" binderror='cart_set_err' data-err="bn_goods.original_img"></image> 254 <image class="wh100 bdr14" src="{{bn_goods.original_img}}" binderror='cart_set_err' data-err="bn_goods.original_img"></image>
260 </view> 255 </view>
261 - <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> 256 + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}&prom_type={{items.prom_type}}&prom_id={{items.prom_id}}">
262 <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view> 257 <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view>
263 <!-- 商品属性 --> 258 <!-- 商品属性 -->
264 <view class="flex-vertical fs28 xc-ash color-gray n_guige"> 259 <view class="flex-vertical fs28 xc-ash color-gray n_guige">
pages/cart/cart2/cart2.wxss
@@ -19,9 +19,6 @@ @@ -19,9 +19,6 @@
19 box-shadow: 16rpx 0px 12px #e7e9eb; 19 box-shadow: 16rpx 0px 12px #e7e9eb;
20 } 20 }
21 21
22 -  
23 -  
24 -  
25 page { 22 page {
26 /* background-color: #FAFAFA; */ 23 /* background-color: #FAFAFA; */
27 background-color: #F0F0F0; 24 background-color: #F0F0F0;
@@ -995,3 +992,16 @@ margin-left: 20rpx; @@ -995,3 +992,16 @@ margin-left: 20rpx;
995 top:36rpx 992 top:36rpx
996 } 993 }
997 994
  995 +.zuhe {
  996 + width: 140rpx;
  997 + text-align: center;
  998 + height:40rpx;
  999 + position: absolute;
  1000 + top: 15rpx;
  1001 + left: -37rpx;
  1002 + transform: rotate(-45deg);
  1003 + background-color: rgb(255,0,0);
  1004 + font-size:22rpx;
  1005 + color: #fff;
  1006 + line-height: 37rpx;
  1007 +}
pages/cart/cart2/zh_calculate.js
@@ -193,6 +193,11 @@ module.exports = { @@ -193,6 +193,11 @@ module.exports = {
193 new_g.prom_type = 0; 193 new_g.prom_type = 0;
194 new_g.prom_id = 0; 194 new_g.prom_id = 0;
195 goods.push(new_g); 195 goods.push(new_g);
  196 +
  197 + //如果商品的数量已经为空了
  198 + if(goods[idx].goods_num<=0){
  199 + goods.splice(idx,1);
  200 + }
196 } 201 }
197 } 202 }
198 203
pages/giftpack/mygiftpack/mygiftpack.js
@@ -148,5 +148,18 @@ onShareAppMessage: function (e) { @@ -148,5 +148,18 @@ onShareAppMessage: function (e) {
148 } 148 }
149 }, 149 },
150 150
  151 + onShareTimeline() {
  152 + var curPage=this;
  153 + var pagePath = curPage.route; //当前页面url
  154 + if (pagePath.indexOf('/') != 0) {
  155 + pagePath = '/' + pagePath;
  156 + }
  157 + return {
  158 + title: '专享礼包',
  159 + imageUrl: this.data.ad_data.ad_code,
  160 + path: pagePath,
  161 + }
  162 + },
  163 +
151 164
152 }); 165 });
153 \ No newline at end of file 166 \ No newline at end of file
pages/goods/categoryList/categoryList.js
@@ -52,7 +52,7 @@ Page({ @@ -52,7 +52,7 @@ Page({
52 currentPage: 1, 52 currentPage: 1,
53 allData: null, 53 allData: null,
54 openFilterModal: !1, 54 openFilterModal: !1,
55 - baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=goods_id&orderType=desc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", 55 + baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=sort&orderType=asc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1",
56 requestUrl: "", 56 requestUrl: "",
57 tabname: "goods_id", //排序的字段 57 tabname: "goods_id", //排序的字段
58 adname: "desc", //升降的字段 58 adname: "desc", //升降的字段
@@ -791,7 +791,7 @@ Page({ @@ -791,7 +791,7 @@ Page({
791 var that = this; 791 var that = this;
792 that.data.requestUrl = t; 792 that.data.requestUrl = t;
793 e.get("/api/weshop/goods/page?1=1", { 793 e.get("/api/weshop/goods/page?1=1", {
794 - data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, 794 + data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 },
795 success: function (data) { 795 success: function (data) {
796 console.log(data.data.data.pageData) 796 console.log(data.data.data.pageData)
797 that.setData({ 797 that.setData({
@@ -853,7 +853,7 @@ Page({ @@ -853,7 +853,7 @@ Page({
853 console.log("page:=" + page) 853 console.log("page:=" + page)
854 var s = this 854 var s = this
855 e.get("/api/weshop/goods/page?1=1", { 855 e.get("/api/weshop/goods/page?1=1", {
856 - data: { page: page, cat_id: cid, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, 856 + data: { page: page, cat_id: cid, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 },
857 success: function (e) { 857 success: function (e) {
858 console.log(e.data.data.pageData) 858 console.log(e.data.data.pageData)
859 s.setData({ 859 s.setData({
pages/goods/goodsInfo/filter.wxs
@@ -8,7 +8,20 @@ function format_tt(ts) { @@ -8,7 +8,20 @@ function format_tt(ts) {
8 var fm=(d.getMonth()+1)+"月"+ d.getDate()+"日"; 8 var fm=(d.getMonth()+1)+"月"+ d.getDate()+"日";
9 return fm; 9 return fm;
10 } 10 }
  11 +
  12 +function act_type(ty){
  13 + switch(ty){
  14 + case 1: return '秒杀';
  15 + case 2: return '团购';
  16 + case 4: return '积分购';
  17 + case 6: return '拼单';
  18 + case 7: return '组合购';
  19 + case 8: return '预售';
  20 + }
  21 +}
  22 +
11 module.exports = { 23 module.exports = {
12 is_has: is_has, 24 is_has: is_has,
13 - format_tt:format_tt 25 + format_tt:format_tt,
  26 + act_type:act_type
14 } 27 }
pages/goods/goodsInfo/goodsInfo.js
@@ -255,15 +255,20 @@ Page({ @@ -255,15 +255,20 @@ Page({
255 //------初始化加载---------- 255 //------初始化加载----------
256 onLoad: function (t) { 256 onLoad: function (t) {
257 257
258 -  
259 -  
260 var ee = this, 258 var ee = this,
261 that = ee, 259 that = ee,
262 th = ee, 260 th = ee,
263 gid = t.goods_id, 261 gid = t.goods_id,
264 first_leader = t.first_leader, 262 first_leader = t.first_leader,
265 room_id = t.room_id, 263 room_id = t.room_id,
266 - room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id 264 + room_user_share = t.room_user_share, //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
  265 + prom_type=t.prom_type,
  266 + prom_id=t.prom_id; //活动ID
  267 +
  268 + if(prom_type){
  269 + this.data.prom_type=prom_type;
  270 + this.data.prom_id=prom_id;
  271 + }
267 272
268 //-- 自定义海报 -- 273 //-- 自定义海报 --
269 getApp().request.promiseGet("/api/weshop/goods/poster/page", { 274 getApp().request.promiseGet("/api/weshop/goods/poster/page", {
@@ -300,6 +305,17 @@ Page({ @@ -300,6 +305,17 @@ Page({
300 var gid_str = decodeURIComponent(t.scene); 305 var gid_str = decodeURIComponent(t.scene);
301 gid_str = gid_str.split("_"); 306 gid_str = gid_str.split("_");
302 gid = gid_str[0]; 307 gid = gid_str[0];
  308 + if(gid.indexOf('.')!=-1){
  309 + var fir_arr=gid.split(".");
  310 + gid=fir_arr[0];
  311 + prom_type=fir_arr[1];
  312 + prom_id=fir_arr[2];
  313 + this.data.prom_type=prom_type;
  314 + this.data.prom_id=prom_id;
  315 + }
  316 +
  317 +
  318 +
303 if (gid_str.length > 1) { 319 if (gid_str.length > 1) {
304 first_leader = gid_str[1]; 320 first_leader = gid_str[1];
305 } 321 }
@@ -435,9 +451,6 @@ Page({ @@ -435,9 +451,6 @@ Page({
435 if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type; 451 if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
436 //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对-- 452 //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
437 if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) { 453 if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
438 - //th.data.fir_def_store={}; //赋值空对象  
439 - //return false;  
440 - //th.data.fir_def_store.is_no_dis=1;  
441 ee.is_no_dis = 1; 454 ee.is_no_dis = 1;
442 } 455 }
443 456
@@ -452,15 +465,7 @@ Page({ @@ -452,15 +465,7 @@ Page({
452 if (that.data.lat != null) { 465 if (that.data.lat != null) {
453 //如果经纬度有变化的话 466 //如果经纬度有变化的话
454 if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) { 467 if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
455 - //that.data.fir_def_store=e;  
456 - // that.setData({  
457 - // def_pick_store: e,  
458 - // sto_sele_name: e.pickup_name,  
459 - // sto_sele_id: e.pickup_id,  
460 - // sto_sele_distr: e.distr_type  
461 - // })  
462 that.set_def_storage(e); 468 that.set_def_storage(e);
463 -  
464 } else { 469 } else {
465 //要用接口是获取距离,js的计算不准 470 //要用接口是获取距离,js的计算不准
466 getApp().request.promiseGet("/api/weshop/pickup/list", { 471 getApp().request.promiseGet("/api/weshop/pickup/list", {
@@ -471,13 +476,6 @@ Page({ @@ -471,13 +476,6 @@ Page({
471 if (e) { 476 if (e) {
472 e.is_no_dis = ee.is_no_dis; 477 e.is_no_dis = ee.is_no_dis;
473 appd.pk_store = e; 478 appd.pk_store = e;
474 - // that.data.fir_def_store=e;  
475 - // that.setData({  
476 - // def_pick_store: e,  
477 - // sto_sele_name: e.pickup_name,  
478 - // sto_sele_id: e.pickup_id,  
479 - // sto_sele_distr: e.distr_type  
480 - // })  
481 that.set_def_storage(e); 479 that.set_def_storage(e);
482 } 480 }
483 481
@@ -491,13 +489,6 @@ Page({ @@ -491,13 +489,6 @@ Page({
491 } else { 489 } else {
492 if (e) { 490 if (e) {
493 e.distance = null; 491 e.distance = null;
494 - // that.data.fir_def_store=e;  
495 - // that.setData({  
496 - // def_pick_store: e,  
497 - // sto_sele_name: e.pickup_name,  
498 - // sto_sele_id: e.pickup_id,  
499 - // sto_sele_distr: e.distr_type  
500 - // })  
501 that.set_def_storage(e); 492 that.set_def_storage(e);
502 } 493 }
503 } 494 }
@@ -614,7 +605,7 @@ Page({ @@ -614,7 +605,7 @@ Page({
614 }).then(res => { 605 }).then(res => {
615 var t = res; 606 var t = res;
616 var data = t.data.data.pageData; 607 var data = t.data.data.pageData;
617 - if (data.length > 0) { 608 + if (data && data.length > 0) {
618 //ee.setData({ is_collect: 1, collect_id: data[0].collect_id, }); 609 //ee.setData({ is_collect: 1, collect_id: data[0].collect_id, });
619 is_collect = 1; 610 is_collect = 1;
620 collect_id = data[0].collect_id; 611 collect_id = data[0].collect_id;
@@ -671,7 +662,7 @@ Page({ @@ -671,7 +662,7 @@ Page({
671 } 662 }
672 } 663 }
673 664
674 - if (th.data.is_closecoupon != 1) { 665 + if (th.data.is_closecoupon != 1 && (!th.data.fir_quan || th.data.fir_quan.length<=0)) {
675 //----获取详情页的券的数量---- 666 //----获取详情页的券的数量----
676 await getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", { 667 await getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", {
677 data: { 668 data: {
@@ -790,7 +781,7 @@ Page({ @@ -790,7 +781,7 @@ Page({
790 if (getApp().globalData.userInfo && t.data.data.prom_type == 7) { 781 if (getApp().globalData.userInfo && t.data.data.prom_type == 7) {
791 //获取活动信息 782 //获取活动信息
792 var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + 783 var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" +
793 - t.data.data.prom_id + "/" + getApp().globalData.userInfo.user_id; 784 + t.data.data.prom_id + "/" + getApp().globalData.user_id;
794 getApp().request.get(url, { 785 getApp().request.get(url, {
795 success: function (e) { 786 success: function (e) {
796 if (e.data.code == 0 && e.data.data) { 787 if (e.data.code == 0 && e.data.data) {
@@ -809,7 +800,8 @@ Page({ @@ -809,7 +800,8 @@ Page({
809 800
810 //-- 把商品的赋值 -- 801 //-- 把商品的赋值 --
811 ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data)); 802 ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data));
812 - ee.check_is_youhui(ee.data.gid); 803 + if(ee.data.prom_type!=1 && ee.data.prom_type!=4 && ee.data.prom_type!=6)
  804 + ee.check_is_youhui(ee.data.gid);
813 805
814 t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss'); 806 t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
815 807
@@ -835,6 +827,11 @@ Page({ @@ -835,6 +827,11 @@ Page({
835 a.wxParse("content", "html", t.data.data.goods_content, ee, 6); 827 a.wxParse("content", "html", t.data.data.goods_content, ee, 6);
836 e.wxParseAddFullImageUrl(ee, "content"); 828 e.wxParseAddFullImageUrl(ee, "content");
837 829
  830 + if(ee.data.prom_type){
  831 + t.data.data.prom_type=ee.data.prom_type;
  832 + t.data.data.prom_id=ee.data.prom_id;
  833 + }
  834 +
838 ee.setData({ 835 ee.setData({
839 data: t.data.data, 836 data: t.data.data,
840 sele_g: t.data.data, 837 sele_g: t.data.data,
@@ -848,43 +845,15 @@ Page({ @@ -848,43 +845,15 @@ Page({
848 if (that.data.sales_rules == 2 && that.data.is_newsales_rules) { 845 if (that.data.sales_rules == 2 && that.data.is_newsales_rules) {
849 //获取门店 846 //获取门店
850 ee.get_sto(); 847 ee.get_sto();
851 - //--等待某个值只运行---,这里有可能因为导航的时间太久,而不能计算门店库存  
852 - /*---  
853 - getApp().waitfor2(that,"wait_for_user_store","fir_def_store",function(){  
854 - if(th.data.fir_def_store && th.data.fir_def_store.pickup_id ){  
855 - var lock=0,plist=null;  
856 - //先读取门店的lock,采用链式写法,少用await  
857 - getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
858 - data:{store_id:os.stoid,wareId:ee.data.data.goods_id,storageId:that.data.fir_def_store.pickup_id,pageSize:1000}  
859 - }).then(res=>{  
860 - if(res.data.code==0 && res.data.data.total>0){  
861 - for(var i in res.data.data.pageData)  
862 - lock+=res.data.data.pageData[i].outQty  
863 - }  
864 - //---通过接口获取门店的线下库存信息--  
865 - return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
866 - data:{storageNos:that.data.fir_def_store.pickup_no,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid}  
867 - })  
868 - }).then(res=>{  
869 - if(res.data.code==0 && res.data.data.total>0){  
870 - plist=res.data.data.pageData[0];  
871 - }  
872 - if(plist && plist.CanOutQty-lock>0){  
873 - that.data.fir_def_store.CanOutQty=plist.CanOutQty-lock;  
874 - }else{  
875 - that.data.fir_def_store.CanOutQty=0;  
876 - }  
877 - //--给门店赋值线下库存--  
878 - th.setData({def_pick_store:that.data.fir_def_store});  
879 - })  
880 - }  
881 - })--*/ 848 +
882 } else { 849 } else {
883 //获取门店 850 //获取门店
884 ee.get_sto(); 851 ee.get_sto();
885 } 852 }
886 853
887 ee.get_sku(o.stoid, t.data.data, gid); 854 ee.get_sku(o.stoid, t.data.data, gid);
  855 + ee.check_has_flash();
  856 +
888 } 857 }
889 else { 858 else {
890 var gg = "", item = t.data.data; 859 var gg = "", item = t.data.data;
@@ -1260,6 +1229,8 @@ Page({ @@ -1260,6 +1229,8 @@ Page({
1260 goods_name: o.goods_name, 1229 goods_name: o.goods_name,
1261 goods_sn: o.goods_sn, 1230 goods_sn: o.goods_sn,
1262 sku: o.sku, 1231 sku: o.sku,
  1232 + prom_id:th.data.sele_g.prom_id,
  1233 + prom_type:th.data.sele_g.prom_type,
1263 }; 1234 };
1264 1235
1265 //---是不是从收藏夹出来的--- 1236 //---是不是从收藏夹出来的---
@@ -1428,7 +1399,7 @@ Page({ @@ -1428,7 +1399,7 @@ Page({
1428 add_cart_next(e, t, a, o, newd, CanOutQty) { 1399 add_cart_next(e, t, a, o, newd, CanOutQty) {
1429 var th = this, i = getApp().request; 1400 var th = this, i = getApp().request;
1430 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ 1401 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
1431 - if (o.prom_type != 1 && ((o.prom_type != 6 && o.prom_type != 4) || th.data.is_normal)) { 1402 + if ((o.prom_type != 1 || o.prom_id<=0) && ((o.prom_type != 6 && o.prom_type != 4) || th.data.is_normal)) {
1432 var conf = th.data.bconfig; 1403 var conf = th.data.bconfig;
1433 if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) { 1404 if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) {
1434 var s_list = JSON.parse(conf.switch_list); 1405 var s_list = JSON.parse(conf.switch_list);
@@ -1850,17 +1821,33 @@ Page({ @@ -1850,17 +1821,33 @@ Page({
1850 return false; 1821 return false;
1851 } 1822 }
1852 1823
1853 - var ind = t.currentTarget.dataset.ind; 1824 + if(th.data.more_flash && open_store==1){
  1825 + th.setData({is_pop_more:1});
  1826 + }else{
  1827 + var ind = t.currentTarget.dataset.ind;
  1828 + //回调。判断是不是优惠促销
  1829 + th.check_is_prom_goods(function () {
  1830 + th.setData({
  1831 + openSpecModal: !0,
  1832 + openSpecModal_ind: ind,
  1833 + });
  1834 + //var is_open=th.data.config
  1835 + th.get_off_price();
  1836 + })
  1837 + }
  1838 + },
1854 1839
1855 - //回调。判断是不是优惠促销  
1856 - th.check_is_prom_goods(function () {  
1857 - th.setData({  
1858 - openSpecModal: !0,  
1859 - openSpecModal_ind: ind,  
1860 - });  
1861 - //var is_open=th.data.config  
1862 - th.get_off_price();  
1863 - }) 1840 + open_next(){
  1841 + var th=this;
  1842 + //回调。判断是不是优惠促销
  1843 + th.check_is_prom_goods(function () {
  1844 + th.setData({
  1845 + openSpecModal: !0,
  1846 + openSpecModal_ind: 1,
  1847 + is_pop_more:0
  1848 + });
  1849 + th.get_off_price();
  1850 + })
1864 }, 1851 },
1865 1852
1866 //判断是不是优惠促销 1853 //判断是不是优惠促销
@@ -2130,13 +2117,13 @@ Page({ @@ -2130,13 +2117,13 @@ Page({
2130 onShareAppMessage: function (t) { 2117 onShareAppMessage: function (t) {
2131 2118
2132 var th = this; 2119 var th = this;
2133 - var price = th.data.data.shop_price; 2120 + var price = th.data.sele_g.shop_price;
2134 if (th.data.prom_act) { 2121 if (th.data.prom_act) {
2135 price = th.data.prom_act.price; 2122 price = th.data.prom_act.price;
2136 2123
2137 } 2124 }
2138 - var title = th.data.data.goods_name;  
2139 - var img = th.data.data.original_img; 2125 + var title = th.data.sele_g.goods_name;
  2126 + var img = th.data.sele_g.original_img;
2140 if (th.data.prom_type == 6 || th.data.prom_type == 1 || th.data.prom_type == 4) { 2127 if (th.data.prom_type == 6 || th.data.prom_type == 1 || th.data.prom_type == 4) {
2141 title = th.data.prom_act.share_title; 2128 title = th.data.prom_act.share_title;
2142 if (!title) title = th.data.prom_act.title; 2129 if (!title) title = th.data.prom_act.title;
@@ -2147,14 +2134,15 @@ Page({ @@ -2147,14 +2134,15 @@ Page({
2147 } 2134 }
2148 2135
2149 2136
2150 - var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid; 2137 + var url = "/pages/goods/goodsInfo/goodsInfo?goods_id="
  2138 + + th.data.sele_g.goods_id+"&prom_type="+th.data.sele_g.prom_type+"&prom_id="+th.data.sele_g.prom_id;
2151 if (getApp().globalData.user_id) { 2139 if (getApp().globalData.user_id) {
2152 url += "&first_leader=" + getApp().globalData.user_id; 2140 url += "&first_leader=" + getApp().globalData.user_id;
2153 } 2141 }
2154 2142
2155 //-- 如果房间分享,且不是会员分享的 -- 2143 //-- 如果房间分享,且不是会员分享的 --
2156 if (getApp().globalData.room_id && 2144 if (getApp().globalData.room_id &&
2157 - th.data.data.goods_id == getApp().globalData.room_goods_id && 2145 + th.data.sele_g.goods_id == getApp().globalData.room_goods_id &&
2158 !getApp().globalData.room_user_share 2146 !getApp().globalData.room_user_share
2159 ) { 2147 ) {
2160 url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1"; 2148 url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1";
@@ -2185,6 +2173,8 @@ Page({ @@ -2185,6 +2173,8 @@ Page({
2185 ob.title = text + " " + name; 2173 ob.title = text + " " + name;
2186 } 2174 }
2187 2175
  2176 + //-- 页面不能刷新 --
  2177 + this.data.show_prew_img=1;
2188 return ob; 2178 return ob;
2189 2179
2190 }, 2180 },
@@ -2266,6 +2256,9 @@ Page({ @@ -2266,6 +2256,9 @@ Page({
2266 case 8: 2256 case 8:
2267 continue; 2257 continue;
2268 2258
  2259 + case 8:
  2260 + continue;
  2261 +
2269 } 2262 }
2270 2263
2271 2264
@@ -2347,10 +2340,8 @@ Page({ @@ -2347,10 +2340,8 @@ Page({
2347 }); 2340 });
2348 2341
2349 2342
2350 -  
2351 that.check_is_youhui(gid, that.data.is_normal); 2343 that.check_is_youhui(gid, that.data.is_normal);
2352 2344
2353 - var ty = 0;  
2354 this.get_sto(that.data.is_normal); 2345 this.get_sto(that.data.is_normal);
2355 2346
2356 2347
@@ -2391,11 +2382,14 @@ Page({ @@ -2391,11 +2382,14 @@ Page({
2391 async sele_spec_chech_activity() { 2382 async sele_spec_chech_activity() {
2392 //---如果是活动的时候--- 2383 //---如果是活动的时候---
2393 var prom = null, goodsinfo = this.data.sele_g, th = this; 2384 var prom = null, goodsinfo = this.data.sele_g, th = this;
  2385 + var user_id=getApp().globalData.user_id;
  2386 + if(!user_id) user_id=0;
2394 if (goodsinfo.prom_type == 1) { 2387 if (goodsinfo.prom_type == 1) {
2395 - await getApp().request.promiseGet("/api/ms/flash_sale/get/" + os.stoid + "/" + goodsinfo.prom_id, { 2388 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + os.stoid + "/" +user_id+"/"+ goodsinfo.prom_id, {
2396 }).then(res => { 2389 }).then(res => {
2397 if (res.data.code == 0) { 2390 if (res.data.code == 0) {
2398 - prom = res.data.data; 2391 + prom = res.data.data;
  2392 + prom.price=prom.user_price;
2399 } 2393 }
2400 }) 2394 })
2401 } 2395 }
@@ -2420,16 +2414,53 @@ Page({ @@ -2420,16 +2414,53 @@ Page({
2420 //----------如果有活动,并且在进行中,就不计算线下库存--------------- 2414 //----------如果有活动,并且在进行中,就不计算线下库存---------------
2421 var now = ut.gettimestamp(); 2415 var now = ut.gettimestamp();
2422 if (prom) { 2416 if (prom) {
2423 - if (prom.is_end == 0 && prom.end_time > now && prom.start_time < now) { 2417 +
  2418 + var t1=prom.start_time;
  2419 + var prom_st=1;
  2420 + if(prom.show_time){
  2421 + t1=prom.show_time;
  2422 + if(prom.start_time>now) prom_st=0;
  2423 + }
  2424 + if (prom.is_end == 0 && prom.end_time > now && t1 < now) {
2424 th.setData({ 2425 th.setData({
2425 prom_type: goodsinfo.prom_type, 2426 prom_type: goodsinfo.prom_type,
2426 prom_price: prom.price, 2427 prom_price: prom.price,
2427 prom_buy_limit: prom.buy_limit, 2428 prom_buy_limit: prom.buy_limit,
2428 prom_end_time: prom.end_time, 2429 prom_end_time: prom.end_time,
2429 prom_start_time: prom.start_time, 2430 prom_start_time: prom.start_time,
2430 - prom_st: 1, 2431 + prom_st: prom_st,
  2432 + prom_act: prom,
  2433 + prom_id:prom.id
2431 }) 2434 })
2432 - return false; 2435 +
  2436 + //却换图片
  2437 + th.init(goodsinfo.goods_id);
  2438 + var newTime = ut.gettimestamp();
  2439 + var endTime2 = prom.end_time;
  2440 + var endTime1 = prom.start_time;
  2441 +
  2442 + this.data.is_timer=0;
  2443 +
  2444 + setTimeout(function () {
  2445 + th.data.is_timer=1;
  2446 + if (endTime1 > newTime) {
  2447 + th.setData({
  2448 + prom_time_text: '距秒杀开始还有'
  2449 + })
  2450 + th.countDown(endTime1, 0);
  2451 + } else {
  2452 + if (endTime2 > newTime) {
  2453 + th.setData({
  2454 + prom_time_text: '距秒杀结束还有',
  2455 + prom_st: 1
  2456 + })
  2457 + th.countDown(endTime2);
  2458 + }
  2459 + }
  2460 +
  2461 + },1000)
  2462 +
  2463 + return false;
2433 } 2464 }
2434 } 2465 }
2435 //---设置普通商品--- 2466 //---设置普通商品---
@@ -2487,13 +2518,6 @@ Page({ @@ -2487,13 +2518,6 @@ Page({
2487 if (!th.data.def_pick_store && th.data.fir_def_store) { 2518 if (!th.data.def_pick_store && th.data.fir_def_store) {
2488 th.setData({ def_pick_store: th.data.fir_def_store }); 2519 th.setData({ def_pick_store: th.data.fir_def_store });
2489 } 2520 }
2490 -  
2491 - /*--最新的,不用这里筛选配送方式  
2492 - if(th.data.def_pick_store && g_distr_type!=0 && th.data.def_pick_store.distr_type!=0 && th.data.def_pick_store.distr_type!=g_distr_type ){  
2493 - th.setData({def_pick_store:null});  
2494 - }--*/  
2495 -  
2496 -  
2497 wx.showLoading({ 2521 wx.showLoading({
2498 title: '加载中.' 2522 title: '加载中.'
2499 }); 2523 });
@@ -2859,9 +2883,7 @@ Page({ @@ -2859,9 +2883,7 @@ Page({
2859 2883
2860 //------隐藏取货门店2级---- 2884 //------隐藏取货门店2级----
2861 hide_sec_mend: function () { 2885 hide_sec_mend: function () {
2862 - this.setData({  
2863 - is_sec_mend: 0,  
2864 - }); 2886 + this.setData({ is_sec_mend: 0, });
2865 }, 2887 },
2866 2888
2867 //评论的调用 2889 //评论的调用
@@ -2875,7 +2897,7 @@ Page({ @@ -2875,7 +2897,7 @@ Page({
2875 parent_id: 0, goods_id: th.data.gid, commenttype: tp, 2897 parent_id: 0, goods_id: th.data.gid, commenttype: tp,
2876 } 2898 }
2877 if (getApp().globalData.userInfo) { 2899 if (getApp().globalData.userInfo) {
2878 - req_where.userId = getApp().globalData.userInfo.user_id; 2900 + req_where.userId = getApp().globalData.user_id;
2879 } 2901 }
2880 2902
2881 var rs_data = null; 2903 var rs_data = null;
@@ -2943,19 +2965,32 @@ Page({ @@ -2943,19 +2965,32 @@ Page({
2943 2965
2944 //--------检查是否活动,活动是否开始,或者是否结束------- 2966 //--------检查是否活动,活动是否开始,或者是否结束-------
2945 async check_prom(gid, prom_type, prom_id) { 2967 async check_prom(gid, prom_type, prom_id) {
2946 - var ee = this,  
2947 - th = ee; 2968 + var ee = this,th = ee;
  2969 + var user_id=getApp().globalData.user_id;
  2970 + if(!user_id) user_id=0;
  2971 +
2948 if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5 || prom_type == 7) { 2972 if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5 || prom_type == 7) {
2949 this.setData({ 2973 this.setData({
2950 - prom_type: 0,  
2951 - isshow: 1, 2974 + prom_type: 0,isshow: 1,
2952 }); 2975 });
2953 return false; 2976 return false;
2954 } 2977 }
2955 2978
  2979 + if (prom_type == 1 && prom_id==0){
  2980 + this.setData({
  2981 + prom_type: 0,isshow: 1,
  2982 + });
  2983 +
  2984 + //获取门店
  2985 + this.get_sto();
  2986 + this.get_sku(o.stoid, this.data.data, gid);
  2987 + this.check_has_flash();
  2988 + return false;
  2989 + }
  2990 +
2956 //if (prom_type != 3 && prom_type!=0){ 2991 //if (prom_type != 3 && prom_type!=0){
2957 //---判断秒杀---- 2992 //---判断秒杀----
2958 - if (prom_type == 1) { 2993 + if (prom_type == 1 && prom_id>0) {
2959 //-------判断活动是否抢光--------- 2994 //-------判断活动是否抢光---------
2960 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { 2995 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
2961 1: 1 2996 1: 1
@@ -2967,8 +3002,7 @@ Page({ @@ -2967,8 +3002,7 @@ Page({
2967 prom_r_null: 1 3002 prom_r_null: 1
2968 }); 3003 });
2969 //拿取价格并且判断时间-- 3004 //拿取价格并且判断时间--
2970 - getApp().request.get("/api/ms/flash_sale/get/" +  
2971 - os.stoid + "/" + prom_id, { 3005 + getApp().request.get("/api/ms/flash_sale/getNew/" +os.stoid + "/" +user_id+"/"+ prom_id, {
2972 success: function (t) { 3006 success: function (t) {
2973 if (t.data.code != 0) { 3007 if (t.data.code != 0) {
2974 ee.setData({ 3008 ee.setData({
@@ -3015,7 +3049,7 @@ Page({ @@ -3015,7 +3049,7 @@ Page({
3015 var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss"); 3049 var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");
3016 3050
3017 ee.setData({ 3051 ee.setData({
3018 - prom_price: t.data.data.price, 3052 + prom_price: t.data.data.user_price,
3019 prom_type: 1, 3053 prom_type: 1,
3020 prom_id: prom_id, 3054 prom_id: prom_id,
3021 prom_buy_limit: t.data.data.buy_limit, 3055 prom_buy_limit: t.data.data.buy_limit,
@@ -3026,17 +3060,9 @@ Page({ @@ -3026,17 +3060,9 @@ Page({
3026 }); 3060 });
3027 3061
3028 ee.get_sto(); 3062 ee.get_sto();
3029 -  
3030 -  
3031 var newTime = ut.gettimestamp(); 3063 var newTime = ut.gettimestamp();
3032 var endTime2 = t.data.data.end_time; 3064 var endTime2 = t.data.data.end_time;
3033 var endTime1 = t.data.data.start_time; 3065 var endTime1 = t.data.data.start_time;
3034 -  
3035 - //---苹果机不兼容---  
3036 - /*----  
3037 - var endTime2 = new Date(prom_end_time).getTime();  
3038 - var endTime1 = new Date(prom_start_time).getTime();----*/  
3039 -  
3040 if (endTime1 > newTime) { 3066 if (endTime1 > newTime) {
3041 ee.setData({ 3067 ee.setData({
3042 prom_time_text: '距秒杀开始还有' 3068 prom_time_text: '距秒杀开始还有'
@@ -3051,6 +3077,56 @@ Page({ @@ -3051,6 +3077,56 @@ Page({
3051 ee.countDown(endTime2); 3077 ee.countDown(endTime2);
3052 } 3078 }
3053 } 3079 }
  3080 +
  3081 + //如果是进行中的话
  3082 + if (endTime1 < newTime) {
  3083 + //-- 获取秒杀活动的多少规格 --
  3084 + ee.get_more_flahs(function (list) {
  3085 + if (list && list.length > 1) {
  3086 +
  3087 + var n_item = list[0];
  3088 + var ind = list.findIndex(function (ele) {
  3089 + return ele.goods_id == ee.data.data.goods_id;
  3090 + })
  3091 + if (ind < 0) return false;
  3092 + if (ind > 0) {
  3093 + n_item = JSON.parse(JSON.stringify(list[ind]));
  3094 + list.splice(ind, 1);
  3095 + list.unshift(n_item);
  3096 + }
  3097 +
  3098 + ee.data.sele_g.viplimited = n_item.viplimited;
  3099 + ee.data.data.viplimited = n_item.viplimited;
  3100 +
  3101 + var gb = 1;
  3102 + //-- 显示多规格 --
  3103 + for (let i in list) {
  3104 + let item = list[i];
  3105 + var gg = "";
  3106 + if (item.goods_spec == "null" || item.goods_spec == null) item.goods_spec = "";
  3107 + if (item.goods_color == "null" || item.goods_color == null) item.goods_color = "";
  3108 +
  3109 + if (item.goods_spec != "" && item.goods_color != "") {
  3110 + gg = item.goods_spec + "/" + item.goods_color;
  3111 + } else if (item.goods_spec != "" || item.goods_color != "") {
  3112 + gg = item.goods_spec + item.goods_color;
  3113 + } else {
  3114 + gg = "规格" + gb;
  3115 + gb++;
  3116 + }
  3117 + item.gg = gg;
  3118 + item.prom_id = item.prom_id;
  3119 + item.prom_type = 1;
  3120 + }
  3121 +
  3122 + ee.setData({
  3123 + sku_g: list,
  3124 + });
  3125 +
  3126 + }
  3127 + })
  3128 + }
  3129 +
3054 } 3130 }
3055 }); 3131 });
3056 } 3132 }
@@ -3106,7 +3182,6 @@ Page({ @@ -3106,7 +3182,6 @@ Page({
3106 3182
3107 } 3183 }
3108 3184
3109 -  
3110 //---判断拼单---- 3185 //---判断拼单----
3111 if (prom_type == 6) { 3186 if (prom_type == 6) {
3112 //-------判断活动是否抢光--------- 3187 //-------判断活动是否抢光---------
@@ -3454,6 +3529,12 @@ Page({ @@ -3454,6 +3529,12 @@ Page({
3454 success: function (t) { 3529 success: function (t) {
3455 if (t.data.code == 0) { 3530 if (t.data.code == 0) {
3456 var g_buy_num = t.data.data.goodsbuynum; 3531 var g_buy_num = t.data.data.goodsbuynum;
  3532 +
  3533 + //如果是秒杀的时候
  3534 + if(th.data.prom_type==0 && gd.prom_type == 1 ){
  3535 + gd.prom_type= 0;
  3536 + }
  3537 +
3457 if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) { 3538 if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) {
3458 //----获取活动购买数---- 3539 //----获取活动购买数----
3459 getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", { 3540 getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {
@@ -4116,6 +4197,95 @@ Page({ @@ -4116,6 +4197,95 @@ Page({
4116 } 4197 }
4117 }) 4198 })
4118 }, 4199 },
  4200 +
  4201 +
  4202 + drawPoster(context, unit, img, vpath) {
  4203 + // 1.灰色背景
  4204 + context.setFillStyle('#f2f1f6');
  4205 + context.rect(0,0,554*unit,899*unit);
  4206 + context.fill();
  4207 + // 2.商城名称
  4208 + let shopName = this.data.sto_sele_name_1;
  4209 + // let shopNameLen = context.measureText(shopName);
  4210 + // let x_shopNameLen = (554 - shopNameLen.width)/2*unit;
  4211 + // console.log('11111111111111',shopNameLen,x_shopNameLen);
  4212 + context.setTextAlign('center');
  4213 + context.setFontSize(26*unit);
  4214 + context.setFillStyle('black');
  4215 + context.fillText(shopName, 277*unit, 60*unit);
  4216 + // // 3.推荐来源
  4217 + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
  4218 + // let fromTextLen = context.measureText(fromText);
  4219 + // let x_fromText = (375 - fromTextLen.width)/2;
  4220 + // console.log('222222',fromTextLen,x_fromText);
  4221 + context.setTextAlign('center');
  4222 + context.setFontSize(22*unit);
  4223 + context.setFillStyle('#96959a');
  4224 + context.fillText(fromText, 277*unit, 105*unit);
  4225 + // 4.海报背景
  4226 + // context.beginPath();
  4227 + // context.setStrokeStyle('#f2f1f6');
  4228 + context.setFillStyle('white');
  4229 + context.fillRect(37*unit, 157*unit, 480*unit, 673*unit);
  4230 + // context.stroke();
  4231 + // context.fill();
  4232 + // 5.商品图片
  4233 + // 图片的x坐标
  4234 + let bg_x = 37*unit
  4235 + // 图片的y坐标
  4236 + let bg_y = 157*unit
  4237 + // 图片宽度
  4238 + let bg_w = 480*unit
  4239 + // 图片高度
  4240 + let bg_h = 474*unit
  4241 + // 图片圆角
  4242 + let bg_r = 4
  4243 + // 绘制海报背景图片圆角
  4244 + context.save()
  4245 + context.beginPath()
  4246 + context.arc(bg_x + bg_r, bg_y + bg_r, bg_r, Math.PI, Math.PI*1.5)
  4247 + context.arc(bg_x + bg_w - bg_r, bg_y + bg_r, bg_r, Math.PI * 1.5, Math.PI * 2)
  4248 + context.arc(bg_x + bg_w, bg_y + bg_h, bg_r, 0, Math.PI * 0.5)
  4249 + context.arc(bg_x, bg_y + bg_h, 0, Math.PI * 0.5, Math.PI)
  4250 + context.clip()
  4251 + context.drawImage(img, bg_x, bg_y, bg_w, bg_h);
  4252 + context.restore()
  4253 + // 6.强烈推荐
  4254 + // context.beginPath();
  4255 + let tj_path = "../../../images/share/q_tj.png";
  4256 + context.beginPath()
  4257 + context.drawImage(tj_path, 54*unit, 648*unit, 85*unit, 30*unit);
  4258 + context.setFontSize(16*unit)
  4259 + context.setLineJoin('round'); //交点设置成圆角
  4260 + context.setFillStyle("white")
  4261 + context.setTextAlign('left');
  4262 + context.fillText('强烈推荐', 64*unit, 672*unit);
  4263 + // 7.商品价格
  4264 + let price = '¥' + this.data.data.shop_price;
  4265 + // if (th.data.prom_act)
  4266 + // pri0 = th.data.prom_act.price;
  4267 + context.setFontSize(32*unit);
  4268 + context.setFillStyle('#DE1117');
  4269 + context.fillText(price, 54*unit, 730*unit);
  4270 + // 8.商品标题
  4271 + context.setFontSize(20*unit);
  4272 + context.setFillStyle('#898989');
  4273 + this.draw_Text(context, this.data.data.goods_name,
  4274 + 54*unit, 770*unit, 240*unit, 240*unit, unit);
  4275 + // 9.小程序码
  4276 + context.drawImage(vpath, 375*unit, 660*unit, 120*unit, 120*unit);
  4277 + context.setFontSize(16*unit);
  4278 + context.setFillStyle('#777');
  4279 + context.fillText('长按识别二维码', 378*unit, 810*unit);
  4280 + // 10.竖线
  4281 + context.beginPath();
  4282 + context.setFillStyle('#eee');
  4283 + context.rect(354*unit, 670*unit, 1*unit, 130*unit);
  4284 + context.fill();
  4285 +
  4286 + },
  4287 +
  4288 +
4119 4289
4120 //--定义的保存图片方法,分享团--- 4290 //--定义的保存图片方法,分享团---
4121 saveImageToPhotosAlbum: function () { 4291 saveImageToPhotosAlbum: function () {
@@ -4128,9 +4298,7 @@ Page({ @@ -4128,9 +4298,7 @@ Page({
4128 } 4298 }
4129 4299
4130 if (this.data.share_hidden) { 4300 if (this.data.share_hidden) {
4131 - this.setData({  
4132 - share_hidden: false,  
4133 - }); 4301 + this.setData({ share_hidden: false,});
4134 }; 4302 };
4135 4303
4136 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 4304 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团
@@ -4138,11 +4306,8 @@ Page({ @@ -4138,11 +4306,8 @@ Page({
4138 if (type == 6) type = 2; 4306 if (type == 6) type = 2;
4139 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3; 4307 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
4140 4308
4141 - wx.showLoading({  
4142 - title: '生成中...',  
4143 - })  
4144 - var that = this,  
4145 - th = that; 4309 + wx.showLoading({ title: '生成中...',})
  4310 + var that = this, th = that;
4146 //设置画板显示,才能开始绘图 4311 //设置画板显示,才能开始绘图
4147 that.setData({ 4312 that.setData({
4148 canvasHidden: false 4313 canvasHidden: false
@@ -4152,6 +4317,8 @@ Page({ @@ -4152,6 +4317,8 @@ Page({
4152 var unit = that.data.screenWidth / 750 * 1.35; //基础单位, 4317 var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
4153 var path2 = that.data.data.original_img; 4318 var path2 = that.data.data.original_img;
4154 var scene = th.data.gid + ""; 4319 var scene = th.data.gid + "";
  4320 + scene+="."+th.data.sele_g.prom_type+"."+th.data.sele_g.prom_id;
  4321 +
4155 var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0; 4322 var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0;
4156 if (user_id > 0) { 4323 if (user_id > 0) {
4157 scene += "_" + user_id; 4324 scene += "_" + user_id;
@@ -4167,67 +4334,90 @@ Page({ @@ -4167,67 +4334,90 @@ Page({
4167 os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; 4334 os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
4168 4335
4169 console.log(path3); 4336 console.log(path3);
  4337 +
4170 4338
4171 - //读取文件成功则OK-- 4339 + // 读取文件成功则OK--
4172 wx.getImageInfo({ 4340 wx.getImageInfo({
4173 src: path3, 4341 src: path3,
4174 success: function (res) { 4342 success: function (res) {
4175 - //回调写法 4343 + // 回调写法
4176 th.get_head_temp(th.get_goods_temp, function () { 4344 th.get_head_temp(th.get_goods_temp, function () {
4177 var vpath = res.path; 4345 var vpath = res.path;
4178 var context = wx.createCanvasContext('share'); 4346 var context = wx.createCanvasContext('share');
4179 - //先画背景 4347 + // 先画背景
4180 var pg_path = "../../../images/share/share_bg.png"; 4348 var pg_path = "../../../images/share/share_bg.png";
4181 4349
4182 // context.fillStyle="#FFFFFF"; 4350 // context.fillStyle="#FFFFFF";
4183 // context.fillRect(0,0,554 * unit, 899 * unit); 4351 // context.fillRect(0,0,554 * unit, 899 * unit);
  4352 +
  4353 + // if(type == 0) {
  4354 + // this.drawPoster(context);
  4355 + // return false;
  4356 + // };
  4357 +
4184 4358
4185 //-- 如果有自定义海报的时候,判断背景的图片 -- 4359 //-- 如果有自定义海报的时候,判断背景的图片 --
4186 if (th.data.share_b_img) { 4360 if (th.data.share_b_img) {
4187 pg_path = th.data.share_b_img; 4361 pg_path = th.data.share_b_img;
4188 } 4362 }
4189 - context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 4363 + // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
  4364 +
  4365 +
  4366 + if(type == 0) { // 如果是普通商品,绘制新海报
  4367 + th.drawPoster(context, unit, th.data.share_goods_img, vpath);
  4368 + } else {
  4369 + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
  4370 + };
  4371 +
  4372 + // th.drawPoster(context, unit, th.data.share_goods_img, vpath);
  4373 +
4190 4374
4191 //-- 是自定义海报的情况下 -- 4375 //-- 是自定义海报的情况下 --
4192 - if (th.data.poster && parseInt(th.data.poster.style) == 2) {  
4193 - //在线上分享人的情况下  
4194 - if (parseInt(th.data.poster.show_headpic)) {  
4195 - //获取坐标  
4196 - var x = parseFloat(th.data.poster.head_x) * 2;  
4197 - var y = parseFloat(th.data.poster.head_y) * 2;  
4198 - var x1 = (x + 90) * unit;  
4199 - var y1 = (y + 50) * unit;  
4200 - //--昵称---  
4201 - context.setFontSize(24 * unit)  
4202 - context.setFillStyle("black")  
4203 - context.fillText(app.globalData.userInfo.nickname, x1, y1);  
4204 - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;  
4205 - //强烈推荐 改许程  
4206 - var tj_path = "../../../images/share/q_tj.png";  
4207 - context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit);  
4208 - context.setFontSize(16 * unit)  
4209 - context.setLineJoin('round'); //交点设置成圆角  
4210 - context.setFillStyle("white")  
4211 - context.fillText('强烈推荐', x1 + width + 8 * unit, y1 - 1 * unit);  
4212 -  
4213 - //context.setFillStyle("black")  
4214 - //context.setFontSize(24 * unit)  
4215 - //context.fillText(getApp().globalData.config.store_name, 40 * unit, 130 * unit);  
4216 - }  
4217 - } else {  
4218 - //--昵称---  
4219 - context.setFontSize(24 * unit)  
4220 - context.setFillStyle("black")  
4221 - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);  
4222 - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;  
4223 - //强烈推荐 改许程  
4224 - var tj_path = "../../../images/share/q_tj.png";  
4225 - context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);  
4226 - context.setFontSize(16 * unit);  
4227 - context.setLineJoin('round'); //交点设置成圆角  
4228 - context.setFillStyle("white");  
4229 - context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 75 * unit);  
4230 - } 4376 + if(type != 0) {
  4377 +
  4378 + if (th.data.poster && parseInt(th.data.poster.style) == 2) {
  4379 + //在线上分享人的情况下
  4380 + if (parseInt(th.data.poster.show_headpic)) {
  4381 + //获取坐标
  4382 + var x = parseFloat(th.data.poster.head_x) * 2;
  4383 + var y = parseFloat(th.data.poster.head_y) * 2;
  4384 + var x1 = (x + 90) * unit;
  4385 + var y1 = (y + 50) * unit;
  4386 + //--昵称---
  4387 + context.setFontSize(24 * unit)
  4388 + context.setFillStyle("black")
  4389 + context.fillText(app.globalData.userInfo.nickname, x1, y1);
  4390 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  4391 + //强烈推荐 改许程
  4392 + var tj_path = "../../../images/share/q_tj.png";
  4393 + context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit);
  4394 + context.setFontSize(16 * unit);
  4395 + context.setLineJoin('round'); //交点设置成圆角
  4396 + context.setFillStyle("white");
  4397 + context.fillText('强烈推荐', x1 + width + 8 * unit, y1 - 1 * unit);
  4398 +
  4399 + //context.setFillStyle("black")
  4400 + //context.setFontSize(24 * unit)
  4401 + //context.fillText(getApp().globalData.config.store_name, 40 * unit, 130 * unit);
  4402 + }
  4403 + } else {
  4404 + //--昵称---
  4405 + context.setFontSize(24 * unit);
  4406 + context.setFillStyle("black");
  4407 + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
  4408 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  4409 + //强烈推荐 改许程
  4410 + var tj_path = "../../../images/share/q_tj.png";
  4411 + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
  4412 + context.setFontSize(16 * unit);
  4413 + context.setLineJoin('round'); //交点设置成圆角
  4414 + context.setFillStyle("white");
  4415 + context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 75 * unit);
  4416 + }
  4417 +
  4418 + };
  4419 +
  4420 +
4231 4421
4232 var share_title = th.data.data.goods_name; 4422 var share_title = th.data.data.goods_name;
4233 if (th.data.prom_type == 1 || th.data.prom_type == 6 || th.data.prom_type == 4) { 4423 if (th.data.prom_type == 1 || th.data.prom_type == 6 || th.data.prom_type == 4) {
@@ -4238,7 +4428,7 @@ Page({ @@ -4238,7 +4428,7 @@ Page({
4238 4428
4239 //---产品名称--- 4429 //---产品名称---
4240 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 4430 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
4241 - if (type != 4) { 4431 + if (type != 4 && type != 0) {
4242 context.setFillStyle("black"); 4432 context.setFillStyle("black");
4243 context.setFontSize(21.3 * unit) 4433 context.setFontSize(21.3 * unit)
4244 th.draw_Text(context, share_title, 4434 th.draw_Text(context, share_title,
@@ -4271,7 +4461,7 @@ Page({ @@ -4271,7 +4461,7 @@ Page({
4271 context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit); 4461 context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit);
4272 context.stroke(); 4462 context.stroke();
4273 4463
4274 - } else { 4464 + } else if(type == 4 && type != 0) {
4275 context.setFillStyle("black"); 4465 context.setFillStyle("black");
4276 context.setFontSize(21.3 * unit) 4466 context.setFontSize(21.3 * unit)
4277 th.draw_Text(context, share_title, 4467 th.draw_Text(context, share_title,
@@ -4291,10 +4481,15 @@ Page({ @@ -4291,10 +4481,15 @@ Page({
4291 } 4481 }
4292 4482
4293 //---中间大图--- 4483 //---中间大图---
4294 - context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); 4484 + if(type != 0) {
  4485 + context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit);
  4486 + };
  4487 +
  4488 +
  4489 +
4295 //-------大图后面就不一样了----------- 4490 //-------大图后面就不一样了-----------
4296 switch (type) { 4491 switch (type) {
4297 - case 0: //普通商品的展示 4492 + case 0: break;//普通商品的展示
4298 case 4: 4493 case 4:
4299 //中间的几个字 4494 //中间的几个字
4300 if (th.data.poster && parseInt(th.data.poster.style) == 2) { 4495 if (th.data.poster && parseInt(th.data.poster.style) == 2) {
@@ -4361,7 +4556,6 @@ Page({ @@ -4361,7 +4556,6 @@ Page({
4361 context.fillText("长按识别二维码", 40 * unit, 806 * unit); 4556 context.fillText("长按识别二维码", 40 * unit, 806 * unit);
4362 context.fillText("立即开始兑换", 40 * unit, 846 * unit); 4557 context.fillText("立即开始兑换", 40 * unit, 846 * unit);
4363 4558
4364 -  
4365 } 4559 }
4366 4560
4367 //---二维吗图--- 4561 //---二维吗图---
@@ -4373,7 +4567,7 @@ Page({ @@ -4373,7 +4567,7 @@ Page({
4373 } else { 4567 } else {
4374 //---二维吗图--- 4568 //---二维吗图---
4375 context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); 4569 context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
4376 - } 4570 + };
4377 4571
4378 break; 4572 break;
4379 case 1: //秒杀商品的展示 4573 case 1: //秒杀商品的展示
@@ -4416,7 +4610,6 @@ Page({ @@ -4416,7 +4610,6 @@ Page({
4416 context.lineTo(520 * unit, 670 * unit) 4610 context.lineTo(520 * unit, 670 * unit)
4417 context.stroke(); 4611 context.stroke();
4418 //---文字--- 4612 //---文字---
4419 -  
4420 context.setFillStyle("black") 4613 context.setFillStyle("black")
4421 context.setFontSize(24 * unit) 4614 context.setFontSize(24 * unit)
4422 context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit); 4615 context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);
@@ -4462,7 +4655,6 @@ Page({ @@ -4462,7 +4655,6 @@ Page({
4462 context.lineTo(520 * unit, 670 * unit) 4655 context.lineTo(520 * unit, 670 * unit)
4463 context.stroke(); 4656 context.stroke();
4464 //---文字--- 4657 //---文字---
4465 -  
4466 context.setFillStyle("black") 4658 context.setFillStyle("black")
4467 context.setFontSize(24 * unit) 4659 context.setFontSize(24 * unit)
4468 context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit); 4660 context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);
@@ -4513,45 +4705,50 @@ Page({ @@ -4513,45 +4705,50 @@ Page({
4513 4705
4514 4706
4515 //--- 如果是自定义海报的时候 --- 4707 //--- 如果是自定义海报的时候 ---
4516 - if (th.data.poster && parseInt(th.data.poster.style) == 2) {  
4517 -  
4518 - //如果显示会员信息的话  
4519 - if (parseInt(th.data.poster.show_headpic)) {  
4520 - //获取坐标  
4521 - var x = parseFloat(th.data.poster.head_x) * 2;  
4522 - var y = parseFloat(th.data.poster.head_y) * 2;  
4523 - //---绘制圆形要放在最后----  
4524 - context.save();  
4525 - context.beginPath();  
4526 - var h_x = x * unit;  
4527 - var h_y = y * unit;  
4528 - var h_r = 40 * unit;  
4529 - var cx = h_x + h_r;  
4530 - var cy = h_y + h_r;  
4531 - context.arc(cx, cy, h_r, 0, Math.PI * 2, false);  
4532 - context.closePath();  
4533 - context.fill();  
4534 - context.clip();  
4535 - context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);  
4536 - context.restore();  
4537 - }  
4538 -  
4539 - } else {  
4540 - //---绘制圆形要放在最后----  
4541 - context.save();  
4542 - context.beginPath();  
4543 - var h_x = 60 * unit;  
4544 - var h_y = 24 * unit;  
4545 - var h_r = 40 * unit;  
4546 - var cx = h_x + h_r;  
4547 - var cy = h_y + h_r;  
4548 - context.arc(cx, cy, h_r, 0, Math.PI * 2, false);  
4549 - context.closePath();  
4550 - context.fill();  
4551 - context.clip();  
4552 - context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);  
4553 - context.restore();  
4554 - } 4708 + if(type != 0) {
  4709 +
  4710 + if (th.data.poster && parseInt(th.data.poster.style) == 2) {
  4711 +
  4712 + //如果显示会员信息的话
  4713 + if (parseInt(th.data.poster.show_headpic)) {
  4714 + //获取坐标
  4715 + var x = parseFloat(th.data.poster.head_x) * 2;
  4716 + var y = parseFloat(th.data.poster.head_y) * 2;
  4717 + //---绘制圆形要放在最后----
  4718 + context.save();
  4719 + context.beginPath();
  4720 + var h_x = x * unit;
  4721 + var h_y = y * unit;
  4722 + var h_r = 40 * unit;
  4723 + var cx = h_x + h_r;
  4724 + var cy = h_y + h_r;
  4725 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  4726 + context.closePath();
  4727 + context.fill();
  4728 + context.clip();
  4729 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  4730 + context.restore();
  4731 + }
  4732 +
  4733 + } else {
  4734 + //---绘制圆形要放在最后----
  4735 + context.save();
  4736 + context.beginPath();
  4737 + var h_x = 60 * unit;
  4738 + var h_y = 24 * unit;
  4739 + var h_r = 40 * unit;
  4740 + var cx = h_x + h_r;
  4741 + var cy = h_y + h_r;
  4742 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  4743 + context.closePath();
  4744 + context.fill();
  4745 + context.clip();
  4746 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  4747 + context.restore();
  4748 + }
  4749 +
  4750 + };
  4751 +
4555 4752
4556 4753
4557 //把画板内容绘制成图片,并回调 画板图片路径 4754 //把画板内容绘制成图片,并回调 画板图片路径
@@ -5540,9 +5737,6 @@ Page({ @@ -5540,9 +5737,6 @@ Page({
5540 this.add_cart_func_inte(t); 5737 this.add_cart_func_inte(t);
5541 }, 5738 },
5542 5739
5543 -  
5544 -  
5545 -  
5546 onShareTimeline() { 5740 onShareTimeline() {
5547 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; 5741 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
5548 if (!store_name) 5742 if (!store_name)
@@ -5602,7 +5796,7 @@ Page({ @@ -5602,7 +5796,7 @@ Page({
5602 check_zh_acting: function (func) { 5796 check_zh_acting: function (func) {
5603 var isok = 1, item = this.data.sele_g; 5797 var isok = 1, item = this.data.sele_g;
5604 //如果有组合购 5798 //如果有组合购
5605 - var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item.prom_id + "/" + getApp().globalData.userInfo.user_id; 5799 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item.prom_id + "/" + getApp().globalData.user_id;
5606 getApp().request.promiseGet(url, {}).then(res => { 5800 getApp().request.promiseGet(url, {}).then(res => {
5607 if (res.data.code == 0 && res.data.data) { 5801 if (res.data.code == 0 && res.data.data) {
5608 if (res.data.data.is_show != 1) { 5802 if (res.data.data.is_show != 1) {
@@ -5628,5 +5822,84 @@ Page({ @@ -5628,5 +5822,84 @@ Page({
5628 item.act = res.data.data; 5822 item.act = res.data.data;
5629 func(isok); 5823 func(isok);
5630 }) 5824 })
5631 - } 5825 + },
  5826 +
  5827 + //获取更多秒杀
  5828 + get_more_flahs: async function (func) {
  5829 + var f_more=false;
  5830 + var user_id=getApp().globalData.user_id;
  5831 + if(!user_id) user_id=0;
  5832 +
  5833 + var url="/api/weshop/goods/listSkuFlash?store_id="+os.stoid+"&goods_id="+this.data.data.goods_id+"&user_id="+user_id;
  5834 + //获取秒杀的多规格
  5835 + await getApp().request.promiseGet(url, {}).then(res=>{
  5836 + if(res.data.code==0 && res.data.data && res.data.data.length>0){
  5837 + f_more=res.data.data;
  5838 + }
  5839 + })
  5840 + if(!f_more) {
  5841 + func(false);
  5842 + return false;
  5843 + }
  5844 + //-- 秒杀的价格要更新 --
  5845 + for(let i in f_more){
  5846 +
  5847 + let item=f_more[i];
  5848 + f_more[i].prom_id=item.act_id;
  5849 + f_more[i].prom_type=1;
  5850 + if(item.goods_id==this.data.data.goods_id){
  5851 + continue;
  5852 + }
  5853 + var url="/api/ms/flash_sale/getNew/"+os.stoid+"/"+user_id+"/"+item.act_id;
  5854 + await getApp().request.promiseGet(url, {}).then(rs=>{
  5855 + if(rs.data.code==0){
  5856 + f_more[i].price=rs.data.data.user_price;
  5857 +
  5858 + }
  5859 + })
  5860 + }
  5861 + func(f_more);
  5862 +
  5863 + },
  5864 +
  5865 + //-- 判断是否有秒杀 --
  5866 + check_has_flash:function () {
  5867 + var th=this;
  5868 + var url="/api/weshop/activitylist/getGoodActInfo";
  5869 + var req_data={
  5870 + store_id:os.stoid,goodsidlist:this.data.data.goods_id,is_detail:1
  5871 + };
  5872 + //获取秒杀的多规格
  5873 + getApp().request.promiseGet(url, {data:req_data}).then(res=>{
  5874 + if(res.data.code==0 && res.data.data && res.data.data.length){
  5875 + th.setData({more_flash:res.data.data});
  5876 + }
  5877 + })
  5878 + },
  5879 +
  5880 + //-- 跳转到秒杀商品详情页 --
  5881 + go_more_flash:function (e) {
  5882 + var prom_id=e.currentTarget.dataset.id;
  5883 + var goods_id=this.data.data.goods_id;
  5884 + var url="/pages/goods/goodsInfo/goodsInfo?goods_id="+goods_id+"&prom_id="+prom_id+"&prom_type=1";
  5885 + getApp().goto(url);
  5886 + },
  5887 +
  5888 + close_pop_more:function () {
  5889 + this.setData({is_pop_more:0})
  5890 + },
  5891 +
  5892 + con_weixin:function () {
  5893 + var url=this.data.sys_switch.weapp_customertype_url;
  5894 + var id=this.data.sys_switch.weapp_customertype_appid;
  5895 + wx.openCustomerServiceChat({
  5896 + extInfo: {url: url},
  5897 + corpId: id,
  5898 + success(res) {}
  5899 + })
  5900 + }
  5901 +
  5902 +
  5903 +
  5904 +
5632 }); 5905 });
pages/goods/goodsInfo/goodsInfo.wxml
@@ -7,16 +7,11 @@ @@ -7,16 +7,11 @@
7 <view class="container"> 7 <view class="container">
8 <view class="type-navbar"> 8 <view class="type-navbar">
9 <view class="type-box" wx:for="{{categories}}" wx:key="categories"> 9 <view class="type-box" wx:for="{{categories}}" wx:key="categories">
10 - <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}">  
11 - {{item.name}}  
12 - </view> 10 + <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}">{{item.name}}</view>
13 </view> 11 </view>
14 </view> 12 </view>
15 <view class="goods-detail"> 13 <view class="goods-detail">
16 <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}"> 14 <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}">
17 - <!-- 视频 -->  
18 - <!-- <swiper bindchange="swiperChange"class="xc-pictures swiperContainer rel" current="{{swiperCurrent}}"  
19 - indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> -->  
20 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove"> 15 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove">
21 <view class="xc-videos-picture rel"> 16 <view class="xc-videos-picture rel">
22 <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange"> 17 <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">
@@ -31,7 +26,6 @@ @@ -31,7 +26,6 @@
31 </view> 26 </view>
32 </swiper-item> 27 </swiper-item>
33 <swiper-item wx:for="{{gallery}}" wx:key="gallery"> 28 <swiper-item wx:for="{{gallery}}" wx:key="gallery">
34 - <!-- <image class="wh100" src="{{item.image_url}}" mode="aspectFit" binderror="bind_bnerr" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image> -->  
35 <view class="wh100 g_img_box" style="background-image:url({{item.image_url}});"></view> 29 <view class="wh100 g_img_box" style="background-image:url({{item.image_url}});"></view>
36 </swiper-item> 30 </swiper-item>
37 </swiper> 31 </swiper>
@@ -93,7 +87,8 @@ @@ -93,7 +87,8 @@
93 零售价¥{{filters.toFix(data.market_price,2)}} 87 零售价¥{{filters.toFix(data.market_price,2)}}
94 </view> 88 </view>
95 </view> 89 </view>
96 - <view class="abs white xc-nanber"> 90 +
  91 + <!-- <view class="abs white xc-nanber">
97 <text class="fs22">已拼{{prom_act.buy_num}}件</text> 92 <text class="fs22">已拼{{prom_act.buy_num}}件</text>
98 <view class="flex" style='margin-top:-34rpx'> 93 <view class="flex" style='margin-top:-34rpx'>
99 <view class="xc-people-img"> 94 <view class="xc-people-img">
@@ -101,7 +96,19 @@ @@ -101,7 +96,19 @@
101 </view> 96 </view>
102 <view class="t-s fs20 xc-people-val">{{prom_act.ct_num}}人拼</view> 97 <view class="t-s fs20 xc-people-val">{{prom_act.ct_num}}人拼</view>
103 </view> 98 </view>
104 - </view> 99 + </view> -->
  100 +
  101 + <!-- 幸运购 -->
  102 + <view class="abs white xc-nanber" wx:if="{{false}}">
  103 + <text class="fs22">已成团{{prom_act.buy_num}}期</text>
  104 + <view class="flex" style='margin-top:-34rpx'>
  105 + <view class="xc-people-img">
  106 + <image class="imgs" src="{{prom_st==1? iurl+'/miniapp/images/r_logo_red.png':iurl+'/miniapp/images/r_logo.png'}}"></image>
  107 + </view>
  108 + <view class="t-s fs20 xc-people-val">{{prom_act.ct_num}}人团</view>
  109 + </view>
  110 + </view>
  111 +
105 <view class="hy-stop word-color fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view> 112 <view class="hy-stop word-color fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view>
106 <view class="hy-stop word-color-lan fs26 abs" wx:if="{{prom_st==0}}">距活动开始还有</view> 113 <view class="hy-stop word-color-lan fs26 abs" wx:if="{{prom_st==0}}">距活动开始还有</view>
107 <view class="secview flex abs fs24 " style="color: black;right: 3px; top:46rpx;"> 114 <view class="secview flex abs fs24 " style="color: black;right: 3px; top:46rpx;">
@@ -210,6 +217,72 @@ @@ -210,6 +217,72 @@
210 </view> 217 </view>
211 </view> 218 </view>
212 </view> 219 </view>
  220 +
  221 + <!-- 幸运购 -->
  222 + <view class="pt_fir se2 bdt16" wx:if="{{teamgroup}}" hidden="{{true}}">
  223 + <view class="xc-partner-frame">
  224 + <view class="zzk-1 flex jc_sb" bindtap="go_t_more">
  225 + <view class="pdl10">已参团4人,还差<text class="c-red">1</text>人成团</view>
  226 + <view class="ckgd flex ai_c">
  227 + 查看奖励
  228 + <view class="bg_right arrow-one"></view>
  229 + </view>
  230 + </view>
  231 + </view>
  232 + <view class='group'>
  233 + <view class='group-list luck' bindtap="go_cj_team" data-ind="{{t_ind}}">
  234 + <!-- <view class="flex ai_c"> -->
  235 + <!-- //选项框头像 -->
  236 + <view class='gtou' wx:for="{{teamgroup}}" wx:for-index="t_ind" wx:key="teamgroup">
  237 + <image src='{{item.user.head_pic}}'></image>
  238 + </view>
  239 + <view class='gtou more'>
  240 + <text class="iconfont icon-sandian"></text>
  241 + </view>
  242 + <!-- <view class='gtou'>
  243 + <image src='{{item.user.head_pic}}'></image>
  244 + </view> -->
  245 + <!-- //等你来拼 -->
  246 + <!-- <view class='gdn ellipsis-1'>{{item.user.nickname}}</view> -->
  247 + <!-- </view> -->
  248 + <!-- //还差几人,剩余时间 -->
  249 + <!-- <view class="rel">
  250 + <view class='ghaicha ellipsis-2'>
  251 + <text class='gred' wx:if="{{prom_act.max_ct_num >0}}">
  252 + <text class="flex" wx:if="{{prom_act.max_ct_num - item.open_num>0}}">
  253 + 还差
  254 + <text class="word-color">{{prom_act.max_ct_num - item.open_num}}</text>
  255 + 人享最低优惠
  256 + </text>
  257 + <text wx:else>您已经享最低优惠</text>
  258 + </text>
  259 + <text class='gred' wx:else>
  260 + 还差
  261 + <text style='color:#ff2753'>{{prom_act.ct_num - item.open_num}}</text>
  262 + 人成团
  263 + </text>
  264 + <view class="t_show">
  265 + 剩余
  266 + <text wx:if="{{timer[t_ind].day}}">{{timer[t_ind].day}}天:</text>
  267 + <text>{{timer[t_ind].hou}}</text>
  268 + :
  269 + <text>{{timer[t_ind].min}}</text>
  270 + :
  271 + <text>{{timer[t_ind].sec}}</text>
  272 + </view>
  273 + </view>
  274 + </view> -->
  275 + <!-- //参加团 -->
  276 + <!-- <view class='cjt t-c'>去参团</view> -->
  277 + <!-- <view class="clear"></view> -->
  278 + </view>
  279 +
  280 + <view class="fs24 pdh20 pdt20">*<text class="c-red">5</text>人成团,<text class="c-red">5</text>人得商品,<text class="c-red">5</text>人全额退款并获得<text class="c-red">惊喜礼品</text>!</view>
  281 + </view>
  282 + </view>
  283 +
  284 +
  285 +
213 </view> 286 </view>
214 <!-- 积分购 --> 287 <!-- 积分购 -->
215 <view wx:if="{{prom_type==4}}"> 288 <view wx:if="{{prom_type==4}}">
@@ -252,6 +325,9 @@ @@ -252,6 +325,9 @@
252 </view> 325 </view>
253 <!-- 不是拼团,不是积分购 --> 326 <!-- 不是拼团,不是积分购 -->
254 <block wx:if="{{prom_type!=6 && prom_type!=4}}"> 327 <block wx:if="{{prom_type!=6 && prom_type!=4}}">
  328 +
  329 +
  330 +
255 <view class="goods-price"> 331 <view class="goods-price">
256 <view class="flex jc_sb"> 332 <view class="flex jc_sb">
257 <view class="co-red" style="" wx:if="{{prom_type==0 || prom_type==3}}"> 333 <view class="co-red" style="" wx:if="{{prom_type==0 || prom_type==3}}">
@@ -287,7 +363,8 @@ @@ -287,7 +363,8 @@
287 </view> 363 </view>
288 <!-- 不是秒杀 --> 364 <!-- 不是秒杀 -->
289 <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 --> 365 <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 -->
290 - <view class="flex ai_and" wx:if="{{!card_field && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 && card_list && card_list.length>0}}"> 366 + <view class="flex ai_and" wx:if="{{!card_field && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 && card_list && card_list.length>0 && g_filters.get_card_price(data,card_list,1)!=''}}">
  367 +
291 <view class="flex ai-center grade-card-frame card-frame"> 368 <view class="flex ai-center grade-card-frame card-frame">
292 <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> 369 <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>
293 <view class="fs24 white view card-name ellipsis-1"> 370 <view class="fs24 white view card-name ellipsis-1">
@@ -295,14 +372,13 @@ @@ -295,14 +372,13 @@
295 </view> 372 </view>
296 </view> 373 </view>
297 <view class="fs32 xc-black3 ai_and carde_frame"> 374 <view class="fs32 xc-black3 ai_and carde_frame">
298 - <text class="fs26">¥</text>  
299 - {{g_filters.get_card_price(data,card_list,0)}} 375 + <text class="fs26">¥</text>{{g_filters.get_card_price(data,card_list,0)}}
300 </view> 376 </view>
301 </view> 377 </view>
302 <!-- 等级卡的显示,购买, 等级卡近30天要显示续费 --> 378 <!-- 等级卡的显示,购买, 等级卡近30天要显示续费 -->
303 <block wx:if="{{g_filters.is_has_rank(rank_switch,data)}}"> 379 <block wx:if="{{g_filters.is_has_rank(rank_switch,data)}}">
304 <!-- 不是秒杀,且会员不是等级会员 --> 380 <!-- 不是秒杀,且会员不是等级会员 -->
305 - <view wx:if="{{!card_field && prom_type!=1 && card_list && card_list.length>0}}"> 381 + <view wx:if="{{!card_field && prom_type!=1 && card_list && card_list.length>0 && g_filters.get_card_price(data,card_list,1)!=''}}">
306 <view class="beauty-makeup-frame flex ai-center"> 382 <view class="beauty-makeup-frame flex ai-center">
307 <view class="left flex ai-center jc_sa"> 383 <view class="left flex ai-center jc_sa">
308 <view class="flex ai-center grade-card-frame card-frame advert-card"> 384 <view class="flex ai-center grade-card-frame card-frame advert-card">
@@ -314,10 +390,7 @@ @@ -314,10 +390,7 @@
314 <view class="card-effect"> 390 <view class="card-effect">
315 <view class="fs24 xc-black3"> 391 <view class="fs24 xc-black3">
316 成为{{g_filters.get_card_price(data,card_list,1)}}立 392 成为{{g_filters.get_card_price(data,card_list,1)}}立
317 - <text class="co-red">  
318 - 省{{filters.toFix(data.shop_price-g_filters.get_card_price(data,card_list,0),2)}}  
319 - </text>  
320 - 元 393 + <text class="co-red">省{{filters.toFix(data.shop_price-g_filters.get_card_price(data,card_list,0),2)}}</text>元
321 </view> 394 </view>
322 <view class="fs22 xc-ash">开通会员 尽享更多优惠</view> 395 <view class="fs22 xc-ash">开通会员 尽享更多优惠</view>
323 </view> 396 </view>
@@ -390,7 +463,7 @@ @@ -390,7 +463,7 @@
390 </view> 463 </view>
391 </view> 464 </view>
392 <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4}}"> 465 <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4}}">
393 - {{data.goods_name}} 466 + {{sele_g.goods_name}}
394 </view> 467 </view>
395 <!-- <view wx:if="{{prom_type==1}}" style='height:58rpx'></view> --> 468 <!-- <view wx:if="{{prom_type==1}}" style='height:58rpx'></view> -->
396 <!-- 许程 7.24 暂时注释 --> 469 <!-- 许程 7.24 暂时注释 -->
@@ -398,7 +471,9 @@ @@ -398,7 +471,9 @@
398 <view class="goods-num" wx:if="{{prom_type==1}}"> 471 <view class="goods-num" wx:if="{{prom_type==1}}">
399 <block wx:if="prom_st>0"> 472 <block wx:if="prom_st>0">
400 <view class="stock">总数量:{{prom_act.goods_num+prom_act.virtual}}件</view> 473 <view class="stock">总数量:{{prom_act.goods_num+prom_act.virtual}}件</view>
401 - <view class="stock">限购:{{prom_act.buy_limit}}件</view> 474 + <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view>
  475 + <view class="stock" wx:else>限购:不限</view>
  476 +
402 <block wx:if="{{prom_st==0}}"> 477 <block wx:if="{{prom_st==0}}">
403 <view class="sales">已购:0件</view> 478 <view class="sales">已购:0件</view>
404 </block> 479 </block>
@@ -408,7 +483,8 @@ @@ -408,7 +483,8 @@
408 </block> 483 </block>
409 <block wx:else> 484 <block wx:else>
410 <view class="stock">总数量:{{prom_act.goods_num}}件</view> 485 <view class="stock">总数量:{{prom_act.goods_num}}件</view>
411 - <view class="stock">限购:{{prom_act.buy_limit}}件</view> 486 + <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view>
  487 + <view class="stock" wx:else>限购:不限</view>
412 <view class="sales">已购:{{prom_act.buy_num}}件</view> 488 <view class="sales">已购:{{prom_act.buy_num}}件</view>
413 </block> 489 </block>
414 </view> 490 </view>
@@ -423,10 +499,7 @@ @@ -423,10 +499,7 @@
423 <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> 499 <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
424 <view class="fs30" style="color:black;">选择门店</view> 500 <view class="fs30" style="color:black;">选择门店</view>
425 </view> 501 </view>
426 - <view class="red_bb fs26">  
427 - 更多门店  
428 - <text class="bg_jj"></text>  
429 - </view> 502 + <view class="red_bb fs26">更多门店<text class="bg_jj"></text></view>
430 </view> 503 </view>
431 <view wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> 504 <view wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
432 <view class="flex-space-between address ai_end pdv10"> 505 <view class="flex-space-between address ai_end pdv10">
@@ -501,6 +574,7 @@ @@ -501,6 +574,7 @@
501 </view> 574 </view>
502 </view> 575 </view>
503 </block> 576 </block>
  577 +
504 <!-- 要判断是不是有订单优惠 --> 578 <!-- 要判断是不是有订单优惠 -->
505 <block wx:if="{{order_prom}}"> 579 <block wx:if="{{order_prom}}">
506 <view class="cx-frame flex" style="position: relative; height: auto"> 580 <view class="cx-frame flex" style="position: relative; height: auto">
@@ -538,6 +612,29 @@ @@ -538,6 +612,29 @@
538 </view> 612 </view>
539 </view> 613 </view>
540 </block> 614 </block>
  615 + <!-- 判断是不是有秒杀 -->
  616 + <block wx:if="{{more_flash}}">
  617 +
  618 + <block wx:for="{{more_flash}}">
  619 +
  620 + <view class="cx-frame flex" style="position: relative; height: auto" wx:if="{{item.prom_type==1}}" >
  621 + <view class="cx-sizs wsize" style="width: 144rpx">秒杀</view>
  622 + <!-- 中间显示层 -->
  623 + <view class="flex ai-center jc_sb" style="width: 570rpx" bindtap="go_more_flash" data-id="{{item.act_id}}">
  624 + <view class="flex">
  625 + <view class="miao_lab">秒</view>
  626 + <view class="order_hui">
  627 + <view class="fs28 ellipsis-1">{{item.act_name}}</view>
  628 + <view class="fs26">
  629 + (活动时间:{{tool.format_tt(item.s_time)}} - {{tool.format_tt(item.e_time)}})
  630 + </view>
  631 + </view>
  632 + </view>
  633 + <view><text class="bg_jj is_more_cx" style="position: relative;top:-10rpx"></text></view>
  634 + </view>
  635 + </view>
  636 + </block>
  637 + </block>
541 <view class="bz_view flex bdt16" wx:if="{{bconfig}}" style=""> 638 <view class="bz_view flex bdt16" wx:if="{{bconfig}}" style="">
542 <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> 639 <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image>
543 <view class="flex f1 ai_c rel"> 640 <view class="flex f1 ai_c rel">
@@ -629,13 +726,6 @@ @@ -629,13 +726,6 @@
629 </view> 726 </view>
630 <!-- 图文详情 --> 727 <!-- 图文详情 -->
631 <view class="bdt16"> 728 <view class="bdt16">
632 - <!-- <view class="tuwen_title">  
633 - <view class="g_line"></view>  
634 - <view class="center_s">  
635 - <image src="{{iurl}}/miniapp/images/tuwen_c.png"></image>  
636 - <text>详情</text>  
637 - </view>  
638 - </view> -->  
639 <view class="t_g_info"> 729 <view class="t_g_info">
640 <view class="red_shu"></view> 730 <view class="red_shu"></view>
641 <view class="fs30 bold">商品详情</view> 731 <view class="fs30 bold">商品详情</view>
@@ -892,10 +982,16 @@ @@ -892,10 +982,16 @@
892 <!-- -----------------底部按钮------------------ --> 982 <!-- -----------------底部按钮------------------ -->
893 <view class="join-cart"> 983 <view class="join-cart">
894 <!-- bindtap="contactService" --> 984 <!-- bindtap="contactService" -->
895 - <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> 985 + <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}}">
896 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 986 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
897 <view>客服</view> 987 <view>客服</view>
898 </button> 988 </button>
  989 +
  990 + <view wx:elif="{{sys_switch.weapp_customertype==2}}" class="custom-service cart-ico new_split" bindtap="con_weixin">
  991 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  992 + <view>客服</view>
  993 + </view>
  994 +
899 <view wx:else class="custom-service cart-ico new_split" bindtap="contactService"> 995 <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">
900 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> 996 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
901 <view>客服</view> 997 <view>客服</view>
@@ -1094,10 +1190,7 @@ @@ -1094,10 +1190,7 @@
1094 <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> 1190 <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
1095 <view class="fs30" style="color:black;">选择门店</view> 1191 <view class="fs30" style="color:black;">选择门店</view>
1096 </view> 1192 </view>
1097 - <view class="red-co fs28" bindtap="choice_store">  
1098 - 更多门店  
1099 - <text class="right-arrow"></text>  
1100 - </view> 1193 + <view class="red-co fs28" bindtap="choice_store">更多门店<text class="right-arrow"></text></view>
1101 </view> 1194 </view>
1102 <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> 1195 <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
1103 <block wx:else> 1196 <block wx:else>
@@ -1365,10 +1458,7 @@ @@ -1365,10 +1458,7 @@
1365 <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon> 1458 <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>
1366 </view> 1459 </view>
1367 <view class="felx choose_more" bindtap="more_store"> 1460 <view class="felx choose_more" bindtap="more_store">
1368 - <text class="fs26 red-co" wx:if="{{is_show_sto_cat}}">  
1369 - {{choice_sort_store==0?'更多门店':'返回'}}  
1370 - </text>  
1371 - <view class="bg_rights" wx:if="{{is_show_sto_cat}}"></view> 1461 + <text class="fs26 red-co" wx:if="{{is_show_sto_cat}}">{{choice_sort_store==0?'更多门店':'返回'}}</text> <view class="bg_rights" wx:if="{{is_show_sto_cat}}"></view>
1372 </view> 1462 </view>
1373 </view> 1463 </view>
1374 </view> 1464 </view>
@@ -1518,4 +1608,27 @@ @@ -1518,4 +1608,27 @@
1518 </view> 1608 </view>
1519 </view> 1609 </view>
1520 </view> 1610 </view>
1521 -</view>  
1522 \ No newline at end of file 1611 \ No newline at end of file
  1612 +</view>
  1613 +
  1614 +<!-- 商品要加入购物车 -->
  1615 +<view class="pop_more_act" wx:if="{{is_pop_more}}">
  1616 + <view class="cover-layer" bindtap="close_pop_more"></view>
  1617 + <view class="content">
  1618 + <view class="main pd20">
  1619 + <view class="t-c fs36" style="color: #c3172d">提示</view>
  1620 +
  1621 + <block wx:for="{{more_flash}}">
  1622 + <view bindtap="go_more_flash" data-id="{{item.act_id}}" class="flex jc_sb fs28 mt20" wx:if="{{item.prom_type==1}}">
  1623 + <view class="ellipsis-2" style="max-width: 80%">该商品有参与{{item.act_name}} {{tool.act_type(item.prom_type)}} 活动</view>
  1624 + <view class="fs26 c-7b">去参与
  1625 + <text class="bg_jj is_more_cx"></text>
  1626 + </view>
  1627 + </view>
  1628 + </block>
  1629 +
  1630 + <view style="margin-top: 30rpx" bindtap="open_next">
  1631 + <button class="p_btn">继续加入购物车</button>
  1632 + </view>
  1633 + </view>
  1634 + </view>
  1635 +</view>
pages/goods/goodsInfo/goodsInfo.wxss
@@ -2690,7 +2690,7 @@ border-radius: 55rpx; @@ -2690,7 +2690,7 @@ border-radius: 55rpx;
2690 } 2690 }
2691 .carde_frame{ 2691 .carde_frame{
2692 height: 50rpx; 2692 height: 50rpx;
2693 - line-height: 18rpx 2693 + /* line-height: 18rpx */
2694 } 2694 }
2695 2695
2696 button.custom-service { line-height: normal; border: 0;} 2696 button.custom-service { line-height: normal; border: 0;}
@@ -2842,4 +2842,37 @@ button.custom-service::after{ @@ -2842,4 +2842,37 @@ button.custom-service::after{
2842 width: 132rpx; 2842 width: 132rpx;
2843 height: 37rpx; 2843 height: 37rpx;
2844 margin-right: 10rpx; 2844 margin-right: 10rpx;
  2845 +}
  2846 +
  2847 +.miao_lab{ width: 36rpx; height: 36rpx; border: 4rpx solid #e71f19; color:#e71f19; text-align: center;margin-right: 10rpx;
  2848 + line-height: 36rpx;font-size: 22rpx; font-weight: bolder; border-radius: 50%; }
  2849 +
  2850 +.pop_more_act .content{
  2851 + position:fixed;background: #fff; width: 100%;
  2852 + left: 0;bottom: 0;z-index: 1000;
  2853 +}
  2854 +
  2855 +.p_btn{
  2856 + background-color: #f23030;
  2857 + height: 70rpx;line-height: 70rpx;
  2858 + color: #fff;
  2859 +}
  2860 +
  2861 +.mt20{ margin-top: 20rpx}
  2862 +
  2863 +.group .group-list.luck {
  2864 + padding: 0 20rpx;
  2865 + justify-content: flex-start;
  2866 +}
  2867 +
  2868 +.group-list.luck .gtou ~ .gtou {
  2869 + margin-left: -16rpx;
  2870 +}
  2871 +
  2872 +.gtou.more {
  2873 + background-color: #ddd;
  2874 + text-align: center;
  2875 + line-height: 70rpx;
  2876 + border-radius: 50%;
  2877 + color: #aaa;
2845 } 2878 }
2846 \ No newline at end of file 2879 \ No newline at end of file
pages/goods/goodsList/g_filter.wxs
@@ -81,12 +81,13 @@ var g_filters = { @@ -81,12 +81,13 @@ var g_filters = {
81 }, 81 },
82 //跳转的接口 82 //跳转的接口
83 get_goods_url:function(item){ 83 get_goods_url:function(item){
84 -  
85 - console.log(item,111)  
86 var url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id 84 var url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id
87 if(item.prom_type==8){ 85 if(item.prom_type==8){
88 - url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id  
89 - } 86 + url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id
  87 + }
  88 + if(item.prom_type==1 && item.prom_id>0 ){
  89 + url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id+"&prom_type=1";
  90 + }
90 return url1; 91 return url1;
91 } 92 }
92 } 93 }
pages/goods/goodsList/goodsList.wxml
@@ -177,7 +177,7 @@ @@ -177,7 +177,7 @@
177 <view class="item-cont"> 177 <view class="item-cont">
178 <view class="title ellipsis-2">{{item.goods_name}}</view> 178 <view class="title ellipsis-2">{{item.goods_name}}</view>
179 <!-- 判断是否有活动价 --> 179 <!-- 判断是否有活动价 -->
180 - <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2}}"> 180 + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}">
181 <view class="flex on"> 181 <view class="flex on">
182 <!-- 活动价 --> 182 <!-- 活动价 -->
183 <view class="price"> 183 <view class="price">
pages/goods/search/g_filter.wxs
@@ -83,11 +83,14 @@ var g_filters = { @@ -83,11 +83,14 @@ var g_filters = {
83 83
84 84
85 get_goods_url:function(item){ 85 get_goods_url:function(item){
86 - console.log(item,111) 86 +
87 var url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id 87 var url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id
88 if(item.prom_type==8){ 88 if(item.prom_type==8){
89 url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id 89 url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id
90 } 90 }
  91 + if(item.prom_type==1 && item.prom_id>0){
  92 + url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id+"&prom_type=1";
  93 + }
91 return url1; 94 return url1;
92 } 95 }
93 } 96 }
pages/goods/search/search.wxml
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 <view class="item-cont"> 35 <view class="item-cont">
36 <view class="title ellipsis-2">{{item.goods_name}}</view> 36 <view class="title ellipsis-2">{{item.goods_name}}</view>
37 <!-- 判断是否有活动价,小程序没有有团购和拼单 --> 37 <!-- 判断是否有活动价,小程序没有有团购和拼单 -->
38 - <block wx:if="{{(item.prom_price>0 || item.prom_integral) && item.prom_type!=2}}"> 38 + <block wx:if="{{(item.prom_price>0 || item.prom_integral) && item.prom_type!=2 && item.prom_id>0}}">
39 <!-- 活动价 --> 39 <!-- 活动价 -->
40 <view class="price"> 40 <view class="price">
41 <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text> 41 <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
pages/index/index/index.js
@@ -335,6 +335,49 @@ Page({ @@ -335,6 +335,49 @@ Page({
335 }) 335 })
336 336
337 337
  338 + //-----秒杀-----
  339 + var flash_data = null;
  340 + var f_req={
  341 + store_id: os.stoid,
  342 + timetype: 2,
  343 + is_end: 0,
  344 + is_show: 1,
  345 + pageSize: 9,
  346 + user_id:0
  347 + };
  348 + if(user_id) f_req.user_id=user_id;
  349 + //--获取活动--
  350 + await getApp().request.promiseGet("/api/ms/flash_sale/spikepage", {
  351 + data:f_req ,
  352 + }).then(res => {
  353 + var e = res;
  354 + if (e.data.code == 0) {
  355 + flash_data = e.data.data.pageData;
  356 + if (flash_data == null || flash_data.length <= 0) return false;
  357 +
  358 + //当前时间戳
  359 + var nt = ut.gettimestamp();
  360 +
  361 + flash_data.forEach(function (val, ind) {
  362 +
  363 + if(val.user_price) val.price=val.user_price;
  364 + if (val.start_time > nt) flash_data[ind].status = 0;
  365 + else if (val.end_time > nt) flash_data[ind].status = 1;
  366 + if (val.buy_num >= val.goods_num) flash_data[ind].status = 2;
  367 + });
  368 +
  369 + var arr = new Array();
  370 + //--三个三个一组---
  371 + for (var i = 0; i < flash_data.length; i += 3) {
  372 + arr.push(flash_data.slice(i, i + 3));
  373 + }
  374 + th.setData({
  375 + saleGoods: arr
  376 + });
  377 + }
  378 + });
  379 +
  380 +
338 381
339 //优惠券要实时更新 382 //优惠券要实时更新
340 getApp().getConfig2(function (e) { 383 getApp().getConfig2(function (e) {
@@ -458,45 +501,6 @@ Page({ @@ -458,45 +501,6 @@ Page({
458 } 501 }
459 }) 502 })
460 503
461 - //-----秒杀-----  
462 - var flash_data = null;  
463 - //--获取活动--  
464 - await getApp().request.promiseGet("/api/ms/flash_sale/spikepage", {  
465 - data: {  
466 - store_id: os.stoid,  
467 - timetype: 2,  
468 - is_end: 0,  
469 - is_show: 1,  
470 - pageSize: 9  
471 - },  
472 - }).then(res => {  
473 - var e = res;  
474 - if (e.data.code == 0) {  
475 - flash_data = e.data.data.pageData;  
476 - if (flash_data == null || flash_data.length <= 0) return false;  
477 -  
478 - //当前时间戳  
479 - var nt = ut.gettimestamp();  
480 -  
481 - flash_data.forEach(function (val, ind) {  
482 - if (val.start_time > nt) flash_data[ind].status = 0;  
483 - else if (val.end_time > nt) flash_data[ind].status = 1;  
484 - if (val.buy_num >= val.goods_num) flash_data[ind].status = 2;  
485 - });  
486 -  
487 - var arr = new Array();  
488 - //--三个三个一组---  
489 - for (var i = 0; i < flash_data.length; i += 3) {  
490 - arr.push(flash_data.slice(i, i + 3));  
491 - }  
492 - th.setData({  
493 - saleGoods: arr  
494 - });  
495 - //th.countDown();  
496 - }  
497 - });  
498 -  
499 -  
500 //----拼单----- 504 //----拼单-----
501 await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/2", { 505 await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/2", {
502 data: { 506 data: {
pages/index/index/index.wxml
@@ -153,9 +153,9 @@ @@ -153,9 +153,9 @@
153 </view> 153 </view>
154 </navigator> 154 </navigator>
155 <view class="seckill-list"> 155 <view class="seckill-list">
156 - <swiper class="s_prom" indicator-dots="{{false}}" bindchange="flashSwiperChange" next-margin="105rpx">  
157 - <swiper-item wx:for="{{saleGoods}}" wx:key="{{index}}" class="p_swiper" wx:key="saleGoods" style="750rpx !important;">  
158 - <navigator class="nav" hover-class="none" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&title={{aitem.goods_name}}" wx:for="{{item}}" wx:key="item" wx:for-item="aitem" wx:for-index="aind"> 156 + <swiper class="s_prom" indicator-dots="{{false}}" bindchange="flashSwiperChange">
  157 + <swiper-item wx:for="{{saleGoods}}" wx:key="{{index}}" class="p_swiper" wx:key="saleGoods" style="740rpx !important;padding: 0; margin-left: 10rpx">
  158 + <navigator style="flex-shrink: 0;width: 247rpx" class="nav" hover-class="none" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&title={{aitem.goods_name}}&prom_type=1&prom_id={{aitem.id}}" wx:for="{{item}}" wx:key="item" wx:for-item="aitem" wx:for-index="aind">
159 <view class="imgview "> 159 <view class="imgview ">
160 <image src="{{url+aitem.original_img}}" mode="aspectFill" lazy-load="true" data-errorimg="saleGoods[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3" data-img="{{aitem.original_img}}"></image> 160 <image src="{{url+aitem.original_img}}" mode="aspectFill" lazy-load="true" data-errorimg="saleGoods[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3" data-img="{{aitem.original_img}}"></image>
161 161
@@ -163,7 +163,7 @@ @@ -163,7 +163,7 @@
163 <image wx:if="{{aitem.status==1}}" class="status_img" src="{{url}}/miniapp/images/miao/going.png"></image> 163 <image wx:if="{{aitem.status==1}}" class="status_img" src="{{url}}/miniapp/images/miao/going.png"></image>
164 <image wx:if="{{aitem.status==2}}" class="status_img" src="{{url}}/miniapp/images/miao/mend.png"></image> 164 <image wx:if="{{aitem.status==2}}" class="status_img" src="{{url}}/miniapp/images/miao/mend.png"></image>
165 </view> 165 </view>
166 - <view class="ellipsis-2 mar-top10" style="height: 70rpx;">{{aitem.title}}</view> 166 + <view class="ellipsis-2 mar-top10" style="height: 76rpx;">{{aitem.goods_name}}</view>
167 <!-- <view class="red-co mar-top10 is_seckill_height"> --> 167 <!-- <view class="red-co mar-top10 is_seckill_height"> -->
168 <view class="co-red mar-top10"> 168 <view class="co-red mar-top10">
169 <text class="fs20">¥</text>{{aitem.price}} 169 <text class="fs20">¥</text>{{aitem.price}}
@@ -215,7 +215,52 @@ @@ -215,7 +215,52 @@
215 </swiper-item> 215 </swiper-item>
216 </swiper> 216 </swiper>
217 </view> 217 </view>
218 - </view> 218 + </view>
  219 +
  220 +
  221 +
  222 + <!--幸运购-->
  223 + <view class="seckill" wx:if="{{false}}">
  224 + <navigator bindtap="go_pre" data-url="/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList" hover-class="none">
  225 + <view class="seckill-time">
  226 + <view class="classname flex ai_c">
  227 + <i class="iconfont icon-luck"></i>
  228 + <text class="bold fs30">幸运购</text>
  229 + </view>
  230 + <view class="flex ai_c seckill-list">
  231 + <text class="fs24 xc-marfin-right">查看全部</text>
  232 + <image class="arrow-right" src="{{url}}/miniapp/images/icon-arrowdown.png"></image>
  233 + </view>
  234 + </view>
  235 + </navigator>
  236 + <view class="seckill-list luck">
  237 + <view class="list-item" wx:for="{{3}}">
  238 + <view class="flex ai-center">
  239 + <view class="img-container"><image class="img-block" src="../../../images/bk.png"></image></view>
  240 + <view class="pdl20 flex fdc jc_sb f1">
  241 +
  242 + <view class="ellipsis-2 name fs28">我是商品</view>
  243 + <view>
  244 + <view class="flex ai-center">
  245 + <text class="rmb c-red">189.00</text>
  246 + <view class="del fs22 c-a pdl10">零售价:<text class="rmb">155</text></view>
  247 + </view>
  248 + <view class="flex jc_sb">
  249 + <progress class="pdr20 f1 progress" percent="50" activeColor="#FF6768" backgroundColor="#d0d0d0" border-radius="12" stroke-width="12" data-content="1人已参团"></progress>
  250 + <view class="btn fs26">去参团</view>
  251 + </view>
  252 + </view>
  253 +
  254 + </view>
  255 + </view>
  256 + <view class="fs24 pdt10 c-7b">*<text class="c-red">5</text>人成团,<text class="c-red">5</text>人得商品,<text class="c-red">5</text>人全额退款并得<text class="c-red">惊喜礼品</text>!</view>
  257 + </view>
  258 + </view>
  259 + </view>
  260 +
  261 +
  262 +
  263 +
219 264
220 265
221 266
pages/index/index/index.wxss
@@ -2,7 +2,8 @@ @@ -2,7 +2,8 @@
2 background: #ff7295; 2 background: #ff7295;
3 } 3 }
4 4
5 -.icon-presell { 5 +.icon-presell,
  6 +.icon-luck {
6 color: #ED6064; 7 color: #ED6064;
7 font-size: 18px; 8 font-size: 18px;
8 margin-right: 4rpx; 9 margin-right: 4rpx;
@@ -1115,3 +1116,82 @@ page { @@ -1115,3 +1116,82 @@ page {
1115 margin-right: 10rpx; 1116 margin-right: 10rpx;
1116 } 1117 }
1117 1118
  1119 +
  1120 +
  1121 +/* .luck {
  1122 + padding-left: 20rpx;
  1123 + padding-right: 20rpx;
  1124 +} */
  1125 +
  1126 +.luck .list-item {
  1127 + background-color: white;
  1128 + padding: 20rpx;
  1129 + border-radius: 12rpx;
  1130 +}
  1131 +
  1132 +.luck .img-container {
  1133 + width: 200rpx;
  1134 + height: 200rpx;
  1135 + border-radius: 14rpx;
  1136 + overflow: hidden;
  1137 + flex-shrink: 0;
  1138 + position: relative;
  1139 +}
  1140 +
  1141 +.luck .img-container::before {
  1142 + content: '幸运购';
  1143 + position: absolute;
  1144 + left: 0;
  1145 + top: 0;
  1146 + padding: 4rpx;
  1147 + background-color: rgba(255,103,103,.7);
  1148 + color: white;
  1149 + font-size: 22rpx;
  1150 + border-radius: 0 0 14rpx 0;
  1151 +}
  1152 +
  1153 +.luck .name::before {
  1154 + content: '5人团';
  1155 + background-color: #FF6768;
  1156 + color: white;
  1157 + font-size: 26rpx;
  1158 + padding-left: 10rpx;
  1159 + padding-right: 10rpx;
  1160 + border-radius: 20rpx;
  1161 + margin-right: 10rpx;
  1162 +}
  1163 +
  1164 +.rmb::before {
  1165 + content: '¥';
  1166 + font-size: 24rpx;
  1167 +}
  1168 +
  1169 +.del {
  1170 + text-decoration: line-through;
  1171 +}
  1172 +
  1173 +.luck .btn {
  1174 + background-color: #FF6768;
  1175 + border-radius: 20rpx;
  1176 + padding-left:20rpx;
  1177 + padding-right: 20rpx;
  1178 + color: white;
  1179 +}
  1180 +
  1181 +.luck .name {
  1182 + height: 88rpx;
  1183 +}
  1184 +
  1185 +
  1186 +.luck .progress {
  1187 + position: relative;
  1188 +}
  1189 +.luck .progress::before {
  1190 + position: absolute;
  1191 + width: 100%;
  1192 + content: attr(data-content);
  1193 + font-size: 20rpx;
  1194 + color: white;
  1195 + text-align: center;
  1196 +}
  1197 +
pages/togoin/togoin.js
@@ -64,6 +64,14 @@ Page({ @@ -64,6 +64,14 @@ Page({
64 64
65 //-- 会员授权 -- 65 //-- 会员授权 --
66 bindGetUserInfo: function(ee) { 66 bindGetUserInfo: function(ee) {
  67 +
  68 + if(!this.data.isAgree) {
  69 + wx.showToast({
  70 + title: '请您先阅读和勾选指定的内容',
  71 + icon: 'none',
  72 + });
  73 + return false;
  74 + }
67 var that = this; 75 var that = this;
68 //-- 点击授权 -- 76 //-- 点击授权 --
69 that.getUserProfile(function(res){ 77 that.getUserProfile(function(res){
@@ -286,7 +294,30 @@ Page({ @@ -286,7 +294,30 @@ Page({
286 close_pop_back:function(){ 294 close_pop_back:function(){
287 this.close_pop(); 295 this.close_pop();
288 wx.navigateBack({ delta: 1}) 296 wx.navigateBack({ delta: 1})
289 - } 297 + },
  298 +
  299 +
  300 + // 是否同意协议
  301 + isAgree(e) {
  302 + let isAgree = null;
  303 + if(e.detail.value[0]) {
  304 + isAgree = true;
  305 + } else {
  306 + isAgree = false;
  307 + };
  308 + // this.data.isAgree = isAgree;
  309 + this.setData({
  310 + isAgree,
  311 + });
  312 + },
  313 +
  314 +
  315 + //通过路径跳转到其他页面
  316 + goto: function(e) {
  317 + console.log('xxxx', e);
  318 + var url = e.currentTarget.dataset.url;
  319 + getApp().goto(url);
  320 + },
290 321
291 322
292 323
pages/togoin/togoin.wxml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 <!-- 登录图 --> 3 <!-- 登录图 -->
4 <view > 4 <view >
5 - <view class="logins flex-center2 ali-c flex" style="position: relative;top: 120rpx;"> 5 + <view class="logins flex-center2 ali-c flex" style="padding-top: 120rpx;">
6 <image mode="widthFix" bindtap="go_index" class="login_img_back" src="{{imghots}}/miniapp/images/loginbg.jpg"></image> 6 <image mode="widthFix" bindtap="go_index" class="login_img_back" src="{{imghots}}/miniapp/images/loginbg.jpg"></image>
7 <view class="middle_view"> 7 <view class="middle_view">
8 <image bindtap="go_index" class="login_img" src="{{store_logo}}" binderror="bind_bnerr" lazy-load="true" data-errorimg="store_logo"></image> 8 <image bindtap="go_index" class="login_img" src="{{store_logo}}" binderror="bind_bnerr" lazy-load="true" data-errorimg="store_logo"></image>
@@ -14,6 +14,13 @@ @@ -14,6 +14,13 @@
14 <!-- 登录按钮 --> 14 <!-- 登录按钮 -->
15 <view> 15 <view>
16 <view class="phones"> 16 <view class="phones">
  17 +
  18 + <view bindtap="" class="user-name flex-vertical fs24 jc-center">
  19 + <checkbox-group bindchange="isAgree">
  20 + <checkbox value="true"/>
  21 + </checkbox-group>
  22 + <view class="user-name-txt">我已阅读同意 <text class="gray" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=0">《用户使用协议》</text>与<text class="gray" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=1">《隐私政策》</text></view>
  23 + </view>
17 24
18 <!-- 授权获取基础信息 --> 25 <!-- 授权获取基础信息 -->
19 <block wx:if="{{canIUseGetUserProfile}}"> 26 <block wx:if="{{canIUseGetUserProfile}}">
pages/togoin/togoin.wxss
@@ -4,7 +4,7 @@ page{ @@ -4,7 +4,7 @@ page{
4 } 4 }
5 .logins { 5 .logins {
6 width: 100%; 6 width: 100%;
7 - padding-bottom: 130rpx; 7 + /* padding-bottom: 130rpx; */
8 background-position: center; 8 background-position: center;
9 background-repeat: no-repeat; 9 background-repeat: no-repeat;
10 background-size: cover 10 background-size: cover
@@ -26,7 +26,7 @@ page{ @@ -26,7 +26,7 @@ page{
26 border-radius: 48rpx; 26 border-radius: 48rpx;
27 color: rgb(255,255,255); 27 color: rgb(255,255,255);
28 font-size: 32rpx; 28 font-size: 32rpx;
29 - margin-top:150rpx; 29 + margin-top: 40rpx;
30 } 30 }
31 .we_chat{ 31 .we_chat{
32 width: 55rpx; 32 width: 55rpx;
@@ -65,3 +65,13 @@ button{ @@ -65,3 +65,13 @@ button{
65 .middle_view{ 65 .middle_view{
66 position: absolute; left: 0; width: 100%; text-align: center; 66 position: absolute; left: 0; width: 100%; text-align: center;
67 } 67 }
  68 +
  69 +/*checkbox 选项框大小 */
  70 +checkbox .wx-checkbox-input {
  71 + width: 30rpx;
  72 + height: 30rpx;
  73 +}
  74 +
  75 +.gray {
  76 + color: #767f8e;
  77 +}
pages/user/index/index.js
@@ -67,7 +67,7 @@ Page({ @@ -67,7 +67,7 @@ Page({
67 getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{ 67 getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{
68 var dis=rs.data.data; 68 var dis=rs.data.data;
69 for(var i in d_list){ 69 for(var i in d_list){
70 - if(d_list[i].name=='我的分销' && dis && dis.switch==0){ 70 + if(d_list[i].name=='我的分销' && (!dis || dis.switch==0)){
71 d_list.splice(i,1); 71 d_list.splice(i,1);
72 } 72 }
73 } 73 }
@@ -237,8 +237,26 @@ Page({ @@ -237,8 +237,26 @@ Page({
237 }); 237 });
238 } 238 }
239 } 239 }
240 - })  
241 - 240 + });
  241 +
  242 + /*-----物流信息提醒-----*/
  243 + rq.get('/api/weshop/order/countDadaOrder', {
  244 + isShowLoading:0,
  245 + data: {
  246 + user_id: e.user_id,
  247 + store_id: os.stoid,
  248 + },
  249 + success: function(su) {
  250 + if (su.data.code == 0) {
  251 + th.setData({
  252 + countDadaOrder: su.data.data
  253 + });
  254 + }
  255 + }
  256 + });
  257 +
  258 +
  259 +
242 260
243 //--初始化是否有打勾-- 261 //--初始化是否有打勾--
244 getApp().request.get("/api/weshop/users/grade/vip/init/get", { 262 getApp().request.get("/api/weshop/users/grade/vip/init/get", {
@@ -395,6 +413,11 @@ Page({ @@ -395,6 +413,11 @@ Page({
395 } 413 }
396 }) 414 })
397 //th.requestRecommend(); 415 //th.requestRecommend();
  416 +
  417 +
  418 +
  419 +
  420 +
398 } 421 }
399 422
400 /*-- 423 /*--
@@ -817,6 +840,19 @@ Page({ @@ -817,6 +840,19 @@ Page({
817 } 840 }
818 }) 841 })
819 }, 842 },
820 - 843 +
  844 + con_weixin:function () {
  845 + var url=this.data.sys_switch.weapp_customertype_url;
  846 + var id=this.data.sys_switch.weapp_customertype_appid;
  847 + wx.openCustomerServiceChat({
  848 + extInfo: {url: url},
  849 + corpId: id,
  850 + success(res) {}
  851 + })
  852 + }
  853 +
  854 +
  855 +
  856 +
821 857
822 }) 858 })
pages/user/index/index.wxml
@@ -96,14 +96,16 @@ @@ -96,14 +96,16 @@
96 </view> 96 </view>
97 <view class="xc-after-sale rel"> 97 <view class="xc-after-sale rel">
98 <!-- 顶上的一栏 --> 98 <!-- 顶上的一栏 -->
99 - <view class="xc-equity-title flex-level" bindtap="go_order" data-url="/pages/user/order_list/order_list">  
100 - <view class="xc-title-frame flex-space-between">  
101 - <view class="flex-vertical xc-title-content"> 99 + <view class="xc-equity-title flex-level">
  100 + <view class="xc-title-frame flex ai-center">
  101 + <view class="flex-vertical xc-title-content" bindtap="go_order" data-url="/pages/user/order_list/order_list">
102 <image class="xc-title-img" src="{{iurl}}/miniapp/images/hdindan.png" style="width: 50rpx; height: 55rpx;margin-right: 5rpx"></image> 102 <image class="xc-title-img" src="{{iurl}}/miniapp/images/hdindan.png" style="width: 50rpx; height: 55rpx;margin-right: 5rpx"></image>
103 <view class="three-level-word">我的订单</view> 103 <view class="three-level-word">我的订单</view>
104 </view> 104 </view>
  105 + <!-- 物流信息提醒 -->
  106 + <view class="fs26 c-5 pdl60" wx:if="{{countDadaOrder != 0}}" bindtap="go_order" data-url="/pages/user/order_list/order_list?index=1"><text class="iconfont icon-dingwei"></text>您有<text class="c-red">{{countDadaOrder}}</text>个同城配送订单</view>
105 </view> 107 </view>
106 - <view class="three-level-word xc-more-frame flex-vertical"> 108 + <view class="three-level-word xc-more-frame flex-vertical" bindtap="go_order" data-url="/pages/user/order_list/order_list">
107 <view class="three-level-word xc-more">更多</view> 109 <view class="three-level-word xc-more">更多</view>
108 <view class="bg_right xc-more-click bcolor"></view> 110 <view class="bg_right xc-more-click bcolor"></view>
109 </view> 111 </view>
@@ -250,10 +252,16 @@ @@ -250,10 +252,16 @@
250 <!-- 没有链接地址的时候 --> 252 <!-- 没有链接地址的时候 -->
251 <block wx:else> 253 <block wx:else>
252 <block wx:if="{{item.name=='联系客服'}}"> 254 <block wx:if="{{item.name=='联系客服'}}">
253 - <button class="item t-c" wx:if="{{sys_switch.weapp_customertype}}" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> 255 + <button class="item t-c" wx:if="{{sys_switch.weapp_customertype==1}}" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
254 <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image> 256 <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
255 <view class="fs26">联系客服</view> 257 <view class="fs26">联系客服</view>
256 - </button> 258 + </button>
  259 +
  260 + <view class="item t-c" bindtap="con_weixin" wx:elif="{{sys_switch.weapp_customertype==2}}">
  261 + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
  262 + <view class="fs26">联系客服</view>
  263 + </view>
  264 +
257 <view class="item t-c" bindtap="contactService" wx:else> 265 <view class="item t-c" bindtap="contactService" wx:else>
258 <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image> 266 <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
259 <view class="fs26">联系客服</view> 267 <view class="fs26">联系客服</view>
pages/user/index/index.wxss
@@ -725,4 +725,13 @@ button::after{ border: 0} @@ -725,4 +725,13 @@ button::after{ border: 0}
725 width: 132rpx; 725 width: 132rpx;
726 height: 37rpx; 726 height: 37rpx;
727 margin-right: 10rpx; 727 margin-right: 10rpx;
  728 +}
  729 +
  730 +.icon-dingwei {
  731 + color: #EA4F2B;
  732 + font-size: 28rpx;
  733 +}
  734 +
  735 +.c-5 {
  736 + color: #555;
728 } 737 }
729 \ No newline at end of file 738 \ No newline at end of file
pages/user/order_detail/order_detail.js
@@ -322,7 +322,8 @@ Page({ @@ -322,7 +322,8 @@ Page({
322 url: "/pages/team/team_confirm/team_confirm?orderSn=" + this.data.order.order_sn + "&orderPay=true" 322 url: "/pages/team/team_confirm/team_confirm?orderSn=" + this.data.order.order_sn + "&orderPay=true"
323 }) 323 })
324 var order=this.data.order; 324 var order=this.data.order;
325 - var order_goods=order.order_goods; 325 + var order_goods=order.order_goods;
  326 + var user_id=order.user_id;
326 327
327 var wlist=""; 328 var wlist="";
328 for(var i in order_goods){ 329 for(var i in order_goods){
@@ -474,8 +475,7 @@ Page({ @@ -474,8 +475,7 @@ Page({
474 475
475 //商品的普通购买 ,不要进行判断 476 //商品的普通购买 ,不要进行判断
476 if((good.prom_type==1 || good.prom_type==6 || good.prom_type==4) && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal){ 477 if((good.prom_type==1 || good.prom_type==6 || good.prom_type==4) && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal){
477 - if(gg.prom_type!=good.prom_type) {  
478 - 478 + if(gg.prom_type!=good.prom_type && gg.prom_type>0) {
479 var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; 479 var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买';
480 th.toast(content); 480 th.toast(content);
481 return false; 481 return false;
@@ -487,10 +487,11 @@ Page({ @@ -487,10 +487,11 @@ Page({
487 //---如果是活动的时候--- 487 //---如果是活动的时候---
488 var prom=null,th=this; 488 var prom=null,th=this;
489 if(gg.prom_type==1){ 489 if(gg.prom_type==1){
490 - await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+gg.prom_id,{ 490 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/"+os.stoid+"/"+user_id+"/"+gg.prom_id,{
491 }).then(res=>{ 491 }).then(res=>{
492 if(res.data.code==0){ 492 if(res.data.code==0){
493 prom=res.data.data; 493 prom=res.data.data;
  494 + prom.price=prom.user_price;
494 } 495 }
495 }) 496 })
496 } 497 }
@@ -595,10 +596,11 @@ Page({ @@ -595,10 +596,11 @@ Page({
595 //---如果是活动的时候--- 596 //---如果是活动的时候---
596 var prom=null,goodsinfo=good,th=this; 597 var prom=null,goodsinfo=good,th=this;
597 if(goodsinfo.prom_type==1){ 598 if(goodsinfo.prom_type==1){
598 - await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+goodsinfo.prom_id,{ 599 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/"+os.stoid+"/"+user_id+"/"+goodsinfo.prom_id,{
599 }).then(res=>{ 600 }).then(res=>{
600 if(res.data.code==0){ 601 if(res.data.code==0){
601 prom=res.data.data; 602 prom=res.data.data;
  603 + prom.price=prom.user_price;
602 } 604 }
603 }) 605 })
604 } 606 }
@@ -638,7 +640,13 @@ Page({ @@ -638,7 +640,13 @@ Page({
638 th.toast(content); 640 th.toast(content);
639 return false; 641 return false;
640 } 642 }
641 - 643 + //看一下会员的秒杀价格是不是发生了变化
  644 + if(goodsinfo.prom_type==1 && goodsinfo.goods_price!=prom.price){
  645 + var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化';
  646 + th.toast(content);
  647 + return false;
  648 + }
  649 +
642 if(goodsinfo.prom_type==4){ 650 if(goodsinfo.prom_type==4){
643 if (good.goods_num > prom.limitqty-prom.buy_num) { 651 if (good.goods_num > prom.limitqty-prom.buy_num) {
644 652
@@ -897,6 +905,7 @@ Page({ @@ -897,6 +905,7 @@ Page({
897 905
898 check_more_order:async function(item){ 906 check_more_order:async function(item){
899 var pickup=null,th=this; 907 var pickup=null,th=this;
  908 + var user_id=getApp().globalData.userInfo.user_id;
900 wx.showLoading(); 909 wx.showLoading();
901 //--------获取门店----------- 910 //--------获取门店-----------
902 await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + item.pickup_id, { 911 await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + item.pickup_id, {
@@ -980,41 +989,62 @@ Page({ @@ -980,41 +989,62 @@ Page({
980 if(card_field && good[card_field]>0){ 989 if(card_field && good[card_field]>0){
981 b_item.price=good[card_field]; 990 b_item.price=good[card_field];
982 } 991 }
983 -  
984 - //--判断商品当前的活动情况--  
985 - switch(good.prom_type){  
986 - case 1:  
987 - var flash=null;  
988 - getApp().request.promiseGet("/api/ms/flash_sale/get/" + os.stoid + "/" + good.prom_id, {  
989 - }).then(res=>{  
990 - if (res.data.code== 0) {  
991 - flash=res.data.data;  
992 - }  
993 - })  
994 - //----已经结束-----  
995 - if (flash && flash.is_end == 0 && flash.end_time > timestamp && flash.start_time > timestamp ) {  
996 - prom=flash;  
997 - b_item.price=prom.price; //  
998 - }  
999 - break;  
1000 - case 6:  
1001 - b_item.is_pd_normal=1; break;  
1002 - case 7:  
1003 - //如果有组合购  
1004 - var url="/api/weshop/prom/zhbuy/get/"+os.stoid+"/"+good.prom_id+"/"+getApp().globalData.userInfo.user_id;  
1005 - await getApp().request.promiseGet(url, {}).then(res => {  
1006 - if(res.data.code==0 && res.data.data){  
1007 - if(res.data.data.is_show==1 && res.data.data.is_end==0  
1008 - && ut.gettimestamp()<res.data.data.end_time  
1009 - && ut.gettimestamp()>res.data.data.start_time  
1010 - ){  
1011 - b_item.prom_type=7;  
1012 - b_item.prom_id=res.data.data.id; 992 +
  993 + var url="/api/weshop/activitylist/getGoodActInfo";
  994 + var req_data={
  995 + store_id:g_item.store_id,goodsidlist:g_item.goods_id,is_detail:1
  996 + };
  997 + await getApp().request.promiseGet(url, {data:req_data}).then(res=>{
  998 + if(res.data.code==0){
  999 + var list = res.data.data;
  1000 + for(let i in list){
  1001 + let item=list[i];
  1002 + if(item.prom_type==1){ good.prom_type=1; good.prom_id=item.act_id; }
  1003 + }
  1004 + }
  1005 + })
  1006 +
  1007 + if(!prom) {
  1008 + //--判断商品当前的活动情况--
  1009 + switch (good.prom_type) {
  1010 + case 1:
  1011 + var flash = null;
  1012 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + good.prom_id, {}).then(res => {
  1013 + if (res.data.code == 0) {
  1014 + flash = res.data.data;
1013 } 1015 }
  1016 + })
  1017 + //----已经结束-----
  1018 + if (flash && flash.is_end == 0 && flash.end_time > timestamp && flash.start_time < timestamp) {
  1019 + prom = flash;
  1020 + prom.price = prom.user_price;
  1021 + b_item.price = prom.price;
  1022 + good.prom_type = 1;
  1023 + good.prom_id = prom.id;
1014 } 1024 }
1015 - })  
1016 - break;  
1017 - } 1025 + break;
  1026 + case 6:
  1027 + b_item.is_pd_normal = 1;
  1028 + break;
  1029 + case 7:
  1030 + //如果有组合购
  1031 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + good.prom_id + "/" + getApp().globalData.userInfo.user_id;
  1032 + await getApp().request.promiseGet(url, {}).then(res => {
  1033 + if (res.data.code == 0 && res.data.data) {
  1034 + if (res.data.data.is_show == 1 && res.data.data.is_end == 0
  1035 + && ut.gettimestamp() < res.data.data.end_time
  1036 + && ut.gettimestamp() > res.data.data.start_time
  1037 + ) {
  1038 + b_item.prom_type = 7;
  1039 + b_item.prom_id = res.data.data.id;
  1040 + good.prom_type = 7;
  1041 + good.prom_id = res.data.data.id;
  1042 + }
  1043 + }
  1044 + })
  1045 + break;
  1046 + }
  1047 + }
1018 1048
1019 //如果有优惠促销的时候,要看下商品的优惠活动有没有过期 1049 //如果有优惠促销的时候,要看下商品的优惠活动有没有过期
1020 if(g_item.prom_type==3 || good.prom_type==3){ 1050 if(g_item.prom_type==3 || good.prom_type==3){
@@ -1132,7 +1162,6 @@ Page({ @@ -1132,7 +1162,6 @@ Page({
1132 back_goods_arr.push(b_item); //返回商品元素 1162 back_goods_arr.push(b_item); //返回商品元素
1133 1163
1134 }else{ 1164 }else{
1135 -  
1136 //-- 看一下购物车上有多少商品 -- 1165 //-- 看一下购物车上有多少商品 --
1137 var cart_num=0; 1166 var cart_num=0;
1138 await getApp().request.promiseGet("/api/weshop/cart/page", { 1167 await getApp().request.promiseGet("/api/weshop/cart/page", {
@@ -1151,8 +1180,7 @@ Page({ @@ -1151,8 +1180,7 @@ Page({
1151 } 1180 }
1152 cart_num=num; 1181 cart_num=num;
1153 }) 1182 })
1154 -  
1155 - 1183 +
1156 if(good.store_count<=0){ 1184 if(good.store_count<=0){
1157 err_text+= good['goods_name']+"库存不足\n"; 1185 err_text+= good['goods_name']+"库存不足\n";
1158 continue; 1186 continue;
@@ -1226,16 +1254,19 @@ Page({ @@ -1226,16 +1254,19 @@ Page({
1226 1254
1227 if(b_item.goods_num>redis_num){ 1255 if(b_item.goods_num>redis_num){
1228 b_item.goods_num=redis_num; 1256 b_item.goods_num=redis_num;
1229 - }  
1230 -  
1231 - if(cart_num+buynum>prom['buy_limit']){  
1232 - err_text+= good['goods_name']+"超出活动限购\n";continue;  
1233 } 1257 }
1234 - prom['buy_limit'] -= (cart_num+buynum);  
1235 - if(b_item.goods_num>prom['buy_limit']){  
1236 - b_item.goods_num=prom['buy_limit'];  
1237 - }  
1238 - 1258 +
  1259 + if(prom['buy_limit']>0){
  1260 + if(cart_num+buynum>prom['buy_limit'] ){
  1261 + err_text+= good['goods_name']+"超出活动限购\n";continue;
  1262 + }
  1263 + prom['buy_limit'] -= (cart_num+buynum);
  1264 + if(b_item.goods_num>prom['buy_limit']){
  1265 + b_item.goods_num=prom['buy_limit'];
  1266 + }
  1267 + }
  1268 +
  1269 +
1239 } 1270 }
1240 back_goods_arr.push(b_item); //返回商品元素 1271 back_goods_arr.push(b_item); //返回商品元素
1241 } 1272 }
@@ -1400,7 +1431,39 @@ Page({ @@ -1400,7 +1431,39 @@ Page({
1400 icon: 'none', 1431 icon: 'none',
1401 duration: 3000 1432 duration: 3000
1402 }) 1433 })
1403 - } 1434 + },
  1435 +
  1436 + con_weixin:function () {
  1437 + var url=this.data.sys_switch.weapp_customertype_url;
  1438 + var id=this.data.sys_switch.weapp_customertype_appid;
  1439 + wx.openCustomerServiceChat({
  1440 + extInfo: {url: url},
  1441 + corpId: id,
  1442 + success(res) {}
  1443 + })
  1444 + },
  1445 +
  1446 + //跳转到商品
  1447 + go_gd:function (e) {
  1448 + var gd= e.currentTarget.dataset.gd;
  1449 + var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd;
  1450 + var url="/api/weshop/activitylist/getGoodActInfo";
  1451 + var req_data={
  1452 + store_id:os.stoid,goodsidlist:gd,is_detail:1
  1453 + };
  1454 + //获取秒杀的多规格
  1455 + getApp().request.promiseGet(url, {data:req_data}).then(res=>{
  1456 + if(res.data.code==0 && res.data.data){
  1457 + if(res.data.data.length==1){
  1458 + good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id;
  1459 + }
  1460 + getApp().goto(good_url);
  1461 +
  1462 + }else{
  1463 + getApp().goto(good_url);
  1464 + }
  1465 + })
  1466 + }
1404 1467
1405 1468
1406 1469
pages/user/order_detail/order_detail.wxml
@@ -20,12 +20,12 @@ @@ -20,12 +20,12 @@
20 </view> 20 </view>
21 <!--wx:if="{{item.return_btn!=4}}" --> 21 <!--wx:if="{{item.return_btn!=4}}" -->
22 <view class="order-detail" wx:for="{{order.order_goods}}" wx:key="{{index}}" > 22 <view class="order-detail" wx:for="{{order.order_goods}}" wx:key="{{index}}" >
23 - <view class="goods-img"> 23 + <view class="goods-img" bindtap="go_gd" data-gd="{{item.goods_id}}">
24 <image class="wh100" src="{{resourceUrl+item.original_img}}" binderror="bind_bnerr" lazy-load="true" 24 <image class="wh100" src="{{resourceUrl+item.original_img}}" binderror="bind_bnerr" lazy-load="true"
25 data-errorimg="order.order_goods[{{index}}].original_img"></image> 25 data-errorimg="order.order_goods[{{index}}].original_img"></image>
26 </view> 26 </view>
27 -  
28 - <navigator class="order-cont" openType="navigate" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> 27 + <!-- 跳转到商品 -->
  28 + <navigator class="order-cont" bindtap="go_gd" data-gd="{{item.goods_id}}">
29 <view class="goods-name">{{item.goods_name}}</view> 29 <view class="goods-name">{{item.goods_name}}</view>
30 <!--<view class="goods-color">{{item.goods_spec}} {{item.goods_color}}</view>--> 30 <!--<view class="goods-color">{{item.goods_spec}} {{item.goods_color}}</view>-->
31 <view class="goods-color">{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</view> 31 <view class="goods-color">{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</view>
@@ -53,15 +53,10 @@ @@ -53,15 +53,10 @@
53 <view class="order-operate"> 53 <view class="order-operate">
54 <view bindtap="checkTeam" class="contact-us check-btn" wx:if="{{optionIsGoup}}">查看拼团详情</view> 54 <view bindtap="checkTeam" class="contact-us check-btn" wx:if="{{optionIsGoup}}">查看拼团详情</view>
55 <view> 55 <view>
56 - <!-- <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> -->  
57 - <!-- <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>  
58 - <view></view> -->  
59 - <!-- </button> -->  
60 - <button wx:if="{{sys_switch.weapp_customertype}}" class="contact-us goods-btn" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">联系客服</button>  
61 - <!-- <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">  
62 - <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>  
63 - <view>联系客服</view>  
64 - </view> --> 56 +
  57 + <button wx:if="{{sys_switch.weapp_customertype==1}}" class="contact-us goods-btn" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">联系客服</button>
  58 +
  59 + <view wx:elif="{{sys_switch.weapp_customertype==2}}" bindtap="con_weixin" class="contact-us goods-btn">联系客服</view>
65 <view wx:else bindtap="contactService" class="contact-us goods-btn">联系客服</view> 60 <view wx:else bindtap="contactService" class="contact-us goods-btn">联系客服</view>
66 </view> 61 </view>
67 <!-- <view bindtap="contactService" class="contact-us goods-btn">联系客服</view> --> 62 <!-- <view bindtap="contactService" class="contact-us goods-btn">联系客服</view> -->
pages/user/order_list/order_list.js
@@ -70,6 +70,13 @@ Page({ @@ -70,6 +70,13 @@ Page({
70 var nowDate = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate(); 70 var nowDate = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate();
71 var date = new Date(now.getTime() - 7 * 24 * 3600 * 1000); 71 var date = new Date(now.getTime() - 7 * 24 * 3600 * 1000);
72 var startDate=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); 72 var startDate=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  73 +
  74 +
  75 + if(t.index) {
  76 + this.setData({
  77 + currentIndex: t.index
  78 + });
  79 + };
73 80
74 this.setData({ 81 this.setData({
75 currentDate: this.currentDate(), 82 currentDate: this.currentDate(),
@@ -497,7 +504,7 @@ Page({ @@ -497,7 +504,7 @@ Page({
497 await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { 504 await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
498 data: { 505 data: {
499 store_id: os.stoid, 506 store_id: os.stoid,
500 - user_id: getApp().globalData.user_id, 507 + user_id: user_id,
501 goods_id: good.goods_id, 508 goods_id: good.goods_id,
502 prom_type: good.prom_type, 509 prom_type: good.prom_type,
503 prom_id: good.prom_id 510 prom_id: good.prom_id
@@ -567,12 +574,9 @@ Page({ @@ -567,12 +574,9 @@ Page({
567 }) 574 })
568 575
569 var num = good['buyqty']; 576 var num = good['buyqty'];
570 - console.log(1111);  
571 - console.log(num);  
572 //---- 要计算商品的限购 ----- 577 //---- 要计算商品的限购 -----
573 if (good['buyqty'] > 0) { 578 if (good['buyqty'] > 0) {
574 if (good.goods_num + promgoodsbuynum > good['buyqty']) { 579 if (good.goods_num + promgoodsbuynum > good['buyqty']) {
575 -  
576 var content = good['goods_name'] + "超出活动限购\n"; 580 var content = good['goods_name'] + "超出活动限购\n";
577 th.toast(content); 581 th.toast(content);
578 return false; 582 return false;
@@ -658,7 +662,7 @@ Page({ @@ -658,7 +662,7 @@ Page({
658 //商品的普通购买 ,不要进行判断 662 //商品的普通购买 ,不要进行判断
659 if ((good.prom_type == 1 || good.prom_type == 6 || good.prom_type == 4 || good.prom_type == 8) 663 if ((good.prom_type == 1 || good.prom_type == 6 || good.prom_type == 4 || good.prom_type == 8)
660 && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal) { 664 && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal) {
661 - if (gg.prom_type != good.prom_type) { 665 + if (gg.prom_type != good.prom_type && gg.prom_type>0) {
662 var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买'; 666 var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买';
663 th.toast(content); 667 th.toast(content);
664 return false; 668 return false;
@@ -671,9 +675,10 @@ Page({ @@ -671,9 +675,10 @@ Page({
671 //---如果是活动的时候--- 675 //---如果是活动的时候---
672 var prom = null, th = this; 676 var prom = null, th = this;
673 if (gg.prom_type == 1) { 677 if (gg.prom_type == 1) {
674 - await getApp().request.promiseGet("/api/ms/flash_sale/get/" + os.stoid + "/" + gg.prom_id, {}).then(res => { 678 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + os.stoid + "/"+ user_id + "/" + gg.prom_id, {}).then(res => {
675 if (res.data.code == 0) { 679 if (res.data.code == 0) {
676 prom = res.data.data; 680 prom = res.data.data;
  681 + prom.price=prom.user_price;
677 } 682 }
678 }) 683 })
679 } 684 }
@@ -771,13 +776,13 @@ Page({ @@ -771,13 +776,13 @@ Page({
771 } 776 }
772 } 777 }
773 778
774 - console.log("------------------------------------");  
775 //---如果是活动的时候--- 779 //---如果是活动的时候---
776 var prom = null, goodsinfo = good, th = this; 780 var prom = null, goodsinfo = good, th = this;
777 if (goodsinfo.prom_type == 1) { 781 if (goodsinfo.prom_type == 1) {
778 - await getApp().request.promiseGet("/api/ms/flash_sale/get/" + os.stoid + "/" + goodsinfo.prom_id, {}).then(res => { 782 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + os.stoid + "/"+ user_id + "/" + goodsinfo.prom_id, {}).then(res => {
779 if (res.data.code == 0) { 783 if (res.data.code == 0) {
780 prom = res.data.data; 784 prom = res.data.data;
  785 + prom.price=prom.user_price;
781 } 786 }
782 }) 787 })
783 } 788 }
@@ -803,7 +808,6 @@ Page({ @@ -803,7 +808,6 @@ Page({
803 if (prom) { 808 if (prom) {
804 var now = ut.gettimestamp(); 809 var now = ut.gettimestamp();
805 if (prom.is_end == 1 && prom.end_time < now) { 810 if (prom.is_end == 1 && prom.end_time < now) {
806 -  
807 var content = goodsinfo.goods_name + '商品的活动已经结束,请取消订单' 811 var content = goodsinfo.goods_name + '商品的活动已经结束,请取消订单'
808 th.toast(content); 812 th.toast(content);
809 return false; 813 return false;
@@ -817,6 +821,13 @@ Page({ @@ -817,6 +821,13 @@ Page({
817 return false; 821 return false;
818 } 822 }
819 823
  824 + // --看一下会员的秒杀价格是不是发生了变化,因为会员的身份发生了变化
  825 + if(goodsinfo.prom_type==1 && goodsinfo.goods_price!=prom.price){
  826 + var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化';
  827 + th.toast(content);
  828 + return false;
  829 + }
  830 +
820 if (goodsinfo.prom_type == 4) { 831 if (goodsinfo.prom_type == 4) {
821 if (good.goods_num > prom.limitqty - prom.buy_num) { 832 if (good.goods_num > prom.limitqty - prom.buy_num) {
822 833
@@ -1058,388 +1069,413 @@ Page({ @@ -1058,388 +1069,413 @@ Page({
1058 var item=th.data.orderList[index]; 1069 var item=th.data.orderList[index];
1059 th.check_more_order(item); 1070 th.check_more_order(item);
1060 }, 1071 },
1061 -  
1062 - check_more_order:async function(item){  
1063 - var pickup=null,th=this;  
1064 - wx.showLoading();  
1065 - //--------获取门店-----------  
1066 - await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + item.pickup_id, {  
1067 -  
1068 - }).then(res=>{  
1069 - pickup = res.data.data;  
1070 - })  
1071 -  
1072 - //--------获取商品----------  
1073 - var goods_list=item.order_goods;  
1074 - //--- 返回的内容 ---  
1075 - var back_goods_arr=[];  
1076 - var err_text="";  
1077 - for(var i in goods_list){  
1078 - var g_item=goods_list[i];  
1079 - //--如果是赠品,不加入购物车--  
1080 - if(g_item['is_gift']) continue;  
1081 - if(g_item['prom_type']==4 ){  
1082 - err_text+= g_item['goods_name']+"积分购商品不加入购物车\n";  
1083 - continue;  
1084 - }  
1085 - if(g_item['prom_type']==5){  
1086 - err_text+= g_item['goods_name']+"搭配购商品不加入购物车\n";  
1087 - continue;  
1088 - }  
1089 - if(g_item['prom_type']==6 ){  
1090 - err_text+= g_item['goods_name']+"拼团商品不加入购物车\n";  
1091 - continue;  
1092 - }  
1093 1072
1094 - //--获取商品--  
1095 - var good=null;  
1096 - await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + g_item.goods_id, {  
1097 1073
1098 - }).then(res=>{  
1099 - good=res.data.data;  
1100 - })  
1101 -  
1102 - if(!good){  
1103 - err_text+= g_item['goods_name']+"未找到商品\n";  
1104 - continue;  
1105 - }  
1106 - if (good.is_on_sale != 1) {  
1107 - err_text+= g_item['goods_name']+"已经下架\n";  
1108 - continue;  
1109 - } 1074 + check_more_order:async function(item){
  1075 + var pickup=null,th=this;
  1076 + var user_id=getApp().globalData.user_id;
  1077 + wx.showLoading();
  1078 + //--------获取门店-----------
  1079 + await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + item.pickup_id, {
  1080 +
  1081 + }).then(res=>{
  1082 + pickup = res.data.data;
  1083 + })
1110 1084
1111 - var timestamp = ut.gettimestamp();  
1112 - if (good.on_time > timestamp) {  
1113 - err_text+= g_item['goods_name']+"还未上架\n";  
1114 - continue;  
1115 - }  
1116 - if (good.down_time > 0) {  
1117 - if (good.down_time < timestamp) {  
1118 - err_text+=g_item['goods_name']+"已经下架\n";  
1119 - continue;  
1120 - }  
1121 - } 1085 + //--------获取商品----------
  1086 + var goods_list=item.order_goods;
  1087 + //--- 返回的内容 ---
  1088 + var back_goods_arr=[];
  1089 + var err_text="";
  1090 + for(var i in goods_list){
  1091 + var g_item=goods_list[i];
  1092 + //--如果是赠品,不加入购物车--
  1093 + if(g_item['is_gift']) continue;
  1094 + if(g_item['prom_type']==4 ){
  1095 + err_text+= g_item['goods_name']+"积分购商品不加入购物车\n";
  1096 + continue;
  1097 + }
  1098 + if(g_item['prom_type']==5){
  1099 + err_text+= g_item['goods_name']+"搭配购商品不加入购物车\n";
  1100 + continue;
  1101 + }
  1102 + if(g_item['prom_type']==6 ){
  1103 + err_text+= g_item['goods_name']+"拼团商品不加入购物车\n";
  1104 + continue;
  1105 + }
1122 1106
1123 - //如果商品的配送方式和门店不匹配  
1124 - if(good['distr_type']>0 && pickup['distr_type']>0 && good['distr_type']!=pickup['distr_type'] ){  
1125 - err_text+= good['goods_name']+"配送方式不一致\n";  
1126 - continue;  
1127 - } 1107 + //--获取商品--
  1108 + var good=null;
  1109 + await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + g_item.goods_id, {
1128 1110
1129 - var prom=null;  
1130 - var b_item={}  
1131 - b_item.goods_id=g_item.goods_id;  
1132 - b_item.goods_name=g_item.goods_name;  
1133 - b_item.goods_num=g_item.goods_num;  
1134 - b_item.guide_id=g_item.guide_id;  
1135 - b_item.guide_type=g_item.guide_type;  
1136 - b_item.pickup_id=item.pickup_id;  
1137 - b_item.price=good.shop_price;  
1138 - b_item.goods_sn=good.goods_sn;  
1139 - b_item.sku=good.sku;  
1140 - b_item.is_integral_normal=g_item.is_integral_normal;  
1141 -  
1142 - //-- 如果会员是等级卡的时候,同时商品也有设置相应的卡价格 --  
1143 - var card_field=th.data.card_field;  
1144 - if(card_field && good[card_field]>0){  
1145 - b_item.price=good[card_field];  
1146 - } 1111 + }).then(res=>{
  1112 + good=res.data.data;
  1113 + })
1147 1114
1148 - //--判断商品当前的活动情况--  
1149 - switch(good.prom_type){  
1150 - //秒杀  
1151 - case 1:  
1152 - var flash=null;  
1153 - await getApp().request.promiseGet("/api/ms/flash_sale/get/" + os.stoid + "/" + good.prom_id, {  
1154 - }).then(res=>{  
1155 - if (res.data.code== 0) {  
1156 - flash=res.data.data;  
1157 - }  
1158 - })  
1159 - //----活动还没有结束-----  
1160 - if (flash && flash.is_end == 0 && flash.end_time>timestamp && flash.start_time<timestamp ) {  
1161 - prom=flash;  
1162 - b_item.price=prom.price; //  
1163 - }  
1164 - break;  
1165 -  
1166 - //拼团  
1167 - case 6:  
1168 - b_item.is_pd_normal=1;  
1169 - break;  
1170 - //组合购的再来一单  
1171 - case 7:  
1172 - //如果有组合购  
1173 - var url="/api/weshop/prom/zhbuy/get/"+os.stoid+"/"+good.prom_id+"/"+getApp().globalData.userInfo.user_id;  
1174 - await getApp().request.promiseGet(url, {}).then(res => {  
1175 - if(res.data.code==0 && res.data.data){  
1176 - if(res.data.data.is_show==1 && res.data.data.is_end==0  
1177 - && ut.gettimestamp()<res.data.data.end_time  
1178 - && ut.gettimestamp()>res.data.data.start_time  
1179 - ){  
1180 - b_item.prom_type=7;  
1181 - b_item.prom_id=res.data.data.id;  
1182 - }  
1183 - }  
1184 - })  
1185 - break;  
1186 - } 1115 + if(!good){
  1116 + err_text+= g_item['goods_name']+"未找到商品\n";
  1117 + continue;
  1118 + }
  1119 + if (good.is_on_sale != 1) {
  1120 + err_text+= g_item['goods_name']+"已经下架\n";
  1121 + continue;
  1122 + }
1187 1123
  1124 + var timestamp = ut.gettimestamp();
  1125 + if (good.on_time > timestamp) {
  1126 + err_text+= g_item['goods_name']+"还未上架\n";
  1127 + continue;
  1128 + }
  1129 + if (good.down_time > 0) {
  1130 + if (good.down_time < timestamp) {
  1131 + err_text+=g_item['goods_name']+"已经下架\n";
  1132 + continue;
  1133 + }
  1134 + }
1188 1135
1189 - //如果有优惠促销的时候,要看下商品的优惠活动有没有过期  
1190 - if(g_item.prom_type==3 || good.prom_type==3){  
1191 - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/1", {}).then(res => {  
1192 - if (res.data.code == 0) {  
1193 - var r_data = res.data.data;  
1194 - if (r_data.promGoodsLists) {  
1195 - b_item.prom_type=3;  
1196 - b_item.prom_id=r_data.promGoodsLists[0].prom_id;  
1197 - }  
1198 - }  
1199 - })  
1200 - } 1136 + //如果商品的配送方式和门店不匹配
  1137 + if(good['distr_type']>0 && pickup['distr_type']>0 && good['distr_type']!=pickup['distr_type'] ){
  1138 + err_text+= good['goods_name']+"配送方式不一致\n";
  1139 + continue;
  1140 + }
1201 1141
1202 - //判断是不是线下库存的购买, 是不是秒杀活动  
1203 - if(th.data.sales_rules==2 && !prom){  
1204 - //-- 看一下购物车上有多少商品 --  
1205 - var cart_num=0;  
1206 - await getApp().request.promiseGet("/api/weshop/cart/page", {  
1207 - data: {  
1208 - store_id: os.stoid,  
1209 - user_id: getApp().globalData.user_id,  
1210 - state:0, is_gift:0,  
1211 - goods_id:good.goods_id,  
1212 - pick_id: b_item.pickup_id  
1213 - }  
1214 - }).then(res=>{  
1215 - var num = 0;  
1216 - if(res.data.code==0 && res.data.data && res.data.data.pageData) {  
1217 - for (var i = 0; i < res.data.data.pageData.length; i++) {  
1218 - num += res.data.data.pageData[i].goods_num;  
1219 - }  
1220 - }  
1221 - cart_num=num;  
1222 - }) 1142 + var prom=null;
  1143 + var b_item={}
  1144 + b_item.goods_id=g_item.goods_id;
  1145 + b_item.goods_name=g_item.goods_name;
  1146 + b_item.goods_num=g_item.goods_num;
  1147 + b_item.guide_id=g_item.guide_id;
  1148 + b_item.guide_type=g_item.guide_type;
  1149 + b_item.pickup_id=item.pickup_id;
  1150 + b_item.price=good.shop_price;
  1151 + b_item.goods_sn=good.goods_sn;
  1152 + b_item.sku=good.sku;
  1153 + b_item.is_integral_normal=g_item.is_integral_normal;
  1154 +
  1155 + //-- 如果会员是等级卡的时候,同时商品也有设置相应的卡价格 --
  1156 + var card_field=th.data.card_field;
  1157 + if(card_field && good[card_field]>0){
  1158 + b_item.price=good[card_field];
  1159 + }
1223 1160
1224 - var lock=0,plist=null;  
1225 -  
1226 - if(b_item.prom_type!=7) {  
1227 - //先读取门店的lock,  
1228 - await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {  
1229 - data: {store_id: os.stoid, wareId: good.goods_id, storageId: b_item.pickup_id, pageSize: 1000}  
1230 - }).then(res => {  
1231 - if (res.data.code == 0 && res.data.data.total > 0) {  
1232 - for (var i in res.data.data.pageData)  
1233 - lock += res.data.data.pageData[i].outQty  
1234 - }  
1235 - })  
1236 - //---通过接口获取门店的线下库存信息--  
1237 - await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {  
1238 - data: {  
1239 - storageNos: pickup.pickup_no,  
1240 - wareIds: encodeURIComponent(good.erpwareid),  
1241 - storeId: os.stoid  
1242 - }  
1243 - }).then(res => {  
1244 - if (res.data.code == 0 && res.data.data.total > 0) {  
1245 - plist = res.data.data.pageData[0];  
1246 - }  
1247 - })  
1248 -  
1249 - if (!plist) {  
1250 - err_text += good['goods_name'] + "库存不足\n";  
1251 - continue;  
1252 - }  
1253 - if (plist.CanOutQty - lock <= 0) {  
1254 - err_text += good['goods_name'] + "库存不足\n";  
1255 - continue;  
1256 - }  
1257 - if (b_item.goods_num > (plist.CanOutQty - lock)) {  
1258 - b_item.goods_num = plist.CanOutQty - lock; 1161 + var url="/api/weshop/activitylist/getGoodActInfo";
  1162 + var req_data={
  1163 + store_id:g_item.store_id,goodsidlist:g_item.goods_id,is_detail:1
  1164 + };
  1165 + await getApp().request.promiseGet(url, {data:req_data}).then(res=>{
  1166 + if(res.data.code==0){
  1167 + var list = res.data.data;
  1168 + for(let i in list){
  1169 + let item=list[i];
  1170 + if(item.prom_type==1){ good.prom_type=1; good.prom_id=item.act_id; }
1259 } 1171 }
1260 } 1172 }
1261 - var req_data={  
1262 - store_id: os.stoid,  
1263 - user_id: getApp().globalData.user_id,  
1264 - goods_id: good.goods_id,  
1265 - }; 1173 + })
1266 1174
1267 - if(b_item.prom_type==7){  
1268 - req_data.prom_type=7;  
1269 - req_data.prom_id=b_item.prom_id;  
1270 - }  
1271 1175
  1176 + if(!prom) {
  1177 + //--判断商品当前的活动情况--
  1178 + switch (good.prom_type) {
  1179 + case 1:
  1180 + var flash = null;
  1181 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + good.prom_id, {}).then(res => {
  1182 + if (res.data.code == 0) {
  1183 + flash = res.data.data;
  1184 + }
  1185 + })
  1186 + //----已经结束-----
  1187 + if (flash && flash.is_end == 0 && flash.end_time > timestamp && flash.start_time < timestamp) {
  1188 + prom = flash;
  1189 + prom.price = prom.user_price;
  1190 + b_item.price = prom.user_price;
  1191 + }
  1192 + break;
  1193 + case 6:
  1194 + b_item.is_pd_normal = 1;
  1195 + break;
  1196 + case 7:
  1197 + //如果有组合购
  1198 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + good.prom_id + "/" + getApp().globalData.userInfo.user_id;
  1199 + await getApp().request.promiseGet(url, {}).then(res => {
  1200 + if (res.data.code == 0 && res.data.data) {
  1201 + if (res.data.data.is_show == 1 && res.data.data.is_end == 0
  1202 + && ut.gettimestamp() < res.data.data.end_time
  1203 + && ut.gettimestamp() > res.data.data.start_time
  1204 + ) {
  1205 + b_item.prom_type = 7;
  1206 + b_item.prom_id = res.data.data.id;
  1207 + good.prom_type = 7;
  1208 + good.prom_id = b_item.prom_id;
1272 1209
1273 - var buynum=0;  
1274 - var promnum=0;  
1275 - //---要获得商品,该用户买了多少件,同步应用---  
1276 - await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {  
1277 - data: req_data,  
1278 - }).then(res => {  
1279 - if(res.data.code==0){  
1280 - var buy_num_data = res.data.data;  
1281 - buynum = buy_num_data.goodsbuynum;  
1282 - if(buy_num_data.promgoodsbuynum){  
1283 - promnum=buy_num_data.promgoodsbuynum;  
1284 - }  
1285 - }  
1286 - }) 1210 + }
  1211 + }
  1212 + })
  1213 + break;
  1214 + }
  1215 + }
1287 1216
1288 - //---- 要计算商品的限购 -----  
1289 - if(good['viplimited']>0){  
1290 - if(cart_num+buynum>good['viplimited']){  
1291 - err_text+= good['goods_name']+"超出限购\n";  
1292 - continue;  
1293 - }  
1294 - good['viplimited']-=(cart_num+buynum);  
1295 - if(b_item.goods_num>good['viplimited']){  
1296 - b_item.goods_num=good['viplimited'];  
1297 - }  
1298 - }  
1299 - //不算组合购的限购  
1300 - back_goods_arr.push(b_item); //返回商品元素 1217 + //如果有优惠促销的时候,要看下商品的优惠活动有没有过期
  1218 + if(g_item.prom_type==3 || good.prom_type==3){
  1219 + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/1", {}).then(res => {
  1220 + if (res.data.code == 0) {
  1221 + var r_data = res.data.data;
  1222 + if (r_data.promGoodsLists) {
  1223 + b_item.prom_type=3;
  1224 + b_item.prom_id=r_data.promGoodsLists[0].prom_id;
  1225 + }
  1226 + }
  1227 + })
  1228 + }
1301 1229
1302 - }else{  
1303 1230
1304 - //-- 看一下购物车上有多少商品 --  
1305 - var cart_num=0;  
1306 - await getApp().request.promiseGet("/api/weshop/cart/page", {  
1307 - data: {  
1308 - store_id: os.stoid,  
1309 - user_id: getApp().globalData.user_id,  
1310 - state:0, is_gift:0,  
1311 - goods_id:good.goods_id  
1312 - }  
1313 - }).then(res=>{  
1314 - var num = 0;  
1315 - if(res.data.code==0 && res.data.data && res.data.data.pageData) {  
1316 - for (var i = 0; i < res.data.data.pageData.length; i++) {  
1317 - num += res.data.data.pageData[i].goods_num;  
1318 - }  
1319 - }  
1320 - cart_num=num;  
1321 - }) 1231 + //判断是不是线下库存的购买, 是不是秒杀活动
  1232 + if(th.data.sales_rules==2 && !prom){
  1233 +
  1234 + //-- 看一下购物车上有多少商品 --
  1235 + var cart_num=0;
  1236 + await getApp().request.promiseGet("/api/weshop/cart/page", {
  1237 + data: {
  1238 + store_id: os.stoid,
  1239 + user_id: getApp().globalData.user_id,
  1240 + state:0, is_gift:0,
  1241 + goods_id:good.goods_id,
  1242 + pick_id: b_item.pickup_id
  1243 + }
  1244 + }).then(res=>{
  1245 + var num = 0;
  1246 + if(res.data.code==0 && res.data.data && res.data.data.pageData) {
  1247 + for (var i = 0; i < res.data.data.pageData.length; i++) {
  1248 + num += res.data.data.pageData[i].goods_num;
  1249 + }
  1250 + }
  1251 + cart_num=num;
  1252 + })
1322 1253
  1254 + var lock=0,plist=null;
1323 1255
1324 - if(good.store_count<=0){  
1325 - err_text+= good['goods_name']+"库存不足\n";  
1326 - continue;  
1327 - }  
1328 - if(b_item.goods_num>good.store_count)  
1329 - b_item.goods_num=good.store_count;  
1330 -  
1331 - var buynum=0; //商品已经购买多少件  
1332 - var promgoodsbuynum=0; //活动已经购买多少件  
1333 - var redis_num = 0; //redis库存  
1334 -  
1335 - var req_data={  
1336 - store_id: os.stoid,  
1337 - user_id: getApp().globalData.user_id,  
1338 - goods_id: good.goods_id,  
1339 - };  
1340 -  
1341 - if(prom){  
1342 - req_data.prom_type= good.prom_type;  
1343 - req_data.prom_id= good.prom_id;  
1344 - b_item.prom_type=good.prom_type;  
1345 - b_item.prom_id=good.prom_id;  
1346 - //------判断活动是否抢光-----  
1347 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +  
1348 - os.stoid + "/" + good.prom_type + "/" + good.prom_id, {  
1349 - 1: 1  
1350 - }).then(res => {  
1351 - redis_num = res.data.data;  
1352 - });  
1353 - if(redis_num<=0){  
1354 - err_text+= good['goods_name']+"活动不足\n";  
1355 - continue;  
1356 - } 1256 + if(b_item.prom_type!=7) {
  1257 + //先读取门店的lock,
  1258 + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
  1259 + data: {store_id: os.stoid, wareId: good.goods_id, storageId: b_item.pickup_id, pageSize: 1000}
  1260 + }).then(res => {
  1261 + if (res.data.code == 0 && res.data.data.total > 0) {
  1262 + for (var i in res.data.data.pageData)
  1263 + lock += res.data.data.pageData[i].outQty
  1264 + }
  1265 + })
1357 1266
1358 - }  
1359 -  
1360 - //---要获得商品,该用户买了多少件,同步应用---  
1361 - await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {  
1362 - data: req_data,  
1363 - }).then(res => {  
1364 - if(res.data.code==0){  
1365 - var buy_num_data = res.data.data;  
1366 - if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum;  
1367 - buynum = buy_num_data.goodsbuynum;  
1368 - }  
1369 - })  
1370 -  
1371 - //---- 要计算商品的限购 -----  
1372 - if(good['viplimited']>0){  
1373 - if(cart_num+buynum>good['viplimited']){  
1374 - err_text+= good['goods_name']+"超出限购\n";  
1375 - continue;  
1376 - }  
1377 - good['viplimited']-=(cart_num+buynum);  
1378 - if(b_item.goods_num>good['viplimited']){  
1379 - b_item.goods_num=good['viplimited'];  
1380 - } 1267 + //---通过接口获取门店的线下库存信息--
  1268 + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {
  1269 + data: {
  1270 + storageNos: pickup.pickup_no,
  1271 + wareIds: encodeURIComponent(good.erpwareid),
  1272 + storeId: os.stoid
  1273 + }
  1274 + }).then(res => {
  1275 + if (res.data.code == 0 && res.data.data.total > 0) {
  1276 + plist = res.data.data.pageData[0];
  1277 + }
  1278 + })
1381 1279
1382 - } 1280 + if (!plist) {
  1281 + err_text += good['goods_name'] + "库存不足\n";
  1282 + continue;
  1283 + }
  1284 + if (plist.CanOutQty - lock <= 0) {
  1285 + err_text += good['goods_name'] + "库存不足\n";
  1286 + continue;
  1287 + }
  1288 + if (b_item.goods_num > (plist.CanOutQty - lock)) {
  1289 + b_item.goods_num = plist.CanOutQty - lock;
  1290 + }
  1291 + }
  1292 + var req_data={
  1293 + store_id: os.stoid,
  1294 + user_id: getApp().globalData.user_id,
  1295 + goods_id: good.goods_id,
  1296 + };
  1297 + if(b_item.prom_type==7){
  1298 + req_data.prom_type=7;
  1299 + req_data.prom_id=b_item.prom_id;
  1300 + }
1383 1301
1384 - //-- 判断活动的库存 --  
1385 - if(prom){  
1386 - if(prom['goods_num']<=prom['buy_num']){  
1387 - err_text+= good['goods_name']+"超出活动库存\n";continue;  
1388 - } 1302 + var buynum=0;
  1303 + var promnum=0;
  1304 + //---要获得商品,该用户买了多少件,同步应用---
  1305 + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
  1306 + data: req_data,
  1307 + }).then(res => {
  1308 + if(res.data.code==0){
  1309 + var buy_num_data = res.data.data;
  1310 + buynum = buy_num_data.goodsbuynum;
  1311 + if(buy_num_data.promgoodsbuynum){
  1312 + promnum=buy_num_data.promgoodsbuynum;
  1313 + }
  1314 + }
  1315 + })
1389 1316
1390 - if(b_item.goods_num>prom['goods_num']-prom['buy_num']){  
1391 - b_item['goods_num']= b_item['goods_num']-b_item['buy_num'];  
1392 - } 1317 + //---- 要计算商品的限购 -----
  1318 + if(good['viplimited']>0){
  1319 + if(cart_num+buynum>good['viplimited']){
  1320 + err_text+= good['goods_name']+"超出限购\n";
  1321 + continue;
  1322 + }
  1323 + good['viplimited']-=(cart_num+buynum);
  1324 + if(b_item.goods_num>good['viplimited']){
  1325 + b_item.goods_num=good['viplimited'];
  1326 + }
  1327 + }
  1328 + //不需要计算组合购的限购
1393 1329
1394 - if(b_item.goods_num>redis_num){  
1395 - b_item.goods_num=redis_num;  
1396 - } 1330 + back_goods_arr.push(b_item); //返回商品元素
1397 1331
1398 - if(cart_num+buynum>prom['buy_limit']){  
1399 - err_text+= good['goods_name']+"超出活动限购\n";continue;  
1400 - }  
1401 - prom['buy_limit'] -= (cart_num+buynum);  
1402 - if(b_item.goods_num>prom['buy_limit']){  
1403 - b_item.goods_num=prom['buy_limit'];  
1404 - } 1332 + }else{
1405 1333
1406 - }  
1407 - back_goods_arr.push(b_item); //返回商品元素  
1408 - }  
1409 - }  
1410 -  
1411 - //有重新购买的数据是时候,就要重新生成订单  
1412 - if(back_goods_arr.length>0){  
1413 - th.setData({back_goods_arr:back_goods_arr});  
1414 - if(!err_text){  
1415 - th.more_add_cart();  
1416 - }else{  
1417 - // 如果没有获取用户信息  
1418 - wx.showModal({  
1419 - title:'确定',  
1420 - content: err_text+',确定要买其他商品码?',  
1421 - success(res) {  
1422 - if (res.confirm) {  
1423 - //跳转到登录页  
1424 - th.more_add_cart();  
1425 - }else{  
1426 - wx.hideLoading(); 1334 + //-- 看一下购物车上有多少商品 --
  1335 + var cart_num=0;
  1336 + await getApp().request.promiseGet("/api/weshop/cart/page", {
  1337 + data: {
  1338 + store_id: os.stoid,
  1339 + user_id: getApp().globalData.user_id,
  1340 + state:0, is_gift:0,
  1341 + goods_id:good.goods_id
  1342 + }
  1343 + }).then(res=>{
  1344 + var num = 0;
  1345 + if(res.data.code==0 && res.data.data && res.data.data.pageData) {
  1346 + for (var i = 0; i < res.data.data.pageData.length; i++) {
  1347 + num += res.data.data.pageData[i].goods_num;
  1348 + }
  1349 + }
  1350 + cart_num=num;
  1351 + })
  1352 +
  1353 +
  1354 + if(good.store_count<=0){
  1355 + err_text+= good['goods_name']+"库存不足\n";
  1356 + continue;
  1357 + }
  1358 + if(b_item.goods_num>good.store_count)
  1359 + b_item.goods_num=good.store_count;
  1360 +
  1361 + var buynum=0; //商品已经购买多少件
  1362 + var promgoodsbuynum=0; //活动已经购买多少件
  1363 + var redis_num = 0; //redis库存
  1364 +
  1365 + var req_data={
  1366 + store_id: os.stoid,
  1367 + user_id: getApp().globalData.user_id,
  1368 + goods_id: good.goods_id,
  1369 + };
  1370 +
  1371 + if(prom){
  1372 + req_data.prom_type= good.prom_type;
  1373 + req_data.prom_id= good.prom_id;
  1374 + b_item.prom_type=good.prom_type;
  1375 + b_item.prom_id=good.prom_id;
  1376 +
  1377 + //------判断活动是否抢光-----
  1378 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  1379 + os.stoid + "/" + good.prom_type + "/" + good.prom_id, {
  1380 + 1: 1
  1381 + }).then(res => {
  1382 + redis_num = res.data.data;
  1383 + });
  1384 + if(redis_num<=0){
  1385 + err_text+= good['goods_name']+"活动不足\n";
  1386 + continue;
  1387 + }
  1388 +
  1389 + }
  1390 +
  1391 + //---要获得商品,该用户买了多少件,同步应用---
  1392 + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
  1393 + data: req_data,
  1394 + }).then(res => {
  1395 + if(res.data.code==0){
  1396 + var buy_num_data = res.data.data;
  1397 + if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum;
  1398 + buynum = buy_num_data.goodsbuynum;
  1399 + }
  1400 + })
  1401 +
  1402 + //---- 要计算商品的限购 -----
  1403 + if(good['viplimited']>0){
  1404 + if(cart_num+buynum>good['viplimited']){
  1405 + err_text+= good['goods_name']+"超出限购\n";
  1406 + continue;
  1407 + }
  1408 + good['viplimited']-=(cart_num+buynum);
  1409 + if(b_item.goods_num>good['viplimited']){
  1410 + b_item.goods_num=good['viplimited'];
  1411 + }
  1412 +
  1413 + }
  1414 +
  1415 + //-- 判断活动的库存 --
  1416 + if(prom) {
  1417 + if (prom['goods_num'] <= prom['buy_num']) {
  1418 + err_text += good['goods_name'] + "超出活动库存\n";
  1419 + continue;
  1420 + }
  1421 +
  1422 + if (b_item.goods_num > prom['goods_num'] - prom['buy_num']) {
  1423 + b_item['goods_num'] = b_item['goods_num'] - b_item['buy_num'];
  1424 + }
  1425 +
  1426 + if (b_item.goods_num > redis_num) {
  1427 + b_item.goods_num = redis_num;
  1428 + }
  1429 +
  1430 + if (prom['buy_limit'] > 0) {
  1431 + if (cart_num + buynum > prom['buy_limit']) {
  1432 + err_text += good['goods_name'] + "超出活动限购\n";
  1433 + continue;
  1434 + }
  1435 + prom['buy_limit'] -= (cart_num + buynum);
  1436 + if (b_item.goods_num > prom['buy_limit']) {
  1437 + b_item.goods_num = prom['buy_limit'];
  1438 + }
  1439 + }
  1440 + }
  1441 +
  1442 +
  1443 + back_goods_arr.push(b_item); //返回商品元素
  1444 + }
  1445 + }
  1446 +
  1447 + //有重新购买的数据是时候,就要重新生成订单
  1448 + if(back_goods_arr.length>0){
  1449 + th.setData({back_goods_arr:back_goods_arr});
  1450 + if(!err_text){
  1451 + th.more_add_cart();
  1452 + }else{
  1453 + wx.hideLoading();
  1454 + // 如果没有获取用户信息
  1455 + wx.showModal({
  1456 + title:'确定',
  1457 + content: err_text+',确定要买其他商品码?',
  1458 + success(res) {
  1459 + if (res.confirm) {
  1460 + //跳转到登录页
  1461 + th.more_add_cart();
  1462 + }else{
  1463 + th.data.moring=0;
  1464 + wx.hideLoading();
  1465 + }
  1466 + },fail(){
1427 th.data.moring=0; 1467 th.data.moring=0;
  1468 + wx.hideLoading();
1428 } 1469 }
1429 - },  
1430 - fail: function (res) {  
1431 - wx.hideLoading();  
1432 - th.data.moring=0;  
1433 - },//接口调用失败的回调函数  
1434 - });  
1435 -  
1436 - }  
1437 - }else{  
1438 - wx.hideLoading();  
1439 - this.data.moring=0;  
1440 - getApp().confirmBox(err_text);  
1441 - }  
1442 - }, 1470 + });
  1471 +
  1472 + }
  1473 + }else{
  1474 + th.data.moring=0;
  1475 + wx.hideLoading();
  1476 + getApp().confirmBox(err_text);
  1477 + }
  1478 + },
1443 1479
1444 more_add_cart:async function(){ 1480 more_add_cart:async function(){
1445 var back_goods_arr=this.data.back_goods_arr; 1481 var back_goods_arr=this.data.back_goods_arr;
pages/user/order_list/order_list.wxml
@@ -241,7 +241,10 @@ @@ -241,7 +241,10 @@
241 <view class="offline-container" wx:else> 241 <view class="offline-container" wx:else>
242 <view class="offline-list"> 242 <view class="offline-list">
243 <view class="item" wx:for="{{list2}}"> 243 <view class="item" wx:for="{{list2}}">
244 - <view class="title"><text class="iconfont icon-order"></text>单号:{{item.No}}</view> 244 + <view class="title">
  245 + <view><text class="iconfont icon-order"></text>单号:{{item.No}}</view>
  246 + <view>{{item.states}}</view>
  247 + </view>
245 <view class="subtitle"> 248 <view class="subtitle">
246 <text>{{item.BillDate}}</text> 249 <text>{{item.BillDate}}</text>
247 <view>消费总额:<text class="co-red fs28">¥{{item.Sum}}</text></view> 250 <view>消费总额:<text class="co-red fs28">¥{{item.Sum}}</text></view>
pages/user/order_list/order_list.wxss
@@ -566,6 +566,7 @@ page { @@ -566,6 +566,7 @@ page {
566 padding: 20rpx; 566 padding: 20rpx;
567 font-size: 26rpx; 567 font-size: 26rpx;
568 display: flex; 568 display: flex;
  569 + justify-content: space-between;
569 align-items: center; 570 align-items: center;
570 } 571 }
571 .icon-order { 572 .icon-order {