wangguoyu 8 mesi fa
parent
commit
921dce8619
3 ha cambiato i file con 52 aggiunte e 22 eliminazioni
  1. 3 3
      pages/study/index.vue
  2. 29 13
      pages/study/product/shuxue.vue
  3. 20 6
      pages/study/product/yingyu.vue

+ 3 - 3
pages/study/index.vue

@@ -340,17 +340,17 @@
 	}
 
 	function listClick(data,data2,index) {
-		
+		//debugger
 		console.log('data',data);
 		console.log('data2',data2);
-		if (!cacheManager.get('auth') && data2.number != 1) {
+		if ((!cacheManager.get('auth') && data2.number != 1)||(!cacheManager.get('auth') && data.type == 2) ) {
 			youkeDialogRef.value.handleShow();
 			return;
 		}
 		const authCode = getUserIdentity();
 		console.log('authCode', authCode);
 		if (!(authCode == 'VIP' || data2.number == 1)) {
-			debugger
+		//	debugger
 			goPayDialogRef.value.handleShow();
 			return false
 		}

+ 29 - 13
pages/study/product/shuxue.vue

@@ -11,7 +11,7 @@
 			<view>
 				<!-- 小岛 -->
 				<view class="brand-item" v-for="(item, index) in options.jieList" :key="item.jieId"
-					@click="listClick(item, index,options)" :class="getClass(options,index,isVip)">
+					@click="listClick(item, index,options)" :class="getClass(options,index,isVip,item)">
 					<view v-if="isVip === 'VIP'">
 						<!-- 序号 -->
 						<view class="brand-icon" v-if="item.studyFlag===0">{{ item.number }}</view>
@@ -22,14 +22,28 @@
 						<!-- 节名称 -->
 						<view class="brand-content">{{ item.jieName }}</view>
 					</view>
-					<view v-if="isVip !== 'VIP'">
+					<view v-if="isVip == 'Not-Vip'">
 						<!-- 序号或锁 -->
-						<view v-if="options.number ==1" class="brand-icon">{{ item.number }}
+						<view   class="brand-icon">{{ item.number }}
 						</view>
 						<!-- 锁 -->
-						<view v-else class="brand-lock"></view>
+						<view   v-if="options.number !='1'" class="brand-lock"></view>
 						<!-- 箭头 -->
-						<view v-if="item.daeFlag  &&  animalNum == index &&isVip != 'Visitor'" class="brand-arrow"></view>
+						<view v-if="item.daeFlag  &&  animalNum == index &&isVip != 'Visitor'" class="brand-arrow">
+						</view>
+						<!-- 节名称 -->
+						<view class="brand-content"> {{ item.jieName }} </view>
+					</view>
+					
+					<view v-if="isVip == 'Visitor'">
+						<!-- 序号或锁 -->
+						<view   class="brand-icon">{{ item.number }}
+						</view>
+						<!-- 锁 -->
+						<view  v-if="options.number !='1' || item.type==2"  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>
@@ -58,9 +72,9 @@
 	} from '@dcloudio/uni-app';
 	const growthType = ref(null);
 	onShow(() => {
-		growthType.value = cacheManager.get('auth')?cacheManager.get('auth').growthType:null
+		growthType.value = cacheManager.get('auth') ? cacheManager.get('auth').growthType : null
 	})
-	
+
 	const $emit = defineEmits(['clickGradeTerm', 'onLeft', 'onRight', 'handleCheckCatalogue', 'listClick'])
 	const props = defineProps({
 		options: {
@@ -71,7 +85,7 @@
 		},
 	})
 	const isVip = getUserIdentity();
-//	console.log('isVip',isVip);
+	console.log('isVip', isVip);
 	const gradeMapping = {
 		1: '一年级',
 		2: '二年级',
@@ -96,13 +110,13 @@
 		$emit('clickGradeTerm');
 	}
 
-	function listClick(data, index,data2) {
+	function listClick(data, index, data2) {
 		data.daeFlag = true
 		nextTick(() => {
 			animalNum.value = index
 		})
 		setTimeout(() => {
-			$emit('listClick', data,data2,index);
+			$emit('listClick', data, data2, index);
 		}, 300)
 
 	}
@@ -154,12 +168,14 @@
 	}
 
 	// 获取节class
-	function getClass(data, index, isVip) {
-		console.log('data',data);
+	function getClass(data, index, isVip,item) {
+		//	console.log('data',data);
 		let brandActive = '';
 		if (isVip === 'VIP') {
 			brandActive = 'brand-active';
-		} else if (data.number == 1) {
+		} else if (data.number == 1 && isVip =='Not-Vip') {
+			brandActive = 'brand-active';
+		} else if (data.number == 1 && isVip =='Visitor' &&item.type ==1) {
 			brandActive = 'brand-active';
 		} else {
 			brandActive = '';

+ 20 - 6
pages/study/product/yingyu.vue

@@ -8,7 +8,7 @@
 			<view>
 				<!-- 小岛 -->
 				<view class="brand-item" v-for="(item, index) in options.jieList" :key="item.jieId"
-					@click="listClick(item, index,options)" :class="getClass(options,index,isVip)">
+					@click="listClick(item, index,options)" :class="getClass(options,index,isVip,item)">
 					<view v-if="isVip === 'VIP'">
 						<!-- 序号 -->
 						<view class="brand-icon">{{ item.number }}</view>
@@ -19,17 +19,28 @@
 						<!-- 节名称 -->
 						<view class="brand-content">{{ item.jieName }}</view>
 					</view>
-					<view v-if="isVip !== 'VIP'">
+					<view v-if="isVip == 'Not-Vip'">
 						<!-- 序号 -->
-						<view class="brand-icon">{{ item.number }}</view>
+						<view  class="brand-icon">{{ item.number }}</view>
 						<!-- 锁 -->
-						<view v-if="options.number !='1'"  class="brand-lock"></view>
+						<view v-if="options.number !='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>
+					<view v-if="isVip == 'Visitor'">
+						<!-- 序号 -->
+						<view  class="brand-icon">{{ item.number }}</view>
+						<!-- 锁 -->
+						<view v-if="options.number !='1' || item.type==2"  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>
 				</view>
 			</view>
 		</view>
@@ -67,6 +78,7 @@
 		},
 	})
 	const isVip = getUserIdentity();
+	console.log('isVip',);
 	const gradeMapping = {
 		1: '一年级',
 		2: '二年级',
@@ -128,11 +140,13 @@
 	}
 
 	// 获取节class
-	function getClass(data, index, isVip) {
+	function getClass(data, index, isVip,item) {
 		let brandActive = '';
 		if (isVip === 'VIP') {
 			brandActive = 'brand-active';
-		} else if (data.number == 1) {
+		} else if (data.number == 1 && isVip =='Not-Vip') {
+			brandActive = 'brand-active';
+		}else if (data.number == 1 && isVip =='Visitor' &&item.type ==1){
 			brandActive = 'brand-active';
 		} else {
 			brandActive = '';