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,7 +1378,9 @@ Page({ | ||
| 1378 | if (goods_weight < 0) goods_weight = 0; | 1378 | if (goods_weight < 0) goods_weight = 0; |
| 1379 | //累积商品重量 每种商品的重量 * 数量 | 1379 | //累积商品重量 每种商品的重量 * 数量 |
| 1380 | goods_weight += item[j]['weight'] * item[j]['goods_num']; | 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,6 +1900,7 @@ Page({ | ||
| 1898 | if (res.data.data[0].region_list) { | 1900 | if (res.data.data[0].region_list) { |
| 1899 | if (th.check_by_area(res.data.data[0].region_list)) { | 1901 | if (th.check_by_area(res.data.data[0].region_list)) { |
| 1900 | freight_free = 0; | 1902 | freight_free = 0; |
| 1903 | + out_of_weight=0; | ||
| 1901 | th.data.is_no_by[th.data.bn_pick] = 1; | 1904 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 1902 | } | 1905 | } |
| 1903 | } | 1906 | } |
| @@ -1905,6 +1908,7 @@ Page({ | @@ -1905,6 +1908,7 @@ Page({ | ||
| 1905 | if (res.data.data[0].goods_list && freight_free) { | 1908 | if (res.data.data[0].goods_list && freight_free) { |
| 1906 | if (th.check_by_goods(res.data.data[0].goods_list)) { | 1909 | if (th.check_by_goods(res.data.data[0].goods_list)) { |
| 1907 | freight_free = 0; | 1910 | freight_free = 0; |
| 1911 | + out_of_weight=0; | ||
| 1908 | th.data.is_no_by[th.data.bn_pick] = 1; | 1912 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 1909 | } | 1913 | } |
| 1910 | } | 1914 | } |
| @@ -3791,6 +3795,7 @@ Page({ | @@ -3791,6 +3795,7 @@ Page({ | ||
| 3791 | if (no_by_data && no_by_data.region_list) { | 3795 | if (no_by_data && no_by_data.region_list) { |
| 3792 | if (th.check_by_area(no_by_data.region_list)) { | 3796 | if (th.check_by_area(no_by_data.region_list)) { |
| 3793 | gift_freight_free = 0; | 3797 | gift_freight_free = 0; |
| 3798 | + out_of_weight=0; | ||
| 3794 | th.data.is_no_by[th.data.bn_pick] = 1; | 3799 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 3795 | } | 3800 | } |
| 3796 | } | 3801 | } |
| @@ -3798,12 +3803,13 @@ Page({ | @@ -3798,12 +3803,13 @@ Page({ | ||
| 3798 | if (no_by_data && no_by_data.goods_list && gift_freight_free) { | 3803 | if (no_by_data && no_by_data.goods_list && gift_freight_free) { |
| 3799 | if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { | 3804 | if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { |
| 3800 | gift_freight_free = 0; | 3805 | gift_freight_free = 0; |
| 3806 | + out_of_weight=0; | ||
| 3801 | //th.data.is_no_by[th.data.bn_pick]=1; | 3807 | //th.data.is_no_by[th.data.bn_pick]=1; |
| 3802 | } | 3808 | } |
| 3803 | } | 3809 | } |
| 3804 | 3810 | ||
| 3805 | var t_shipping_price = | 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 | goods_piece, user_addr, gift_freight_free, allpice, rs); | 3813 | goods_piece, user_addr, gift_freight_free, allpice, rs); |
| 3808 | return t_shipping_price; | 3814 | return t_shipping_price; |
| 3809 | 3815 |
packageC/pages/presell/cart/cart.js
| @@ -1645,6 +1645,7 @@ Page({ | @@ -1645,6 +1645,7 @@ Page({ | ||
| 1645 | if (no_by_data && no_by_data.region_list) { | 1645 | if (no_by_data && no_by_data.region_list) { |
| 1646 | if (th.check_by_area(no_by_data.region_list)) { | 1646 | if (th.check_by_area(no_by_data.region_list)) { |
| 1647 | gift_freight_free = 0; | 1647 | gift_freight_free = 0; |
| 1648 | + out_of_weight=0; | ||
| 1648 | th.data.is_no_by[bn_pick] = 1; | 1649 | th.data.is_no_by[bn_pick] = 1; |
| 1649 | } | 1650 | } |
| 1650 | } | 1651 | } |
| @@ -1652,11 +1653,12 @@ Page({ | @@ -1652,11 +1653,12 @@ Page({ | ||
| 1652 | if (no_by_data && no_by_data.goods_list && gift_freight_free) { | 1653 | if (no_by_data && no_by_data.goods_list && gift_freight_free) { |
| 1653 | if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { | 1654 | if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { |
| 1654 | gift_freight_free = 0; | 1655 | gift_freight_free = 0; |
| 1656 | + out_of_weight=0; | ||
| 1655 | } | 1657 | } |
| 1656 | } | 1658 | } |
| 1657 | 1659 | ||
| 1658 | var t_shipping_price = | 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 | goods_piece, user_addr, gift_freight_free, allpice, rs); | 1662 | goods_piece, user_addr, gift_freight_free, allpice, rs); |
| 1661 | return t_shipping_price; | 1663 | return t_shipping_price; |
| 1662 | 1664 | ||
| @@ -1819,7 +1821,7 @@ Page({ | @@ -1819,7 +1821,7 @@ Page({ | ||
| 1819 | 1821 | ||
| 1820 | var code = th.data.wu_arr[th.data.index].code; | 1822 | var code = th.data.wu_arr[th.data.index].code; |
| 1821 | var shipping_price = | 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 | goods_piece, th.data.user_addr, freight_free, allpice, rs); | 1825 | goods_piece, th.data.user_addr, freight_free, allpice, rs); |
| 1824 | exp_price = parseFloat(shipping_price).toFixed(2); | 1826 | exp_price = parseFloat(shipping_price).toFixed(2); |
| 1825 | } | 1827 | } |
packageC/pages/presell/cart/cart2.js
| @@ -714,6 +714,7 @@ Page({ | @@ -714,6 +714,7 @@ Page({ | ||
| 714 | if (res.data.data[0].region_list) { | 714 | if (res.data.data[0].region_list) { |
| 715 | if (th.check_by_area(res.data.data[0].region_list)) { | 715 | if (th.check_by_area(res.data.data[0].region_list)) { |
| 716 | freight_free = 0; | 716 | freight_free = 0; |
| 717 | + out_of_weight=0; | ||
| 717 | th.data.is_no_by[th.data.bn_pick] = 1; | 718 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 718 | } | 719 | } |
| 719 | } | 720 | } |
| @@ -721,6 +722,7 @@ Page({ | @@ -721,6 +722,7 @@ Page({ | ||
| 721 | if (res.data.data[0].goods_list && freight_free) { | 722 | if (res.data.data[0].goods_list && freight_free) { |
| 722 | if (th.check_by_goods(res.data.data[0].goods_list)) { | 723 | if (th.check_by_goods(res.data.data[0].goods_list)) { |
| 723 | freight_free = 0; | 724 | freight_free = 0; |
| 725 | + out_of_weight=0; | ||
| 724 | th.data.is_no_by[th.data.bn_pick] = 1; | 726 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 725 | } | 727 | } |
| 726 | } | 728 | } |
| @@ -1677,7 +1679,7 @@ Page({ | @@ -1677,7 +1679,7 @@ Page({ | ||
| 1677 | var price = 0, th = this; | 1679 | var price = 0, th = this; |
| 1678 | price += parseFloat(o_shipping_price); | 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 | return 0; | 1683 | return 0; |
| 1682 | } | 1684 | } |
| 1683 | if (user_addr == null) { | 1685 | if (user_addr == null) { |
| @@ -2578,6 +2580,7 @@ Page({ | @@ -2578,6 +2580,7 @@ Page({ | ||
| 2578 | if (no_by_data && no_by_data.region_list) { | 2580 | if (no_by_data && no_by_data.region_list) { |
| 2579 | if (th.check_by_area(no_by_data.region_list)) { | 2581 | if (th.check_by_area(no_by_data.region_list)) { |
| 2580 | gift_freight_free = 0; | 2582 | gift_freight_free = 0; |
| 2583 | + out_of_weight=0; | ||
| 2581 | th.data.is_no_by[th.data.bn_pick] = 1; | 2584 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 2582 | } | 2585 | } |
| 2583 | } | 2586 | } |
| @@ -2585,12 +2588,13 @@ Page({ | @@ -2585,12 +2588,13 @@ Page({ | ||
| 2585 | if (no_by_data && no_by_data.goods_list && gift_freight_free) { | 2588 | if (no_by_data && no_by_data.goods_list && gift_freight_free) { |
| 2586 | if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { | 2589 | if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { |
| 2587 | gift_freight_free = 0; | 2590 | gift_freight_free = 0; |
| 2591 | + out_of_weight=0; | ||
| 2588 | //th.data.is_no_by[th.data.bn_pick]=1; | 2592 | //th.data.is_no_by[th.data.bn_pick]=1; |
| 2589 | } | 2593 | } |
| 2590 | } | 2594 | } |
| 2591 | 2595 | ||
| 2592 | var t_shipping_price = | 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 | goods_piece, user_addr, gift_freight_free, allpice, rs); | 2598 | goods_piece, user_addr, gift_freight_free, allpice, rs); |
| 2595 | return t_shipping_price; | 2599 | return t_shipping_price; |
| 2596 | 2600 |
pages/cart/cart2/cart2.js
| @@ -1487,7 +1487,9 @@ Page({ | @@ -1487,7 +1487,9 @@ Page({ | ||
| 1487 | if (goods_weight < 0) goods_weight = 0; | 1487 | if (goods_weight < 0) goods_weight = 0; |
| 1488 | //累积商品重量 每种商品的重量 * 数量 | 1488 | //累积商品重量 每种商品的重量 * 数量 |
| 1489 | goods_weight += item[j]['weight'] * item[j]['goods_num']; | 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,17 +1541,19 @@ Page({ | ||
| 1539 | cart_item.shipping_price = 0; | 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 | if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) { | 1546 | if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) { |
| 1545 | if (th.check_by_area(by_qc.region_list)) { | 1547 | if (th.check_by_area(by_qc.region_list)) { |
| 1546 | freight_free = 0; | 1548 | freight_free = 0; |
| 1547 | th.data.is_no_by[pickid] = 1; | 1549 | th.data.is_no_by[pickid] = 1; |
| 1550 | + out_of_weight=0; | ||
| 1548 | } | 1551 | } |
| 1549 | } | 1552 | } |
| 1550 | //如果有设置不包邮区商品 | 1553 | //如果有设置不包邮区商品 |
| 1551 | if (by_qc.goods_list != "" && by_qc.goods_list != undefined && by_qc != null && freight_free > 0) { | 1554 | if (by_qc.goods_list != "" && by_qc.goods_list != undefined && by_qc != null && freight_free > 0) { |
| 1552 | freight_free = 0; | 1555 | freight_free = 0; |
| 1556 | + out_of_weight=0; | ||
| 1553 | no_ex_good = by_qc.goods_list; | 1557 | no_ex_good = by_qc.goods_list; |
| 1554 | } | 1558 | } |
| 1555 | } | 1559 | } |
| @@ -2030,6 +2034,7 @@ Page({ | @@ -2030,6 +2034,7 @@ Page({ | ||
| 2030 | if (res.data.data[0].region_list) { | 2034 | if (res.data.data[0].region_list) { |
| 2031 | if (th.check_by_area(res.data.data[0].region_list)) { | 2035 | if (th.check_by_area(res.data.data[0].region_list)) { |
| 2032 | freight_free = 0; | 2036 | freight_free = 0; |
| 2037 | + out_of_weight=0; | ||
| 2033 | th.data.is_no_by[th.data.bn_pick] = 1; | 2038 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 2034 | } | 2039 | } |
| 2035 | } | 2040 | } |
| @@ -2037,6 +2042,7 @@ Page({ | @@ -2037,6 +2042,7 @@ Page({ | ||
| 2037 | if (res.data.data[0].goods_list && freight_free) { | 2042 | if (res.data.data[0].goods_list && freight_free) { |
| 2038 | if (th.check_by_goods(res.data.data[0].goods_list)) { | 2043 | if (th.check_by_goods(res.data.data[0].goods_list)) { |
| 2039 | freight_free = 0; | 2044 | freight_free = 0; |
| 2045 | + out_of_weight=0; | ||
| 2040 | th.data.is_no_by[th.data.bn_pick] = 1; | 2046 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 2041 | } | 2047 | } |
| 2042 | } | 2048 | } |
| @@ -4023,6 +4029,7 @@ Page({ | @@ -4023,6 +4029,7 @@ Page({ | ||
| 4023 | if (no_by_data && no_by_data.region_list) { | 4029 | if (no_by_data && no_by_data.region_list) { |
| 4024 | if (th.check_by_area(no_by_data.region_list)) { | 4030 | if (th.check_by_area(no_by_data.region_list)) { |
| 4025 | gift_freight_free = 0; | 4031 | gift_freight_free = 0; |
| 4032 | + out_of_weight=0 | ||
| 4026 | th.data.is_no_by[th.data.bn_pick] = 1; | 4033 | th.data.is_no_by[th.data.bn_pick] = 1; |
| 4027 | } | 4034 | } |
| 4028 | } | 4035 | } |
| @@ -4030,6 +4037,7 @@ Page({ | @@ -4030,6 +4037,7 @@ Page({ | ||
| 4030 | if (no_by_data && no_by_data.goods_list && gift_freight_free) { | 4037 | if (no_by_data && no_by_data.goods_list && gift_freight_free) { |
| 4031 | if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { | 4038 | if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { |
| 4032 | gift_freight_free = 0; | 4039 | gift_freight_free = 0; |
| 4040 | + out_of_weight=0 | ||
| 4033 | //th.data.is_no_by[th.data.bn_pick]=1; | 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,6 +485,7 @@ Page({ | ||
| 485 | if(res.data.data[0].region_list){ | 485 | if(res.data.data[0].region_list){ |
| 486 | if(th.check_by_area(res.data.data[0].region_list)){ | 486 | if(th.check_by_area(res.data.data[0].region_list)){ |
| 487 | freight_free=0; | 487 | freight_free=0; |
| 488 | + out_of_weight=0; | ||
| 488 | th.data.is_no_by[th.data.bn_pick]=1; | 489 | th.data.is_no_by[th.data.bn_pick]=1; |
| 489 | } | 490 | } |
| 490 | } | 491 | } |
| @@ -492,6 +493,7 @@ Page({ | @@ -492,6 +493,7 @@ Page({ | ||
| 492 | if(res.data.data[0].goods_list && freight_free){ | 493 | if(res.data.data[0].goods_list && freight_free){ |
| 493 | if(th.check_by_goods(res.data.data[0].goods_list)){ | 494 | if(th.check_by_goods(res.data.data[0].goods_list)){ |
| 494 | freight_free=0; | 495 | freight_free=0; |
| 496 | + out_of_weight=0; | ||
| 495 | th.data.is_no_by[th.data.bn_pick]=1; | 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,7 +449,7 @@ Page({ | ||
| 449 | //--全部金额-- | 449 | //--全部金额-- |
| 450 | var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; | 450 | var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; |
| 451 | var shipping_price = | 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 | goods_piece, th.data.user_addr, freight_free, allpice, rs); | 453 | goods_piece, th.data.user_addr, freight_free, allpice, rs); |
| 454 | var exp_price = parseFloat(shipping_price).toFixed(2); | 454 | var exp_price = parseFloat(shipping_price).toFixed(2); |
| 455 | allpice = parseFloat(exp_price) + parseFloat(allpice); | 455 | allpice = parseFloat(exp_price) + parseFloat(allpice); |
| @@ -467,7 +467,7 @@ Page({ | @@ -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 | goods_piece, user_addr, freight_free, o_price, rs) { | 471 | goods_piece, user_addr, freight_free, o_price, rs) { |
| 472 | var price = 0, th = this; | 472 | var price = 0, th = this; |
| 473 | price += parseFloat(o_shipping_price); | 473 | price += parseFloat(o_shipping_price); |
pages/team/team_success/team_success.js
| @@ -820,7 +820,7 @@ Page({ | @@ -820,7 +820,7 @@ Page({ | ||
| 820 | var th=this; | 820 | var th=this; |
| 821 | var scene=this.data.teamgroup.id; | 821 | var scene=this.data.teamgroup.id; |
| 822 | var goods_id=this.data.teamlist.goods_id; | 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 | var img=th.data.iurl+th.data.teamlist.share_imgurl; | 825 | var img=th.data.iurl+th.data.teamlist.share_imgurl; |
| 826 | //--把会员分享出去-- | 826 | //--把会员分享出去-- |