wangguoyu 4 months ago
parent
commit
708bef3162
2 changed files with 16 additions and 6 deletions
  1. 1 1
      pages/study/index.vue
  2. 15 5
      pages/study/product/yingyu.vue

+ 1 - 1
pages/study/index.vue

@@ -8,7 +8,7 @@
 					:options="item">
 				</shuxueZhangjie>
 				<yingyuZhangjie v-if="currentProduct ==2" @clickGradeTerm="clickGradeTerm"
-					@handleCheckCatalogue="handleCheckCatalogue" @listClick="listClick" :options="item">
+					@handleCheckCatalogue="handleCheckCatalogue" @listClick="listClick" :gradeTerm='gradeTerm' :options="item">
 				</yingyuZhangjie>
 			</view>
 		</swiper-item>

+ 15 - 5
pages/study/product/yingyu.vue

@@ -70,6 +70,9 @@
 		options: {
 			type: Object,
 		},
+		gradeTerm: {
+			type: String,
+		},
 	})
 	const isVip = getUserIdentity();
 	const gradeMapping = {
@@ -90,6 +93,7 @@
 	let isSliding = ref(false);
 	let endX = ref(0);
 	let gradeTerm = ref('');
+	
 
 	function clickGradeTerm() {
 		$emit('clickGradeTerm');
@@ -132,10 +136,6 @@
 		}
 	}
 	
-	function translateData(data) {
-		return gradeMapping[data.nianji] + termMapping[data.cardId]
-	}
-
 	function handleCheckCatalogue() {
 		$emit('handleCheckCatalogue');
 	}
@@ -196,12 +196,22 @@
 	//	console.log('New options:', newVal);
 	//	console.log('Old options:', oldVal);
 		// 在这里可以根据新的 options 做一些操作,比如发起请求等
-		gradeTerm.value = translateData(newVal);
+		
 		dataRecom(newVal)
 	}, {
 		deep: true,
 		immediate: true
 	});
+	watch(() => props.gradeTerm, (newVal, oldVal) => {
+	//	console.log('New options:', newVal);
+	//	console.log('Old options:', oldVal);
+		// 在这里可以根据新的 options 做一些操作,比如发起请求等
+		gradeTerm.value = newVal
+	
+	}, {
+		deep: true,
+		immediate: true
+	});
 </script>
 
 <style>