Forráskód Böngészése

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

tanxue 5 hónapja
szülő
commit
d9b1c33b90
4 módosított fájl, 14 hozzáadás és 15 törlés
  1. 9 11
      pages/study/index.vue
  2. 2 2
      pages/study/product/shuxue.vue
  3. 1 1
      utils/common.js
  4. 2 1
      utils/request.js

+ 9 - 11
pages/study/index.vue

@@ -66,15 +66,7 @@
 		numberStr: '',
 	});
 	onLoad((options) => {
-		// 获取路由参数
-		if(options){
-			zhangId.value = options.zhangId
-			nianji.value = options.nianji
-			cardId.value = options.cardId
-		}
-		
 		init(options)
-
 	})
 
 	function init(options){
@@ -89,10 +81,11 @@
 			// 蛋
 			// eggDialogRef.value.eggShow();
 		} else {
-			console.log(options);
+			zhangId.value = options.zhangId
+			nianji.value = options.nianji
+			cardId.value = options.cardId
 			// 未登录 游客 
 			getCommonZhang(options)
-	
 		}
 	}
 	
@@ -192,7 +185,12 @@
 	function getNewData() {
 		selectZhang.value.zhangId = cacheManager.get('zhangInfo').zhangId;
 		selectZhang.value.cardId = cacheManager.get('zhangInfo').cardId;
-		selectZhang.value.nianji = cacheManager.get('zhangInfo').nianji;
+		selectZhang.value.nianji = cacheManager.get('zhangInfo').nianji;
+		cacheManager.updateObject('auth', {
+		  zhangId: selectZhang.value.zhangId,
+		  cardId: selectZhang.value.cardId,
+		  nianji: selectZhang.value.nianji,
+		})
 
 	}
 

+ 2 - 2
pages/study/product/shuxue.vue

@@ -6,8 +6,8 @@
 			<view class="chapter-title-box">{{options.zhangName}}</view>
 			<view>
 				<view class="brand-item" v-for="(item, index) in options.jieList" :key="item.jieId"
-					@click="listClick(item, index)" :class="{ 'brand-active': index === 0 }">
-					<view class="brand-icon">
+					@click="listClick(item, index)" :class="{ 'brand-active': isVip === 'VIP' || item.number == 1 }">
+					<view v-if="isVip === 'VIP' || item.number == 1" class="brand-icon">
 						{{ item.number }}
 					</view>
 					<view v-if="item.daeFlag">

+ 1 - 1
utils/common.js

@@ -57,7 +57,7 @@ export function catchError(promise) {
 export function getUserIdentity() {
 	const auth = cacheManager.get('auth');
 	if (auth) {
-		if (auth.cardList.some(item => item === auth.catdId)) {
+		if (auth.cardList.some(item => item === auth.cardId)) {
 			// VIP
 			return 'VIP'
 		}

+ 2 - 1
utils/request.js

@@ -45,6 +45,7 @@ const request = config => {
 				//   return
 				// }
 				const code = res.code
+				const msg = res.msg
 				// const msg = errorCode[code] || res.data.msg || errorCode['default']
 				if (code === 401) {
 					showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
@@ -72,7 +73,7 @@ const request = config => {
 					toast("数据异常-400")
 					reject('400')
 				} else if (code !== 0) {
-					//   toast(msg)
+					toast(msg)
 					reject(code)
 				}
 				resolve(res)