Commit 1a59d68ff22a3f8a32798d5b2705759ccbd61a6f
1 parent
83cf3dbd
不包邮商品,地区 重量问题
Showing
7 changed files
with
33 additions
and
11 deletions
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
| ... | ... | @@ -1378,7 +1378,9 @@ Page({ |
| 1378 | 1378 | if (goods_weight < 0) goods_weight = 0; |
| 1379 | 1379 | //累积商品重量 每种商品的重量 * 数量 |
| 1380 | 1380 | goods_weight += item[j]['weight'] * item[j]['goods_num']; |
| 1381 | - out_of_weight = (weight_free*1000) - goods_weight; | |
| 1381 | + if(weight_free > 0){ | |
| 1382 | + out_of_weight = (weight_free*1000) - goods_weight; | |
| 1383 | + } | |
| 1382 | 1384 | } |
| 1383 | 1385 | } |
| 1384 | 1386 | //判断是不是有组合购的金额 |
| ... | ... | @@ -1898,6 +1900,7 @@ Page({ |
| 1898 | 1900 | if (res.data.data[0].region_list) { |
| 1899 | 1901 | if (th.check_by_area(res.data.data[0].region_list)) { |
| 1900 | 1902 | freight_free = 0; |
| 1903 | + out_of_weight=0; | |
| 1901 | 1904 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 1902 | 1905 | } |
| 1903 | 1906 | } |
| ... | ... | @@ -1905,6 +1908,7 @@ Page({ |
| 1905 | 1908 | if (res.data.data[0].goods_list && freight_free) { |
| 1906 | 1909 | if (th.check_by_goods(res.data.data[0].goods_list)) { |
| 1907 | 1910 | freight_free = 0; |
| 1911 | + out_of_weight=0; | |
| 1908 | 1912 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 1909 | 1913 | } |
| 1910 | 1914 | } |
| ... | ... | @@ -3791,6 +3795,7 @@ Page({ |
| 3791 | 3795 | if (no_by_data && no_by_data.region_list) { |
| 3792 | 3796 | if (th.check_by_area(no_by_data.region_list)) { |
| 3793 | 3797 | gift_freight_free = 0; |
| 3798 | + out_of_weight=0; | |
| 3794 | 3799 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 3795 | 3800 | } |
| 3796 | 3801 | } |
| ... | ... | @@ -3798,12 +3803,13 @@ Page({ |
| 3798 | 3803 | if (no_by_data && no_by_data.goods_list && gift_freight_free) { |
| 3799 | 3804 | if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { |
| 3800 | 3805 | gift_freight_free = 0; |
| 3806 | + out_of_weight=0; | |
| 3801 | 3807 | //th.data.is_no_by[th.data.bn_pick]=1; |
| 3802 | 3808 | } |
| 3803 | 3809 | } |
| 3804 | 3810 | |
| 3805 | 3811 | var t_shipping_price = |
| 3806 | - this.calculatewuliu(code, gift_shipping_price, goods_weight, | |
| 3812 | + this.calculatewuliu(code, gift_shipping_price, goods_weight,out_of_weight, | |
| 3807 | 3813 | goods_piece, user_addr, gift_freight_free, allpice, rs); |
| 3808 | 3814 | return t_shipping_price; |
| 3809 | 3815 | ... | ... |
packageC/pages/presell/cart/cart.js
| ... | ... | @@ -1645,6 +1645,7 @@ Page({ |
| 1645 | 1645 | if (no_by_data && no_by_data.region_list) { |
| 1646 | 1646 | if (th.check_by_area(no_by_data.region_list)) { |
| 1647 | 1647 | gift_freight_free = 0; |
| 1648 | + out_of_weight=0; | |
| 1648 | 1649 | th.data.is_no_by[bn_pick] = 1; |
| 1649 | 1650 | } |
| 1650 | 1651 | } |
| ... | ... | @@ -1652,11 +1653,12 @@ Page({ |
| 1652 | 1653 | if (no_by_data && no_by_data.goods_list && gift_freight_free) { |
| 1653 | 1654 | if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { |
| 1654 | 1655 | gift_freight_free = 0; |
| 1656 | + out_of_weight=0; | |
| 1655 | 1657 | } |
| 1656 | 1658 | } |
| 1657 | 1659 | |
| 1658 | 1660 | var t_shipping_price = |
| 1659 | - this.calculatewuliu(code, gift_shipping_price, goods_weight, | |
| 1661 | + this.calculatewuliu(code, gift_shipping_price, goods_weight,out_of_weight, | |
| 1660 | 1662 | goods_piece, user_addr, gift_freight_free, allpice, rs); |
| 1661 | 1663 | return t_shipping_price; |
| 1662 | 1664 | |
| ... | ... | @@ -1819,7 +1821,7 @@ Page({ |
| 1819 | 1821 | |
| 1820 | 1822 | var code = th.data.wu_arr[th.data.index].code; |
| 1821 | 1823 | var shipping_price = |
| 1822 | - th.calculatewuliu(code, o_shipping_price, goods_weight, | |
| 1824 | + th.calculatewuliu(code, o_shipping_price, goods_weight,out_of_weight, | |
| 1823 | 1825 | goods_piece, th.data.user_addr, freight_free, allpice, rs); |
| 1824 | 1826 | exp_price = parseFloat(shipping_price).toFixed(2); |
| 1825 | 1827 | } | ... | ... |
packageC/pages/presell/cart/cart2.js
| ... | ... | @@ -714,6 +714,7 @@ Page({ |
| 714 | 714 | if (res.data.data[0].region_list) { |
| 715 | 715 | if (th.check_by_area(res.data.data[0].region_list)) { |
| 716 | 716 | freight_free = 0; |
| 717 | + out_of_weight=0; | |
| 717 | 718 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 718 | 719 | } |
| 719 | 720 | } |
| ... | ... | @@ -721,6 +722,7 @@ Page({ |
| 721 | 722 | if (res.data.data[0].goods_list && freight_free) { |
| 722 | 723 | if (th.check_by_goods(res.data.data[0].goods_list)) { |
| 723 | 724 | freight_free = 0; |
| 725 | + out_of_weight=0; | |
| 724 | 726 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 725 | 727 | } |
| 726 | 728 | } |
| ... | ... | @@ -1677,7 +1679,7 @@ Page({ |
| 1677 | 1679 | var price = 0, th = this; |
| 1678 | 1680 | price += parseFloat(o_shipping_price); |
| 1679 | 1681 | //如果是包邮 |
| 1680 | - if (freight_free > 0 && o_price >= freight_free && out_of_weight > 0) { | |
| 1682 | + if (freight_free > 0 && o_price >= freight_free && out_of_weight >= 0) { | |
| 1681 | 1683 | return 0; |
| 1682 | 1684 | } |
| 1683 | 1685 | if (user_addr == null) { |
| ... | ... | @@ -2578,6 +2580,7 @@ Page({ |
| 2578 | 2580 | if (no_by_data && no_by_data.region_list) { |
| 2579 | 2581 | if (th.check_by_area(no_by_data.region_list)) { |
| 2580 | 2582 | gift_freight_free = 0; |
| 2583 | + out_of_weight=0; | |
| 2581 | 2584 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 2582 | 2585 | } |
| 2583 | 2586 | } |
| ... | ... | @@ -2585,12 +2588,13 @@ Page({ |
| 2585 | 2588 | if (no_by_data && no_by_data.goods_list && gift_freight_free) { |
| 2586 | 2589 | if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { |
| 2587 | 2590 | gift_freight_free = 0; |
| 2591 | + out_of_weight=0; | |
| 2588 | 2592 | //th.data.is_no_by[th.data.bn_pick]=1; |
| 2589 | 2593 | } |
| 2590 | 2594 | } |
| 2591 | 2595 | |
| 2592 | 2596 | var t_shipping_price = |
| 2593 | - this.calculatewuliu(code, gift_shipping_price, goods_weight, | |
| 2597 | + this.calculatewuliu(code, gift_shipping_price, goods_weight,out_of_weight, | |
| 2594 | 2598 | goods_piece, user_addr, gift_freight_free, allpice, rs); |
| 2595 | 2599 | return t_shipping_price; |
| 2596 | 2600 | ... | ... |
pages/cart/cart2/cart2.js
| ... | ... | @@ -1487,7 +1487,9 @@ Page({ |
| 1487 | 1487 | if (goods_weight < 0) goods_weight = 0; |
| 1488 | 1488 | //累积商品重量 每种商品的重量 * 数量 |
| 1489 | 1489 | goods_weight += item[j]['weight'] * item[j]['goods_num']; |
| 1490 | - out_of_weight = (weight_free*1000) - goods_weight; | |
| 1490 | + if(weight_free > 0){ | |
| 1491 | + out_of_weight = (weight_free*1000) - goods_weight; | |
| 1492 | + } | |
| 1491 | 1493 | } |
| 1492 | 1494 | } |
| 1493 | 1495 | //判断是不是有组合购的金额 |
| ... | ... | @@ -1539,17 +1541,19 @@ Page({ |
| 1539 | 1541 | cart_item.shipping_price = 0; |
| 1540 | 1542 | |
| 1541 | 1543 | //--有不包邮区域,且不免运费,全场的计算,要减到优惠金额 和券的金额-- |
| 1542 | - 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) { | |
| 1544 | + 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)) { | |
| 1543 | 1545 | //如果有设置不包邮区域的时候 |
| 1544 | 1546 | if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) { |
| 1545 | 1547 | if (th.check_by_area(by_qc.region_list)) { |
| 1546 | 1548 | freight_free = 0; |
| 1547 | 1549 | th.data.is_no_by[pickid] = 1; |
| 1550 | + out_of_weight=0; | |
| 1548 | 1551 | } |
| 1549 | 1552 | } |
| 1550 | 1553 | //如果有设置不包邮区商品 |
| 1551 | 1554 | if (by_qc.goods_list != "" && by_qc.goods_list != undefined && by_qc != null && freight_free > 0) { |
| 1552 | 1555 | freight_free = 0; |
| 1556 | + out_of_weight=0; | |
| 1553 | 1557 | no_ex_good = by_qc.goods_list; |
| 1554 | 1558 | } |
| 1555 | 1559 | } |
| ... | ... | @@ -2030,6 +2034,7 @@ Page({ |
| 2030 | 2034 | if (res.data.data[0].region_list) { |
| 2031 | 2035 | if (th.check_by_area(res.data.data[0].region_list)) { |
| 2032 | 2036 | freight_free = 0; |
| 2037 | + out_of_weight=0; | |
| 2033 | 2038 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 2034 | 2039 | } |
| 2035 | 2040 | } |
| ... | ... | @@ -2037,6 +2042,7 @@ Page({ |
| 2037 | 2042 | if (res.data.data[0].goods_list && freight_free) { |
| 2038 | 2043 | if (th.check_by_goods(res.data.data[0].goods_list)) { |
| 2039 | 2044 | freight_free = 0; |
| 2045 | + out_of_weight=0; | |
| 2040 | 2046 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 2041 | 2047 | } |
| 2042 | 2048 | } |
| ... | ... | @@ -4023,6 +4029,7 @@ Page({ |
| 4023 | 4029 | if (no_by_data && no_by_data.region_list) { |
| 4024 | 4030 | if (th.check_by_area(no_by_data.region_list)) { |
| 4025 | 4031 | gift_freight_free = 0; |
| 4032 | + out_of_weight=0 | |
| 4026 | 4033 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 4027 | 4034 | } |
| 4028 | 4035 | } |
| ... | ... | @@ -4030,6 +4037,7 @@ Page({ |
| 4030 | 4037 | if (no_by_data && no_by_data.goods_list && gift_freight_free) { |
| 4031 | 4038 | if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { |
| 4032 | 4039 | gift_freight_free = 0; |
| 4040 | + out_of_weight=0 | |
| 4033 | 4041 | //th.data.is_no_by[th.data.bn_pick]=1; |
| 4034 | 4042 | } |
| 4035 | 4043 | } | ... | ... |
pages/cart/cart2_inte/cart2_inte.js
| ... | ... | @@ -485,6 +485,7 @@ Page({ |
| 485 | 485 | if(res.data.data[0].region_list){ |
| 486 | 486 | if(th.check_by_area(res.data.data[0].region_list)){ |
| 487 | 487 | freight_free=0; |
| 488 | + out_of_weight=0; | |
| 488 | 489 | th.data.is_no_by[th.data.bn_pick]=1; |
| 489 | 490 | } |
| 490 | 491 | } |
| ... | ... | @@ -492,6 +493,7 @@ Page({ |
| 492 | 493 | if(res.data.data[0].goods_list && freight_free){ |
| 493 | 494 | if(th.check_by_goods(res.data.data[0].goods_list)){ |
| 494 | 495 | freight_free=0; |
| 496 | + out_of_weight=0; | |
| 495 | 497 | th.data.is_no_by[th.data.bn_pick]=1; |
| 496 | 498 | } |
| 497 | 499 | } | ... | ... |
pages/cart/cart_wk/cart_wk.js
| ... | ... | @@ -449,7 +449,7 @@ Page({ |
| 449 | 449 | //--全部金额-- |
| 450 | 450 | var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; |
| 451 | 451 | var shipping_price = |
| 452 | - th.calculatewuliu(code, o_shipping_price, goods_weight, | |
| 452 | + th.calculatewuliu(code, o_shipping_price, goods_weight,out_of_weight, | |
| 453 | 453 | goods_piece, th.data.user_addr, freight_free, allpice, rs); |
| 454 | 454 | var exp_price = parseFloat(shipping_price).toFixed(2); |
| 455 | 455 | allpice = parseFloat(exp_price) + parseFloat(allpice); |
| ... | ... | @@ -467,7 +467,7 @@ Page({ |
| 467 | 467 | }, |
| 468 | 468 | |
| 469 | 469 | //----------------计算物流--------------- |
| 470 | - calculatewuliu: function (code, o_shipping_price, goods_weight, | |
| 470 | + calculatewuliu: function (code, o_shipping_price, goods_weight,out_of_weight, | |
| 471 | 471 | goods_piece, user_addr, freight_free, o_price, rs) { |
| 472 | 472 | var price = 0, th = this; |
| 473 | 473 | price += parseFloat(o_shipping_price); | ... | ... |
pages/team/team_success/team_success.js
| ... | ... | @@ -820,7 +820,7 @@ Page({ |
| 820 | 820 | var th=this; |
| 821 | 821 | var scene=this.data.teamgroup.id; |
| 822 | 822 | var goods_id=this.data.teamlist.goods_id; |
| 823 | - var url="/pages/team/team_show/team_show?tg_id="+scene+"&goods_id"+goods_id; | |
| 823 | + var url="/pages/team/team_show/team_show?tg_id="+scene+"&goods_id="+goods_id; | |
| 824 | 824 | //--分享图片-- |
| 825 | 825 | var img=th.data.iurl+th.data.teamlist.share_imgurl; |
| 826 | 826 | //--把会员分享出去-- | ... | ... |