From 178793bdd16465a35726181c1a3706d3f79f5c27 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Thu, 30 Mar 2023 15:37:35 +0800 Subject: [PATCH] 阶梯促销 优化市场价打折 --- packageE/pages/cart/cart2/ladder_calculate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packageE/pages/cart/cart2/ladder_calculate.js b/packageE/pages/cart/cart2/ladder_calculate.js index 00a8001..9c94907 100644 --- a/packageE/pages/cart/cart2/ladder_calculate.js +++ b/packageE/pages/cart/cart2/ladder_calculate.js @@ -43,6 +43,7 @@ module.exports = { for (var j = 0; j < item.cart_num; j++) { no_in_arr.push({ price: item.goods_price, + goods_market_price:item.goods_market_price, offline_price: item.offline_price, goods_id: item.goods_id, shop_price: item.shop_price, @@ -65,7 +66,7 @@ module.exports = { if (no_in_arr.length == 0) break; let item_j =ladder_list[j]; var end = no_in_arr.pop(); - var new_price = parseInt(item_j.discount_field) == 1 ? end.shop_price : end.price; + var new_price = parseInt(item_j.discount_field) == 2?end.goods_market_price:(parseInt(item_j.discount_field) == 1 ? end.shop_price : end.price); var account=new_price * parseFloat(item_j.discount) / 10; aprice +=account; @@ -240,7 +241,6 @@ module.exports = { } } - } } -- libgit2 0.21.4