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 | 202 | |
| 203 | 203 | //-- 统一购买 -- |
| 204 | 204 | buy_libao:function (th) { |
| 205 | + var _that=this; | |
| 205 | 206 | if(th.data.sele_g.is_pickup){ |
| 206 | 207 | if(!th.data.def_pick_store || (th.data.def_pick_store && !th.data.def_pick_store.pickup_id)){ |
| 207 | 208 | getApp().my_warnning("请先选择门店", 1, th); |
| ... | ... | @@ -249,13 +250,21 @@ module.exports = { |
| 249 | 250 | getApp().request.json_post(url, json, |
| 250 | 251 | function (res) { |
| 251 | 252 | if (res.data.code == 0 && res.data.data) { |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 252 | 257 | switch(that.data.buyType){ |
| 253 | 258 | case 1://立即兑换 |
| 259 | + var order_sn = res.data.data; | |
| 260 | + | |
| 254 | 261 | th.setData({submit:0}) |
| 255 | 262 | getApp().my_warnning("兑换成功!", 1, th); |
| 256 | 263 | th.closeSpecModal(); |
| 264 | + _that.go_detail(id,order_sn,th); | |
| 257 | 265 | break; |
| 258 | 266 | case 2://立即购买 |
| 267 | + | |
| 259 | 268 | var order_sn = res.data.data.orderSn; |
| 260 | 269 | |
| 261 | 270 | var money=that.data.payMoney; |
| ... | ... | @@ -276,9 +285,12 @@ module.exports = { |
| 276 | 285 | |
| 277 | 286 | break; |
| 278 | 287 | case 3://立即领取 |
| 288 | + | |
| 289 | + var order_sn = res.data.data; | |
| 279 | 290 | th.setData({submit:0}) |
| 280 | 291 | getApp().my_warnning("领取成功!", 1, th); |
| 281 | 292 | th.closeSpecModal(); |
| 293 | + _that.go_detail(id,order_sn,th); | |
| 282 | 294 | break; |
| 283 | 295 | } |
| 284 | 296 | |
| ... | ... | @@ -291,7 +303,15 @@ module.exports = { |
| 291 | 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 | //------------处理门店--------------- | ... | ... |