From a2b4bec6c3fe02affa91b94c9d4dad28ddd29739 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Wed, 12 Apr 2023 14:28:29 +0800 Subject: [PATCH] 优惠促销多活动的优化 --- packageE/pages/cart/cart2/cart2.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index 4a0f264..1889b9b 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -2178,7 +2178,7 @@ Page({ var cart_item = c_arr[i]; //就是每一单的意思 var pickid = cart_item.pickup_id; var o_price = 0; - var o_price_no_zh = 0; //参与订单优惠叠加--组合购的金额汇总 + var o_price_no_zh = 0; //参与订单优惠累积的金额 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; var item = c_arr[i].goods; //就是每一单的从表的意思 @@ -2243,12 +2243,12 @@ Page({ var is_no_zh = 0; if (item[jc].prom_type != 7 && item[jc].prom_type != 10) is_no_zh = 1; - //组合购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加 + //组合购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加,就要累积组合购的金额 if (item[jc].prom_type == 7 && th.data.zhhe_act_map && th.data.zhhe_act_map[item[jc].prom_id] && th.data.zhhe_act_map[item[jc].prom_id].is_orderyh) { is_no_zh = 1; } - //阶梯购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加 + //阶梯购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加,就要累积阶梯促销的金额 if (item[jc].prom_type == 10 && ladder_prom_goods && ladder_prom_goods[item[jc].prom_id] && th.data.ladder_map[item[jc].prom_id].is_useorderyh) { is_no_zh = 1; @@ -2263,13 +2263,17 @@ Page({ //--- 秒杀, 团购的时候,判断有没有订单优惠和包邮模板的叠加 --- if( [1,2,3,6].indexOf(item[jc].prom_type)>-1){ + + var gd_price=item[jc].goods_price; + if(item[jc].account_fir) gd_price=item[jc].account_fir; + if(!item[jc].is_order_yh && !item[jc].whsle_id){ - no_order_yh+=item[jc].goods_price * item[jc].goods_num; + no_order_yh+=gd_price * item[jc].goods_num; if(item[jc].quan_num) no_order_yh-=item[jc].quan_num; //券要把他补回去 } if(!item[jc].is_post_temp){ - no_post_temp+=item[jc].goods_price * item[jc].goods_num; + no_post_temp+=gd_price * item[jc].goods_num; if(item[jc].quan_num) no_post_temp-=item[jc].quan_num; //券要把他补回去 } } -- libgit2 0.21.4