Pārlūkot izejas kodu

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

wangxy 2 mēneši atpakaļ
vecāks
revīzija
414db4a2fb
2 mainītis faili ar 167 papildinājumiem un 18 dzēšanām
  1. 159 10
      pages/my/xuexiJilu.vue
  2. 8 8
      pages/study/index.vue

+ 159 - 10
pages/my/xuexiJilu.vue

@@ -16,7 +16,7 @@
 						<uni-list>
 							<uni-list-item v-for="item in data.shuxue.list" class="xxjl-item-box">
 								<template v-slot:body>
-									<view @click="goDao(item)">
+									<view @click="goDao(item,1)">
 										<view class="item-date-row">
 											<view class="data-item">
 												<icon class="data-icon"></icon>
@@ -54,7 +54,7 @@
 						<uni-list>
 							<uni-list-item v-for="item in data.yingyu.list" class="xxjl-item-box">
 								<template v-slot:body>
-									<view>
+									<view @click="goDao(item,2)">
 										<view class="item-date-row">
 											<view class="data-item">
 												<icon class="data-icon"></icon>
@@ -101,6 +101,13 @@
 		xuexiJiluDelete
 	} from "@/api/my.js";
 	import {
+		userZhangInfo,
+		userLocate,
+		userZhangForntInfo,
+		userZhangNextInfo,
+		getCommonZhangInfo
+	} from "@/api/learnPlan.js"
+	import {
 		onLoad
 	} from "@dcloudio/uni-app";
 	import cuoti from "@/components/chengji/chengji.vue";
@@ -109,6 +116,11 @@
 		getWrongInfo
 	} from "@/api/wrong";
 	import {
+		getWordListYk,
+		getWordList,
+		wordXuewan
+	} from "@/api/word.js"
+	import {
 		toast,
 		getUserIdentity
 	} from "@/utils/common";
@@ -121,7 +133,7 @@
 	const deleteJiluContent = '你确定要执行这个操作吗?';
 	const wrongRef = ref(null);
 	const deleteId = ref('');
