diff --git a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js index ed69f2c..8febce7 100644 --- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js +++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js @@ -537,11 +537,12 @@ Page({ var cut_good_weight = 0; for (let i in gd_arr_list) { let item = gd_arr_list[i]; - if (back_data && back_data['is_by_all'] && !back_data.no_free_goods) { - continue; - } - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) { - if (item['exp_sum_type'] == 2) { + + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { + + + if (item['exp_sum_type'] == 2) { + goods_weight += item['weight'] * item['buynum']; cut_good_weight += item['weight'] * item['buynum']; } if (back_data.weight_free > 0) { diff --git a/packageC/pages/presell/cart/cart.js b/packageC/pages/presell/cart/cart.js index 6c7eb10..7fc3c63 100644 --- a/packageC/pages/presell/cart/cart.js +++ b/packageC/pages/presell/cart/cart.js @@ -1821,12 +1821,11 @@ Page({ var cut_good_weight = 0; for (let i in gd_arr_list) { let item = gd_arr_list[i]; - if (back_data && back_data['is_by_all'] && !back_data.no_free_goods) { - continue; - } - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) { + + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { if (item['exp_sum_type'] == 2) { - cut_good_weight += item['weight'] * item['buynum']; + goods_weight += item['weight'] * item['buynum']; + cut_good_weight += item['weight'] * item['buynum']; } if (back_data.weight_free > 0) { out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; diff --git a/packageC/pages/presell/cart/cart2.js b/packageC/pages/presell/cart/cart2.js index a7df533..a3b371f 100644 --- a/packageC/pages/presell/cart/cart2.js +++ b/packageC/pages/presell/cart/cart2.js @@ -697,10 +697,8 @@ Page({ var cut_good_weight = 0; for (let i in gd_arr_list) { let item = gd_arr_list[i]; - if (back_data && back_data['is_by_all'] && !back_data.no_free_goods) { - continue; - } - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) { + + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { if (item['exp_sum_type'] == 2) { cut_good_weight += item['weight'] * item['buynum']; } diff --git a/packageC/pages/presell/cart/cart2_pre.js b/packageC/pages/presell/cart/cart2_pre.js index 750209c..4a882e4 100644 --- a/packageC/pages/presell/cart/cart2_pre.js +++ b/packageC/pages/presell/cart/cart2_pre.js @@ -366,17 +366,17 @@ Page({ var cut_good_weight = 0; for (let i in gd_arr_list) { let item = data[i]; - if (back_data && back_data['is_by_all'] && !back_data.no_free_goods) { - continue; - } - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) { + + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { if (item['exp_sum_type'] == 2) { - cut_good_weight += item['weight'] * item['buynum']; - } - if (back_data.weight_free > 0) { - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; + goods_weight += item['weight'] * item['buynum']; + cut_good_weight += item['weight'] * item['buynum']; } - continue; + if (back_data.weight_free > 0) { + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; + } + continue; + } switch (item['exp_sum_type']) { diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index a3ae08d..dd7dd02 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -1737,17 +1737,18 @@ Page({ if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1 && th.data.is_quan_by[pickid]) { continue; } - if (back_data && back_data['is_by_all'] && !back_data.no_free_goods) { - continue; - } - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item[j].goods_id) == -1) { - if (item[j]['exp_sum_type'] == 2) { + + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item[j].goods_id) == -1)) { + + if (item[j]['exp_sum_type'] == 2) { cut_good_weight += item[j]['weight'] * item[j]['goods_num']; + goods_weight += item[j]['weight'] * item[j]['goods_num']; } - if (back_data.weight_free > 0) { - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; - } - continue; + if (back_data.weight_free > 0) { + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; + } + continue; + } switch (item[j]['exp_sum_type']) { @@ -2128,17 +2129,17 @@ Page({ var cut_good_weight = 0; for (let i in gd_arr_list) { let item = gd_arr_list[i]; - if (back_data && back_data['is_by_all']) { - if(!back_data.no_free_goods || !back_data.no_free_goods.length) continue; - } - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) { + + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { if (item['exp_sum_type'] == 2) { - cut_good_weight += item['weight'] * item['buynum']; - } - if (back_data.weight_free > 0) { - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; + goods_weight += item['weight'] * item['buynum']; + cut_good_weight += item['weight'] * item['buynum']; } - continue; + if (back_data.weight_free > 0) { + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; + } + continue; + } switch (item['exp_sum_type']) { diff --git a/pages/cart/cart2_inte/cart2_inte.js b/pages/cart/cart2_inte/cart2_inte.js index 46f596d..c62df2c 100644 --- a/pages/cart/cart2_inte/cart2_inte.js +++ b/pages/cart/cart2_inte/cart2_inte.js @@ -451,12 +451,10 @@ Page({ var cut_good_weight = 0; for (let i in gd_arr_list) { let item = gd_arr_list[i]; - if (back_data && back_data['is_by_all']) { - if(!back_data.no_free_goods || !back_data.no_free_goods.length) continue; - } - - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) { + + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1) ) { if (item['exp_sum_type'] == 2) { + goods_weight += item['weight'] * item['buynum']; cut_good_weight += item['weight'] * item['buynum']; } if (back_data.weight_free > 0) { diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js index 62a1635..a31009f 100644 --- a/pages/cart/cart2_pt/cart2_pt.js +++ b/pages/cart/cart2_pt/cart2_pt.js @@ -428,10 +428,8 @@ Page({ var cut_good_weight = 0; for (let i in gd_arr_list) { let item = gd_arr_list[i]; - if (back_data && back_data['is_by_all'] && !back_data.no_free_goods) { - continue; - } - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) { + + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { if (item['exp_sum_type'] == 2) { cut_good_weight += item['weight'] * item['buynum']; } diff --git a/pages/cart/cart_wk/cart_wk.js b/pages/cart/cart_wk/cart_wk.js index 261c02e..0d0d3cb 100644 --- a/pages/cart/cart_wk/cart_wk.js +++ b/pages/cart/cart_wk/cart_wk.js @@ -491,12 +491,11 @@ Page({ var cut_good_weight = 0; for (let i in gd_arr_list) { let item = gd_arr_list[i]; - if (back_data && back_data['is_by_all']) { - if(!back_data.no_free_goods || !back_data.no_free_goods.length) continue; - } - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) { + + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { if (item['exp_sum_type'] == 2) { - cut_good_weight += item['weight'] * item['buynum']; + goods_weight += item['weight'] * item['buynum']; + cut_good_weight += item['weight'] * item['buynum']; } if (back_data.weight_free > 0) { out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;