浏览代码

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

wangxy 3 月之前
父节点
当前提交
f5b9d2f3a0
共有 3 个文件被更改,包括 181 次插入30 次删除
  1. 54 16
      pages/study/index.vue
  2. 6 0
      pages/study/product/yingyuNew.vue
  3. 121 14
      pages/wordList/wordList.vue

+ 54 - 16
pages/study/index.vue

@@ -21,7 +21,7 @@
 				<!-- 	新的英语(人教版等等) -->
 				<yingyuNewZhangjie v-if="currentProduct ==2&&typeId==1" @clickGradeTerm="clickGradeTerm"
 					@handleCheckCatalogue="handleCheckCatalogue(item)" @listClick="listClick" :gradeTerm='gradeTerm'
-					:options="item" :youkeImage="youkeImage">
+					:options="item" :youkeImage="youkeImage" :youkeImageBook="youkeImageBook">
 				</yingyuNewZhangjie>
 			</swiper-item>
 		</swiper>
@@ -95,10 +95,12 @@
 	const tipFlag = ref(null) //游客使用
 	const catalogueRef = ref(null);
 	const youkeImage = ref(null);
+	const youkeImageBook = ref(null);
 	const currentProduct = ref(null);
 	const localAuth = ref(null);
 	const levelId = ref(null); //游客使用
 	const subjectId = ref(null); //游客使用
+	const youkeZhangId = ref(null); //游客使用
 	const typeId = ref(null);
 	const zhangList = ref(null);
 	const gradeTerm = ref(null);
@@ -264,14 +266,7 @@
 				})
 			}
 		} else {
-			subjectId.value = options.subjectId
-			typeId.value = options.typeId
-			levelId.value = options.levelId
-			tipFlag.value = options.tipFlag;
-			currentProduct.value = options.subjectId
-			// 未登录 游客 
-			getCommonZhang(options)
-			getProjectImg()
+			chooseMethodYouke(options)
 		}
 	}
 
@@ -281,8 +276,8 @@
 			getZhangInfoNewYingyu()
 		} else {
 			// 之前 旧的岛 数学英语 和新的数学
-			getZhangInfoNewYingyu()
-			//	getZhangInfo()
+
+			getZhangInfo()
 		}
 	}
 
@@ -303,6 +298,25 @@
 			recordZhangJie()
 		}
 	}
+
+
+	function chooseMethodYouke(options) {
+		subjectId.value = options.subjectId
+		typeId.value = options.typeId
+		levelId.value = options.levelId
+		tipFlag.value = options.tipFlag;
+		currentProduct.value = options.subjectId
+		youkeZhangId.value = options.zhangId
+		if (subjectId.value == 2 && typeId.value == 1) {
+			// 新英语
+			getCommonZhangNewYingyu(options)
+		} else {
+			// 未登录 游客 旧的数学 英语 新数学
+			getCommonZhang(options)
+		}
+		getProjectImg()
+	}
+
 	// 新的英语 (人教版 之类的 新结构)
 	function getZhangInfoNewYingyu(data) {
 		let req = {
@@ -386,6 +400,27 @@
 		})
 	}
 
