Commit 2303c9d9c41b0d708081e4533e3d79a435837caf
1 parent
8553a17e
优化订单优惠券使用
Showing
5 changed files
with
23 additions
and
2 deletions
packageC/pages/presell/cart/cart.js
... | ... | @@ -1883,6 +1883,7 @@ Page({ |
1883 | 1883 | th.confirm_quan_befor() |
1884 | 1884 | } |
1885 | 1885 | } |
1886 | + return | |
1886 | 1887 | } |
1887 | 1888 | if (length2 == 1) { |
1888 | 1889 | console.error('优惠券2'); |
... | ... | @@ -1900,6 +1901,7 @@ Page({ |
1900 | 1901 | } |
1901 | 1902 | |
1902 | 1903 | } |
1904 | + return | |
1903 | 1905 | } |
1904 | 1906 | if (length3 == 1 && th.data.exp_type==0) { |
1905 | 1907 | console.error('优惠券3'); |
... | ... | @@ -1916,6 +1918,7 @@ Page({ |
1916 | 1918 | th.confirm_quan_befor() |
1917 | 1919 | |
1918 | 1920 | } |
1921 | + return | |
1919 | 1922 | } |
1920 | 1923 | |
1921 | 1924 | }, | ... | ... |
packageC/pages/presell/cart/cart2.js
... | ... | @@ -2965,6 +2965,7 @@ Page({ |
2965 | 2965 | th.confirm_quan_befor() |
2966 | 2966 | } |
2967 | 2967 | } |
2968 | + return | |
2968 | 2969 | } |
2969 | 2970 | if (length2 == 1) { |
2970 | 2971 | console.error('优惠券2'); |
... | ... | @@ -2982,6 +2983,7 @@ Page({ |
2982 | 2983 | } |
2983 | 2984 | |
2984 | 2985 | } |
2986 | + return | |
2985 | 2987 | } |
2986 | 2988 | if (length3 == 1 && th.data.bn_exp_type==0) { |
2987 | 2989 | console.error('优惠券3'); |
... | ... | @@ -2998,6 +3000,7 @@ Page({ |
2998 | 3000 | th.confirm_quan_befor() |
2999 | 3001 | |
3000 | 3002 | } |
3003 | + return | |
3001 | 3004 | } |
3002 | 3005 | |
3003 | 3006 | }, | ... | ... |
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -7348,10 +7348,11 @@ Page({ |
7348 | 7348 | //默认选择优惠券 |
7349 | 7349 | def_coupon_fn_aft() { |
7350 | 7350 | console.error('进入默认优惠券选择'); |
7351 | + | |
7351 | 7352 | let th = this; |
7352 | 7353 | let first_entry = th.data.first_entry; |
7353 | 7354 | console.error(first_entry); |
7354 | - if (first_entry > 0) { | |
7355 | + if (first_entry > 0 || (th.data.cartlist && th.data.cartlist.length>1)) { | |
7355 | 7356 | return |
7356 | 7357 | } |
7357 | 7358 | first_entry += 1; |
... | ... | @@ -7362,7 +7363,10 @@ Page({ |
7362 | 7363 | let length2 = th.data.def_coupon2 ? th.data.def_coupon2.length : 0 |
7363 | 7364 | let length3 = th.data.def_coupon3 ? th.data.def_coupon3.length : 0 |
7364 | 7365 | let length4 = th.data.def_coupon4 ? th.data.def_coupon4.length : 0 |
7365 | - let length = length1 + length2 + length3 + length4 | |
7366 | + let length = length1 + length2 | |
7367 | + if ((th.data.show_submit && th.data.is_b_now==1 && th.data.bn_exp_type==0) || (th.data.is_b_now==0 && th.data.cartlist && th.data.cartlist.length==1 && th.data.cartlist[0].exp_type==0)) { | |
7368 | + length= length + length3 + length4 | |
7369 | + } | |
7366 | 7370 | console.error(length); |
7367 | 7371 | if (length != 1) { |
7368 | 7372 | return |
... | ... | @@ -7385,6 +7389,7 @@ Page({ |
7385 | 7389 | th.confirm_quan_befor() |
7386 | 7390 | } |
7387 | 7391 | } |
7392 | + return | |
7388 | 7393 | } |
7389 | 7394 | if (length2 == 1) { |
7390 | 7395 | console.error('优惠券2'); |
... | ... | @@ -7401,6 +7406,7 @@ Page({ |
7401 | 7406 | th.confirm_quan_befor() |
7402 | 7407 | } |
7403 | 7408 | } |
7409 | + return | |
7404 | 7410 | } |
7405 | 7411 | if (length3 == 1) { |
7406 | 7412 | console.error('优惠券3'); |
... | ... | @@ -7419,6 +7425,8 @@ Page({ |
7419 | 7425 | th.sele_quan_item_by_befor(); |
7420 | 7426 | th.confirm_quan_befor() |
7421 | 7427 | } |
7428 | + return | |
7429 | + | |
7422 | 7430 | } |
7423 | 7431 | if (length4 == 1) { |
7424 | 7432 | console.error('优惠券4'); |
... | ... | @@ -7438,6 +7446,7 @@ Page({ |
7438 | 7446 | th.confirm_quan_befor() |
7439 | 7447 | }, 500); |
7440 | 7448 | } |
7449 | + return | |
7441 | 7450 | } |
7442 | 7451 | |
7443 | 7452 | }, | ... | ... |
packageE/pages/cart/cart2_pt/cart2_pt.js
... | ... | @@ -2630,6 +2630,7 @@ Page({ |
2630 | 2630 | th.confirm_quan_befor() |
2631 | 2631 | } |
2632 | 2632 | } |
2633 | + return | |
2633 | 2634 | } |
2634 | 2635 | if (length2 == 1) { |
2635 | 2636 | console.error('优惠券2'); |
... | ... | @@ -2647,6 +2648,7 @@ Page({ |
2647 | 2648 | } |
2648 | 2649 | |
2649 | 2650 | } |
2651 | + return | |
2650 | 2652 | } |
2651 | 2653 | if (length3 == 1 && th.data.bn_exp_type == 0) { |
2652 | 2654 | console.error('优惠券3'); |
... | ... | @@ -2663,6 +2665,7 @@ Page({ |
2663 | 2665 | th.confirm_quan_befor() |
2664 | 2666 | |
2665 | 2667 | } |
2668 | + return | |
2666 | 2669 | } |
2667 | 2670 | |
2668 | 2671 | }, | ... | ... |
packageE/pages/cart/cart_wk/cart_wk.js
... | ... | @@ -2145,6 +2145,7 @@ Page({ |
2145 | 2145 | th.confirm_quan_befor() |
2146 | 2146 | } |
2147 | 2147 | } |
2148 | + return | |
2148 | 2149 | } |
2149 | 2150 | if (length2 == 1) { |
2150 | 2151 | console.error('优惠券2'); |
... | ... | @@ -2162,6 +2163,7 @@ Page({ |
2162 | 2163 | } |
2163 | 2164 | |
2164 | 2165 | } |
2166 | + return | |
2165 | 2167 | } |
2166 | 2168 | if (length3 == 1 && th.data.exp_type == 0) { |
2167 | 2169 | console.error('优惠券3'); |
... | ... | @@ -2178,6 +2180,7 @@ Page({ |
2178 | 2180 | th.confirm_quan_befor() |
2179 | 2181 | |
2180 | 2182 | } |
2183 | + return | |
2181 | 2184 | } |
2182 | 2185 | |
2183 | 2186 | }, | ... | ... |