Commit 14af7dd86619484691ad18d80d2c33b2c7a8d991
1 parent
55d2a0bb
秒杀自定义模板bug优化,id空掉了
Showing
1 changed file
with
6 additions
and
3 deletions
components/diy_seckill/diy_seckill.js
... | ... | @@ -113,6 +113,11 @@ Component({ |
113 | 113 | |
114 | 114 | //就算是添加的活动已经过期,就要用最新的活动 |
115 | 115 | set_goods_list(g_id, goodslist) { |
116 | + | |
117 | + goodslist.forEach(function (vy, indy) { | |
118 | + if(!vy.id) vy.id=vy.prom_id; | |
119 | + }) | |
120 | + | |
116 | 121 | // 判断火热,预热 |
117 | 122 | var newTime = ut.gettimestamp(), all_array = [], th = this; |
118 | 123 | th.setData({ newTime: newTime }); |
... | ... | @@ -121,16 +126,14 @@ Component({ |
121 | 126 | g_id.forEach(function (val, ind) { |
122 | 127 | goodslist.forEach(function (vy, indy) { |
123 | 128 | if (val.goodsid == vy.goods_id) { |
124 | - if(!vy.id) vy.id=vy.prom_id; | |
125 | 129 | all_array.push(vy); |
126 | 130 | } |
127 | 131 | }) |
128 | 132 | }) |
129 | 133 | } else { |
130 | - all_array = goodslist; | |
134 | + all_array = goodslist; | |
131 | 135 | } |
132 | 136 | |
133 | - | |
134 | 137 | if (all_array.length == 0) { |
135 | 138 | all_array = goodslist; |
136 | 139 | } | ... | ... |