wangguoyu hai 2 semanas
pai
achega
c12edaed04

+ 110 - 20
pages/study/index.vue

@@ -2,26 +2,25 @@
 	<view>
 		<swiper :circular="true" @change="onChangeTab" :duration="currentDuration" :current="current"
 			class="ezy-study-swiper" :class="'ezy-study-swiper'+ currentProduct">
-			<swiper-item v-for="(item,index) in zhangList" :key="index">
-			<!-- 	旧的数学 -->
-				<shuxueZhangjie v-if="currentProduct ==1&&typeId==2" @clickGradeTerm="clickGradeTerm"
+			<swiper-item v-for="(item,index) in zhangList" :key="index">
+				<!-- 	旧的数学 -->
+								<shuxueZhangjie v-if="currentProduct ==1&&typeId==2" @clickGradeTerm="clickGradeTerm"
 					@handleCheckCatalogue="handleCheckCatalogue(item)" @listClick="listClick" :gradeTerm='gradeTerm'
 					:options="item" :youkeImage="youkeImage">
-				</shuxueZhangjie>
+				</shuxueZhangjie>
 				<!-- 	旧的英语 -->
-				<yingyuZhangjie v-if="currentProduct ==2&&typeId==2" @clickGradeTerm="clickGradeTerm"
+								<yingyuZhangjie v-if="currentProduct ==2&&typeId==2" @clickGradeTerm="clickGradeTerm"
 					@handleCheckCatalogue="handleCheckCatalogue(item)" @listClick="listClick" :gradeTerm='gradeTerm'
 					:options="item" :youkeImage="youkeImage">
-				</yingyuZhangjie>
+				</yingyuZhangjie>
 				<!-- 	新的数学 -->
-				<shuxueNewZhangjie v-if="currentProduct ==1&&typeId==1" @clickGradeTerm="clickGradeTerm"
+							<shuxueNewZhangjie v-if="currentProduct ==1&&typeId==1" @clickGradeTerm="clickGradeTerm"
 					@handleCheckCatalogue="handleCheckCatalogue(item)" @listClick="listClick" :gradeTerm='gradeTerm'
 					:options="item" :youkeImage="youkeImage">
-				</shuxueNewZhangjie>
-				<!-- 	新的英语(人教版等等) -->
-				<yingyuNewZhangjie v-if="currentProduct ==2&&typeId==1" @clickGradeTerm="clickGradeTerm"
-					@handleCheckCatalogue="handleCheckCatalogue(item)" @listClick="listClick" :gradeTerm='gradeTerm'
-					:options="item" :youkeImage="youkeImage">
+				</shuxueNewZhangjie>
+				<!-- 	新的英语(人教版等等) -->
+				<yingyuNewZhangjie @clickGradeTerm="clickGradeTerm" @handleCheckCatalogue="handleCheckCatalogue(item)"
+					@listClick="listClick" :gradeTerm='gradeTerm' :options="item" :youkeImage="youkeImage">
 				</yingyuNewZhangjie>
 			</swiper-item>
 		</swiper>
@@ -70,7 +69,7 @@
 
 	import shuxueZhangjie from './product/shuxue.vue';
 	import shuxueNewZhangjie from './product/shuxueNew.vue';
-	import yingyuZhangjie from './product/yingyu.vue';
+	import yingyuZhangjie from './product/yingyu.vue';
 	import yingyuNewZhangjie from './product/yingyuNew.vue';
 
 	import {
@@ -216,11 +215,21 @@
 		console.log('e', e);
 		console.log(e.detail.current);
 		if (cacheManager.get('auth')) {
-			infoData.zhangId = cacheManager.get('zhangInfo').zhangList[e.detail.current].zhangId
-			cacheManager.updateObject('auth', {
-				currentZhang: e.detail.current,
-				zhangId: infoData.zhangId
-			})
+			// 新的英语人教版
+			if (currentProduct.value == 2 && typeId.value == 1) {
+				infoData.zhangId = cacheManager.get('zhangInfo').zhangList[0].zhangId
+				cacheManager.updateObject('auth', {
+					currentZhang: e.detail.current,
+					zhangId: infoData.zhangId
+				})
+			} else {
+				// 旧的数学 英语 新的数学
+				infoData.zhangId = cacheManager.get('zhangInfo').zhangList[e.detail.current].zhangId
+				cacheManager.updateObject('auth', {
+					currentZhang: e.detail.current,
+					zhangId: infoData.zhangId
+				})
+			}
 		}
 	}
 
