Commit e9aec8f885a688339d52bf4a631ed6f2a9d9dc89
1 parent
df453f1b
OA搭配促销增加使用优惠卷开关
Showing
3 changed files
with
17 additions
and
8 deletions
packageA/pages/prom_list/prom_list.js
@@ -40,7 +40,8 @@ Page({ | @@ -40,7 +40,8 @@ Page({ | ||
40 | g_buy_num: null, | 40 | g_buy_num: null, |
41 | sele_collocation:null, | 41 | sele_collocation:null, |
42 | 42 | ||
43 | - room_id:0, //房间号 | 43 | + room_id:0, //房间号 |
44 | + is_coupon: 1, //搭配促销禁用 | ||
44 | }, | 45 | }, |
45 | 46 | ||
46 | //------初始化加载---------- | 47 | //------初始化加载---------- |
@@ -262,15 +263,17 @@ Page({ | @@ -262,15 +263,17 @@ Page({ | ||
262 | } | 263 | } |
263 | 264 | ||
264 | if (!ee.data.collocationList) { | 265 | if (!ee.data.collocationList) { |
265 | - wx.setStorageSync('is_coupon', 1); | ||
266 | /*---获取活动的重表---*/ | 266 | /*---获取活动的重表---*/ |
267 | //调用接口判断订单优惠, | 267 | //调用接口判断订单优惠, |
268 | getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + ee.data.gid + "/2", {}).then(res => { | 268 | getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + ee.data.gid + "/2", {}).then(res => { |
269 | if (res.data.code == 0) { | 269 | if (res.data.code == 0) { |
270 | - var r_data = res.data.data; | 270 | + var r_data = res.data.data; |
271 | + | ||
272 | + th.data.is_coupon = r_data.collocationPromList.is_coupon; | ||
273 | + | ||
274 | + | ||
271 | th.loop_promise(0, r_data.collocationList, function () { | 275 | th.loop_promise(0, r_data.collocationList, function () { |
272 | // 设置搭配购是否使用优惠卷 | 276 | // 设置搭配购是否使用优惠卷 |
273 | - wx.setStorageSync('is_coupon', r_data.collocationPromList.is_coupon); | ||
274 | ee.setData({ | 277 | ee.setData({ |
275 | collocationGoods: r_data.collocationPromList, | 278 | collocationGoods: r_data.collocationPromList, |
276 | collocationList: r_data.collocationList, | 279 | collocationList: r_data.collocationList, |
@@ -531,6 +534,8 @@ Page({ | @@ -531,6 +534,8 @@ Page({ | ||
531 | newd['pick_dis'] = th.data.sto_sele_distr; | 534 | newd['pick_dis'] = th.data.sto_sele_distr; |
532 | newd["collocation_goods"]=th.data.sele_collocation; | 535 | newd["collocation_goods"]=th.data.sele_collocation; |
533 | 536 | ||
537 | + newd["is_coupon"] = th.data.is_coupon; | ||
538 | + | ||
534 | th.buyNow(newd); | 539 | th.buyNow(newd); |
535 | 540 | ||
536 | }, | 541 | }, |
pages/cart/cart2/cart2.js
@@ -166,11 +166,9 @@ Page({ | @@ -166,11 +166,9 @@ Page({ | ||
166 | //----------子页返回父页触发---------- | 166 | //----------子页返回父页触发---------- |
167 | onShow: function () { | 167 | onShow: function () { |
168 | var th = this; | 168 | var th = this; |
169 | - // 搭配购是否使用优惠卷 | ||
170 | - var isCoupon = wx.getStorageSync('is_coupon'); | ||
171 | th.setData({ | 169 | th.setData({ |
172 | show_submit: 0, | 170 | show_submit: 0, |
173 | - is_coupon: isCoupon, | 171 | + |
174 | }); //让提交先掩藏 | 172 | }); //让提交先掩藏 |
175 | th.data.g_cart_q_time = null; | 173 | th.data.g_cart_q_time = null; |
176 | 174 | ||
@@ -819,6 +817,8 @@ Page({ | @@ -819,6 +817,8 @@ Page({ | ||
819 | get_buy_goods: function (e) { | 817 | get_buy_goods: function (e) { |
820 | var th = this; | 818 | var th = this; |
821 | var gg = to.get_b_now(); | 819 | var gg = to.get_b_now(); |
820 | + | ||
821 | + | ||
822 | //--------如果goods_id一样,就是要立即购买----- | 822 | //--------如果goods_id一样,就是要立即购买----- |
823 | if (e == gg.goods_id) { | 823 | if (e == gg.goods_id) { |
824 | a.get("/api/weshop/goods/get/" + oo.stoid + "/" + e, { | 824 | a.get("/api/weshop/goods/get/" + oo.stoid + "/" + e, { |
@@ -968,6 +968,10 @@ Page({ | @@ -968,6 +968,10 @@ Page({ | ||
968 | //--看是不是搭配促销-- | 968 | //--看是不是搭配促销-- |
969 | if (gg.prom_type == 5) { | 969 | if (gg.prom_type == 5) { |
970 | 970 | ||
971 | + th.setData({ | ||
972 | + 'is_coupon': gg.is_coupon | ||
973 | + }); | ||
974 | + | ||
971 | t.data.data.prom_id = gg.prom_id; | 975 | t.data.data.prom_id = gg.prom_id; |
972 | t.data.data.prom_type = 5; | 976 | t.data.data.prom_type = 5; |
973 | if (gg.room_id) { | 977 | if (gg.room_id) { |
pages/cart/cart2/cart2.wxml
@@ -351,7 +351,7 @@ | @@ -351,7 +351,7 @@ | ||
351 | <view class="xc-coupon-frame flex-center" data-bn="1" bindtap="open_coupon_list" data-pickid="{{bn_pick}}" wx:if="{{is_coupon > 0 && ((selected_quan_list && selected_quan_list.length>0) || get_by_quan_list!=null)}}"> | 351 | <view class="xc-coupon-frame flex-center" data-bn="1" bindtap="open_coupon_list" data-pickid="{{bn_pick}}" wx:if="{{is_coupon > 0 && ((selected_quan_list && selected_quan_list.length>0) || get_by_quan_list!=null)}}"> |
352 | <view class="work-frame flex-space-between"> | 352 | <view class="work-frame flex-space-between"> |
353 | <view class="work"> | 353 | <view class="work"> |
354 | - 优惠券2222 <text class="quan_num_show">{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list?get_by_quan_list.length:0)}}张可用</text> | 354 | + 优惠券 <text class="quan_num_show">{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list?get_by_quan_list.length:0)}}张可用</text> |
355 | </view> | 355 | </view> |
356 | <view class="xc-right-frame"> | 356 | <view class="xc-right-frame"> |
357 | <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text> | 357 | <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text> |