Commit ea12e918715f633e1f013a5f929bdc9cd45e1325
1 parent
778b03d2
拼团的优化
Showing
2 changed files
with
47 additions
and
20 deletions
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -156,6 +156,8 @@ Page({ |
| 156 | 156 | prom_st: 0, |
| 157 | 157 | f_prom_st: 0, |
| 158 | 158 | prom_r_null: 0, |
| 159 | + f_prom_r_null: 0, | |
| 160 | + | |
| 159 | 161 | prom_end_time: null, |
| 160 | 162 | prom_start_time: null, |
| 161 | 163 | prom_act: null, |
| ... | ... | @@ -1024,6 +1026,10 @@ Page({ |
| 1024 | 1026 | var ee = this, |
| 1025 | 1027 | gid = this.data.gid, |
| 1026 | 1028 | i = getApp().request; |
| 1029 | + if(this.data.front_g){ | |
| 1030 | + gid = this.data.front_g.goods_id; | |
| 1031 | + } | |
| 1032 | + | |
| 1027 | 1033 | |
| 1028 | 1034 | this.wait_for_store_config(); |
| 1029 | 1035 | //先检验一下商品的活动情况 |
| ... | ... | @@ -1229,8 +1235,13 @@ Page({ |
| 1229 | 1235 | } |
| 1230 | 1236 | ee.data.g_buy_num = new Map(); |
| 1231 | 1237 | |
| 1238 | + | |
| 1239 | + //再返回的时候,prom_id要以f_prom_act为准 | |
| 1240 | + var c_prom_id=ee.data.data.prom_id; | |
| 1241 | + if(ee.data.f_prom_act) c_prom_id=ee.data.f_prom_act.id; | |
| 1242 | + | |
| 1232 | 1243 | //-- 增加相同的活动 -- |
| 1233 | - ee.check_prom(gid, ee.data.data.prom_type, ee.data.data.prom_id); | |
| 1244 | + ee.check_prom(gid, ee.data.data.prom_type, c_prom_id); | |
| 1234 | 1245 | |
| 1235 | 1246 | var th = ee; |
| 1236 | 1247 | if (ee.data.cat_name == '') { |
| ... | ... | @@ -2716,11 +2727,11 @@ Page({ |
| 2716 | 2727 | |
| 2717 | 2728 | closeSpecModal: function () { |
| 2718 | 2729 | if (this.data.openSpecModal_pt && this.data.is_normal) { |
| 2719 | - this.get_sto(); | |
| 2720 | 2730 | this.setData({ |
| 2721 | - sele_g: this.data.data, | |
| 2722 | - gid: this.data.data.goods_id | |
| 2731 | + sele_g: this.data.front_g, | |
| 2732 | + gid: this.data.front_g.goods_id | |
| 2723 | 2733 | }) |
| 2734 | + this.get_sto(); | |
| 2724 | 2735 | this.sele_spec_chech_activity(1); |
| 2725 | 2736 | } |
| 2726 | 2737 | |
| ... | ... | @@ -4797,7 +4808,9 @@ Page({ |
| 4797 | 4808 | if (em.data.code == 0) { |
| 4798 | 4809 | |
| 4799 | 4810 | if (em.data.data <= 0) ee.setData({ |
| 4800 | - prom_r_null: 1,pro_null:1 | |
| 4811 | + prom_r_null: 1, | |
| 4812 | + f_prom_r_null: 1, | |
| 4813 | + pro_null:1, | |
| 4801 | 4814 | }); |
| 4802 | 4815 | //拿取价格并且判断时间-- |
| 4803 | 4816 | getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, { |
| ... | ... | @@ -5298,7 +5311,8 @@ Page({ |
| 5298 | 5311 | var endTime2 = th.data.prom_act.end_time; |
| 5299 | 5312 | th.setData({ |
| 5300 | 5313 | prom_time_text: '距结束还剩:', |
| 5301 | - prom_st: 1 | |
| 5314 | + prom_st: 1, | |
| 5315 | + f_prom_st: 1, | |
| 5302 | 5316 | }) |
| 5303 | 5317 | setTimeout(function () { |
| 5304 | 5318 | th.countDown(endTime2) |
| ... | ... | @@ -5315,7 +5329,8 @@ Page({ |
| 5315 | 5329 | } |
| 5316 | 5330 | th.setData({ |
| 5317 | 5331 | prom_time_text: '活动已经结束:', |
| 5318 | - prom_st: 3 | |
| 5332 | + prom_st: 3, | |
| 5333 | + f_prom_st: 3 | |
| 5319 | 5334 | }) |
| 5320 | 5335 | th.setData({ |
| 5321 | 5336 | djs: obj |
| ... | ... | @@ -5466,9 +5481,9 @@ Page({ |
| 5466 | 5481 | //如果是拼单活动的普通购买 |
| 5467 | 5482 | if (ind == 1) { |
| 5468 | 5483 | |
| 5469 | - | |
| 5470 | - //要把不匹配还原 | |
| 5471 | - if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ | |
| 5484 | + if(th.data.front_pick){ | |
| 5485 | + th.setData({def_pick_store: ut.deep_cp(th.data.front_pick)}); | |
| 5486 | + }else if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ //要把不匹配还原 | |
| 5472 | 5487 | th.data.def_pick_store.is_no_dis_nor=0; |
| 5473 | 5488 | th.setData({def_pick_store:th.data.def_pick_store}) |
| 5474 | 5489 | } |
| ... | ... | @@ -5919,6 +5934,14 @@ Page({ |
| 5919 | 5934 | |
| 5920 | 5935 | //----------立即购买_pt----------- |
| 5921 | 5936 | buyNow_pt: function (e) { |
| 5937 | + | |
| 5938 | + this.setData({ | |
| 5939 | + openSpecModal: 0, | |
| 5940 | + openSpecModal_inte: 0, | |
| 5941 | + openSpecModal_inte_normal: 0, | |
| 5942 | + openSpecModal_pt: 0, | |
| 5943 | + openSpecModal_flash_normal:0 | |
| 5944 | + }) | |
| 5922 | 5945 | |
| 5923 | 5946 | wxlog.info(getApp().globalData.user_id+'-拼团立即购买:'+JSON.stringify(e)); |
| 5924 | 5947 | |
| ... | ... | @@ -8460,8 +8483,12 @@ Page({ |
| 8460 | 8483 | |
| 8461 | 8484 | }, |
| 8462 | 8485 | |
| 8463 | - //-- 积分购 -- | |
| 8486 | + //-- 积分购购买弹出框 -- | |
| 8464 | 8487 | go_pay_integral: function () { |
| 8488 | + | |
| 8489 | + //-- 在打开弹出框的时候,front_pk门店要赋值 -- | |
| 8490 | + this.setData({def_pick_store: ut.deep_cp(this.data.front_pick)}); | |
| 8491 | + | |
| 8465 | 8492 | this.data.g_buy_num = new Map(); |
| 8466 | 8493 | this.get_sto(0) |
| 8467 | 8494 | this.setData({ |
| ... | ... | @@ -8470,14 +8497,15 @@ Page({ |
| 8470 | 8497 | }); |
| 8471 | 8498 | }, |
| 8472 | 8499 | |
| 8473 | - //-- 积分购普通购买 -- | |
| 8500 | + //-- 积分购普通购买弹出框 -- | |
| 8474 | 8501 | go_pay_integral_normal:async function () { |
| 8475 | 8502 | |
| 8476 | 8503 | this.data.g_buy_num = new Map(); |
| 8477 | 8504 | var th = this; |
| 8478 | 8505 | |
| 8479 | - //要把不匹配还原 | |
| 8480 | - if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ | |
| 8506 | + if(th.data.front_pick){ | |
| 8507 | + th.setData({def_pick_store: ut.deep_cp(th.data.front_pick)}); | |
| 8508 | + }else if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ //要把不匹配还原 | |
| 8481 | 8509 | th.data.def_pick_store.is_no_dis_nor=0; |
| 8482 | 8510 | th.setData({def_pick_store:th.data.def_pick_store}) |
| 8483 | 8511 | } |
| ... | ... | @@ -8515,13 +8543,12 @@ Page({ |
| 8515 | 8543 | this.setData({ |
| 8516 | 8544 | openSpecModal_inte_normal: 0 |
| 8517 | 8545 | }); |
| 8518 | - //要进行还原 | |
| 8519 | - this.get_sto(); | |
| 8546 | + //要进行还原 | |
| 8520 | 8547 | this.setData({ |
| 8521 | - sele_g: this.data.data, | |
| 8522 | - gid: this.data.data.goods_id | |
| 8548 | + sele_g: this.data.front_g, | |
| 8549 | + gid: this.data.front_g.goods_id | |
| 8523 | 8550 | }) |
| 8524 | - | |
| 8551 | + this.get_sto(); | |
| 8525 | 8552 | this.sele_spec_chech_activity(); |
| 8526 | 8553 | }, |
| 8527 | 8554 | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -1119,7 +1119,7 @@ |
| 1119 | 1119 | </block> |
| 1120 | 1120 | <!-- -----秒杀------ --> |
| 1121 | 1121 | <block wx:if="{{prom_type==1 || prom_type==2}}"> |
| 1122 | - <block wx:if="{{prom_st==1 && !prom_r_null}}"> | |
| 1122 | + <block wx:if="{{f_prom_st==1 && !prom_r_null}}"> | |
| 1123 | 1123 | <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> |
| 1124 | 1124 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view> |
| 1125 | 1125 | </block> | ... | ... |