Commit f9fdd19b6c20901fefd2390a4046d75a45ca1f70
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 | 369 | console.log(rs); |
370 | 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 | 373 | switch (good['exp_sum_type']) { |
374 | 374 | case 1: |
375 | 375 | //统一运费 |
... | ... | @@ -436,7 +436,8 @@ Page({ |
436 | 436 | //------------立即购买------------- |
437 | 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 | 441 | ff = false; |
441 | 442 | getApp().my_warnning("请选择收货地址",0,this); |
442 | 443 | this.data.is_summit_ing = 0; |
... | ... | @@ -449,7 +450,7 @@ Page({ |
449 | 450 | console.log(th.data.wu_arr); |
450 | 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 | 454 | if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { |
454 | 455 | getApp().my_warnning("读取物流失败",0,this); |
455 | 456 | this.data.is_summit_ing = 0; |
... | ... | @@ -468,8 +469,6 @@ Page({ |
468 | 469 | 'more_address': addr == null ? "" : addr.more_address, |
469 | 470 | 'mobile': th.data.userinfo.mobile, |
470 | 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 | 472 | 'invoice_title':'', |
474 | 473 | 'goods_price': th.data.formData.all_price, //商品总价 |
475 | 474 | 'shipping_price': th.data.formData.shipping_price, //物流金额 |
... | ... | @@ -485,6 +484,12 @@ Page({ |
485 | 484 | 'is_pt_tz':th.data.is_pt_tz, //开团类型 |
486 | 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 | 494 | if(!th.data.bn_goods.is_normal){ |
490 | 495 | item.is_zsorder=th.data.kt_type+1; //开团类型 | ... | ... |