Commit 8bfaa1c18ce5a5b29bd34d668ac72f6516565e9b
1 parent
16fb08f8
包邮券的计算问题优化,(4个bug)
Showing
1 changed file
with
5 additions
and
5 deletions
pages/cart/cart2/cart2.js
| ... | ... | @@ -595,7 +595,7 @@ Page({ |
| 595 | 595 | is_good_no_by=th.check_by_goods(no_ex_good,item[j].goods_id); |
| 596 | 596 | } |
| 597 | 597 | //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮 |
| 598 | - if(o_price>freight_free && freight_free>0 && !is_good_no_by && th.data.is_no_by[pickid]!=1) continue; | |
| 598 | + if(o_price>=freight_free && freight_free>0 && !is_good_no_by && th.data.is_no_by[pickid]!=1) continue; | |
| 599 | 599 | //--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算-- |
| 600 | 600 | if(th.data.using_quan[pickid] && th.data.using_quan[pickid].isby==1 && !is_good_no_by) continue; |
| 601 | 601 | |
| ... | ... | @@ -627,7 +627,7 @@ Page({ |
| 627 | 627 | var code = th.data.wu_arr[c_arr[i].wind].code; |
| 628 | 628 | th.data.cartlist[i].shipping_price = |
| 629 | 629 | th.calculatewuliu(code, o_shipping_price, goods_weight, |
| 630 | - goods_piece,th.data.user_addr, freight_free, o_price, rs,); | |
| 630 | + goods_piece,th.data.user_addr, freight_free, o_price, rs); | |
| 631 | 631 | |
| 632 | 632 | if(!th.data.using_quan[pickid] || th.data.using_quan[pickid].isby!=1){ |
| 633 | 633 | if( th.data.cartlist[i].shipping_price ==0) th.data.is_by[pickid]=0; //已经全场包邮,就不要选择券了 |
| ... | ... | @@ -1375,7 +1375,7 @@ Page({ |
| 1375 | 1375 | var price =0,th=this; |
| 1376 | 1376 | price +=parseFloat(o_shipping_price); |
| 1377 | 1377 | //如果是包邮 |
| 1378 | - if (freight_free > 0 && o_price > freight_free){ return 0;} | |
| 1378 | + if (freight_free > 0 && o_price >= freight_free){ return 0;} | |
| 1379 | 1379 | if (user_addr==null) { return 0; } |
| 1380 | 1380 | //计算物流的config item; |
| 1381 | 1381 | var item=null; |
| ... | ... | @@ -1388,7 +1388,7 @@ Page({ |
| 1388 | 1388 | var fw_price = 0, fp_price=0; |
| 1389 | 1389 | item=item.config; |
| 1390 | 1390 | //------按重量---------- |
| 1391 | - if (goods_weight>=0) { | |
| 1391 | + if (goods_weight>=0 && item['money']) { | |
| 1392 | 1392 | fw_price =parseFloat(item['money']); |
| 1393 | 1393 | if (goods_weight > item['first_weight']){ |
| 1394 | 1394 | var fw = goods_weight - item['first_weight']; |
| ... | ... | @@ -1397,7 +1397,7 @@ Page({ |
| 1397 | 1397 | } |
| 1398 | 1398 | } |
| 1399 | 1399 | //------按件数---------- |
| 1400 | - if (goods_piece > 0) { | |
| 1400 | + if (goods_piece > 0 && item['piecemoney']) { | |
| 1401 | 1401 | fp_price = parseFloat(item['piecemoney']); |
| 1402 | 1402 | if (goods_piece > item['first_piece']) { |
| 1403 | 1403 | var fp = goods_piece - item['first_piece']; | ... | ... |