Commit ce2775e46a5a0a54d0339a22e3d816f541f39e9b
1 parent
47261ef5
购物车bug 多门店问题修复
Showing
1 changed file
with
5 additions
and
4 deletions
pages/cart/cart/cart.js
... | ... | @@ -301,11 +301,12 @@ Page({ |
301 | 301 | //如果秒杀活动都去掉了,或者结束了,那么这个商品也没有必要留着 |
302 | 302 | if (item.prom_type == 1) { |
303 | 303 | var prom = null; |
304 | + var now = ut.gettimestamp(); | |
304 | 305 | await getApp().request.promiseGet("/api/ms/flash_sale/get/" + os.stoid + "/" + item.prom_id, {}).then(res => { |
305 | 306 | if (res.data.code == 0) prom = res.data.data; |
306 | 307 | }) |
307 | - //---如果有活动,不算在一起--- | |
308 | - if (!prom && prom.is_end == 0 && prom.end_time > now && prom.start_time < now) { | |
308 | + //---如果互动都已经过期,或者还未开始,或者无活动 | |
309 | + if (!prom || prom.is_end == 1 || prom.end_time < now || prom.start_time > now) { | |
309 | 310 | var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; |
310 | 311 | a.delete(url, { |
311 | 312 | success: function (t) { |
... | ... | @@ -513,9 +514,9 @@ Page({ |
513 | 514 | } |
514 | 515 | }else{ |
515 | 516 | //-- 此时要实时更新线下取价价格 -- |
516 | - for(var i=0;i<arr.length;i++){ | |
517 | + for(var ij in arr){ | |
517 | 518 | //每个门店都去看下线下取价 |
518 | - var list=arr[i]; | |
519 | + var list=arr[ij]; | |
519 | 520 | for(var i in list.goods){ |
520 | 521 | list.goods[i].offline_price=0 |
521 | 522 | } | ... | ... |