wangguoyu il y a 2 semaines
Parent
commit
0fb4494a92
2 fichiers modifiés avec 144 ajouts et 80 suppressions
  1. 106 66
      pages/study/index.vue
  2. 38 14
      pages/study/product/shuxue.vue

+ 106 - 66
pages/study/index.vue

@@ -19,16 +19,16 @@
 					:options="item" :youkeImage="youkeImage">
 				</shuxueNewZhangjie>
 				<!-- 	新的英语(人教版等等) -->
-				<yingyuNewZhangjie   v-if="currentProduct ==2&&typeId==1"  @clickGradeTerm="clickGradeTerm" :currentSwiperIndex="currentSwiperIndex"
-					@handleCheckCatalogue="handleCheckCatalogue(item)" @listClick="listClick" :gradeTerm='gradeTerm'  
-					:options="item" :zhangName="zhangName" :youkeImage="youkeImage" :youkeImageBook="youkeImageBook">
+				<yingyuNewZhangjie v-if="currentProduct ==2&&typeId==1" @clickGradeTerm="clickGradeTerm"
+					:currentSwiperIndex="currentSwiperIndex" @handleCheckCatalogue="handleCheckCatalogue(item)"
+					@listClick="listClick" :gradeTerm='gradeTerm' :options="item" :zhangName="zhangName"
+					:youkeImage="youkeImage" :youkeImageBook="youkeImageBook">
 				</yingyuNewZhangjie>
 			</swiper-item>
 		</swiper>
 		<!-- 蛋 -->
 		<egg-dialog ref="eggDialogRef" @eggBtn="eggBtn"></egg-dialog>
-		<catalogue ref="catalogueRef" :list=zhangList @change-zhang="handleChangeZhang"
-			></catalogue>
+		<catalogue ref="catalogueRef" :list=zhangList @change-zhang="handleChangeZhang"></catalogue>
 		<CustomTabBar :levelId="levelId" :currentTabNumber="0" :subjectId="subjectId" :typeId="typeId"
 			:tipFlag="tipFlag">
 		</CustomTabBar>
@@ -36,10 +36,10 @@
 		<tip-big-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :imgShow="true"></tip-big-dialog>
 		<dao-tip-dialog ref="daoTipDialogRef" v-if="showDaoTip" :productTip="productTipImg"
 			@dao-tip-close="daoTipClose"></dao-tip-dialog>
-		<tipMiddleDialog ref="tipDialogRef" :closeFlag='false' @confirm-btn="BanbenConfirmBtn" :title="tipTitle" :notClose="true"
-			:content="tipContentVersion"></tipMiddleDialog>
-		<tipMiddleDialog ref="tipDialogRef2" :closeFlag='false' :title="tipTitle" @confirm-btn="BanbenConfirmBtn" :notClose="true" :showTip="true"
-			:content="tipContentVersionAndroid"></tipMiddleDialog>
+		<tipMiddleDialog ref="tipDialogRef" :closeFlag='false' @confirm-btn="BanbenConfirmBtn" :title="tipTitle"
+			:notClose="true" :content="tipContentVersion"></tipMiddleDialog>
+		<tipMiddleDialog ref="tipDialogRef2" :closeFlag='false' :title="tipTitle" @confirm-btn="BanbenConfirmBtn"
+			:notClose="true" :showTip="true" :content="tipContentVersionAndroid"></tipMiddleDialog>
 	</view>
 </template>
 <script setup>
@@ -81,7 +81,9 @@
 	import shuxueNewZhangjie from './product/shuxueNew.vue';
 	import yingyuZhangjie from './product/yingyu.vue';
 	import yingyuNewZhangjie from './product/yingyuNew.vue';
-  import {useVersionUpdate} from "@/utils/versionUpdate.js";
+	import {
+		useVersionUpdate
+	} from "@/utils/versionUpdate.js";
 
 	import {
 		useTabBarHistory
@@ -95,12 +97,14 @@
 	} from "@/utils/common";
 	import cacheManager from "@/utils/cacheManager.js";
 	import TipDialog from "../../components/dialog/tipDialog";
-  import {getDataFromStr} from "../../utils/common";
+	import {
+		getDataFromStr
+	} from "../../utils/common";
 	const tipContent = '是否前往开通付费?'; //当前产品
 	const goPayDialogRef = ref(null);
 	const youkeDialogRef = ref(null);
 	const dSwiperRef = ref(null);
