|
@@ -410,29 +410,34 @@
|
|
|
// 立即开刮
|
|
|
payment() {
|
|
|
this.payInfo = this.ticketList[this.ticketIndex]
|
|
|
- let data = {
|
|
|
- userCouponIds: [],
|
|
|
- autoCoupon: 1,
|
|
|
- boxId: this.payInfo.boxId,
|
|
|
- orderNum: 1
|
|
|
- }
|
|
|
- $http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
|
|
|
- if (res.code == 0) {
|
|
|
- let info = {
|
|
|
- ...res.data,
|
|
|
- ...this.payInfo,
|
|
|
- picUrl: this.payInfo.picUrl[0],
|
|
|
- couponTitle: res.data && res.data.couponList && res.data.couponList.length && res
|
|
|
- .data.couponList[0].title,
|
|
|
- couponId: res.data && res.data.couponList && res.data.couponList.length && res.data
|
|
|
- .couponList[0].id
|
|
|
- }
|
|
|
- this.payInfo = info
|
|
|
- this.payShow = true
|
|
|
+ if(this.payInfo) {
|
|
|
+ let data = {
|
|
|
+ userCouponIds: [],
|
|
|
+ autoCoupon: 1,
|
|
|
+ boxId: this.payInfo.boxId,
|
|
|
+ orderNum: 1
|
|
|
}
|
|
|
- }).catch(() => {
|
|
|
- uni.$u.toast('开刮失败,请重试!');
|
|
|
- })
|
|
|
+ $http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ let info = {
|
|
|
+ ...res.data,
|
|
|
+ ...this.payInfo,
|
|
|
+ picUrl: this.payInfo.picUrl[0],
|
|
|
+ couponTitle: res.data && res.data.couponList && res.data.couponList.length && res
|
|
|
+ .data.couponList[0].title,
|
|
|
+ couponId: res.data && res.data.couponList && res.data.couponList.length && res.data
|
|
|
+ .couponList[0].id
|
|
|
+ }
|
|
|
+ this.payInfo = info
|
|
|
+ this.payShow = true
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ uni.$u.toast('开刮失败,请重试!');
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ uni.$u.toast('盲票正在准备中');
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
|
|
|
// 关闭支付弹框
|
|
@@ -487,9 +492,14 @@
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- uni.navigateTo({
|
|
|
- url: `/packagePrize/rolling/index?boxId=${ this.ticketInfo.boxId }&isTry=1`
|
|
|
- })
|
|
|
+ if(this.ticketInfo && this.ticketInfo.boxId){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/packagePrize/rolling/index?boxId=${ this.ticketInfo.boxId }&isTry=1`
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ uni.$u.toast('盲票正在准备中');
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
|
|
|
// 线上立即刮票成功,跳转到刮奖过程
|