<template >
	<view>
		<u-tabbar v-model="myCurrent" mid-button-size="35px"	 :midButton="true" :list="tabbarList" 
		:before-switch="beforeSwitch" active-color="#1F4A99" inactive-color="#B3BED1"  ></u-tabbar>
		
	</view>
</template>

<script>
 	var img1=require('@/components/riFill-hearts-fill@1x.png')
	var img2=require('@/components/home@1x.png')
	var img3=require('@/components/riFill-hearts-fill@.png')
	var img4=require('@/components/home@.png')
 	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:"/",
						login:false,
				 	},
					{
					 
						iconPath: img3,
						selectedIconPath: img1,
						textImg:true,
						text: img2,
						text2: img4,
						pagePath2:"/pages/staffHome/staffHome",
						midButton:true,
						
					
					},
				 	{
				 		iconPath: "account",
				 		selectedIconPath: "account-fill",
				 		text: '我的',
						login:true,
						pagePath2:"/pages/mine/mine",
				 	}
			 ],
			};
			
		},methods:{
			setcount(c){
				//this.myCurrent=c
			},
			beforeSwitch(index){
			
				var bl=false
				
				if(index==this.current){
					
					return false
				}
				//this.myCurrent=index
				var url =this.tabbarList[index].pagePath2;
				
				if(this.tabbarList[index].login){
					var userInfo=this.carhelp.getPersonInfo()
					if(userInfo){
						
					}else{
						url="/pages/login/index"
						bl=true	
					}
					
				}
				uni.navigateTo({
					url: url
				})
			
				
				
			},
			
		},
		mounted(){
			
		},destroyed(){
			
		}
		
		
	}
</script>

<style>
	 
</style>
