diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index ccb8767..9429abe 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -75,7 +75,9 @@ Page({ canvasHidden:true, screenWidth: 0, - submit:0 + submit:0, + + is_detail:1 //是详情页面的购买 }, onLoad: function (options) { diff --git a/pages/giftpack/public/buy_com.js b/pages/giftpack/public/buy_com.js index 49fb0b4..4c127b5 100644 --- a/pages/giftpack/public/buy_com.js +++ b/pages/giftpack/public/buy_com.js @@ -202,6 +202,7 @@ module.exports = { //-- 统一购买 -- buy_libao:function (th) { + var _that=this; if(th.data.sele_g.is_pickup){ if(!th.data.def_pick_store || (th.data.def_pick_store && !th.data.def_pick_store.pickup_id)){ getApp().my_warnning("请先选择门店", 1, th); @@ -249,13 +250,21 @@ module.exports = { getApp().request.json_post(url, json, function (res) { if (res.data.code == 0 && res.data.data) { + + + + switch(that.data.buyType){ case 1://立即兑换 + var order_sn = res.data.data; + th.setData({submit:0}) getApp().my_warnning("兑换成功!", 1, th); th.closeSpecModal(); + _that.go_detail(id,order_sn,th); break; case 2://立即购买 + var order_sn = res.data.data.orderSn; var money=that.data.payMoney; @@ -276,9 +285,12 @@ module.exports = { break; case 3://立即领取 + + var order_sn = res.data.data; th.setData({submit:0}) getApp().my_warnning("领取成功!", 1, th); th.closeSpecModal(); + _that.go_detail(id,order_sn,th); break; } @@ -291,7 +303,15 @@ module.exports = { th.setData({submit:0}) } ) + }, + + //-- 跳转到商品使用页面 -- + go_detail(id,orderSn,th){ + //不是详情页面,就不跳转了 + if(!th.data.is_detail) return false; + var url='/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId='+id+'&orderSn='+orderSn; + getApp().goto(url); }, //------------处理门店--------------- diff --git a/pages/user/plus/plus.js b/pages/user/plus/plus.js index 27d2327..5d38a14 100644 --- a/pages/user/plus/plus.js +++ b/pages/user/plus/plus.js @@ -42,6 +42,9 @@ Page({ focus:false, is_select: false, //是否选择营业员过 is_buy_card_id:"",//是否是链接直接过来购买的卡号id + + is_fir_open:0 //防止多次打开 + }, swiperChange: function (e) { var currentId = e.detail.current; @@ -280,7 +283,7 @@ Page({ is_plusCard: parr, is_show: 1 }) - if(th.data.is_buy_card_id){ + if(th.data.is_buy_card_id && !th.data.is_fir_open){ let i = parr.findIndex(item=>item.CardId==th.data.is_buy_card_id) if(i>-1){ // th.setData({ @@ -294,6 +297,7 @@ Page({ } setTimeout(function (){ + th.data.is_fir_open=1; //保证不多次打开 th.Opening(e) },1000)