Commit 2f8fab9faf2117005e7439fdc238b782a8b835d9
1 parent
9b5c4b1b
包邮券的显示优化
Showing
3 changed files
with
33 additions
and
6 deletions
packageC/pages/presell/cart/cart2.js
@@ -929,7 +929,7 @@ Page({ | @@ -929,7 +929,7 @@ Page({ | ||
929 | //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮,同时商品购买时候,服务卡项购买不计算运费---------- | 929 | //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮,同时商品购买时候,服务卡项购买不计算运费---------- |
930 | if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_past != 1 && th.data.act.goods_type==0) { | 930 | if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_past != 1 && th.data.act.goods_type==0) { |
931 | //看是不是有调用过包邮券 | 931 | //看是不是有调用过包邮券 |
932 | - if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1) { | 932 | + if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1 && !th.data.can_use_ord_prom[th.data.bn_pick] ) { |
933 | var condition = allpice - cut_price - quan_price; | 933 | var condition = allpice - cut_price - quan_price; |
934 | //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱--- | 934 | //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱--- |
935 | getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { | 935 | getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { |
@@ -959,6 +959,12 @@ Page({ | @@ -959,6 +959,12 @@ Page({ | ||
959 | }) | 959 | }) |
960 | } | 960 | } |
961 | 961 | ||
962 | + //要让包邮券消失,在使用非实收包邮券的时候 | ||
963 | + if(th.data.can_use_ord_prom[th.data.bn_pick]){ | ||
964 | + th.setData({ get_by_quan_list: null }); | ||
965 | + th.data.isget_by_quan[th.data.bn_pick] = 0; | ||
966 | + } | ||
967 | + | ||
962 | var shipping_price =0; | 968 | var shipping_price =0; |
963 | if(good.is_free_shipping == 0 ) { | 969 | if(good.is_free_shipping == 0 ) { |
964 | //-- 在没有使用包邮券的时候 -- | 970 | //-- 在没有使用包邮券的时候 -- |
packageE/pages/cart/cart2/cart2.js
@@ -3361,8 +3361,8 @@ Page({ | @@ -3361,8 +3361,8 @@ Page({ | ||
3361 | //--如果是物流,且选择了地址,就要开始显示包邮券,且包邮券也已经优惠了优惠活动的金额-- | 3361 | //--如果是物流,且选择了地址,就要开始显示包邮券,且包邮券也已经优惠了优惠活动的金额-- |
3362 | if (cart_item.exp_type == 0 && th.data.user_addr != null && !cart_item.is_xz_yh) { | 3362 | if (cart_item.exp_type == 0 && th.data.user_addr != null && !cart_item.is_xz_yh) { |
3363 | 3363 | ||
3364 | - //看是不是有调用过包邮券 | ||
3365 | - if (!th.data.isget_by_quan[pickid]) { | 3364 | + //看是不是有调用过包邮券,同时有使用非实收的订单促销,就也不能显示包邮券 |
3365 | + if (!th.data.isget_by_quan[pickid] && !this.data.can_use_ord_prom[pickid]) { | ||
3366 | //--判断要不要显示包邮券,调用接口,因为有for循环--- | 3366 | //--判断要不要显示包邮券,调用接口,因为有for循环--- |
3367 | await getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { | 3367 | await getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { |
3368 | data: { | 3368 | data: { |
@@ -3404,6 +3404,13 @@ Page({ | @@ -3404,6 +3404,13 @@ Page({ | ||
3404 | }) | 3404 | }) |
3405 | } | 3405 | } |
3406 | 3406 | ||
3407 | + //要让包邮券消失,在使用非实收包邮券的时候 | ||
3408 | + if(th.data.can_use_ord_prom[pickid]){ | ||
3409 | + var tt_by='get_by_quan_list_cart['+pickid+']'; | ||
3410 | + th.setData({ [tt_by]: null }); | ||
3411 | + th.data.isget_by_quan[pickid] = 0; | ||
3412 | + } | ||
3413 | + | ||
3407 | 3414 | ||
3408 | //-- 如果没有订单优惠,或者订单优惠中有勾选包邮模板 -- | 3415 | //-- 如果没有订单优惠,或者订单优惠中有勾选包邮模板 -- |
3409 | if (!ord_prom || ord_prom.is_post_temp) { | 3416 | if (!ord_prom || ord_prom.is_post_temp) { |
@@ -4103,8 +4110,8 @@ Page({ | @@ -4103,8 +4110,8 @@ Page({ | ||
4103 | 4110 | ||
4104 | //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮---------- | 4111 | //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮---------- |
4105 | if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_past != 1) { | 4112 | if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_past != 1) { |
4106 | - //看是不是有调用过包邮券 | ||
4107 | - if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1) { | 4113 | + //看是不是有调用过包邮券,同时非实收订单促销也不用使用包邮券 |
4114 | + if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1 && !th.data.can_use_ord_prom[th.data.bn_pick]) { | ||
4108 | 4115 | ||
4109 | //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱--- | 4116 | //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱--- |
4110 | getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { | 4117 | getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { |
@@ -4137,6 +4144,14 @@ Page({ | @@ -4137,6 +4144,14 @@ Page({ | ||
4137 | }) | 4144 | }) |
4138 | } | 4145 | } |
4139 | 4146 | ||
4147 | + | ||
4148 | + //要让包邮券消失,在使用非实收包邮券的时候 | ||
4149 | + if(th.data.can_use_ord_prom[th.data.bn_pick]){ | ||
4150 | + th.setData({ get_by_quan_list: null }); | ||
4151 | + th.data.isget_by_quan[th.data.bn_pick] = 0; | ||
4152 | + } | ||
4153 | + | ||
4154 | + | ||
4140 | var shipping_price = 0; | 4155 | var shipping_price = 0; |
4141 | var quan_no_goods_arr = null; | 4156 | var quan_no_goods_arr = null; |
4142 | var is_by_quan = 0; | 4157 | var is_by_quan = 0; |
packageE/pages/cart/cart2_pt/cart2_pt.js
@@ -869,7 +869,7 @@ Page({ | @@ -869,7 +869,7 @@ Page({ | ||
869 | if (th.data.user_addr != null && th.data.bn_exp_type == 0 && (th.data.kt_type != 3 || th.data.bn_goods.is_normal == 1)) { | 869 | if (th.data.user_addr != null && th.data.bn_exp_type == 0 && (th.data.kt_type != 3 || th.data.bn_goods.is_normal == 1)) { |
870 | 870 | ||
871 | //看是不是有调用过包邮券 | 871 | //看是不是有调用过包邮券 |
872 | - if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1) { | 872 | + if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1 && !th.data.can_use_ord_prom[th.data.bn_pick] ) { |
873 | 873 | ||
874 | //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱--- | 874 | //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱--- |
875 | getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { | 875 | getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { |
@@ -902,6 +902,12 @@ Page({ | @@ -902,6 +902,12 @@ Page({ | ||
902 | }) | 902 | }) |
903 | } | 903 | } |
904 | 904 | ||
905 | + //要让包邮券消失,在使用非实收包邮券的时候 | ||
906 | + if(th.data.can_use_ord_prom[th.data.bn_pick]){ | ||
907 | + th.setData({ get_by_quan_list: null }); | ||
908 | + th.data.isget_by_quan[th.data.bn_pick] = 0; | ||
909 | + } | ||
910 | + | ||
905 | if(good.is_free_shipping){ | 911 | if(good.is_free_shipping){ |
906 | var wl_txt = "formData.shipping_price"; | 912 | var wl_txt = "formData.shipping_price"; |
907 | th.setData({ [wl_txt]: 0 }) | 913 | th.setData({ [wl_txt]: 0 }) |