Commit 532d91bf4cfd5d3fb885513d6d4466875f8e0a31

Authored by yvan.ni
1 parent e30db7c2

运费的包邮问题的优化

packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
... ... @@ -946,13 +946,15 @@ Page({
946 946  
947 947 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
948 948  
949   - if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
950   - if (goods_weight < 0) goods_weight = 0;
951   - goods_weight += item['weight'] * item['buynum'];
952   - cut_good_weight += item['weight'] * item['buynum'];
953   - }
954   - if (back_data.weight_free > 0) {
955   - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  949 + if(back_data.weight_free* 1000<item['weight'] * item['buynum']) {
  950 + if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
  951 + if (goods_weight < 0) goods_weight = 0;
  952 + goods_weight += item['weight'] * item['buynum'];
  953 + cut_good_weight += item['weight'] * item['buynum'];
  954 + }
  955 + if (back_data.weight_free > 0) {
  956 + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  957 + }
956 958 }
957 959 continue;
958 960 }
... ...
packageC/pages/presell/cart/cart.js
... ... @@ -2598,13 +2598,15 @@ Page({
2598 2598  
2599 2599 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
2600 2600  
2601   - if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
2602   - if (goods_weight < 0) goods_weight = 0;
2603   - goods_weight += item['weight'] * item['buynum'];
2604   - cut_good_weight += item['weight'] * item['buynum'];
2605   - }
2606   - if (back_data.weight_free > 0) {
2607   - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  2601 + if(back_data.weight_free* 1000<item['weight'] * item['buynum']) {
  2602 + if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
  2603 + if (goods_weight < 0) goods_weight = 0;
  2604 + goods_weight += item['weight'] * item['buynum'];
  2605 + cut_good_weight += item['weight'] * item['buynum'];
  2606 + }
  2607 + if (back_data.weight_free > 0) {
  2608 + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  2609 + }
2608 2610 }
2609 2611 continue;
2610 2612 }
... ...
packageC/pages/presell/cart/cart2.js
... ... @@ -1019,14 +1019,16 @@ Page({
1019 1019  
1020 1020 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
1021 1021  
1022   - if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
1023   - if (goods_weight < 0) goods_weight = 0;
1024   - cut_good_weight += item['weight'] * item['buynum'];
1025   - goods_weight += item['weight'] * item['buynum'];
  1022 + if(back_data.weight_free* 1000<item['weight'] * item['buynum']) {
  1023 + if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
  1024 + if (goods_weight < 0) goods_weight = 0;
  1025 + cut_good_weight += item['weight'] * item['buynum'];
  1026 + goods_weight += item['weight'] * item['buynum'];
1026 1027  
1027   - }
1028   - if (back_data.weight_free > 0) {
1029   - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  1028 + }
  1029 + if (back_data.weight_free > 0) {
  1030 + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  1031 + }
1030 1032 }
1031 1033 continue;
1032 1034 }
... ...
packageE/pages/cart/cart2/cart2.js
... ... @@ -3630,13 +3630,16 @@ Page({
3630 3630 if (back_data && back_data['is_by_all'] && item[j].is_post_temp
3631 3631 && (!back_data.no_free_goods || !th.ck_no_goods_arr(back_data.no_free_goods, item[j].goods_id))) {
3632 3632  
3633   - if (item[j]['exp_sum_type'] == 2 && back_data.weight_free > 0) {
3634   - if (goods_weight < 0) goods_weight = 0;
3635   - cut_good_weight += item[j]['weight'] * item[j]['goods_num'];
3636   - goods_weight += item[j]['weight'] * item[j]['goods_num'];
3637   - }
3638   - if (back_data.weight_free > 0) {
3639   - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  3633 +
  3634 + if( back_data.weight_free* 1000<item[j]['weight'] * item[j]['goods_num']){
  3635 + if (item[j]['exp_sum_type'] == 2 && back_data.weight_free > 0 ) {
  3636 + if (goods_weight < 0) goods_weight = 0;
  3637 + cut_good_weight += item[j]['weight'] * item[j]['goods_num'];
  3638 + goods_weight += item[j]['weight'] * item[j]['goods_num'];
  3639 + }
  3640 + if (back_data.weight_free > 0) {
  3641 + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  3642 + }
3640 3643 }
3641 3644 continue;
3642 3645  
... ... @@ -4394,14 +4397,16 @@ Page({
4394 4397  
4395 4398 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || !th.ck_no_goods_arr(back_data.no_free_goods, item.goods_id))) {
4396 4399  
4397   - if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
4398   - if (goods_weight < 0) goods_weight = 0;
4399   - goods_weight += item['weight'] * item['buynum'];
4400   - cut_good_weight += item['weight'] * item['buynum'];
4401   - }
4402   - if (back_data.weight_free > 0) {
4403   - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
4404   - }
  4400 + if(back_data.weight_free* 1000<item['weight'] * item['buynum']){
  4401 + if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
  4402 + if (goods_weight < 0) goods_weight = 0;
  4403 + goods_weight += item['weight'] * item['buynum'];
  4404 + cut_good_weight += item['weight'] * item['buynum'];
  4405 + }
  4406 + if (back_data.weight_free > 0) {
  4407 + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  4408 + }
  4409 + }
4405 4410 continue;
4406 4411  
4407 4412 }
... ...
packageE/pages/cart/cart2_inte/cart2_inte.js
... ... @@ -817,13 +817,15 @@ Page({
817 817  
818 818 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1) ) {
819 819  
820   - if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
821   - if (goods_weight < 0) goods_weight = 0;
822   - goods_weight += item['weight'] * item['buynum'];
823   - cut_good_weight += item['weight'] * item['buynum'];
824   - }
825   - if (back_data.weight_free > 0) {
826   - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  820 + if(back_data.weight_free* 1000<item['weight'] * item['buynum']) {
  821 + if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
  822 + if (goods_weight < 0) goods_weight = 0;
  823 + goods_weight += item['weight'] * item['buynum'];
  824 + cut_good_weight += item['weight'] * item['buynum'];
  825 + }
  826 + if (back_data.weight_free > 0) {
  827 + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  828 + }
827 829 }
828 830 continue;
829 831 }
... ...
packageE/pages/cart/cart2_pt/cart2_pt.js
... ... @@ -992,14 +992,15 @@ Page({
992 992 let item = gd_arr_list[i];
993 993  
994 994 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
995   -
996   - if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
997   - if (goods_weight < 0) goods_weight = 0;
998   - cut_good_weight += item['weight'] * item['buynum'];
999   - goods_weight += item['weight'] * item['buynum'];
1000   - }
1001   - if (back_data.weight_free > 0) {
1002   - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  995 + if(back_data.weight_free* 1000<item['weight'] * item['buynum']) {
  996 + if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
  997 + if (goods_weight < 0) goods_weight = 0;
  998 + cut_good_weight += item['weight'] * item['buynum'];
  999 + goods_weight += item['weight'] * item['buynum'];
  1000 + }
  1001 + if (back_data.weight_free > 0) {
  1002 + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  1003 + }
1003 1004 }
1004 1005 continue;
1005 1006 }
... ...
packageE/pages/cart/cart_wk/cart_wk.js
... ... @@ -1003,14 +1003,15 @@ Page({
1003 1003 let item = gd_arr_list[i];
1004 1004  
1005 1005 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
1006   -
1007   - if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
1008   - if (goods_weight < 0) goods_weight = 0;
1009   - goods_weight += item['weight'] * item['buynum'];
1010   - cut_good_weight += item['weight'] * item['buynum'];
1011   - }
1012   - if (back_data.weight_free > 0) {
1013   - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  1006 + if(back_data.weight_free* 1000<item['weight'] * item['buynum']) {
  1007 + if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
  1008 + if (goods_weight < 0) goods_weight = 0;
  1009 + goods_weight += item['weight'] * item['buynum'];
  1010 + cut_good_weight += item['weight'] * item['buynum'];
  1011 + }
  1012 + if (back_data.weight_free > 0) {
  1013 + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  1014 + }
1014 1015 }
1015 1016 continue;
1016 1017 }
... ...