diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 2f46118..65d0cd4 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -156,6 +156,8 @@ Page({ prom_st: 0, f_prom_st: 0, prom_r_null: 0, + f_prom_r_null: 0, + prom_end_time: null, prom_start_time: null, prom_act: null, @@ -1024,6 +1026,10 @@ Page({ var ee = this, gid = this.data.gid, i = getApp().request; + if(this.data.front_g){ + gid = this.data.front_g.goods_id; + } + this.wait_for_store_config(); //先检验一下商品的活动情况 @@ -1229,8 +1235,13 @@ Page({ } ee.data.g_buy_num = new Map(); + + //再返回的时候,prom_id要以f_prom_act为准 + var c_prom_id=ee.data.data.prom_id; + if(ee.data.f_prom_act) c_prom_id=ee.data.f_prom_act.id; + //-- 增加相同的活动 -- - ee.check_prom(gid, ee.data.data.prom_type, ee.data.data.prom_id); + ee.check_prom(gid, ee.data.data.prom_type, c_prom_id); var th = ee; if (ee.data.cat_name == '') { @@ -2716,11 +2727,11 @@ Page({ closeSpecModal: function () { if (this.data.openSpecModal_pt && this.data.is_normal) { - this.get_sto(); this.setData({ - sele_g: this.data.data, - gid: this.data.data.goods_id + sele_g: this.data.front_g, + gid: this.data.front_g.goods_id }) + this.get_sto(); this.sele_spec_chech_activity(1); } @@ -4797,7 +4808,9 @@ Page({ if (em.data.code == 0) { if (em.data.data <= 0) ee.setData({ - prom_r_null: 1,pro_null:1 + prom_r_null: 1, + f_prom_r_null: 1, + pro_null:1, }); //拿取价格并且判断时间-- getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, { @@ -5298,7 +5311,8 @@ Page({ var endTime2 = th.data.prom_act.end_time; th.setData({ prom_time_text: '距结束还剩:', - prom_st: 1 + prom_st: 1, + f_prom_st: 1, }) setTimeout(function () { th.countDown(endTime2) @@ -5315,7 +5329,8 @@ Page({ } th.setData({ prom_time_text: '活动已经结束:', - prom_st: 3 + prom_st: 3, + f_prom_st: 3 }) th.setData({ djs: obj @@ -5466,9 +5481,9 @@ Page({ //如果是拼单活动的普通购买 if (ind == 1) { - - //要把不匹配还原 - if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ + if(th.data.front_pick){ + th.setData({def_pick_store: ut.deep_cp(th.data.front_pick)}); + }else if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ //要把不匹配还原 th.data.def_pick_store.is_no_dis_nor=0; th.setData({def_pick_store:th.data.def_pick_store}) } @@ -5919,6 +5934,14 @@ Page({ //----------立即购买_pt----------- buyNow_pt: function (e) { + + this.setData({ + openSpecModal: 0, + openSpecModal_inte: 0, + openSpecModal_inte_normal: 0, + openSpecModal_pt: 0, + openSpecModal_flash_normal:0 + }) wxlog.info(getApp().globalData.user_id+'-拼团立即购买:'+JSON.stringify(e)); @@ -8460,8 +8483,12 @@ Page({ }, - //-- 积分购 -- + //-- 积分购购买弹出框 -- go_pay_integral: function () { + + //-- 在打开弹出框的时候,front_pk门店要赋值 -- + this.setData({def_pick_store: ut.deep_cp(this.data.front_pick)}); + this.data.g_buy_num = new Map(); this.get_sto(0) this.setData({ @@ -8470,14 +8497,15 @@ Page({ }); }, - //-- 积分购普通购买 -- + //-- 积分购普通购买弹出框 -- go_pay_integral_normal:async function () { this.data.g_buy_num = new Map(); var th = this; - //要把不匹配还原 - if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ + if(th.data.front_pick){ + th.setData({def_pick_store: ut.deep_cp(th.data.front_pick)}); + }else if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ //要把不匹配还原 th.data.def_pick_store.is_no_dis_nor=0; th.setData({def_pick_store:th.data.def_pick_store}) } @@ -8515,13 +8543,12 @@ Page({ this.setData({ openSpecModal_inte_normal: 0 }); - //要进行还原 - this.get_sto(); + //要进行还原 this.setData({ - sele_g: this.data.data, - gid: this.data.data.goods_id + sele_g: this.data.front_g, + gid: this.data.front_g.goods_id }) - + this.get_sto(); this.sele_spec_chech_activity(); }, diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index 9588290..33ef28f 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -1119,7 +1119,7 @@ - + 加入购物车 立即抢购