| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 | 
							- <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,index)"
 
- 				:style="{ backgroundImage: 'url(' + (currentTab === index ? item.activePath : item.iconPath) + ')' }">
 
- 			</view>
 
- 		</view>
 
- 	</view>
 
- </template>
 
- <script>
 
- 	import {
 
- 		useTabBarHistory
 
- 	} from '@/utils/emitEvents.js';
 
- 	import cacheManager from "@/utils/cacheManager.js";
 
- 	import {
 
- 		toast,
 
- 		getUserIdentity
 
- 	} from "@/utils/common";
 
- 	export default {
 
- 		data() {
 
- 			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: {
 
- 				type: String,
 
- 			},
 
- 			cardId: {
 
- 				type: String,
 
- 			},
 
- 			zhangId: {
 
- 				type: String,
 
- 			},
 
- 		},
 
- 		methods: {
 
- 			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;
 
- 					}
 
- 					uni.redirectTo({
 
- 						url: path
 
- 					});
 
- 				}
 
- 			},
 
- 		},
 
- 		created() {
 
- 			console.log(this.nianji);
 
- 		}
 
- 	}
 
- </script>
 
- <style scoped>
 
- 	.custom-tabbar {
 
- 		display: flex;
 
- 		justify-content: space-around;
 
- 		align-items: center;
 
- 		/* 其他样式 */
 
- 	}
 
- 	.tab-item {
 
- 		flex: 1;
 
- 		/* 样式 */
 
- 	}
 
- 	.tab-icon {
 
- 		/* 图标样式 */
 
- 	}
 
- </style>
 
 
  |