From 1a59d68ff22a3f8a32798d5b2705759ccbd61a6f Mon Sep 17 00:00:00 2001 From: abson Date: Sat, 15 Jan 2022 13:55:32 +0800 Subject: [PATCH] 不包邮商品,地区 重量问题 --- packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js | 10 ++++++++-- packageC/pages/presell/cart/cart.js | 6 ++++-- packageC/pages/presell/cart/cart2.js | 8 ++++++-- pages/cart/cart2/cart2.js | 12 ++++++++++-- pages/cart/cart2_inte/cart2_inte.js | 2 ++ pages/cart/cart_wk/cart_wk.js | 4 ++-- pages/team/team_success/team_success.js | 2 +- 7 files changed, 33 insertions(+), 11 deletions(-) diff --git a/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js b/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js index b62e091..ccc853c 100644 --- a/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js +++ b/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js @@ -1378,7 +1378,9 @@ Page({ if (goods_weight < 0) goods_weight = 0; //累积商品重量 每种商品的重量 * 数量 goods_weight += item[j]['weight'] * item[j]['goods_num']; - out_of_weight = (weight_free*1000) - goods_weight; + if(weight_free > 0){ + out_of_weight = (weight_free*1000) - goods_weight; + } } } //判断是不是有组合购的金额 @@ -1898,6 +1900,7 @@ Page({ if (res.data.data[0].region_list) { if (th.check_by_area(res.data.data[0].region_list)) { freight_free = 0; + out_of_weight=0; th.data.is_no_by[th.data.bn_pick] = 1; } } @@ -1905,6 +1908,7 @@ Page({ if (res.data.data[0].goods_list && freight_free) { if (th.check_by_goods(res.data.data[0].goods_list)) { freight_free = 0; + out_of_weight=0; th.data.is_no_by[th.data.bn_pick] = 1; } } @@ -3791,6 +3795,7 @@ Page({ if (no_by_data && no_by_data.region_list) { if (th.check_by_area(no_by_data.region_list)) { gift_freight_free = 0; + out_of_weight=0; th.data.is_no_by[th.data.bn_pick] = 1; } } @@ -3798,12 +3803,13 @@ Page({ if (no_by_data && no_by_data.goods_list && gift_freight_free) { if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { gift_freight_free = 0; + out_of_weight=0; //th.data.is_no_by[th.data.bn_pick]=1; } } var t_shipping_price = - this.calculatewuliu(code, gift_shipping_price, goods_weight, + this.calculatewuliu(code, gift_shipping_price, goods_weight,out_of_weight, goods_piece, user_addr, gift_freight_free, allpice, rs); return t_shipping_price; diff --git a/packageC/pages/presell/cart/cart.js b/packageC/pages/presell/cart/cart.js index 2703208..212eac5 100644 --- a/packageC/pages/presell/cart/cart.js +++ b/packageC/pages/presell/cart/cart.js @@ -1645,6 +1645,7 @@ Page({ if (no_by_data && no_by_data.region_list) { if (th.check_by_area(no_by_data.region_list)) { gift_freight_free = 0; + out_of_weight=0; th.data.is_no_by[bn_pick] = 1; } } @@ -1652,11 +1653,12 @@ Page({ if (no_by_data && no_by_data.goods_list && gift_freight_free) { if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { gift_freight_free = 0; + out_of_weight=0; } } var t_shipping_price = - this.calculatewuliu(code, gift_shipping_price, goods_weight, + this.calculatewuliu(code, gift_shipping_price, goods_weight,out_of_weight, goods_piece, user_addr, gift_freight_free, allpice, rs); return t_shipping_price; @@ -1819,7 +1821,7 @@ Page({ var code = th.data.wu_arr[th.data.index].code; var shipping_price = - th.calculatewuliu(code, o_shipping_price, goods_weight, + th.calculatewuliu(code, o_shipping_price, goods_weight,out_of_weight, goods_piece, th.data.user_addr, freight_free, allpice, rs); exp_price = parseFloat(shipping_price).toFixed(2); } diff --git a/packageC/pages/presell/cart/cart2.js b/packageC/pages/presell/cart/cart2.js index 9e58657..3f01342 100644 --- a/packageC/pages/presell/cart/cart2.js +++ b/packageC/pages/presell/cart/cart2.js @@ -714,6 +714,7 @@ Page({ if (res.data.data[0].region_list) { if (th.check_by_area(res.data.data[0].region_list)) { freight_free = 0; + out_of_weight=0; th.data.is_no_by[th.data.bn_pick] = 1; } } @@ -721,6 +722,7 @@ Page({ if (res.data.data[0].goods_list && freight_free) { if (th.check_by_goods(res.data.data[0].goods_list)) { freight_free = 0; + out_of_weight=0; th.data.is_no_by[th.data.bn_pick] = 1; } } @@ -1677,7 +1679,7 @@ Page({ var price = 0, th = this; price += parseFloat(o_shipping_price); //如果是包邮 - if (freight_free > 0 && o_price >= freight_free && out_of_weight > 0) { + if (freight_free > 0 && o_price >= freight_free && out_of_weight >= 0) { return 0; } if (user_addr == null) { @@ -2578,6 +2580,7 @@ Page({ if (no_by_data && no_by_data.region_list) { if (th.check_by_area(no_by_data.region_list)) { gift_freight_free = 0; + out_of_weight=0; th.data.is_no_by[th.data.bn_pick] = 1; } } @@ -2585,12 +2588,13 @@ Page({ if (no_by_data && no_by_data.goods_list && gift_freight_free) { if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { gift_freight_free = 0; + out_of_weight=0; //th.data.is_no_by[th.data.bn_pick]=1; } } var t_shipping_price = - this.calculatewuliu(code, gift_shipping_price, goods_weight, + this.calculatewuliu(code, gift_shipping_price, goods_weight,out_of_weight, goods_piece, user_addr, gift_freight_free, allpice, rs); return t_shipping_price; diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index f4daabf..0c69b6e 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -1487,7 +1487,9 @@ Page({ if (goods_weight < 0) goods_weight = 0; //累积商品重量 每种商品的重量 * 数量 goods_weight += item[j]['weight'] * item[j]['goods_num']; - out_of_weight = (weight_free*1000) - goods_weight; + if(weight_free > 0){ + out_of_weight = (weight_free*1000) - goods_weight; + } } } //判断是不是有组合购的金额 @@ -1539,17 +1541,19 @@ Page({ cart_item.shipping_price = 0; //--有不包邮区域,且不免运费,全场的计算,要减到优惠金额 和券的金额-- - if (no_ex_id && freight_free > 0 && (o_price - quan_price) >= freight_free && cart_item.exp_type == 0 && (by_qc.region_list || by_qc.goods_list) && out_of_weight >= 0) { + if (no_ex_id && freight_free > 0 && (o_price - quan_price) >= freight_free && cart_item.exp_type == 0 && (by_qc.region_list || by_qc.goods_list)) { //如果有设置不包邮区域的时候 if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) { if (th.check_by_area(by_qc.region_list)) { freight_free = 0; th.data.is_no_by[pickid] = 1; + out_of_weight=0; } } //如果有设置不包邮区商品 if (by_qc.goods_list != "" && by_qc.goods_list != undefined && by_qc != null && freight_free > 0) { freight_free = 0; + out_of_weight=0; no_ex_good = by_qc.goods_list; } } @@ -2030,6 +2034,7 @@ Page({ if (res.data.data[0].region_list) { if (th.check_by_area(res.data.data[0].region_list)) { freight_free = 0; + out_of_weight=0; th.data.is_no_by[th.data.bn_pick] = 1; } } @@ -2037,6 +2042,7 @@ Page({ if (res.data.data[0].goods_list && freight_free) { if (th.check_by_goods(res.data.data[0].goods_list)) { freight_free = 0; + out_of_weight=0; th.data.is_no_by[th.data.bn_pick] = 1; } } @@ -4023,6 +4029,7 @@ Page({ if (no_by_data && no_by_data.region_list) { if (th.check_by_area(no_by_data.region_list)) { gift_freight_free = 0; + out_of_weight=0 th.data.is_no_by[th.data.bn_pick] = 1; } } @@ -4030,6 +4037,7 @@ Page({ if (no_by_data && no_by_data.goods_list && gift_freight_free) { if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { gift_freight_free = 0; + out_of_weight=0 //th.data.is_no_by[th.data.bn_pick]=1; } } diff --git a/pages/cart/cart2_inte/cart2_inte.js b/pages/cart/cart2_inte/cart2_inte.js index 140cdb9..b57a966 100644 --- a/pages/cart/cart2_inte/cart2_inte.js +++ b/pages/cart/cart2_inte/cart2_inte.js @@ -485,6 +485,7 @@ Page({ if(res.data.data[0].region_list){ if(th.check_by_area(res.data.data[0].region_list)){ freight_free=0; + out_of_weight=0; th.data.is_no_by[th.data.bn_pick]=1; } } @@ -492,6 +493,7 @@ Page({ if(res.data.data[0].goods_list && freight_free){ if(th.check_by_goods(res.data.data[0].goods_list)){ freight_free=0; + out_of_weight=0; th.data.is_no_by[th.data.bn_pick]=1; } } diff --git a/pages/cart/cart_wk/cart_wk.js b/pages/cart/cart_wk/cart_wk.js index 0ff9d42..ae5f3ee 100644 --- a/pages/cart/cart_wk/cart_wk.js +++ b/pages/cart/cart_wk/cart_wk.js @@ -449,7 +449,7 @@ Page({ //--全部金额-- var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; var shipping_price = - th.calculatewuliu(code, o_shipping_price, goods_weight, + th.calculatewuliu(code, o_shipping_price, goods_weight,out_of_weight, goods_piece, th.data.user_addr, freight_free, allpice, rs); var exp_price = parseFloat(shipping_price).toFixed(2); allpice = parseFloat(exp_price) + parseFloat(allpice); @@ -467,7 +467,7 @@ Page({ }, //----------------计算物流--------------- - calculatewuliu: function (code, o_shipping_price, goods_weight, + calculatewuliu: function (code, o_shipping_price, goods_weight,out_of_weight, goods_piece, user_addr, freight_free, o_price, rs) { var price = 0, th = this; price += parseFloat(o_shipping_price); diff --git a/pages/team/team_success/team_success.js b/pages/team/team_success/team_success.js index f833456..0d85179 100644 --- a/pages/team/team_success/team_success.js +++ b/pages/team/team_success/team_success.js @@ -820,7 +820,7 @@ Page({ var th=this; var scene=this.data.teamgroup.id; var goods_id=this.data.teamlist.goods_id; - var url="/pages/team/team_show/team_show?tg_id="+scene+"&goods_id"+goods_id; + var url="/pages/team/team_show/team_show?tg_id="+scene+"&goods_id="+goods_id; //--分享图片-- var img=th.data.iurl+th.data.teamlist.share_imgurl; //--把会员分享出去-- -- libgit2 0.21.4