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

	</view>
</template>

<script>
 	
 	export default {
		name:"tabbarHr",
		props:{
			current: {
				setIntervalId:"",
				require: false,
				default: 0,
			},
		},
		data() {
			return {
				activeColor:"#5098FF",
				 myCurrent:this.current,
				list: [{
										iconPath: "home",
										selectedIconPath: "home",
										text: '首页',
										customIcon: false,
										pagePath2:"/pages/hr/index/index"
									},
									 
									
									{
									iconPath: "chat",
									selectedIconPath: "chat",
										text: '消息',
											count:0,
										customIcon: false,
										pagePath2:"/pages/hr/newsIndex/newsIndex",
									},
									{
										iconPath: "account",
										selectedIconPath: "account",
										text: '我的',
										pagePath2:"/pages/hr/my/my",
										customIcon: false,
									},
								],
			};
			
		},methods:{
			beforeSwitch(index){
				clearInterval(this.setIntervalId)
				if(index==this.current){
					return false
				}
				var url =this.list[index].pagePath2;
				uni.navigateTo({
					url: url
				})
				return true;
			},
			 getNum(){
				 
			 				 this.list[1].count=this.carhelp.get("tabbar_show_num")
			 				
			 }
		},mounted(){
			
			this.getNum()
			this.setIntervalId=setTimeout(()=>{
				this.getNum()
			},1000*2)
				
		},destroyed(){
			
		}
		
	}
</script>

<style>
	 
</style>
