wangguoyu 2 maanden geleden
bovenliggende
commit
03a17e7434
2 gewijzigde bestanden met toevoegingen van 31 en 34 verwijderingen
  1. 1 21
      App.vue
  2. 30 13
      components/custom-tabbar/custom-tabbar.vue

+ 1 - 21
App.vue

@@ -49,27 +49,7 @@
 			// 		url: '/pages/login/index' 
 			// 	});
 			// }
-			
-			if (cacheManager.get('auth')) {
-				uni.reLaunch({
-					url: `/pages/study/index`,
-					success() {
-						  plus.navigator.closeSplashscreen();
-					}
-				})
-			}else if(cacheManager.get('wxLogin') &&!(cacheManager.get('wxLogin').bind)){
-					console.log('微信登录且未绑定')
-				// 微信登录且未绑定 
-			} else {
-				cacheManager.clearAll()
-				uni.reLaunch({
-					url: '/pages/login/index' ,
-					success() {
-						  plus.navigator.closeSplashscreen();
-					}
-				});
-			}
-			
+	
 			const webview = plus.webview.currentWebview();
 			plus.key.addEventListener('backbutton', () => {
 				const store = useIsCanBack();

+ 30 - 13
components/custom-tabbar/custom-tabbar.vue

@@ -6,9 +6,9 @@
 				:style="{ backgroundImage: 'url(' + (currentTab == index ? item.activePath : item.iconPath) + ')' }">
 			</view>
 		</view>
-	</view>	
+	</view>
 	<tip-big-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :imgShow="false"></tip-big-dialog>
-		
+
 </template>
 
 <script>
@@ -52,6 +52,7 @@
 					},
 				],
 				currentTab: 0,
+				isNavigating: false,
 				MESSAGE_VISITER_TO_LOGIN
 			};
 		},
@@ -82,12 +83,11 @@
 			},
 
 			switchTab(path, index) {
-				
+
 				if (index == this.currentTab) {
 					// 同页面不刷新
 					return;
 				}
-				
 				if (path !== '/pages/game/index') {
 					this.currentTab = index;
 				}
@@ -98,7 +98,7 @@
 					}
 					uni.redirectTo({
 						url: path + '?nianji=' + this.nianji + '&cardId=' + this.cardId + '&zhangId=' +
-							this.zhangId+ '&tipFlag=' + this.tipFlag
+							this.zhangId + '&tipFlag=' + this.tipFlag
 					});
 				} else {
 					/* if (path === '/pages/game/index') {
@@ -110,20 +110,37 @@
 						});
 						return;
 					} */
-					uni.redirectTo({
-						url: path,
-						"animationType": "fade-in",
-						"animationDuration":0
-					});
+
+					this.navigateToEditPage(path)
+
 				}
 
 			},
+			navigateToEditPage(path) {
+				if (this.isNavigating) {
+					uni.showToast({
+						title: '正在跳转中...',
+						icon: 'none'
+					});
+					return;
+				}
+				this.isNavigating = true;
+				uni.showLoading({
+					title: '加载中'
+				}); // 显示Loading
 
+				uni.redirectTo({
+					url: path,
+					complete: () => {
+						uni.hideLoading();
+						this.isNavigating = false;
+					}
+				});
+			}
 		},
 		created() {
 
-			this.currentTab  =this.currentTabNumber
+			this.currentTab = this.currentTabNumber
 		}
 	}
-</script>
-
+</script>