Commit a37de3e5edeaf703bbb996db91bfd319ccc072c2
1 parent
111fbdf6
专享礼包详情页面,在购买,领取,兑换成功后跳转
Showing
2 changed files
with
23 additions
and
1 deletions
pages/giftpack/giftpacklist/giftpacklist.js
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 | //------------处理门店--------------- |