diff --git a/packageA/pages/prom_list/prom_list.js b/packageA/pages/prom_list/prom_list.js index 4e985ca..0c8e2ef 100644 --- a/packageA/pages/prom_list/prom_list.js +++ b/packageA/pages/prom_list/prom_list.js @@ -40,7 +40,8 @@ Page({ g_buy_num: null, sele_collocation:null, - room_id:0, //房间号 + room_id:0, //房间号 + is_coupon: 1, //搭配促销禁用 }, //------初始化加载---------- @@ -262,15 +263,17 @@ Page({ } if (!ee.data.collocationList) { - wx.setStorageSync('is_coupon', 1); /*---获取活动的重表---*/ //调用接口判断订单优惠, getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + ee.data.gid + "/2", {}).then(res => { if (res.data.code == 0) { - var r_data = res.data.data; + var r_data = res.data.data; + + th.data.is_coupon = r_data.collocationPromList.is_coupon; + + th.loop_promise(0, r_data.collocationList, function () { // 设置搭配购是否使用优惠卷 - wx.setStorageSync('is_coupon', r_data.collocationPromList.is_coupon); ee.setData({ collocationGoods: r_data.collocationPromList, collocationList: r_data.collocationList, @@ -531,6 +534,8 @@ Page({ newd['pick_dis'] = th.data.sto_sele_distr; newd["collocation_goods"]=th.data.sele_collocation; + newd["is_coupon"] = th.data.is_coupon; + th.buyNow(newd); }, diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 2e7798e..1b55ae1 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -166,11 +166,9 @@ Page({ //----------子页返回父页触发---------- onShow: function () { var th = this; - // 搭配购是否使用优惠卷 - var isCoupon = wx.getStorageSync('is_coupon'); th.setData({ show_submit: 0, - is_coupon: isCoupon, + }); //让提交先掩藏 th.data.g_cart_q_time = null; @@ -819,6 +817,8 @@ Page({ get_buy_goods: function (e) { var th = this; var gg = to.get_b_now(); + + //--------如果goods_id一样,就是要立即购买----- if (e == gg.goods_id) { a.get("/api/weshop/goods/get/" + oo.stoid + "/" + e, { @@ -968,6 +968,10 @@ Page({ //--看是不是搭配促销-- if (gg.prom_type == 5) { + th.setData({ + 'is_coupon': gg.is_coupon + }); + t.data.data.prom_id = gg.prom_id; t.data.data.prom_type = 5; if (gg.room_id) { diff --git a/pages/cart/cart2/cart2.wxml b/pages/cart/cart2/cart2.wxml index 225a0aa..b91f5ad 100644 --- a/pages/cart/cart2/cart2.wxml +++ b/pages/cart/cart2/cart2.wxml @@ -351,7 +351,7 @@ - 优惠券2222 {{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list?get_by_quan_list.length:0)}}张可用 + 优惠券 {{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list?get_by_quan_list.length:0)}}张可用 不使用