Просмотр исходного кода

Merge branch '2024鹅状元' of https://gogs.mtavip.com/wangguoyu/uniProject into 2024鹅状元

tanxue 5 месяцев назад
Родитель
Сommit
606f46303a
2 измененных файлов с 55 добавлено и 26 удалено
  1. 13 8
      pages/study/index.vue
  2. 42 18
      pages/study/product/shuxue.vue

+ 13 - 8
pages/study/index.vue

@@ -1,5 +1,6 @@
 <template>
-	<view class="ezy-study-page">
+	<view class="ezy-study-page">
+		{{currentProduct}}
 		<shuxueZhangjie v-if="currentProduct ==1" @clickGradeTerm="clickGradeTerm" @onLeft="onLeft" @onRight="onRight"
 			@handleCheckCatalogue="handleCheckCatalogue" @listClick="listClick" :options="infoData">
 		</shuxueZhangjie>
@@ -10,7 +11,7 @@
 		<egg-dialog ref="eggDialogRef" @eggBtn="eggBtn"></egg-dialog>
 		<catalogue ref="catalogueRef" @change-zhang="handleChangeZhang"></catalogue>
 		<CustomTabBar :cardId="cardId" :nianji="nianji" :zhangId="zhangId"></CustomTabBar>
-				<tip-small-dialog ref="goPayDialogRef" @confirm-btn="goPay" :content="tipContent"></tip-small-dialog>
+				<tip-small-dialog ref="goPayDialogRef" @confirm-btn="goPayPage" :content="tipContent"></tip-small-dialog>
 	</view>
 
 </template>
@@ -46,14 +47,14 @@
 		toast,getUserIdentity
 	} from "@/utils/common";
 	import cacheManager from "@/utils/cacheManager.js";
-	const tipContent = '付费章节,是否前往开通付费?'; 
-	const currentProduct = cacheManager.get('auth').cardId; //当前产品
+	const tipContent = '付费章节,是否前往开通付费?';  //当前产品
 	const goPayDialogRef = ref(null);
 	const eggDialogRef = ref(null);
 	const zhangId = ref(null); //游客使用
 	const nianji = ref(null);//游客使用
 	const cardId = ref(null);//游客使用
-	const catalogueRef = ref(null);
+	const catalogueRef = ref(null);
+	const currentProduct = ref(null);
 	const selectZhang = ref(null);
 	let infoData = reactive({
 		jieList: [],
@@ -70,7 +71,8 @@
 	})
 
 	function init(options){
-		if (cacheManager.get('auth')) {
+		if (cacheManager.get('auth')) {
+			currentProduct.value = cacheManager.get('auth').cardId;
 			//会员 取auth
 			selectZhang.value = cacheManager.get('auth');
 			console.log(selectZhang.value);
@@ -83,7 +85,8 @@
 		} else {
 			zhangId.value = options.zhangId
 			nianji.value = options.nianji
-			cardId.value = options.cardId
+			cardId.value = options.cardId
+			currentProduct.value = options.cardId
 			// 未登录 游客 
 			getCommonZhang(options)
 		}
@@ -206,7 +209,9 @@
 
 		})
 	}
-
+	function goPayPage(){
+		
+	}
 	function handleChangeZhang(data) {
 		selectZhang.value = data;
     const authCode = getUserIdentity();

+ 42 - 18
pages/study/product/shuxue.vue

@@ -5,21 +5,33 @@
 			<view class="chapter-box" @click="handleCheckCatalogue">{{options.numberStr}}</view>
 			<view class="chapter-title-box">{{options.zhangName}}</view>
 			<view>
+			
 				<view class="brand-item" v-for="(item, index) in options.jieList" :key="item.jieId"
-					@click="listClick(item, index)" :class="getClass(options)">
-					<view v-if="isVip === 'VIP' || item.number == 1" class="brand-icon">
+					@click="listClick(item, index)" :class="getClass(options.jieList,index)">
+					<view v-if="isVip === 'VIP'" class="brand-icon">
 						{{ item.number }}
+						<view v-if="item.daeFlag">
+						<template v-if="growthType ==0">蛋</template>
+						<template v-if="growthType ==1">小鹅</template>
+						<template v-if="growthType ==2">中鹅</template>
+						<template v-if="growthType ==3">大鹅</template>
+						</view>
+						<view class="brand-content">
+							{{ item.jieName }}
+						</view>
 					</view>
-					<view v-if="item.daeFlag">
-					<template v-if="growthType ==0">蛋</template>
-					<template v-if="growthType ==1">小鹅</template>
-					<template v-if="growthType ==2">中鹅</template>
-					<template v-if="growthType ==3">大鹅</template>
-					</view>
-					<!-- 如果用户不是 VIP 且不是第一项,则添加 brand-lock 类 -->
-					<view v-if="!(isVip=='VIP' || item.number == 1)" class="brand-lock"></view>
-					<view class="brand-content">
-						{{ item.jieName }}
+					<view v-if="isVip !== 'VIP'">
+						<view v-if="item.number ==1" class="brand-icon">{{ item.number }}</view>
+						<view v-if="item.number !=1" class="brand-lock">{{ item.number }}</view>
+						<view v-if="item.daeFlag">
+						<template v-if="growthType ==0">蛋</template>
+						<template v-if="growthType ==1">小鹅</template>
+						<template v-if="growthType ==2">中鹅</template>
+						<template v-if="growthType ==3">大鹅</template>
+						</view>
+						<view class="brand-content">
+							{{ item.jieName }}
+						</view>
 					</view>
 				</view>
 			</view>
@@ -75,8 +87,22 @@
 		$emit('listClick', data);
 	}
 
-	function getClass (data){
-		console.log(data);
+	function getClass (data,index){
+		// 节 4个  且最后一个为单元测试
+		if(data.length ==4 && data[data.length -1].jieName =='单元测试'){
+			// if(data[index].jieName.length){
+			// 		return  'class1'  
+			// }else{
+			// 		return  'class2'  
+			// }
+		
+		}else{
+			// if(data[index].jieName.length){
+			// 		return  'class3'  
+			// }else{
+			// 		return  'class4'  
+			// }
+		}
 	}
 	function translateData(data) {
 		return gradeMapping[data.nianji] + termMapping[data.cardId]
@@ -137,12 +163,10 @@
 			    return false;
 			});
 		}
-		console.log(data);
-		console.log("1111");
 	}
 	watch(() => props.options, (newVal, oldVal) => {
-		console.log('New options:', newVal);
-		console.log('Old options:', oldVal);
+	//	console.log('New options:', newVal);
+	//	console.log('Old options:', oldVal);
 		// 在这里可以根据新的 options 做一些操作,比如发起请求等
 		gradeTerm.value = translateData(newVal);
 		dataRecom(newVal)