Commit 2839101455d4caf704d6ee6c9bc984b1a8f0caab
1 parent
c210f9cf
两件商品的总重量,超出多少千克内容包邮
Showing
1 changed file
with
13 additions
and
5 deletions
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -3612,6 +3612,9 @@ Page({ |
3612 | 3612 | } |
3613 | 3613 | } |
3614 | 3614 | |
3615 | + | |
3616 | + var goods_weight_out1=-1; | |
3617 | + | |
3615 | 3618 | //--------循环计算总价----------- |
3616 | 3619 | for (var j = 0; j < item.length; j++) { |
3617 | 3620 | |
... | ... | @@ -3630,17 +3633,16 @@ Page({ |
3630 | 3633 | if (back_data && back_data['is_by_all'] && item[j].is_post_temp |
3631 | 3634 | && (!back_data.no_free_goods || !th.ck_no_goods_arr(back_data.no_free_goods, item[j].goods_id))) { |
3632 | 3635 | |
3633 | - | |
3634 | - if( back_data.weight_free* 1000<item[j]['weight'] * item[j]['goods_num']){ | |
3636 | + //if( back_data.weight_free* 1000<item[j]['weight'] * item[j]['goods_num']){ | |
3635 | 3637 | if (item[j]['exp_sum_type'] == 2 && back_data.weight_free > 0 ) { |
3636 | - if (goods_weight < 0) goods_weight = 0; | |
3638 | + if (goods_weight_out1 < 0) goods_weight_out1 = 0; | |
3637 | 3639 | cut_good_weight += item[j]['weight'] * item[j]['goods_num']; |
3638 | - goods_weight += item[j]['weight'] * item[j]['goods_num']; | |
3640 | + goods_weight_out1 += item[j]['weight'] * item[j]['goods_num']; | |
3639 | 3641 | } |
3640 | 3642 | if (back_data.weight_free > 0) { |
3641 | 3643 | out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; |
3642 | 3644 | } |
3643 | - } | |
3645 | + //} | |
3644 | 3646 | continue; |
3645 | 3647 | |
3646 | 3648 | } |
... | ... | @@ -3675,6 +3677,12 @@ Page({ |
3675 | 3677 | if (out_of_weight >= 0) out_of_weight = -cut_good_weight; |
3676 | 3678 | else out_of_weight = -back_data.weight_free * 1000; |
3677 | 3679 | |
3680 | + if(out_of_weight<0){ | |
3681 | + if (goods_weight < 0) goods_weight = 0; | |
3682 | + goods_weight+=goods_weight_out1; | |
3683 | + } | |
3684 | + | |
3685 | + | |
3678 | 3686 | var code = ""; |
3679 | 3687 | |
3680 | 3688 | if (!th.data.wu_arr) { | ... | ... |