Browse Source

跳转问题

lsx 2 năm trước cách đây
mục cha
commit
e3b1911a21
1 tập tin đã thay đổi với 13 bổ sung4 xóa
  1. 13 4
      src/packagePrize/rolling/animation.vue

+ 13 - 4
src/packagePrize/rolling/animation.vue

@@ -60,9 +60,12 @@
 				infoimg: false,
 				Choice: false,
 				ChoiceData: '',
+				pagesNum: '',
 			};
 		},
-
+		onShow() {
+			this.pagesNum = getCurrentPages().length
+		},
 		onLoad(options) {
 			if (options.orderId) {
 				this.orderId = options.orderId
@@ -117,9 +120,15 @@
 								if (num == 10) {
 									uni.hideLoading();
 									clearInterval(time)
-									uni.navigateBack({
-										delta: 2
-									})
+									if(_this.pagesNum > 2) {
+										uni.navigateBack({
+											delta: 2
+										})
+									}else {
+										uni.switchTab({
+											url: `/pages/index/index`
+										})
+									}
 								}
 							}, 1000)
 						}