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 | 40 | g_buy_num: null, |
| 41 | 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 | 263 | } |
| 263 | 264 | |
| 264 | 265 | if (!ee.data.collocationList) { |
| 265 | - wx.setStorageSync('is_coupon', 1); | |
| 266 | 266 | /*---获取活动的重表---*/ |
| 267 | 267 | //调用接口判断订单优惠, |
| 268 | 268 | getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + ee.data.gid + "/2", {}).then(res => { |
| 269 | 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 | 275 | th.loop_promise(0, r_data.collocationList, function () { |
| 272 | 276 | // 设置搭配购是否使用优惠卷 |
| 273 | - wx.setStorageSync('is_coupon', r_data.collocationPromList.is_coupon); | |
| 274 | 277 | ee.setData({ |
| 275 | 278 | collocationGoods: r_data.collocationPromList, |
| 276 | 279 | collocationList: r_data.collocationList, |
| ... | ... | @@ -531,6 +534,8 @@ Page({ |
| 531 | 534 | newd['pick_dis'] = th.data.sto_sele_distr; |
| 532 | 535 | newd["collocation_goods"]=th.data.sele_collocation; |
| 533 | 536 | |
| 537 | + newd["is_coupon"] = th.data.is_coupon; | |
| 538 | + | |
| 534 | 539 | th.buyNow(newd); |
| 535 | 540 | |
| 536 | 541 | }, | ... | ... |
pages/cart/cart2/cart2.js
| ... | ... | @@ -166,11 +166,9 @@ Page({ |
| 166 | 166 | //----------子页返回父页触发---------- |
| 167 | 167 | onShow: function () { |
| 168 | 168 | var th = this; |
| 169 | - // 搭配购是否使用优惠卷 | |
| 170 | - var isCoupon = wx.getStorageSync('is_coupon'); | |
| 171 | 169 | th.setData({ |
| 172 | 170 | show_submit: 0, |
| 173 | - is_coupon: isCoupon, | |
| 171 | + | |
| 174 | 172 | }); //让提交先掩藏 |
| 175 | 173 | th.data.g_cart_q_time = null; |
| 176 | 174 | |
| ... | ... | @@ -819,6 +817,8 @@ Page({ |
| 819 | 817 | get_buy_goods: function (e) { |
| 820 | 818 | var th = this; |
| 821 | 819 | var gg = to.get_b_now(); |
| 820 | + | |
| 821 | + | |
| 822 | 822 | //--------如果goods_id一样,就是要立即购买----- |
| 823 | 823 | if (e == gg.goods_id) { |
| 824 | 824 | a.get("/api/weshop/goods/get/" + oo.stoid + "/" + e, { |
| ... | ... | @@ -968,6 +968,10 @@ Page({ |
| 968 | 968 | //--看是不是搭配促销-- |
| 969 | 969 | if (gg.prom_type == 5) { |
| 970 | 970 | |
| 971 | + th.setData({ | |
| 972 | + 'is_coupon': gg.is_coupon | |
| 973 | + }); | |
| 974 | + | |
| 971 | 975 | t.data.data.prom_id = gg.prom_id; |
| 972 | 976 | t.data.data.prom_type = 5; |
| 973 | 977 | if (gg.room_id) { | ... | ... |
pages/cart/cart2/cart2.wxml
| ... | ... | @@ -351,7 +351,7 @@ |
| 351 | 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 | 352 | <view class="work-frame flex-space-between"> |
| 353 | 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 | 355 | </view> |
| 356 | 356 | <view class="xc-right-frame"> |
| 357 | 357 | <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text> | ... | ... |