Commit d96fb29f1228384719b282cf6bb550f181fc9150
1 parent
ccf9590f
fix:修改购物车库存
Showing
2 changed files
with
10 additions
and
9 deletions
components/diy_seckill/diy_seckill.js
| @@ -182,13 +182,22 @@ Component({ | @@ -182,13 +182,22 @@ Component({ | ||
| 182 | 182 | ||
| 183 | 183 | ||
| 184 | Promise.all(promisies).then(() => { | 184 | Promise.all(promisies).then(() => { |
| 185 | + | ||
| 186 | + // 判断活动是否结束 | ||
| 187 | + for(let i in all_array){ | ||
| 188 | + let item=all_array[i]; | ||
| 189 | + if(newTime > item.end_time) { | ||
| 190 | + all_array[i].status = 3; | ||
| 191 | + }; | ||
| 192 | + | ||
| 193 | + } | ||
| 194 | + | ||
| 185 | var arr = new Array(); | 195 | var arr = new Array(); |
| 186 | //--三个三个一组--- | 196 | //--三个三个一组--- |
| 187 | for (var i = 0; i < all_array.length; i += 3) { | 197 | for (var i = 0; i < all_array.length; i += 3) { |
| 188 | arr.push(all_array.slice(i, i + 3)); | 198 | arr.push(all_array.slice(i, i + 3)); |
| 189 | } | 199 | } |
| 190 | /*--熏染到前台--*/ | 200 | /*--熏染到前台--*/ |
| 191 | - | ||
| 192 | th.setData({ goods_array: arr }); | 201 | th.setData({ goods_array: arr }); |
| 193 | }); | 202 | }); |
| 194 | 203 |
packageA/pages/goodsInfo/goodsInfo.js
| @@ -932,14 +932,6 @@ Page({ | @@ -932,14 +932,6 @@ Page({ | ||
| 932 | // 已经付款的单数 | 932 | // 已经付款的单数 |
| 933 | var gd_buy_num = th.data.sele_g.buy_num; | 933 | var gd_buy_num = th.data.sele_g.buy_num; |
| 934 | 934 | ||
| 935 | - // 是否超出活动库存 | ||
| 936 | - if (t + gd_buy_num > redisNum) { | ||
| 937 | - wx.showModal({ | ||
| 938 | - title: '超出活动库存', | ||
| 939 | - }); | ||
| 940 | - return false; | ||
| 941 | - } | ||
| 942 | - | ||
| 943 | // 是否开启个人限购 | 935 | // 是否开启个人限购 |
| 944 | if (th.data.sele_g.viplimited > 0) { | 936 | if (th.data.sele_g.viplimited > 0) { |
| 945 | 937 |