Commit 0b05dccca984b2abf933c31aeacb28cc0a2b9802
1 parent
ba26d6da
优惠促销优惠券和商品详情优惠券冲突解决
Showing
1 changed file
with
3 additions
and
8 deletions
pages/cart/cart2/cart2.js
@@ -1298,7 +1298,7 @@ Page({ | @@ -1298,7 +1298,7 @@ Page({ | ||
1298 | for (var j = 0; j < ord_goods.length; j++) { | 1298 | for (var j = 0; j < ord_goods.length; j++) { |
1299 | if (ord_goods[j].is_gift) continue; | 1299 | if (ord_goods[j].is_gift) continue; |
1300 | if (ord_goods[j].prom_type == 3 && ord_goods[j].prom_id == item_map.prom_id) { | 1300 | if (ord_goods[j].prom_type == 3 && ord_goods[j].prom_id == item_map.prom_id) { |
1301 | - ord_goods[j].is_xz_yh = item_map.is_xz_yh; | 1301 | + ord_goods[j].is_xz_yh =ord_goods[j].is_xz_yh?ord_goods[j].is_xz_yh:item_map.is_xz_yh; |
1302 | ord_goods[j].is_past = item_map.is_past; | 1302 | ord_goods[j].is_past = item_map.is_past; |
1303 | ord_goods[j].account_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_fir; | 1303 | ord_goods[j].account_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_fir; |
1304 | ord_goods[j].account_yu_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_yu_fir; | 1304 | ord_goods[j].account_yu_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_yu_fir; |
@@ -3769,7 +3769,6 @@ Page({ | @@ -3769,7 +3769,6 @@ Page({ | ||
3769 | //-----获取购物车进来的劵------- | 3769 | //-----获取购物车进来的劵------- |
3770 | get_cart_quan: async function (order_prom_list_cart) { | 3770 | get_cart_quan: async function (order_prom_list_cart) { |
3771 | var th = this; | 3771 | var th = this; |
3772 | - var is_xz_yh = 1; | ||
3773 | var user_id = getApp().globalData.user_id; | 3772 | var user_id = getApp().globalData.user_id; |
3774 | //等待值的出现 | 3773 | //等待值的出现 |
3775 | //getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () { | 3774 | //getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () { |
@@ -3828,8 +3827,6 @@ Page({ | @@ -3828,8 +3827,6 @@ Page({ | ||
3828 | if (th.data.prom_goods_map[pickup_id][gd.prom_id].is_xz_yh) continue; | 3827 | if (th.data.prom_goods_map[pickup_id][gd.prom_id].is_xz_yh) continue; |
3829 | th.data.prom_goods_map[pickup_id][gd.prom_id].coupon_sele = 1; | 3828 | th.data.prom_goods_map[pickup_id][gd.prom_id].coupon_sele = 1; |
3830 | } | 3829 | } |
3831 | - is_xz_yh = 0; | ||
3832 | - | ||
3833 | var item_price = gd.goods_price * gd.goods_num; | 3830 | var item_price = gd.goods_price * gd.goods_num; |
3834 | var item_price2 = item_price; | 3831 | var item_price2 = item_price; |
3835 | 3832 | ||
@@ -3905,10 +3902,8 @@ Page({ | @@ -3905,10 +3902,8 @@ Page({ | ||
3905 | arr[ind].ckeck_quan_price = ckeck_quan_price - (cut_price ? cut_price : 0); | 3902 | arr[ind].ckeck_quan_price = ckeck_quan_price - (cut_price ? cut_price : 0); |
3906 | arr[ind].check_quan_ware_list = check_quan_ware_list; | 3903 | arr[ind].check_quan_ware_list = check_quan_ware_list; |
3907 | arr[ind].check_quan_price_list = check_quan_price_list; | 3904 | arr[ind].check_quan_price_list = check_quan_price_list; |
3908 | - arr[ind].is_xz_yh = is_xz_yh; | ||
3909 | - | ||
3910 | //是否关闭使用优惠券 | 3905 | //是否关闭使用优惠券 |
3911 | - if (th.data.is_close_quan != 1 && !is_xz_yh) { | 3906 | + if (th.data.is_close_quan != 1 ) { |
3912 | //--调用接口,获取优惠券的列表,3秒钟内控制接口请求-- | 3907 | //--调用接口,获取优惠券的列表,3秒钟内控制接口请求-- |
3913 | var url = "/api/weshop/couponList/getUseCouponList"; | 3908 | var url = "/api/weshop/couponList/getUseCouponList"; |
3914 | await app.request.promiseGet(url, { | 3909 | await app.request.promiseGet(url, { |
@@ -4040,7 +4035,7 @@ Page({ | @@ -4040,7 +4035,7 @@ Page({ | ||
4040 | if (res.data.code == 0) { | 4035 | if (res.data.code == 0) { |
4041 | var get_data = res.data.data; | 4036 | var get_data = res.data.data; |
4042 | arr.is_bz = prom.is_bz; //是不是倍增 | 4037 | arr.is_bz = prom.is_bz; //是不是倍增 |
4043 | - arr.is_xz_yh = prom.is_xz_yh; //是不是优惠 | 4038 | + arr.is_xz_yh =arr.is_xz_yh?arr.is_xz_yh:prom.is_xz_yh; //是不是优惠 |
4044 | arr.bs = get_data.bs; //是不是倍数 | 4039 | arr.bs = get_data.bs; //是不是倍数 |
4045 | arr.is_past = get_data.is_past; //是不是包邮 | 4040 | arr.is_past = get_data.is_past; //是不是包邮 |
4046 | arr.prom_price = get_data.price >= 0 ? get_data.price : price; | 4041 | arr.prom_price = get_data.price >= 0 ? get_data.price : price; |