From f9fdd19b6c20901fefd2390a4046d75a45ca1f70 Mon Sep 17 00:00:00 2001 From: yvan Date: Mon, 5 Oct 2020 20:19:03 +0800 Subject: [PATCH] 1. 拼团在购买的时候优化--当商品的配送方式是物流的时候 --- pages/cart/cart2_pt/cart2_pt.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js index 5222fd6..a25f9ed 100644 --- a/pages/cart/cart2_pt/cart2_pt.js +++ b/pages/cart/cart2_pt/cart2_pt.js @@ -369,7 +369,7 @@ Page({ console.log(rs); var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格---------- - if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && th.data.kt_type!=3 ){ + if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && && (th.data.kt_type!=3 || th.data.bn_goods.is_normal==1) ){ switch (good['exp_sum_type']) { case 1: //统一运费 @@ -436,7 +436,8 @@ Page({ //------------立即购买------------- console.log("buy_new"); - if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){ + //如果不是阶梯团,或者是普通购买,商家选择了物流,以及地址为空的时候 + if(th.data.bn_exp_type == 0 && th.data.user_addr==null && (th.data.kt_type!=3 || th.data.bn_goods.is_normal==1) ){ ff = false; getApp().my_warnning("请选择收货地址",0,this); this.data.is_summit_ing = 0; @@ -449,7 +450,7 @@ Page({ console.log(th.data.wu_arr); console.log(th.data.bn_exp_type); - if(th.data.bn_exp_type==0) { + if(th.data.bn_exp_type==0 && (th.data.kt_type!=3 || th.data.bn_goods.is_normal==1)) { if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { getApp().my_warnning("读取物流失败",0,this); this.data.is_summit_ing = 0; @@ -468,8 +469,6 @@ Page({ 'more_address': addr == null ? "" : addr.more_address, 'mobile': th.data.userinfo.mobile, 'email':'', - 'shipping_code': th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code, - 'shipping_name': th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name, 'invoice_title':'', 'goods_price': th.data.formData.all_price, //商品总价 'shipping_price': th.data.formData.shipping_price, //物流金额 @@ -485,6 +484,12 @@ Page({ 'is_pt_tz':th.data.is_pt_tz, //开团类型 'order_goods':new Array(), }; + + //如果不是阶梯团,或者是普通购买, + if((th.data.kt_type!=3 || th.data.bn_goods.is_normal==1)){ + item['shipping_code']= th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code; + item['shipping_name']= th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name; + } if(!th.data.bn_goods.is_normal){ item.is_zsorder=th.data.kt_type+1; //开团类型 -- libgit2 0.21.4