+	function getCommonZhangNewYingyu(data) {
+
+		let req = {
+			levelId: data.levelId,
+			zhangId: data.youkeZhangId
+		}
+		getCommonZhangInfo(req).then(res => {
+			translateData(res.data)
+			youkeImage.value = res.data.icon
+			youkeImageBook.value = res.data.zhangIcon
+			zhangList.value = res.data.zhangList[0].zList
+			current.value = 0
+		}).catch((err) => {
+			toast('数据异常,请重新登录!')
+			cacheManager.clearAll();
+			uni.reLaunch({
+				url: '/pages/login/index'
+			});
+		})
+	}
+
 	function getCommonZhang(data) {
 
 		let req = {
@@ -457,13 +492,16 @@
 
 	function goDanciList(data, index) {
 		if (!cacheManager.get('auth')) {
-
-			let youkeData = {
-
+			let youkeData = {
+				subjectId:subjectId.value,
+				typeId:typeId.value,
+				levelId:levelId.value,
+				tipFlag:tipFlag.value,
+				youkeZhangId:youkeZhangId.value,
+				jieId:data.jieId
 			}
-
 			uni.redirectTo({
-				url: '/pages/study/lookShipinNew?youkePageData=' + JSON.stringify(youkeData)
+				url: '/pages/wordList/wordList?youkePageData=' + JSON.stringify(youkeData)
 			})
 		} else {
 			uni.redirectTo({

+ 6 - 0
pages/study/product/yingyuNew.vue

@@ -67,6 +67,7 @@
 	} from '@dcloudio/uni-app';
 	const growthType = ref(null);
 	const growthImg = ref(null);
+	const youkeImageBook = ref(null);
 	const $emit = defineEmits(['clickGradeTerm', 'onLeft', 'onRight', 'handleCheckCatalogue', 'listClick'])
 	const props = defineProps({
 		options: {
@@ -75,6 +76,9 @@
 		youkeImage: {
 			String: '',
 		},
+		youkeImageBook: {
+			String: '',
+		},
 		gradeTerm: {
 			type: String,
 		},
@@ -82,6 +86,8 @@
 	onShow(() => {
 		growthType.value = cacheManager.get('auth')?cacheManager.get('auth').growthType:props.youkeImage
 			growthImg.value = cacheManager.get('auth') ? cacheManager.get('zhangInfo').icon : props.youkeImage;
+			youkeImageBook.value = cacheManager.get('auth') ? cacheManager.get('zhangInfo').zhangIcon : props.youkeImageBook;
+			
 	})
 	const isVip = getUserIdentity();
 	console.log('isVip',isVip);

+ 121 - 14
pages/wordList/wordList.vue

@@ -1,22 +1,129 @@
 <template>
 	<view class="word-list-page">
-
+		<view class="icon-title-navBar-box">
+			<view @click="goBack" class="nav-bar-icon"></view>
+			<text class="nav-bar-title">{{listData.title || ''}}</text>
+		</view>
+		<view class="ezy-tab-border">
+			<view class="ezy-border-body">
+				<view class="word-title-box">{{listData.jieName || ''}}</view>
+				<view class="word-num-box"><icon></icon><text>{{listData.studyCount || 0}}/{{listData.count || 0}}词</text></view>
+				<view class="word-list-body" v-if="listData.wordList && listData.wordList.length > 0">
+				<!-- 单词 -->
+					<view class="word-list-item" v-for="(item,index) in listData.wordList" :key="index" @click="toWord(item)">
+						<view class="item-word">
+							<view class="word-text">
+								<text v-for="(word, wordIndex) in item.chaifen[0].split(',')" 
+								:key="wordIndex" class="word-color">
+								{{ word }}
+								</text>
+							</view>
+							<view class="phonetic-alphabet">{{item.yinbiao || ''}}</view>
+						</view>
+						<view class="item-explain">
+							<view class="item-explain-content">
+								<view class="explain-text" v-for="(meaning, meaningIndex) in item.jianyi" :key="meaningIndex">{{meaning}}</view>
+							</view>
+						</view>
+						<view class="item-arrow"><icon></icon></view>
+					</view>
+				</view>
+			</view>
+		</view>
 	</view>
 </template>
 
-<script>
-	export default {
-		data() {
-			return {
-				
-			}
-		},
-		methods: {
-			
-		}
+<script setup>
+import {reactive,ref} from "vue";
+import {toast} from "@/utils/common";
+import {onLoad} from "@dcloudio/uni-app";
+import {getWordList,getWordListYk} from "@/api/word.js";
+import cacheManager from '@/utils/cacheManager.js';
+
+const listData = reactive({
+    count: 0, // 总数,默认值设为 0
+    studyCount: 0, // 已学总数,默认值设为 0
+    jieName: '',//节名称
+    title: '', // 版本+年级+学期
+    wordList: [] // 单词列表,默认值设为空数组
+});
+
+let routerOpt = ref(false);
+
+onLoad((options) => {
+	console.log('options555',options);
+	routerOpt = options;
+	if (!cacheManager.get('auth')) {
+		// 游客
+		getWordListDataYk();
+	} else {
+		// 非游客
+		getWordListData();
 	}
-</script>
+});
 
-<style>
+// 返回
+function goBack(){
+	if (!cacheManager.get('auth')) {
+		// 游客
+		uni.redirectTo({
+			url: `/pages/study/index?levelId=${routerOpt.levelId}&typeId=${routerOpt.typeId}&subjectId=${routerOpt.subjectId}&tipFlag=${routerOpt.tipFlag}&youkeZhangId=${routerOpt.youkeZhangId}&jieId=${routerOpt.jieId}`
+		})
+	} else {
+		// 非游客
+		uni.redirectTo({
+			url: `/pages/study/index`
+		})
+	}
+	
+}
+
+function getWordListData() {
+    const opt = {
+        jieId: routerOpt.jieId
+    };
+    getWordList(opt).then(res => {
+        if (res.code === 0) {
+            listData.count = res.data.count;
+            listData.studyCount = res.data.studyCount;
+            listData.jieName = res.data.jieName;
+            listData.title = res.data.title;
+            listData.wordList = res.data.wordList;
+        }
+    }).catch(err => {
+        toast("获取单词列表数据失败");
+    });
+}
 
-</style>
+function getWordListDataYk() {
+    const opt = {
+        jieId: routerOpt.jieId
+    };
+    getWordListYk(opt).then(res => {
+        if (res.code === 0) {
+            listData.count = res.data.count;
+            listData.studyCount = res.data.studyCount;
+            listData.jieName = res.data.jieName;
+            listData.title = res.data.title;
+            listData.wordList = res.data.wordList;
+        }
+    }).catch(err => {
+        toast("获取单词列表数据失败");
+    });
+}
+
+// 单词
+function toWord(data){
+	if (!cacheManager.get('auth')) {
+		// 游客
+		uni.redirectTo({
+			url: `/pages/newEnglish/index?jieId=${routerOpt.jieId}&wordId=${data.id}&levelId=${routerOpt.levelId}&typeId=${routerOpt.typeId}&subjectId=${routerOpt.subjectId}&tipFlag=${routerOpt.tipFlag}&youkeZhangId=${routerOpt.youkeZhangId}&jieId=${routerOpt.jieId}`
+		})
+	} else {
+		// 非游客
+		uni.redirectTo({
+			url: `/pages/newEnglish/index?jieId=${routerOpt.jieId}&wordId=${data.id}`
+		})
+	}
+}
+</script>