@@ -238,9 +247,10 @@
 			}
 			if (!cacheManager.get('daoPageCache').isCache) {
 				console.log('不实用换葱');
-				getZhangInfo()
+				chooseMethodNoCache()
 			} else {
 				console.log('shiyonghuancun');
+				chooseMethodUseCache()
 				translateData(cacheManager.get('zhangInfo'))
 				zhangList.value = cacheManager.get('zhangInfo').zhangList
 				current.value = cacheManager.get('auth').currentZhang
@@ -269,6 +279,64 @@
 		}
 	}
 
+	function chooseMethodNoCache() {
+		// 新的英语 (人教版 之类的 新结构)
+		if (currentProduct.value == 2 && typeId.value == 1) {
+			getZhangInfoNewYingyu()
+		} else {
+			// 之前 旧的岛 数学英语 和新的数学
+			getZhangInfoNewYingyu()
+			//	getZhangInfo()
+		}
+	}
+
+	function chooseMethodUseCache() {
+
+	}
+	// 新的英语 (人教版 之类的 新结构)
+	function getZhangInfoNewYingyu(data) {
+		let req = {
+			levelId: localAuth.value.levelId,
+		//	levelId: 31,
+				zhangId:localAuth.value.zhangId
+		//	zhangId: 195
+		}
+		userZhangInfo(req).then(res => {
+			cacheManager.set('zhangInfo', res.data)
+			let zhang = cacheManager.get('zhangInfo').zhangList[0].zList.findIndex(zhang => zhang.zid == localAuth
+				.value.zhangId);
+			console.log('zhang', zhang);
+			if (zhang != -1) {
+				cacheManager.updateObject('auth', {
+					currentZhang: zhang
+				})
+			} else {
+				cacheManager.updateObject('auth', {
+					currentZhang: 0
+				})
+			}
+			cacheManager.set('daoPageCache', {
+				isCache: true
+			})
+
+			nextTick(() => {
+				translateData(res.data)
+				zhangList.value = res.data.zhangList[0].zList
+				current.value = cacheManager.get('auth').currentZhang
+				infoData.zhangId = res.data.zhangList[0].zhangId
+				recordZhangJie()
+			})
+
+		}).catch((err) => {
+			toast('数据异常,请重新登录!')
+			cacheManager.clearAll();
+			uni.reLaunch({
+				url: '/pages/login/index'
+			});
+		})
+	}
+
+	//旧的岛 数学英语 和新的数学
 	function getZhangInfo(data) {
 		let req = {
 			levelId: localAuth.value.levelId
@@ -377,6 +445,23 @@
 		})
 	}
 
+	function goDanciList(data, index) {
+		if (!cacheManager.get('auth')) {
+
+			let youkeData = {
+
+			}
+
+			uni.redirectTo({
+				url: '/pages/study/lookShipinNew?youkePageData=' + JSON.stringify(youkeData)
+			})
+		} else {
+			uni.redirectTo({
+				url: '/pages/wordList/wordList?jieId=' + data.jieId
+			})
+		}
+	}
+
 	function goLookShipin(data, index) {
 
 		if (!cacheManager.get('auth')) {
@@ -456,7 +541,12 @@
 			// 最后一项
 			goKaoshi(data, index)
 		} else {
-			goLookShipin(data, index)
+			if (currentProduct.value == 2 && typeId.value == 1) {
+				goDanciList(data, index)
+			} else {
+				goLookShipin(data, index)
+			}
+
 		}
 	}
 