-	const eggDialogRef = ref(null);
+	const eggDialogRef = ref(null);
 	const yingyuNewZhangjieRef = ref(null);
 	const current = ref(0);
 	const zid = ref(0);
@@ -114,12 +118,12 @@
 	const localAuth = ref(null);
 	const levelId = ref(null); //游客使用
 	const subjectId = ref(null); //游客使用
-	const youkeZhangId = ref(null); //游客使用
+	const youkeZhangId = ref(null); //游客使用
 	const currentSwiperIndex = ref(0)
 	const zhangName = ref(null);
 	const typeId = ref(null);
 	const zhangList = ref(null);
-	const gradeTerm = ref(null);
+	const gradeTerm = ref(null);
 	const weizhiIndex = ref(null);
 	const updateUrl = ref(null);
 	let infoData = reactive({
@@ -148,11 +152,12 @@
 	const tipContentVersion = '您的APP不是最新版本,部分功能不能使用,请升级至最新版本!';
 	const tipContentVersionAndroid = '您的APP不是最新版本,部分功能不能使用,请升级至最新版本!'
 
-  const { initDownload } = useVersionUpdate()
+	const {
+		initDownload
+	} = useVersionUpdate()
 
 	onLoad((options) => {
-		init(options);
-		getLoginInit()
+		getLoginInit(options)
 	})
 
 
@@ -162,7 +167,7 @@
 			const appStoreUrl = 'itms-apps://itunes.apple.com/app/6741551741'
 			plus.runtime.openURL(appStoreUrl)
 		} else {
-      initDownload(updateUrl.value)
+			initDownload(updateUrl.value)
 			// 处理 Android/HarmonyOS 设备
 			/*const {
 				brand
@@ -211,7 +216,7 @@
 		}
 	}
 
-	function getLoginInit() {
+	function getLoginInit(options) {
 		getVersion({}).then(res => {
 			updateUrl.value = res.data.updateUrl;
 			if (version != res.data.version) {
@@ -222,6 +227,15 @@
 					tipDialogRef2.value.handleShow();
 
 				}
+			} else {
+				// 游客模式 新增 tishen字段 用于苹果审核
+				if(cacheManager.get("youkeTishen")){
+					cacheManager.remove('youkeTishen')
+				}
+				if (res.data.tishen.toString() == 'true') {
+					cacheManager.set('youkeTishen', res.data.tishen)
+				}
+				init(options)
 			}
 		})
 	}
@@ -296,14 +310,16 @@
 	}
 
 	function onChangeTab(e) {
-		console.log(e.detail.current);
-		
-		if (cacheManager.get('auth')) {
-	
+		console.log(e.detail.current);
+
+		if (cacheManager.get('auth')) {
+
 			// 新的英语人教版
-			if (currentProduct.value == 2 && typeId.value == 1) {
-				currentSwiperIndex.value = e.detail.current
-			    cacheManager.updateObject('zhangInfo', { weizhiIndex: 0 })
+			if (currentProduct.value == 2 && typeId.value == 1) {
+				currentSwiperIndex.value = e.detail.current
+				cacheManager.updateObject('zhangInfo', {
+					weizhiIndex: 0
+				})
 				cacheManager.updateObject('zhangInfo', {
 					curZid: cacheManager.get('zhangInfo').zhangList[0].zList[e.detail.current].zid
 				})
@@ -312,7 +328,7 @@
 				cacheManager.updateObject('zhangInfo', {
 					curZhangId: cacheManager.get('zhangInfo').zhangList[e.detail.current].zhangId
 				})
-				
+
 			}
 		}
 	}
@@ -350,32 +366,32 @@
 			getZhangInfo()
 		}
 	}
-
-	function jinggao(data){
-		uni.showModal({
-			title: '提示',
-			content: data,
-			showCancel:false,
-			success: function (res) {
-				if (res.confirm) {
-					console.log('用户点击确定');
-				} else if (res.cancel) {
-					console.log('用户点击取消');
-				}
-			}
-		});
-	}
 
-	function chooseMethodUseCache() {
-	
-	
-		
+	function jinggao(data) {
+		uni.showModal({
+			title: '提示',
+			content: data,
+			showCancel: false,
+			success: function(res) {
+				if (res.confirm) {
+					console.log('用户点击确定');
+				} else if (res.cancel) {
+					console.log('用户点击取消');
+				}
+			}
+		});
+	}
+
+	function chooseMethodUseCache() {
+
+
+
 		// 新的英语 (人教版 之类的 新结构)
 		if (currentProduct.value == 2 && typeId.value == 1) {
-			translateData(cacheManager.get('zhangInfo'))
-			if(!cacheManager.get('zhangInfo').zhangList[0]){
-				jinggao("cacheManager.get('zhangInfo').zhangList[0].zList")
-			}	
+			translateData(cacheManager.get('zhangInfo'))
+			if (!cacheManager.get('zhangInfo').zhangList[0]) {
+				jinggao("cacheManager.get('zhangInfo').zhangList[0].zList")
+			}
 			zhangList.value = cacheManager.get('zhangInfo').zhangList[0].zList
 			zhangName.value = cacheManager.get('zhangInfo').zhangList[0].zhangName
 			const curZid = cacheManager.get('zhangInfo').curZid;
@@ -385,10 +401,10 @@
 		} else {
 			// 之前 旧的岛 数学英语 和新的数学
 			const curZhangId = cacheManager.get('zhangInfo').curZhangId;
-			const resZhangList = cacheManager.get('zhangInfo').zhangList;
-			if(!cacheManager.get('zhangInfo').zhangList){
-				jinggao("resZhangList")
-			}	
+			const resZhangList = cacheManager.get('zhangInfo').zhangList;
+			if (!cacheManager.get('zhangInfo').zhangList) {
+				jinggao("resZhangList")
+			}
 			const index = resZhangList.findIndex(item => item.zhangId == curZhangId)
 			console.log('index', index);
 			translateData(cacheManager.get('zhangInfo'))
@@ -459,7 +475,7 @@
 				translateData(res.data)
 				zhangList.value = res.data.zhangList
 				current.value = index
-		
+
 				recordZhangJie()
 			})
 
@@ -538,14 +554,18 @@
 	function handleChangeZhang(data) {
 		const authCode = getUserIdentity();
 		if (authCode !== 'Visitor') {
-      if (currentProduct.value == 2 && typeId.value == 1) {
-        // 专属与新英语切换版本时需要修改levelId 值,重组版本zhangId
-        const authData = cacheManager.get('auth');
-        const levelIdData = getDataFromStr(authData.levelId)[0];
-        cacheManager.updateObject('auth', {levelId: levelIdData+','+data.zhangId})
-      } else {
-        cacheManager.updateObject('zhangInfo', { curZhangId: data.zhangId })
-      }
+			if (currentProduct.value == 2 && typeId.value == 1) {
+				// 专属与新英语切换版本时需要修改levelId 值,重组版本zhangId
+				const authData = cacheManager.get('auth');
+				const levelIdData = getDataFromStr(authData.levelId)[0];
+				cacheManager.updateObject('auth', {
+					levelId: levelIdData + ',' + data.zhangId
+				})
+			} else {
+				cacheManager.updateObject('zhangInfo', {
+					curZhangId: data.zhangId
+				})
+			}
 		}
 		currentDuration.value = 0
 		setTimeout(() => {
@@ -707,11 +727,31 @@
 
 	function listClick(data, data2, index) {
 		//console.log('data', data); // 节内容
-		//	console.log('data2', data2); //章内容
-		chooseMethodListClick(data, data2, index)
-
+		//	console.log('data2', data2); //章内容
+		if(cacheManager.get("youkeTishen").toString() =='true'){
+				chooseMethodListClickForTishen(data, data2, index)
+		}else{
+				chooseMethodListClick(data, data2, index)
+		}
 	}
 
+	function chooseMethodListClickForTishen(data, data2, index) {
+
+		console.log('data', data); // 节内容
+		console.log('data2', data2); //章内容
+		const authCode = getUserIdentity();
+
+		if (currentProduct.value == 2 && typeId.value == 1) {
+			goDanciList(data, index)
+		} else {
+			if (data.type == 2) {
+				// 最后一项
+				goKaoshi(data, index)
+			} else {
+				goLookShipin(data, index)
+			}
+		}
+	}
 	function chooseMethodListClick(data, data2, index) {
 
 		console.log('data', data); // 节内容

+ 38 - 14
pages/study/product/shuxue.vue

@@ -24,7 +24,7 @@
 					</view>
 					<view v-if="isVip == 'Not-Vip'">
 						<!-- 序号或锁 -->
-						<view  class="brand-icon">{{ item.number }}
+						<view class="brand-icon">{{ item.number }}
 						</view>
 						<view v-if="item.firstFlag !=1" class="brand-lock"></view>
 						<!-- 箭头 -->
@@ -34,18 +34,25 @@
 						<view class="brand-content"> {{ item.jieName }} </view>
 					</view>
 
-					<view v-if="isVip == 'Visitor'">
-			
+					<view v-if="isVip == 'Visitor' && appleTishen =='true'&&item.type!=2">
+						<!-- 锁 -->
+						<view class="brand-icon">{{ item.number }}
+						</view>
+						<!-- 节名称 -->
+						<view  class="brand-content"> {{ item.jieName }} </view>
+					</view>
+					<view v-if="isVip == 'Visitor'&& appleTishen =='false'">
+
 						<!-- 锁 -->
-						<view  class="brand-icon">{{ item.number }}
+						<view class="brand-icon">{{ item.number }}
 						</view>
 						<!-- 锁 -->
-						<view  v-if="item.firstFlag !=1" class="brand-lock"></view>
+						<view v-if="item.firstFlag !=1" class="brand-lock"></view>
 						<!-- 箭头 -->
 						<view v-if="item.daeFlag  &&  animalNum == index &&isVip != 'Visitor'" class="brand-arrow">
 						</view>
 						<!-- 节名称 -->
-						<view class="brand-content"> {{ item.jieName }} </view>
+						<view  class="brand-content"> {{ item.jieName }} </view>
 					</view>
 				</view>
 			</view>
@@ -71,6 +78,7 @@
 		onShow
 	} from '@dcloudio/uni-app';
 	const growthType = ref(null);
+	const appleTishen = ref(null);
 
 	const $emit = defineEmits(['clickGradeTerm', 'onLeft', 'onRight', 'handleCheckCatalogue', 'listClick'])
 	const props = defineProps({
@@ -86,10 +94,12 @@
 	})
 	onShow(() => {
 		growthType.value = cacheManager.get('auth') ? cacheManager.get('auth').growthType : props.youkeImage
+		appleTishen.value = cacheManager.get('youkeTishen').toString()
+		console.log(appleTishen.value);
 	})
-	
+
 	const isVip = getUserIdentity();
-	console.log('isVip', isVip);
+	//console.log('isVip', isVip);
 	const gradeMapping = {
 		1: '一年级',
 		2: '二年级',
@@ -173,23 +183,37 @@
 
 	// 获取节class
 	function getClass(data, index, isVip, item) {
+		
 		//	console.log('data',data);
 		let brandActive = '';
 		if (isVip === 'VIP') {
 			brandActive = 'brand-active';
 		} else if (data.number == 1 && item.firstFlag == 1 && isVip == 'Not-Vip') {
 			brandActive = 'brand-active';
+		} else if (appleTishen.value =='true') {
+			brandActive = 'brand-active';
 		} else if (data.number == 1 && item.firstFlag == 1 && isVip == 'Visitor' && item.type == 1) {
 			brandActive = 'brand-active';
-		} else {
+		}  else {
 			brandActive = '';
 		}
 		let indexLast = data.jieList.length - 1;
-		// 判断最后一个为名称是否为单元测试,是单元测试则返回ceshi-jie
-		if (index === indexLast && data.jieList[data.jieList.length - 1].jieName == '单元测试') {
-			return 'ceshi-brand-item' + ' ' + brandActive;
-		} else {
-			return getJieClass(data, index, brandActive)
+		// 用于苹果审核 游客模式 去掉单元测试
+		if(appleTishen.value =='true' && isVip == 'Visitor'){
+			
+			// 判断最后一个为名称是否为单元测试,是单元测试则返回ceshi-jie
+			if (index === indexLast && data.jieList[data.jieList.length - 1].jieName == '单元测试') {
+				return '';
+			} else {
+				return getJieClass(data, index, brandActive)
+			}
+		}else{
+			// 判断最后一个为名称是否为单元测试,是单元测试则返回ceshi-jie
+			if (index === indexLast && data.jieList[data.jieList.length - 1].jieName == '单元测试') {
+				return 'ceshi-brand-item' + ' ' + brandActive;
+			} else {
+				return getJieClass(data, index, brandActive)
+			}
 		}
 	}
 	// 根据获取节字数获取class