wangguoyu 1 nedēļu atpakaļ
vecāks
revīzija
438fe70155
2 mainītis faili ar 60 papildinājumiem un 16 dzēšanām
  1. 54 16
      pages/study/index.vue
  2. 6 0
      pages/study/product/yingyuNew.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);