+ 7 - 5
pages/study/product/yingyuNew.vue

@@ -2,6 +2,8 @@
 	<view class="ezy-study-page ezy-yingyu-study-page">
 		<view class="study-school-year" @click="clickGradeTerm">{{gradeTerm}}</view>
 		<view class="ezy-study-wrap" @touchstart="onTouchStart" @touchend="onTouchEnd">
+			<img class="study-name-img" :src="growthImg"/>
+			<view></view>
 			<view @click="handleCheckCatalogue" class="chapter-title-box">{{options.zhangName}}</view>
 			<!-- 动物类型 -->
 			<view v-if="growthType!=null" :class="currentGrowth()"></view>
@@ -11,7 +13,7 @@
 					@click="listClick(item, index,options)" :class="getClass(options,index,isVip,item)">
 					<view v-if="isVip === 'VIP'">
 						<!-- 序号 -->
-						<view class="brand-icon">{{ item.number }}</view>
+					<!-- 	<view class="brand-icon">{{ item.number }}</view> -->
 						<!-- 星星 -->
 						<view class="brand-finish-icon" v-if="item.studyFlag===1"></view>
 						<!-- 箭头 -->
@@ -21,8 +23,7 @@
 					</view>
 					<view v-if="isVip == 'Not-Vip'">
 						<!-- 序号 -->
-						<view  class="brand-icon">{{ item.number }}
-						</view>
+			<!-- 			<view  class="brand-icon">{{ item.number }}</view> -->
 						<view v-if="item.firstFlag !=1" class="brand-lock"></view>
 						<!-- 箭头 -->
 						<view v-if="item.daeFlag  &&  animalNum == index && isVip != 'Visitor'" class="brand-arrow"></view>
@@ -32,7 +33,7 @@
 					</view>
 					<view v-if="isVip == 'Visitor'">
 						<!-- 锁 -->
-						<view  class="brand-icon">{{ item.number }} </view>
+		<!-- 				<view  class="brand-icon">{{ item.number }} </view> -->
 						<!-- 锁 -->
 						<view  v-if="item.firstFlag !=1" class="brand-lock"></view>
 						<!-- 箭头 -->
@@ -65,7 +66,7 @@
 		onShow
 	} from '@dcloudio/uni-app';
 	const growthType = ref(null);
-
+	const growthImg = ref(null);
 	const $emit = defineEmits(['clickGradeTerm', 'onLeft', 'onRight', 'handleCheckCatalogue', 'listClick'])
 	const props = defineProps({
 		options: {
@@ -80,6 +81,7 @@
 	})
 	onShow(() => {
 		growthType.value = cacheManager.get('auth')?cacheManager.get('auth').growthType:props.youkeImage
+			growthImg.value = cacheManager.get('auth') ? cacheManager.get('zhangInfo').icon : props.youkeImage;
 	})
 	const isVip = getUserIdentity();
 	console.log('isVip',isVip);

+ 5 - 5
unpackage/dist/cache/.vite/deps/_metadata.json

@@ -1,19 +1,19 @@
 {
-  "hash": "122c3a9d",
-  "configHash": "d5858f9f",
+  "hash": "1d9d3ec9",
+  "configHash": "8df3381c",
   "lockfileHash": "e3b0c442",
-  "browserHash": "d8bf20c4",
+  "browserHash": "73f1e45b",
   "optimized": {
     "uview-plus": {
       "src": "../../../../../node_modules/uview-plus/index.js",
       "file": "uview-plus.js",
-      "fileHash": "5da21bbe",
+      "fileHash": "3ab1291e",
       "needsInterop": false
     },
     "ts-md5/dist/md5": {
       "src": "../../../../../node_modules/ts-md5/dist/md5.js",
       "file": "ts-md5_dist_md5.js",
-      "fileHash": "674d644d",
+      "fileHash": "01b01de3",
       "needsInterop": true
     }
   },