Browse Source

修复试玩boxId为undefined时闪退问题

DELL 3 years ago
parent
commit
fc67b6b1c5
1 changed files with 15 additions and 3 deletions
  1. 15 3
      src/packagePrize/rolling/index.vue

+ 15 - 3
src/packagePrize/rolling/index.vue

@@ -123,7 +123,7 @@
 				statusHeight: 30,
 				btnShow: false,
 				
-				boxId: '',
+				boxId: null,
 				isTry: null,
 				orderId: '',
 				ticketId: '',
@@ -193,18 +193,30 @@
 								_this.btnShow = true
 								_this.running()
 							},500)
-						} else if (res.code == 401 || res.code == 500) {
+						} else if (res.code == 401 ) {
 							uni.hideLoading();
 							clearInterval(time)
 							uni.navigateBack({
 								delta: 2
 							})
-						} 
+						}  else if(res.code == 500) {
+							uni.hideLoading();
+							clearInterval(time)
+							uni.navigateBack({
+								delta: 1
+							})
+						}
 						
 						if (num == 10) {
 							uni.hideLoading();
 							clearInterval(time)
 						}
+					}).catch(() => {
+						uni.hideLoading();
+						clearInterval(time)
+						uni.navigateBack({
+							delta: 1
+						})
 					})
 				}, 1000)
 			},