Commit a2b4bec6c3fe02affa91b94c9d4dad28ddd29739

Authored by yvan.ni
1 parent 2dbb9868

优惠促销多活动的优化

packageE/pages/cart/cart2/cart2.js
... ... @@ -2178,7 +2178,7 @@ Page({
2178 2178 var cart_item = c_arr[i]; //就是每一单的意思
2179 2179 var pickid = cart_item.pickup_id;
2180 2180 var o_price = 0;
2181   - var o_price_no_zh = 0; //参与订单优惠叠加--组合购的金额汇总
  2181 + var o_price_no_zh = 0; //参与订单优惠累积的金额
2182 2182 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
2183 2183 var item = c_arr[i].goods; //就是每一单的从表的意思
2184 2184  
... ... @@ -2243,12 +2243,12 @@ Page({
2243 2243 var is_no_zh = 0;
2244 2244 if (item[jc].prom_type != 7 && item[jc].prom_type != 10) is_no_zh = 1;
2245 2245  
2246   - //组合购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加
  2246 + //组合购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加,就要累积组合购的金额
2247 2247 if (item[jc].prom_type == 7 && th.data.zhhe_act_map && th.data.zhhe_act_map[item[jc].prom_id]
2248 2248 && th.data.zhhe_act_map[item[jc].prom_id].is_orderyh) {
2249 2249 is_no_zh = 1;
2250 2250 }
2251   - //阶梯购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加
  2251 + //阶梯购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加,就要累积阶梯促销的金额
2252 2252 if (item[jc].prom_type == 10 && ladder_prom_goods && ladder_prom_goods[item[jc].prom_id]
2253 2253 && th.data.ladder_map[item[jc].prom_id].is_useorderyh) {
2254 2254 is_no_zh = 1;
... ... @@ -2263,13 +2263,17 @@ Page({
2263 2263  
2264 2264 //--- 秒杀, 团购的时候,判断有没有订单优惠和包邮模板的叠加 ---
2265 2265 if( [1,2,3,6].indexOf(item[jc].prom_type)>-1){
  2266 +
  2267 + var gd_price=item[jc].goods_price;
  2268 + if(item[jc].account_fir) gd_price=item[jc].account_fir;
  2269 +
2266 2270 if(!item[jc].is_order_yh && !item[jc].whsle_id){
2267   - no_order_yh+=item[jc].goods_price * item[jc].goods_num;
  2271 + no_order_yh+=gd_price * item[jc].goods_num;
2268 2272 if(item[jc].quan_num) no_order_yh-=item[jc].quan_num; //券要把他补回去
2269 2273  
2270 2274 }
2271 2275 if(!item[jc].is_post_temp){
2272   - no_post_temp+=item[jc].goods_price * item[jc].goods_num;
  2276 + no_post_temp+=gd_price * item[jc].goods_num;
2273 2277 if(item[jc].quan_num) no_post_temp-=item[jc].quan_num; //券要把他补回去
2274 2278 }
2275 2279 }
... ...