Commit 4f3483a8d3c837df05d21679c2077bcb02e36788
Merge branch 'test' of http://git.vipzhuang.cn/wxd/MShopWeApp into qa
Showing
1 changed file
with
16 additions
and
5 deletions
packageE/pages/cart/cart2/cart2.js
@@ -3612,6 +3612,9 @@ Page({ | @@ -3612,6 +3612,9 @@ Page({ | ||
3612 | } | 3612 | } |
3613 | } | 3613 | } |
3614 | 3614 | ||
3615 | + | ||
3616 | + var goods_weight_out1=-1; | ||
3617 | + | ||
3615 | //--------循环计算总价----------- | 3618 | //--------循环计算总价----------- |
3616 | for (var j = 0; j < item.length; j++) { | 3619 | for (var j = 0; j < item.length; j++) { |
3617 | 3620 | ||
@@ -3630,17 +3633,16 @@ Page({ | @@ -3630,17 +3633,16 @@ Page({ | ||
3630 | if (back_data && back_data['is_by_all'] && item[j].is_post_temp | 3633 | if (back_data && back_data['is_by_all'] && item[j].is_post_temp |
3631 | && (!back_data.no_free_goods || !th.ck_no_goods_arr(back_data.no_free_goods, item[j].goods_id))) { | 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 | if (item[j]['exp_sum_type'] == 2 && back_data.weight_free > 0 ) { | 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 | cut_good_weight += item[j]['weight'] * item[j]['goods_num']; | 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 | if (back_data.weight_free > 0) { | 3642 | if (back_data.weight_free > 0) { |
3641 | out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; | 3643 | out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; |
3642 | } | 3644 | } |
3643 | - } | 3645 | + //} |
3644 | continue; | 3646 | continue; |
3645 | 3647 | ||
3646 | } | 3648 | } |
@@ -3675,6 +3677,15 @@ Page({ | @@ -3675,6 +3677,15 @@ Page({ | ||
3675 | if (out_of_weight >= 0) out_of_weight = -cut_good_weight; | 3677 | if (out_of_weight >= 0) out_of_weight = -cut_good_weight; |
3676 | else out_of_weight = -back_data.weight_free * 1000; | 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_out1<0) goods_weight = -1; | ||
3682 | + else{ | ||
3683 | + if(goods_weight<0) goods_weight=0; | ||
3684 | + goods_weight+=(goods_weight_out1>-1?goods_weight_out1:0); | ||
3685 | + } | ||
3686 | + } | ||
3687 | + | ||
3688 | + | ||
3678 | var code = ""; | 3689 | var code = ""; |
3679 | 3690 | ||
3680 | if (!th.data.wu_arr) { | 3691 | if (!th.data.wu_arr) { |