From 532d91bf4cfd5d3fb885513d6d4466875f8e0a31 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Wed, 3 Jul 2024 13:59:25 +0800 Subject: [PATCH] 运费的包邮问题的优化 --- packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js | 16 +++++++++------- packageC/pages/presell/cart/cart.js | 16 +++++++++------- packageC/pages/presell/cart/cart2.js | 16 +++++++++------- packageE/pages/cart/cart2/cart2.js | 35 ++++++++++++++++++++--------------- packageE/pages/cart/cart2_inte/cart2_inte.js | 16 +++++++++------- packageE/pages/cart/cart2_pt/cart2_pt.js | 17 +++++++++-------- packageE/pages/cart/cart_wk/cart_wk.js | 17 +++++++++-------- 7 files changed, 74 insertions(+), 59 deletions(-) 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 2303053..7a3dd58 100644 --- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js +++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js @@ -946,13 +946,15 @@ Page({ 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 && back_data.weight_free > 0) { - if (goods_weight < 0) goods_weight = 0; - 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; + if(back_data.weight_free* 1000 0) { + if (goods_weight < 0) goods_weight = 0; + 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; + } } continue; } diff --git a/packageC/pages/presell/cart/cart.js b/packageC/pages/presell/cart/cart.js index 117bfef..b7a27b6 100644 --- a/packageC/pages/presell/cart/cart.js +++ b/packageC/pages/presell/cart/cart.js @@ -2598,13 +2598,15 @@ Page({ 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 && back_data.weight_free > 0) { - if (goods_weight < 0) goods_weight = 0; - 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; + if(back_data.weight_free* 1000 0) { + if (goods_weight < 0) goods_weight = 0; + 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; + } } continue; } diff --git a/packageC/pages/presell/cart/cart2.js b/packageC/pages/presell/cart/cart2.js index 43d0f51..1d998be 100644 --- a/packageC/pages/presell/cart/cart2.js +++ b/packageC/pages/presell/cart/cart2.js @@ -1019,14 +1019,16 @@ Page({ 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 && back_data.weight_free > 0) { - if (goods_weight < 0) goods_weight = 0; - cut_good_weight += item['weight'] * item['buynum']; - goods_weight += item['weight'] * item['buynum']; + if(back_data.weight_free* 1000 0) { + if (goods_weight < 0) goods_weight = 0; + cut_good_weight += item['weight'] * item['buynum']; + goods_weight += item['weight'] * item['buynum']; - } - if (back_data.weight_free > 0) { - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; + } + if (back_data.weight_free > 0) { + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; + } } continue; } diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index 4b53275..4ced60d 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -3630,13 +3630,16 @@ Page({ if (back_data && back_data['is_by_all'] && item[j].is_post_temp && (!back_data.no_free_goods || !th.ck_no_goods_arr(back_data.no_free_goods, item[j].goods_id))) { - if (item[j]['exp_sum_type'] == 2 && back_data.weight_free > 0) { - if (goods_weight < 0) goods_weight = 0; - 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; + + if( back_data.weight_free* 1000 0 ) { + if (goods_weight < 0) goods_weight = 0; + 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; @@ -4394,14 +4397,16 @@ Page({ 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))) { - if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) { - if (goods_weight < 0) goods_weight = 0; - 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; - } + if(back_data.weight_free* 1000 0) { + if (goods_weight < 0) goods_weight = 0; + 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; + } + } continue; } diff --git a/packageE/pages/cart/cart2_inte/cart2_inte.js b/packageE/pages/cart/cart2_inte/cart2_inte.js index 06647aa..a805415 100644 --- a/packageE/pages/cart/cart2_inte/cart2_inte.js +++ b/packageE/pages/cart/cart2_inte/cart2_inte.js @@ -817,13 +817,15 @@ Page({ 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 && back_data.weight_free > 0) { - if (goods_weight < 0) goods_weight = 0; - 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; + if(back_data.weight_free* 1000 0) { + if (goods_weight < 0) goods_weight = 0; + 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; + } } continue; } diff --git a/packageE/pages/cart/cart2_pt/cart2_pt.js b/packageE/pages/cart/cart2_pt/cart2_pt.js index f3945d8..9bc99d5 100644 --- a/packageE/pages/cart/cart2_pt/cart2_pt.js +++ b/packageE/pages/cart/cart2_pt/cart2_pt.js @@ -992,14 +992,15 @@ Page({ let item = gd_arr_list[i]; 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 && back_data.weight_free > 0) { - if (goods_weight < 0) goods_weight = 0; - cut_good_weight += item['weight'] * item['buynum']; - goods_weight += item['weight'] * item['buynum']; - } - if (back_data.weight_free > 0) { - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; + if(back_data.weight_free* 1000 0) { + if (goods_weight < 0) goods_weight = 0; + cut_good_weight += item['weight'] * item['buynum']; + goods_weight += item['weight'] * item['buynum']; + } + if (back_data.weight_free > 0) { + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; + } } continue; } diff --git a/packageE/pages/cart/cart_wk/cart_wk.js b/packageE/pages/cart/cart_wk/cart_wk.js index f06d36f..8270739 100644 --- a/packageE/pages/cart/cart_wk/cart_wk.js +++ b/packageE/pages/cart/cart_wk/cart_wk.js @@ -1003,14 +1003,15 @@ Page({ let item = gd_arr_list[i]; 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 && back_data.weight_free > 0) { - if (goods_weight < 0) goods_weight = 0; - 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; + if(back_data.weight_free* 1000 0) { + if (goods_weight < 0) goods_weight = 0; + 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; + } } continue; } -- libgit2 0.21.4