Commit 8424fb60c8d7cd903e8677633adc6a35ce070a0e
1 parent
8fa89a81
物流的选择方式的优化
Showing
10 changed files
with
66 additions
and
20 deletions
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
... | ... | @@ -611,7 +611,7 @@ Page({ |
611 | 611 | |
612 | 612 | //-----------拼装购物车结算的数组,如果有默认物流时要用默认物流编号,计算默认的物流,不管是不是自提都算一下----------------- |
613 | 613 | var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
614 | - if (def_exp_code) { | |
614 | + if (def_exp_code && !th.data.is_default_logistics ) { | |
615 | 615 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
616 | 616 | var item = th.data.wu_arr[k]; |
617 | 617 | if (def_exp_code == item.code) { |
... | ... | @@ -833,7 +833,7 @@ Page({ |
833 | 833 | |
834 | 834 | |
835 | 835 | var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
836 | - if (et == 0 && def_exp_code) { | |
836 | + if (et == 0 && def_exp_code && !th.data.is_default_logistics) { | |
837 | 837 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
838 | 838 | var item = th.data.wu_arr[k]; |
839 | 839 | if (def_exp_code == item.code) { |
... | ... | @@ -3013,7 +3013,7 @@ Page({ |
3013 | 3013 | |
3014 | 3014 | } |
3015 | 3015 | //判断有没有默认的物流地址值 |
3016 | - if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) { | |
3016 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) { | |
3017 | 3017 | var wu_arr = this.data.wu_arr; |
3018 | 3018 | if (wu_arr != null && wu_arr != "") { |
3019 | 3019 | for (var i = 0; i < wu_arr.length; i++) { |
... | ... | @@ -3052,7 +3052,7 @@ Page({ |
3052 | 3052 | } |
3053 | 3053 | |
3054 | 3054 | //判断有没有默认的物流地址值 |
3055 | - if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) { | |
3055 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) { | |
3056 | 3056 | var wu_arr = this.data.wu_arr; |
3057 | 3057 | if (wu_arr != null && wu_arr != "") { |
3058 | 3058 | for (var i = 0; i < wu_arr.length; i++) { |
... | ... | @@ -3634,6 +3634,7 @@ Page({ |
3634 | 3634 | //更新下默认,在onshow里面 |
3635 | 3635 | update_code() { |
3636 | 3636 | var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
3637 | + if(th.data.is_default_logistics) return false; | |
3637 | 3638 | //--定时器,判断wu_arr不未空-- |
3638 | 3639 | var uii = setInterval(function () { |
3639 | 3640 | if (th.data.wu_arr) { | ... | ... |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
... | ... | @@ -1695,9 +1695,12 @@ Page({ |
1695 | 1695 | m_wind = 0, |
1696 | 1696 | def_exp_code = getApp().globalData.userInfo.def_exp_code; |
1697 | 1697 | |
1698 | + | |
1699 | + | |
1698 | 1700 | var uii = setInterval(function () { |
1699 | 1701 | if (th.data.wu_arr) { |
1700 | 1702 | clearInterval(uii); |
1703 | + if(th.data.is_default_logistics) return false; | |
1701 | 1704 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
1702 | 1705 | var item = th.data.wu_arr[k]; |
1703 | 1706 | if (def_exp_code == item.code) { | ... | ... |
packageC/pages/payForAnother/payForAnother.js
... | ... | @@ -583,7 +583,7 @@ Page({ |
583 | 583 | |
584 | 584 | //-----------拼装购物车结算的数组,如果有默认物流时要用默认物流编号,计算默认的物流,不管是不是自提都算一下----------------- |
585 | 585 | var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
586 | - if (def_exp_code) { | |
586 | + if (def_exp_code && !th.data.is_default_logistics) { | |
587 | 587 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
588 | 588 | var item = th.data.wu_arr[k]; |
589 | 589 | if (def_exp_code == item.code) { |
... | ... | @@ -764,7 +764,7 @@ Page({ |
764 | 764 | |
765 | 765 | |
766 | 766 | var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
767 | - if (et == 0 && def_exp_code) { | |
767 | + if (et == 0 && def_exp_code && !th.data.is_default_logistics) { | |
768 | 768 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
769 | 769 | var item = th.data.wu_arr[k]; |
770 | 770 | if (def_exp_code == item.code) { |
... | ... | @@ -2712,7 +2712,7 @@ Page({ |
2712 | 2712 | |
2713 | 2713 | } |
2714 | 2714 | //判断有没有默认的物流地址值 |
2715 | - if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) { | |
2715 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) { | |
2716 | 2716 | var wu_arr = this.data.wu_arr; |
2717 | 2717 | if (wu_arr != null && wu_arr != "") { |
2718 | 2718 | for (var i = 0; i < wu_arr.length; i++) { |
... | ... | @@ -2751,7 +2751,7 @@ Page({ |
2751 | 2751 | } |
2752 | 2752 | |
2753 | 2753 | //判断有没有默认的物流地址值 |
2754 | - if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) { | |
2754 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) { | |
2755 | 2755 | var wu_arr = this.data.wu_arr; |
2756 | 2756 | if (wu_arr != null && wu_arr != "") { |
2757 | 2757 | for (var i = 0; i < wu_arr.length; i++) { |
... | ... | @@ -3323,10 +3323,12 @@ Page({ |
3323 | 3323 | //更新下默认,在onshow里面 |
3324 | 3324 | update_code(){ |
3325 | 3325 | var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
3326 | + | |
3326 | 3327 | //--定时器,判断wu_arr不未空-- |
3327 | 3328 | var uii = setInterval(function () { |
3328 | 3329 | if (th.data.wu_arr) { |
3329 | 3330 | clearInterval(uii); |
3331 | + if(th.data.is_default_logistics) return false; | |
3330 | 3332 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
3331 | 3333 | var item = th.data.wu_arr[k]; |
3332 | 3334 | if (def_exp_code == item.code) { | ... | ... |
packageC/pages/presell/cart/cart.js
... | ... | @@ -923,7 +923,7 @@ Page({ |
923 | 923 | } |
924 | 924 | |
925 | 925 | //判断有没有默认的物流地址值 |
926 | - if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) { | |
926 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) { | |
927 | 927 | var wu_arr = this.data.wu_arr; |
928 | 928 | if (wu_arr != null && wu_arr != "") { |
929 | 929 | for (var i = 0; i < wu_arr.length; i++) { |
... | ... | @@ -1429,10 +1429,12 @@ Page({ |
1429 | 1429 | //更新下默认,在onshow里面 |
1430 | 1430 | update_code() { |
1431 | 1431 | var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
1432 | + | |
1432 | 1433 | //--定时器,判断wu_arr不未空-- |
1433 | 1434 | var uii = setInterval(function () { |
1434 | 1435 | if (th.data.wu_arr) { |
1435 | 1436 | clearInterval(uii); |
1437 | + if(th.data.is_default_logistics) return false; | |
1436 | 1438 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
1437 | 1439 | var item = th.data.wu_arr[k]; |
1438 | 1440 | if (def_exp_code == item.code) { | ... | ... |
packageC/pages/presell/cart/cart2.js
... | ... | @@ -453,7 +453,7 @@ Page({ |
453 | 453 | |
454 | 454 | |
455 | 455 | var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
456 | - if (et == 0 && def_exp_code) { | |
456 | + if (et == 0 && def_exp_code && !th.data.is_default_logistics) { | |
457 | 457 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
458 | 458 | var item = th.data.wu_arr[k]; |
459 | 459 | if (def_exp_code == item.code) { |
... | ... | @@ -1886,7 +1886,7 @@ Page({ |
1886 | 1886 | |
1887 | 1887 | } |
1888 | 1888 | //判断有没有默认的物流地址值 |
1889 | - if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) { | |
1889 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) { | |
1890 | 1890 | var wu_arr = this.data.wu_arr; |
1891 | 1891 | if (wu_arr != null && wu_arr != "") { |
1892 | 1892 | for (var i = 0; i < wu_arr.length; i++) { |
... | ... | @@ -1925,7 +1925,7 @@ Page({ |
1925 | 1925 | } |
1926 | 1926 | |
1927 | 1927 | //判断有没有默认的物流地址值 |
1928 | - if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) { | |
1928 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) { | |
1929 | 1929 | var wu_arr = this.data.wu_arr; |
1930 | 1930 | if (wu_arr != null && wu_arr != "") { |
1931 | 1931 | for (var i = 0; i < wu_arr.length; i++) { |
... | ... | @@ -2429,10 +2429,12 @@ Page({ |
2429 | 2429 | //更新下默认,在onshow里面 |
2430 | 2430 | update_code() { |
2431 | 2431 | var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
2432 | + | |
2432 | 2433 | //--定时器,判断wu_arr不未空-- |
2433 | 2434 | var uii = setInterval(function () { |
2434 | 2435 | if (th.data.wu_arr) { |
2435 | 2436 | clearInterval(uii); |
2437 | + if(th.data.is_default_logistics) return false; | |
2436 | 2438 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
2437 | 2439 | var item = th.data.wu_arr[k]; |
2438 | 2440 | if (def_exp_code == item.code) { | ... | ... |
packageC/pages/presell/cart/cart2_pre.js
... | ... | @@ -1122,6 +1122,8 @@ Page({ |
1122 | 1122 | var uii = setInterval(function () { |
1123 | 1123 | if (th.data.wu_arr) { |
1124 | 1124 | clearInterval(uii); |
1125 | + if(th.data.is_default_logistics) return false; | |
1126 | + | |
1125 | 1127 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
1126 | 1128 | var item = th.data.wu_arr[k]; |
1127 | 1129 | if (def_exp_code == item.code) { | ... | ... |
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -980,7 +980,7 @@ Page({ |
980 | 980 | |
981 | 981 | //-----------拼装购物车结算的数组,如果有默认物流时要用默认物流编号,计算默认的物流,不管是不是自提都算一下----------------- |
982 | 982 | var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
983 | - if (def_exp_code) { | |
983 | + if (def_exp_code && !th.data.is_default_logistics) { | |
984 | 984 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
985 | 985 | var item = th.data.wu_arr[k]; |
986 | 986 | if (def_exp_code == item.code) { |
... | ... | @@ -1243,7 +1243,10 @@ Page({ |
1243 | 1243 | |
1244 | 1244 | |
1245 | 1245 | var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
1246 | - if (et == 0 && def_exp_code) { | |
1246 | + | |
1247 | + | |
1248 | + | |
1249 | + if (et == 0 && def_exp_code && !th.data.is_default_logistics) { | |
1247 | 1250 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
1248 | 1251 | var item = th.data.wu_arr[k]; |
1249 | 1252 | if (def_exp_code == item.code) { |
... | ... | @@ -2346,7 +2349,7 @@ Page({ |
2346 | 2349 | if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1 && th.data.is_quan_by[pickid]) { |
2347 | 2350 | continue; |
2348 | 2351 | } |
2349 | - | |
2352 | + | |
2350 | 2353 | |
2351 | 2354 | if (back_data && back_data['is_by_all'] && item[j].is_post_temp |
2352 | 2355 | && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item[j].goods_id) == -1)) { |
... | ... | @@ -4547,7 +4550,7 @@ Page({ |
4547 | 4550 | |
4548 | 4551 | } |
4549 | 4552 | //判断有没有默认的物流地址值 |
4550 | - if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) { | |
4553 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) { | |
4551 | 4554 | var wu_arr = this.data.wu_arr; |
4552 | 4555 | if (wu_arr != null && wu_arr != "") { |
4553 | 4556 | for (var i = 0; i < wu_arr.length; i++) { |
... | ... | @@ -4586,7 +4589,7 @@ Page({ |
4586 | 4589 | } |
4587 | 4590 | |
4588 | 4591 | //判断有没有默认的物流地址值 |
4589 | - if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) { | |
4592 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) { | |
4590 | 4593 | var wu_arr = this.data.wu_arr; |
4591 | 4594 | if (wu_arr != null && wu_arr != "") { |
4592 | 4595 | for (var i = 0; i < wu_arr.length; i++) { |
... | ... | @@ -5138,10 +5141,12 @@ Page({ |
5138 | 5141 | //更新下默认,在onshow里面 |
5139 | 5142 | update_code() { |
5140 | 5143 | var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
5144 | + | |
5141 | 5145 | //--定时器,判断wu_arr不未空-- |
5142 | 5146 | var uii = setInterval(function () { |
5143 | 5147 | if (th.data.wu_arr) { |
5144 | 5148 | clearInterval(uii); |
5149 | + if(th.data.is_default_logistics) return false; | |
5145 | 5150 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
5146 | 5151 | var item = th.data.wu_arr[k]; |
5147 | 5152 | if (def_exp_code == item.code) { | ... | ... |
pages/cart/cart2_inte/cart2_inte.js
... | ... | @@ -472,7 +472,7 @@ Page({ |
472 | 472 | if (th.data.bn_goods) et = th.data.bn_exp_type |
473 | 473 | |
474 | 474 | var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
475 | - if (et == 0 && def_exp_code) { | |
475 | + if (et == 0 && def_exp_code && !th.data.is_default_logistics) { | |
476 | 476 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
477 | 477 | var item = th.data.wu_arr[k]; if (def_exp_code == item.code) { m_wind = k; } |
478 | 478 | } |
... | ... | @@ -1315,7 +1315,7 @@ Page({ |
1315 | 1315 | } |
1316 | 1316 | |
1317 | 1317 | //判断有没有默认的物流地址值 |
1318 | - if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) { | |
1318 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) { | |
1319 | 1319 | var wu_arr = this.data.wu_arr; |
1320 | 1320 | if (wu_arr != null && wu_arr != "") { |
1321 | 1321 | for (var i = 0; i < wu_arr.length; i++) { |
... | ... | @@ -1416,10 +1416,13 @@ Page({ |
1416 | 1416 | //更新下默认,在onshow里面 |
1417 | 1417 | update_code() { |
1418 | 1418 | var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
1419 | + | |
1420 | + | |
1419 | 1421 | //--定时器,判断wu_arr不未空-- |
1420 | 1422 | var uii = setInterval(function () { |
1421 | 1423 | if (th.data.wu_arr) { |
1422 | 1424 | clearInterval(uii); |
1425 | + if(th.data.is_default_logistics) return false; | |
1423 | 1426 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
1424 | 1427 | var item = th.data.wu_arr[k]; |
1425 | 1428 | if (def_exp_code == item.code) { m_wind = k; } | ... | ... |
pages/cart/cart2_pt/cart2_pt.js
... | ... | @@ -1465,10 +1465,10 @@ Page({ |
1465 | 1465 | //更新下默认,在onshow里面 |
1466 | 1466 | update_code() { |
1467 | 1467 | var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; |
1468 | - | |
1469 | 1468 | var uii = setInterval(function () { |
1470 | 1469 | if (th.data.wu_arr) { |
1471 | 1470 | clearInterval(uii); |
1471 | + if(th.data.is_default_logistics) return false; | |
1472 | 1472 | for (var k = 0; k < th.data.wu_arr.length; k++) { |
1473 | 1473 | var item = th.data.wu_arr[k]; |
1474 | 1474 | if (def_exp_code == item.code) { | ... | ... |
pages/cart/cart_wk/cart_wk.js
... | ... | @@ -109,6 +109,13 @@ Page({ |
109 | 109 | |
110 | 110 | }) |
111 | 111 | |
112 | + //--更新默认地址--,看一下是不是跳到地址页面 | |
113 | + if (!getApp().globalData.is_cart_old) { | |
114 | + this.update_code(); | |
115 | + } else { | |
116 | + getApp().globalData.is_cart_old = 0; | |
117 | + } | |
118 | + | |
112 | 119 | }, |
113 | 120 | /** |
114 | 121 | * 用户点击右上角分享 |
... | ... | @@ -1065,6 +1072,25 @@ Page({ |
1065 | 1072 | }); |
1066 | 1073 | }, |
1067 | 1074 | |
1075 | + //更新下默认,在onshow里面 | |
1076 | + update_code() { | |
1077 | + var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; | |
1078 | + var uii = setInterval(function () { | |
1079 | + if (th.data.wu_arr) { | |
1080 | + clearInterval(uii); | |
1081 | + if(th.data.is_default_logistics) return false; | |
1082 | + for (var k = 0; k < th.data.wu_arr.length; k++) { | |
1083 | + var item = th.data.wu_arr[k]; | |
1084 | + if (def_exp_code == item.code) { | |
1085 | + m_wind = k; | |
1086 | + } | |
1087 | + } | |
1088 | + //--如果是立即购买-- | |
1089 | + th.setData({ index: m_wind, is_express: m_wind }); | |
1090 | + } | |
1091 | + }, 500) | |
1092 | + }, | |
1093 | + | |
1068 | 1094 | |
1069 | 1095 | //// 开启物流的弹窗 |
1070 | 1096 | show_wu_arr: function (e) { | ... | ... |