Commit d020062eee3c64d3c897d218f008ea27b3b50f2c

Authored by 后端研发-苏泰源
1 parent 9b4163f9

自定义秒杀 服务卡修改

components/diy_seckill/diy_seckill.js
@@ -153,9 +153,13 @@ Component({ @@ -153,9 +153,13 @@ Component({
153 for(let i in all_array){ 153 for(let i in all_array){
154 let item=all_array[i]; 154 let item=all_array[i];
155 if(item.user_price) item.price=item.user_price; 155 if(item.user_price) item.price=item.user_price;
156 - if(item.start_time > newTime) { 156 + if(item.start_time > newTime) { //活动即将开始
157 item.status = 0; 157 item.status = 0;
158 - } else if(item.end_time > newTime) { 158 + } else if(item.end_time >= newTime) {
  159 + item.status = 3;
  160 + };
  161 +
  162 + if(item.start_time < newTime && item.goods_num > item.buy_num) {
159 item.status = 1; 163 item.status = 1;
160 }; 164 };
161 165
components/diy_seckill/diy_seckill.wxml
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <view class='one'> 20 <view class='one'>
21 <view class='sp_top'> 21 <view class='sp_top'>
22 <view class='po'></view> 22 <view class='po'></view>
23 - <block wx:if="{{aitem.start_time>newTime}}"> 23 + <block wx:if="{{aitem.status == 0}}">
24 <view class="rob" style="justify-content: flex-start"> 24 <view class="rob" style="justify-content: flex-start">
25 <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span> 25 <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span>
26 </view> 26 </view>
@@ -44,11 +44,7 @@ @@ -44,11 +44,7 @@
44 </block> 44 </block>
45 </block> --> 45 </block> -->
46 46
47 - <block wx:if="{{aitem.status == 0}}">  
48 - <view class="rob" style="justify-content: flex-start">  
49 - <span class='s_top_kill gray'>活动已结束</span>  
50 - </view>  
51 - </block> 47 +
52 <block wx:if="{{aitem.status == 1}}"> 48 <block wx:if="{{aitem.status == 1}}">
53 <view class="rob" style="justify-content: flex-start"> 49 <view class="rob" style="justify-content: flex-start">
54 <span class='s_top_kill'>火热进行</span> 50 <span class='s_top_kill'>火热进行</span>
@@ -58,7 +54,12 @@ @@ -58,7 +54,12 @@
58 <view class="rob" style="justify-content: flex-start"> 54 <view class="rob" style="justify-content: flex-start">
59 <span class='s_top_kill gray'>已抢光</span> 55 <span class='s_top_kill gray'>已抢光</span>
60 </view> 56 </view>
61 - </block> 57 + </block>
  58 + <block wx:if="{{aitem.status == 3}}">
  59 + <view class="rob" style="justify-content: flex-start">
  60 + <span class='s_top_kill gray'>活动已结束</span>
  61 + </view>
  62 + </block>
62 63
63 64
64 65