Commit f36f36af04d8ab5a39976595027a212aa09f00a5

Authored by yvan.ni
1 parent e9abcab2

优惠促销取价的优化

packageE/pages/cart/cart2/cart2.js
... ... @@ -1384,8 +1384,11 @@ Page({
1384 1384 }
1385 1385  
1386 1386 }else{
1387   - item1.prom_id = arr[k].show_can_cx[key_o].cur_act.prom_id;
1388   - item1.prom_type = arr[k].show_can_cx[key_o].cur_act.prom_type;
  1387 + //不是优惠促销的不参与 不是订单促销参与(订单促销不是实收价的时候)
  1388 + if( !(arr[k].show_can_cx.no_cj_prom && arr[k].show_can_cx.cur_act.prom_type==3) && !th.data.can_use_ord_prom[arr[k].pick_id]){
  1389 + item1.prom_id = arr[k].show_can_cx[key_o].cur_act.prom_id;
  1390 + item1.prom_type = arr[k].show_can_cx[key_o].cur_act.prom_type;
  1391 + }
1389 1392 }
1390 1393 }
1391 1394 }
... ... @@ -8898,6 +8901,19 @@ Page({
8898 8901 })
8899 8902 //清空优惠促销的内容
8900 8903 this.data.prom_goods_map = {};
  8904 +
  8905 + //处理一下商品
  8906 + let goods0 = JSON.parse(JSON.stringify(this.data.cartlist_y));
  8907 + let goods = [];
  8908 + for (var ik = 0; ik < goods0.length; ik++) {
  8909 + var item_c = goods0[ik];
  8910 + if(item_c.pick_id == pickid && item_c.is_collocation) continue;
  8911 + if(item_c.is_gift) continue
  8912 + goods.push(item_c);
  8913 + }
  8914 +
  8915 + //原始数据要有深拷贝不能有地址的牵连
  8916 + this.data.cartlist_y = JSON.parse(JSON.stringify(goods))
8901 8917 //-- 重新计算一下价格 --
8902 8918 this.get_cart_next(null, 1, {prom_type: 0, prom_id: 0});
8903 8919 }
... ...