Commit c584cb08033e0c6bb2f5216b8c25ba41280622a5
1 parent
21f10250
包邮券的使用
Showing
1 changed file
with
16 additions
and
5 deletions
packageE/pages/cart/cart2/cart2.js
@@ -3021,7 +3021,6 @@ Page({ | @@ -3021,7 +3021,6 @@ Page({ | ||
3021 | //--------循环计算总价----------- | 3021 | //--------循环计算总价----------- |
3022 | for (var j = 0; j < item.length; j++) { | 3022 | for (var j = 0; j < item.length; j++) { |
3023 | 3023 | ||
3024 | - | ||
3025 | //如果是一件代发商品,不计算运费 | 3024 | //如果是一件代发商品,不计算运费 |
3026 | if (item[j].whsle_id) continue; | 3025 | if (item[j].whsle_id) continue; |
3027 | //如果商品本身是包邮了 | 3026 | //如果商品本身是包邮了 |
@@ -3033,9 +3032,9 @@ Page({ | @@ -3033,9 +3032,9 @@ Page({ | ||
3033 | continue; | 3032 | continue; |
3034 | } | 3033 | } |
3035 | 3034 | ||
3036 | - | 3035 | + //-- 如果有达到包邮条件,同时判断商品有没有在不包邮商品里面 -- |
3037 | if (back_data && back_data['is_by_all'] && item[j].is_post_temp | 3036 | if (back_data && back_data['is_by_all'] && item[j].is_post_temp |
3038 | - && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item[j].goods_id) == -1)) { | 3037 | + && (!back_data.no_free_goods || !th.ck_no_goods_arr(back_data.no_free_goods,item[j].goods_id))) { |
3039 | 3038 | ||
3040 | if (item[j]['exp_sum_type'] == 2 && back_data.weight_free > 0) { | 3039 | if (item[j]['exp_sum_type'] == 2 && back_data.weight_free > 0) { |
3041 | if (goods_weight < 0) goods_weight = 0; | 3040 | if (goods_weight < 0) goods_weight = 0; |
@@ -3161,7 +3160,6 @@ Page({ | @@ -3161,7 +3160,6 @@ Page({ | ||
3161 | 3160 | ||
3162 | var order_m = 0; | 3161 | var order_m = 0; |
3163 | 3162 | ||
3164 | - | ||
3165 | //么有使用券,或者活动没有限制使用优惠券 | 3163 | //么有使用券,或者活动没有限制使用优惠券 |
3166 | if (ord_prom && (quan_price <= 0 || !ord_prom.is_xz_yh)) { | 3164 | if (ord_prom && (quan_price <= 0 || !ord_prom.is_xz_yh)) { |
3167 | order_prom_id = ord_prom['id']; | 3165 | order_prom_id = ord_prom['id']; |
@@ -3515,6 +3513,18 @@ Page({ | @@ -3515,6 +3513,18 @@ Page({ | ||
3515 | } | 3513 | } |
3516 | }, | 3514 | }, |
3517 | 3515 | ||
3516 | + //-- 判断商品是不是在不包邮商品里面 -- | ||
3517 | + ck_no_goods_arr(no_free_goods,goods_id){ | ||
3518 | + for (var j = 0; j < no_free_goods.length; j++) { | ||
3519 | + var ck_gd_id= parseInt(no_free_goods[j]+''); | ||
3520 | + var goods_id= parseInt(goods_id+''); | ||
3521 | + if(ck_gd_id==goods_id){ | ||
3522 | + return true; | ||
3523 | + } | ||
3524 | + } | ||
3525 | + return false; | ||
3526 | + }, | ||
3527 | + | ||
3518 | //---------计算立即购买---------- | 3528 | //---------计算立即购买---------- |
3519 | calculatePrice2: async function (qfunc) { | 3529 | calculatePrice2: async function (qfunc) { |
3520 | var th = this, good = this.data.bn_goods; | 3530 | var th = this, good = this.data.bn_goods; |
@@ -3721,7 +3731,7 @@ Page({ | @@ -3721,7 +3731,7 @@ Page({ | ||
3721 | //-- 代发商品不算运费 -- | 3731 | //-- 代发商品不算运费 -- |
3722 | if (good.whsle_id) continue; | 3732 | if (good.whsle_id) continue; |
3723 | 3733 | ||
3724 | - if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { | 3734 | + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || !th.ck_no_goods_arr(back_data.no_free_goods,item.goods_id))) { |
3725 | 3735 | ||
3726 | if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) { | 3736 | if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) { |
3727 | if (goods_weight < 0) goods_weight = 0; | 3737 | if (goods_weight < 0) goods_weight = 0; |
@@ -3825,6 +3835,7 @@ Page({ | @@ -3825,6 +3835,7 @@ Page({ | ||
3825 | th.setData({ [wl_txt]: 0, }) | 3835 | th.setData({ [wl_txt]: 0, }) |
3826 | } | 3836 | } |
3827 | } | 3837 | } |
3838 | + | ||
3828 | //-----------------支付价,优惠券不减物流----------------- | 3839 | //-----------------支付价,优惠券不减物流----------------- |
3829 | var total_m = (parseFloat(allpice1)).toFixed(2); | 3840 | var total_m = (parseFloat(allpice1)).toFixed(2); |
3830 | var order_m = (parseFloat(allpice - cut_price) - quan_price).toFixed(2); | 3841 | var order_m = (parseFloat(allpice - cut_price) - quan_price).toFixed(2); |