Commit f09f9c136daca51f42aa1c15ceb0806062bbd9d8

Authored by WXD-SEASON\season
2 parents 214634ad a37de3e5

Merge branch 'dev_oa_fu7' into dev

pages/giftpack/giftpacklist/giftpacklist.js
@@ -75,7 +75,9 @@ Page({ @@ -75,7 +75,9 @@ Page({
75 canvasHidden:true, 75 canvasHidden:true,
76 76
77 screenWidth: 0, 77 screenWidth: 0,
78 - submit:0 78 + submit:0,
  79 +
  80 + is_detail:1 //是详情页面的购买
79 }, 81 },
80 onLoad: function (options) { 82 onLoad: function (options) {
81 83
pages/giftpack/public/buy_com.js
@@ -202,6 +202,7 @@ module.exports = { @@ -202,6 +202,7 @@ module.exports = {
202 202
203 //-- 统一购买 -- 203 //-- 统一购买 --
204 buy_libao:function (th) { 204 buy_libao:function (th) {
  205 + var _that=this;
205 if(th.data.sele_g.is_pickup){ 206 if(th.data.sele_g.is_pickup){
206 if(!th.data.def_pick_store || (th.data.def_pick_store && !th.data.def_pick_store.pickup_id)){ 207 if(!th.data.def_pick_store || (th.data.def_pick_store && !th.data.def_pick_store.pickup_id)){
207 getApp().my_warnning("请先选择门店", 1, th); 208 getApp().my_warnning("请先选择门店", 1, th);
@@ -249,13 +250,21 @@ module.exports = { @@ -249,13 +250,21 @@ module.exports = {
249 getApp().request.json_post(url, json, 250 getApp().request.json_post(url, json,
250 function (res) { 251 function (res) {
251 if (res.data.code == 0 && res.data.data) { 252 if (res.data.code == 0 && res.data.data) {
  253 +
  254 +
  255 +
  256 +
252 switch(that.data.buyType){ 257 switch(that.data.buyType){
253 case 1://立即兑换 258 case 1://立即兑换
  259 + var order_sn = res.data.data;
  260 +
254 th.setData({submit:0}) 261 th.setData({submit:0})
255 getApp().my_warnning("兑换成功!", 1, th); 262 getApp().my_warnning("兑换成功!", 1, th);
256 th.closeSpecModal(); 263 th.closeSpecModal();
  264 + _that.go_detail(id,order_sn,th);
257 break; 265 break;
258 case 2://立即购买 266 case 2://立即购买
  267 +
259 var order_sn = res.data.data.orderSn; 268 var order_sn = res.data.data.orderSn;
260 269
261 var money=that.data.payMoney; 270 var money=that.data.payMoney;
@@ -276,9 +285,12 @@ module.exports = { @@ -276,9 +285,12 @@ module.exports = {
276 285
277 break; 286 break;
278 case 3://立即领取 287 case 3://立即领取
  288 +
  289 + var order_sn = res.data.data;
279 th.setData({submit:0}) 290 th.setData({submit:0})
280 getApp().my_warnning("领取成功!", 1, th); 291 getApp().my_warnning("领取成功!", 1, th);
281 th.closeSpecModal(); 292 th.closeSpecModal();
  293 + _that.go_detail(id,order_sn,th);
282 break; 294 break;
283 } 295 }
284 296
@@ -291,7 +303,15 @@ module.exports = { @@ -291,7 +303,15 @@ module.exports = {
291 th.setData({submit:0}) 303 th.setData({submit:0})
292 } 304 }
293 ) 305 )
  306 + },
  307 +
  308 + //-- 跳转到商品使用页面 --
  309 + go_detail(id,orderSn,th){
  310 + //不是详情页面,就不跳转了
  311 + if(!th.data.is_detail) return false;
294 312
  313 + var url='/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId='+id+'&orderSn='+orderSn;
  314 + getApp().goto(url);
295 }, 315 },
296 316
297 //------------处理门店--------------- 317 //------------处理门店---------------
pages/user/plus/plus.js
@@ -42,6 +42,9 @@ Page({ @@ -42,6 +42,9 @@ Page({
42 focus:false, 42 focus:false,
43 is_select: false, //是否选择营业员过 43 is_select: false, //是否选择营业员过
44 is_buy_card_id:"",//是否是链接直接过来购买的卡号id 44 is_buy_card_id:"",//是否是链接直接过来购买的卡号id
  45 +
  46 + is_fir_open:0 //防止多次打开
  47 +
45 }, 48 },
46 swiperChange: function (e) { 49 swiperChange: function (e) {
47 var currentId = e.detail.current; 50 var currentId = e.detail.current;
@@ -280,7 +283,7 @@ Page({ @@ -280,7 +283,7 @@ Page({
280 is_plusCard: parr, 283 is_plusCard: parr,
281 is_show: 1 284 is_show: 1
282 }) 285 })
283 - if(th.data.is_buy_card_id){ 286 + if(th.data.is_buy_card_id && !th.data.is_fir_open){
284 let i = parr.findIndex(item=>item.CardId==th.data.is_buy_card_id) 287 let i = parr.findIndex(item=>item.CardId==th.data.is_buy_card_id)
285 if(i>-1){ 288 if(i>-1){
286 // th.setData({ 289 // th.setData({
@@ -294,6 +297,7 @@ Page({ @@ -294,6 +297,7 @@ Page({
294 } 297 }
295 298
296 setTimeout(function (){ 299 setTimeout(function (){
  300 + th.data.is_fir_open=1; //保证不多次打开
297 th.Opening(e) 301 th.Opening(e)
298 },1000) 302 },1000)
299 303