From 5ed417589ff783cc95a0134e5b379fef86fb332b Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Wed, 6 Dec 2023 14:05:56 +0800 Subject: [PATCH] 取价方式的优化 --- packageE/pages/cart/cart2/cart2.js | 30 +++++++++++++++++++++++++++--- packageE/pages/cart/cart2/cart2.wxml | 181 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------- 2 files changed, 125 insertions(+), 86 deletions(-) diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index 19dd45c..3317088 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -6811,7 +6811,19 @@ Page({ if (fid > -1) return false; } - ob.price += item.goods_price * item.goods_num; + //优惠促销取价的优化 + let f_price=item.goods_price; + if(ob.discount_field!=undefined){ + switch (ob.discount_field){ + case 0: f_price=item.goods_price;break; + case 1: f_price=item.shop_price;break; + case 2: f_price=item.market_price;break; + } + } + + item.goods_price=f_price; + + ob.price += f_price * item.goods_num; ob.goods_num += item.goods_num; ob.goods.push({ goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num }); @@ -6858,10 +6870,12 @@ Page({ switch (prom.discount_field){ case 0: f_price=item.goods_price;break; case 1: f_price=item.shop_price;break; - case 2: f_price=item.market_price;break; + case 2: f_price=item.goods_market_price;break; } } + item.goods_price=f_price; + ob.price = f_price * item.goods_num; ob.goods_num = item.goods_num; ob.is_bz = prom.is_bz; @@ -6869,6 +6883,7 @@ Page({ ob.is_xz_yh = prom.is_xz_yh; ob.is_order_yh = prom.is_order_yh; ob.is_post_temp = prom.is_post_temp; + ob.discount_field = prom.discount_field; ob.goods = new Array(); ob.goods.push({ goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num }); map[pickid][item.prom_id] = ob; @@ -6911,14 +6926,17 @@ Page({ //优惠促销取价的优化 let f_price=item.goods_price; + if(prom.discount_field!=undefined){ switch (prom.discount_field){ case 0: f_price=item.goods_price;break; case 1: f_price=item.shop_price;break; - case 2: f_price=item.market_price;break; + case 2: f_price=item.goods_market_price;break; } } + item.goods_price=f_price; + ob.prom_id = item.prom_id; ob.name = prom.name; ob.price = f_price * item.goods_num; @@ -6927,6 +6945,7 @@ Page({ ob.is_xz_yh = prom.is_xz_yh; ob.is_order_yh = prom.is_order_yh; ob.is_post_temp = prom.is_post_temp; + ob.discount_field = prom.discount_field; ob.goods = new Array(); ob.goods.push({ goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num }); var obj = {}; @@ -8320,6 +8339,11 @@ Page({ } } func({'code': 0, 'msg': '成功'}) + }, + + //--- 不参与优惠促销的开关 --- + no_cj_prom:function (e){ + let can_cx_idx=e.currentTarget.dataset.can_cx_idx; } diff --git a/packageE/pages/cart/cart2/cart2.wxml b/packageE/pages/cart/cart2/cart2.wxml index 8523ff9..6a37c8d 100644 --- a/packageE/pages/cart/cart2/cart2.wxml +++ b/packageE/pages/cart/cart2/cart2.wxml @@ -118,57 +118,65 @@ - - - - - - - - - - 促销 - - - 优惠促销 - 搭配促销 - 组合购 - 阶梯促销 + + + + + + + + + + + + 促销 + + + 优惠促销 + 搭配促销 + 组合购 + 阶梯促销 + + + + + - - - - - - - - - - 促销 - - - 优惠促销 - 搭配促销 - 组合购 - 阶梯促销 + + + + + 促销 + + + 优惠促销 + 搭配促销 + 组合购 + 阶梯促销 + + + + + - - - - - + - + + + + 参与优惠活动 + + @@ -177,54 +185,61 @@ - - - - - - - 促销 - - - 优惠促销 - 搭配促销 - 组合购 - 阶梯促销 + + + + + + + 促销 + + + 优惠促销 + 搭配促销 + 组合购 + 阶梯促销 + + + + - - - - - - - - - 促销 - - - 优惠促销 - 搭配促销 - 组合购 - 阶梯促销 + + + + + 促销 + + + 优惠促销 + 搭配促销 + 组合购 + 阶梯促销 + + + + - - - + + + + + + 参与优惠活动 + - - + -- libgit2 0.21.4