Browse Source

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

tanxue 5 tháng trước cách đây
mục cha
commit
bcff8479ce

+ 29 - 23
components/custom-tabbar/custom-tabbar.vue

@@ -1,8 +1,9 @@
 <template>
 	<view class="ezy-custom-tabbar">
 		<view class="tabbar-item-box">
-			<view class="tabbar-item" v-for="(item, index) in tabList" :key="index" @click="switchTab(item.path)"
-				:style="{backgroundImage: 'url(' + item.iconPath + ')'}"></view>
+			<view class="tabbar-item" v-for="(item, index) in tabList" :key="index" @click="switchTab(item.path,index)"
+				:style="{ backgroundImage: 'url(' + (currentTab === index ? item.activePath : item.iconPath) + ')' }">
+			</view>
 		</view>
 	</view>
 </template>
@@ -13,7 +14,8 @@
 	} from '@/utils/emitEvents.js';
 	import cacheManager from "@/utils/cacheManager.js";
 	import {
-		toast,getUserIdentity
+		toast,
+		getUserIdentity
 	} from "@/utils/common";
 	export default {
 
@@ -21,22 +23,26 @@
 			return {
 				tabList: [{
 						iconPath: 'static/images/tabbar/unselect/plan-sj.png',
+						activePath: 'static/images/tabbar/select/plan-sj.png',
 						path: `/pages/study/index`
 					},
 					{
 						iconPath: 'static/images/tabbar/unselect/partner-sj.png',
+						activePath: 'static/images/tabbar/select/partner-sj.png',
 						path: '/pages/game/index'
 					},
 					{
 						iconPath: 'static/images/tabbar/unselect/my-sj.png',
+						activePath: 'static/images/tabbar/select/my-sj.png',
 						path: `/pages/my/index`
 					},
 				],
+				currentTab: 0
 
 			};
 		},
 		props: {
-			nianji: { 
+			nianji: {
 				type: String,
 			},
 			cardId: {
@@ -45,34 +51,34 @@
 			zhangId: {
 				type: String,
 			},
-		
+
 		},
 		methods: {
 
-			switchTab(path, params = {}) {
-				
-				/* if(path =='/pages/game/index'){
-					toast("功能暂未开放!")
-					return false
-				} */
-				
+			switchTab(path, index) {
+				this.currentTab = index;
 				if (getUserIdentity() == 'Visitor') {
+					if (path === '/pages/game/index') {
+						// 游戏需要返回功能
+						uni.navigateTo({
+						  url: path
+						});
+						return ;
+					}
 					uni.redirectTo({
 						url: path + '?nianji=' + this.nianji + '&cardId=' + this.cardId + '&zhangId=' + this
 							.zhangId
 					});
-				}else{
-
-          if (path === '/pages/game/index') {
-            // 游戏需要返回功能
-            uni.navigateTo({
-              url: path
-            });
-            return ;
-          }
-
+				} else {
+					if (path === '/pages/game/index') {
+						// 游戏需要返回功能
+						uni.navigateTo({
+							url: path
+						});
+						return;
+					}
 					uni.redirectTo({
-						url: path 
+						url: path
 					});
 				}
 

+ 1 - 1
pages/game/components/goose.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<up-line-progress v-if="growthType!==3" :percentage="progress" :showText="false" activeColor="#54e1fe" class="game-progress-box"></up-line-progress>
-    <text class="game-progress-text">成长值:{{progress}}%</text>
+		<text v-if="growthType!==3" class="game-progress-text">成长值:{{progress}}%</text>
 		<image :src="imgUrl" class="goose-img-box"></image>
 	</view>
 </template>

+ 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>