wangguoyu преди 5 месеца
родител
ревизия
6309181938
променени са 1 файла, в които са добавени 40 реда и са изтрити 18 реда
  1. 40 18
      pages/study/product/shuxue.vue

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

@@ -6,20 +6,30 @@
 			<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'"  class="brand-lock">
+						<view v-if="item.number ==1">{{ 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 +85,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 +161,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)