Ver Fonte

Merge remote-tracking branch 'origin/2025鹅状元dev' into 2025鹅状元dev

wangxy há 3 meses atrás
pai
commit
7f2f649bbe
1 ficheiros alterados com 23 adições e 33 exclusões
  1. 23 33
      pages/study/index.vue

+ 23 - 33
pages/study/index.vue

@@ -571,43 +571,33 @@
 			})
 
 		} else {
-			wordXuewan({
+			getWordList({
 				jieId: data.jieId
-			}).then(res => {
-				getZhangInfoNewYingyu()
-				// const localZhangInfo = cacheManager.get('zhangInfo')
-				// const result = updateStudyFlag(localZhangInfo, data.jieId, 1);
-				// console.log('result',result);
-
-				// if (result) {
-				// 	cacheManager.set('zhangInfo', result)
-				// }
+			}).then(res => {
+				if (res.code == 0 && res.data.wordList.length > 0) {
+					uni.redirectTo({
+						url: '/pages/wordList/wordList?jieId=' + data.jieId
+					})
+				} else {
+					toast("该单元没有学习内容!");
+					console.log('data,jieId', data.jieId);
+					wordXuewan({
+						jieId: data.jieId
+					}).then(res => {
+						getZhangInfoNewYingyu()
+						// 更新缓存  备用 现在是 直接调用接口
+						// const result = updateStudyFlag(responseData, data.jieId, 1);
+						// if (result) {
+						// 	cacheManager.set('zhangInfo', result)
+						// }
 
+					})
+					return false
+				}
 			})
-			// getWordList({
-			// 	jieId: data.jieId
-			// }).then(res => {
-			// 	if (res.code == 0 && res.data.wordList.length > 0) {
-			// 		uni.redirectTo({
-			// 			url: '/pages/wordList/wordList?jieId=' + data.jieId
-			// 		})
-			// 	} else {
-			// 		toast("该单元没有学习内容!");
-			// 		console.log('data,jieId', data.jieId);
-			// 		wordXuewan({
-			// 			jieId: data.jieId
-			// 		}).then(res => {
-			// 			const result = updateStudyFlag(responseData, data.jieId, 1);
-			// 			if (result) {
-			// 				cacheManager.set('zhangInfo', result)
-			// 			}
-
-			// 		})
-			// 		return false
-			// 	}
-			// })
 		}
-	}
+	}
+	// 更新缓存  备用 现在是 直接调用接口
 	const updateStudyFlag = (data, jieIdToUpdate, newValue) => {
 		// 检查data和必要的数据结构是否存在
 		if (!data || !Array.isArray(data.zhangList)) {