Browse Source

Merge branch '2024鹅状元' of https://gogs.mtavip.com/wangguoyu/uniProject into 2024鹅状元

tanxue 5 months ago
parent
commit
9c84b7cb0c
2 changed files with 14 additions and 14 deletions
  1. 1 5
      components/custom-tabbar/custom-tabbar.vue
  2. 13 9
      pages/study/index.vue

+ 1 - 5
components/custom-tabbar/custom-tabbar.vue

@@ -64,7 +64,7 @@
 				type: String,
 			},
 			currentTabNumber: {
-				type: String,
+				type: Number,
 			},
 
 		},
@@ -77,11 +77,7 @@
 			},
 
 			switchTab(path, index) {
-
 				this.currentTab = index;
-				uni.redirectTo({
-					url: path
-				});
 				if (getUserIdentity() == 'Visitor') {
 					if (path === '/pages/game/index') {
 						this.$refs.youkeDialogRef.handleShow();

+ 13 - 9
pages/study/index.vue

@@ -14,7 +14,7 @@
 	<!-- 蛋 -->
 	<egg-dialog ref="eggDialogRef" @eggBtn="eggBtn"></egg-dialog>
 	<catalogue ref="catalogueRef" :list=zhangList @change-zhang="handleChangeZhang"></catalogue>
-	<CustomTabBar :cardId="cardId" :nianji="nianji" :zhangId="zhangId"></CustomTabBar>
+	<CustomTabBar :cardId="cardId" :currentTabNumber="0" :nianji="nianji" :zhangId="zhangId"></CustomTabBar>
 	<tip-small-dialog ref="goPayDialogRef" @confirm-btn="goPayPage" :content="tipContent"></tip-small-dialog>
 	<tip-middle-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :content="YouKeContent"></tip-middle-dialog>
 </template>
@@ -98,14 +98,18 @@
 		init(options)
 	})
 
-	function onChangeTab(e) {
-		console.log(e.detail.current);
-		infoData.zhangId = cacheManager.get('zhangInfo').zhangList[e.detail.current].zhangId
-		cacheManager.updateObject('auth', {
-			currentZhang: e.detail.current,
-			zhangId: infoData.zhangId
-		})
-
+	function onChangeTab(e) {
+		console.log('e',e);	
+		console.log(e.detail.current);
+		if( cacheManager.get('auth')){
+			infoData.zhangId = cacheManager.get('zhangInfo').zhangList[e.detail.current].zhangId
+			cacheManager.updateObject('auth', {
+				currentZhang: e.detail.current,
+				zhangId: infoData.zhangId
+			})
+			
+		}
+	
 		//current.value = e.detail.current;
 	}