<template >
	<view>
		<u-tabbar v-model="myCurrent" :list="tabbarList" 
		:before-switch="beforeSwitch" active-color="#1F4A99"  ></u-tabbar>
		
	</view>
</template>

<script>
 	
 	export default {
		name:"tabbarJob",
		props:{
			current: 0,
			elderStatus: false
		},
		data() {
			return {
				activeColor:"#1F4A99",
				oldindex:this.current,
				 myCurrent:this.current,
				 tabbarList: [
					 {
					 
				 		iconPath: "home",
				 		selectedIconPath: "home-fill",
				 		text: '主页 ',
						pagePath2:"/pages/homePage/homePage",
				 	},
					{
					 
						iconPath: "heart",
						selectedIconPath: "heart-fill",
						text: '职工之家 ',
						pagePath2:"/pages/staffHome/staffHome",
					},
				 	{
				 		iconPath: "account",
				 		selectedIconPath: "account-fill",
				 		text: '我的',
						pagePath2:"/pages/mine/mine",
				 	}
			 ],
			};
			
		},methods:{
			setcount(c){
				this.myCurrent=c
			},
			beforeSwitch(index){
			
				
				if(index==this.current){
					return false
				}
				var url =this.tabbarList[index].pagePath2;
				
				uni.navigateTo({
					url: url
				})
				if(index==1){
					this.myCurrent=this.oldindex;
					return false;
				}else{
					return true;
				}
				
			},
			
		},mounted(){
			
		},destroyed(){
			
		}
		
		
	}
</script>

<style>
	 
</style>
