Commit f9fdd19b6c20901fefd2390a4046d75a45ca1f70

Authored by 后端研发-倪永富
1 parent 2abc3a97

1. 拼团在购买的时候优化--当商品的配送方式是物流的时候

Showing 1 changed file with 10 additions and 5 deletions
pages/cart/cart2_pt/cart2_pt.js
@@ -369,7 +369,7 @@ Page({ @@ -369,7 +369,7 @@ Page({
369 console.log(rs); 369 console.log(rs);
370 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; 370 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
371 //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格---------- 371 //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格----------
372 - if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && th.data.kt_type!=3 ){ 372 + 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) ){
373 switch (good['exp_sum_type']) { 373 switch (good['exp_sum_type']) {
374 case 1: 374 case 1:
375 //统一运费 375 //统一运费
@@ -436,7 +436,8 @@ Page({ @@ -436,7 +436,8 @@ Page({
436 //------------立即购买------------- 436 //------------立即购买-------------
437 console.log("buy_new"); 437 console.log("buy_new");
438 438
439 - if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){ 439 + //如果不是阶梯团,或者是普通购买,商家选择了物流,以及地址为空的时候
  440 + if(th.data.bn_exp_type == 0 && th.data.user_addr==null && (th.data.kt_type!=3 || th.data.bn_goods.is_normal==1) ){
440 ff = false; 441 ff = false;
441 getApp().my_warnning("请选择收货地址",0,this); 442 getApp().my_warnning("请选择收货地址",0,this);
442 this.data.is_summit_ing = 0; 443 this.data.is_summit_ing = 0;
@@ -449,7 +450,7 @@ Page({ @@ -449,7 +450,7 @@ Page({
449 console.log(th.data.wu_arr); 450 console.log(th.data.wu_arr);
450 console.log(th.data.bn_exp_type); 451 console.log(th.data.bn_exp_type);
451 452
452 - if(th.data.bn_exp_type==0) { 453 + if(th.data.bn_exp_type==0 && (th.data.kt_type!=3 || th.data.bn_goods.is_normal==1)) {
453 if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { 454 if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) {
454 getApp().my_warnning("读取物流失败",0,this); 455 getApp().my_warnning("读取物流失败",0,this);
455 this.data.is_summit_ing = 0; 456 this.data.is_summit_ing = 0;
@@ -468,8 +469,6 @@ Page({ @@ -468,8 +469,6 @@ Page({
468 'more_address': addr == null ? "" : addr.more_address, 469 'more_address': addr == null ? "" : addr.more_address,
469 'mobile': th.data.userinfo.mobile, 470 'mobile': th.data.userinfo.mobile,
470 'email':'', 471 'email':'',
471 - 'shipping_code': th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code,  
472 - 'shipping_name': th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name,  
473 'invoice_title':'', 472 'invoice_title':'',
474 'goods_price': th.data.formData.all_price, //商品总价 473 'goods_price': th.data.formData.all_price, //商品总价
475 'shipping_price': th.data.formData.shipping_price, //物流金额 474 'shipping_price': th.data.formData.shipping_price, //物流金额
@@ -485,6 +484,12 @@ Page({ @@ -485,6 +484,12 @@ Page({
485 'is_pt_tz':th.data.is_pt_tz, //开团类型 484 'is_pt_tz':th.data.is_pt_tz, //开团类型
486 'order_goods':new Array(), 485 'order_goods':new Array(),
487 }; 486 };
  487 +
  488 + //如果不是阶梯团,或者是普通购买,
  489 + if((th.data.kt_type!=3 || th.data.bn_goods.is_normal==1)){
  490 + item['shipping_code']= th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code;
  491 + item['shipping_name']= th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name;
  492 + }
488 493
489 if(!th.data.bn_goods.is_normal){ 494 if(!th.data.bn_goods.is_normal){
490 item.is_zsorder=th.data.kt_type+1; //开团类型 495 item.is_zsorder=th.data.kt_type+1; //开团类型