Commit 178793bdd16465a35726181c1a3706d3f79f5c27
1 parent
7a696005
阶梯促销 优化市场价打折
Showing
1 changed file
with
2 additions
and
2 deletions
packageE/pages/cart/cart2/ladder_calculate.js
| ... | ... | @@ -43,6 +43,7 @@ module.exports = { |
| 43 | 43 | for (var j = 0; j < item.cart_num; j++) { |
| 44 | 44 | no_in_arr.push({ |
| 45 | 45 | price: item.goods_price, |
| 46 | + goods_market_price:item.goods_market_price, | |
| 46 | 47 | offline_price: item.offline_price, |
| 47 | 48 | goods_id: item.goods_id, |
| 48 | 49 | shop_price: item.shop_price, |
| ... | ... | @@ -65,7 +66,7 @@ module.exports = { |
| 65 | 66 | if (no_in_arr.length == 0) break; |
| 66 | 67 | let item_j =ladder_list[j]; |
| 67 | 68 | var end = no_in_arr.pop(); |
| 68 | - var new_price = parseInt(item_j.discount_field) == 1 ? end.shop_price : end.price; | |
| 69 | + var new_price = parseInt(item_j.discount_field) == 2?end.goods_market_price:(parseInt(item_j.discount_field) == 1 ? end.shop_price : end.price); | |
| 69 | 70 | var account=new_price * parseFloat(item_j.discount) / 10; |
| 70 | 71 | aprice +=account; |
| 71 | 72 | |
| ... | ... | @@ -240,7 +241,6 @@ module.exports = { |
| 240 | 241 | } |
| 241 | 242 | } |
| 242 | 243 | |
| 243 | - | |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | ... | ... |