-
+	const localAuth = ref(null);
 	const data = reactive({
 		items: ['数学', '英语'],
 		current: 0,
@@ -153,17 +165,154 @@
 	subjectId.value = data.current + 1;
 
 
-	function goDao(data) {
-		const auth = cacheManager.get('auth');
-		cacheManager.updateObject('auth', {
-			levelId: data.levelId,
-			zhangId: data.zhangId,
+	function goDao(data, subjectId) {
+
+		console.log('data', data);
+		console.log('subjectId', subjectId);
+
+		if (subjectId == 2 && data.typeId == 1) {
+			cacheManager.remove('zhangInfo')
+			cacheManager.updateObject('auth', {
+				levelId: data.levelId + ',' + data.zhangId,
+				typeId: data.typeId,
+				subjectId: subjectId,
+			})
+			localAuth.value = cacheManager.get('auth');
+			data.subjectId = subjectId
+			getZhangInfoNewYingyu(data)
+		} else {
+			cacheManager.remove('zhangInfo')
+			cacheManager.updateObject('auth', {
+				levelId: data.levelId,
+				typeId: data.typeId,
+				subjectId: subjectId,
+			})
+			localAuth.value = cacheManager.get('auth');
+			data.subjectId = subjectId
+			getZhangInfo(data)
+		}
+	}
+
+	function goDanciList(data) {
+		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("wordList数据错误!");
+				return false
+			}
 		})
-		cacheManager.remove('zhangInfo')
+	}
+
+
+	function listClick(data) {
+		if (data.subjectId == 2 && data.typeId == 1) {
+			goDanciList(data)
+		} else {
+			if (data.type == 2) {
+				// 最后一项
+				goKaoshi(data)
+			} else {
+				goLookShipin(data)
+			}
+		}
+	}
+
+	function goKaoshi(data) {
 		uni.redirectTo({
-			url: `/pages/study/index`
+			url: `/pages/unitTest/index?jieId=` + data.jieId
 		})
+	}
+
+	function goLookShipin(data, index) {
+		if (data.typeId == 1) {
+			// 1新 2旧
+			if (!data.videoId) {
+				toast("videoId 丢失!");
+				return false
+			}
+			uni.redirectTo({
+				url: '/pages/study/lookShipinNew?jieId=' + data.jieId
+			})
+		} else {
+			if (!data.videoId) {
+				toast("videoId 丢失!");
+				return false
+			}
+			uni.redirectTo({
+				url: '/pages/study/lookShipin?jieId=' + data.jieId
+			})
+		}
+	}
 
+
+	function getZhangInfoNewYingyu(item) {
+		const arr = localAuth.value.levelId.split(",");
+		let req = {
+			levelId: arr[0],
+			zhangId: arr[1]
+		}
+		userZhangInfo(req).then(res => {
+			if (res.code == 0) {
+				cacheManager.set('zhangInfo', res.data)
+				setTimeout(() => {
+					cacheManager.updateObject('zhangInfo', {
+						curZid: item.zhangId
+					})
+					listClick(item)
+					recordZhangJie()
+				}, 100)
+
+			}
+		}).catch((err) => {
+			toast('数据异常,请重新登录!1')
+			cacheManager.clearAll();
+			uni.reLaunch({
+				url: '/pages/login/index'
+			});
+		})
+	}
+
+
+	function getZhangInfo(item) {
+		let req = {
+			levelId: item.levelId
+		}
+		userZhangInfo(req).then(res => {
+			if (res.code == 0) {
+				cacheManager.set('zhangInfo', res.data)
+				setTimeout(() => {
+					cacheManager.updateObject('zhangInfo', {
+						curZhangId: item.zhangId
+					})
+					listClick(item)
+					recordZhangJie()
+				}, 100)
+
+			}
+		}).catch((err) => {
+			toast('数据异常,请重新登录!2')
+			cacheManager.clearAll();
+			uni.reLaunch({
+				url: '/pages/login/index'
+			});
+		})
+	}
+
+	function recordZhangJie() {
+
+		let req = {
+			levelId: localAuth.value.levelId,
+			userId: localAuth.value.userId,
+			subjectId: currentProduct.value,
+		}
+		userLocate(req).then(res => {
+
+		})
 	}
 
 	function deleteJilu(item) {

+ 8 - 8
pages/study/index.vue

@@ -354,7 +354,7 @@
 			})
 
 		}).catch((err) => {
-			toast('数据异常,请重新登录!')
+			toast('数据异常,请重新登录!3')
 			cacheManager.clearAll();
 			uni.reLaunch({
 				url: '/pages/login/index'
@@ -381,11 +381,11 @@
 			})
 
 		}).catch((err) => {
-			toast('数据异常,请重新登录!')
-			cacheManager.clearAll();
-			uni.reLaunch({
-				url: '/pages/login/index'
-			});
+			toast('数据异常,请重新登录!4')
+			// cacheManager.clearAll();
+			// uni.reLaunch({
+			// 	url: '/pages/login/index'
+			// });
 		})
 	}
 
@@ -402,7 +402,7 @@
 			zhangName.value = res.data.zhangList[0].zhangName
 			current.value = 0
 		}).catch((err) => {
-			toast('数据异常,请重新登录!')
+			toast('数据异常,请重新登录!5')
 			cacheManager.clearAll();
 			uni.reLaunch({
 				url: '/pages/login/index'
@@ -421,7 +421,7 @@
 			zhangList.value = res.data.zhangList
 			current.value = 0
 		}).catch((err) => {
-			toast('数据异常,请重新登录!')
+			toast('数据异常,请重新登录!6')
 			cacheManager.clearAll();
 			uni.reLaunch({
 				url: '/pages/login/index'