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

<script>
 	
 	export default {
		name:"tabbarJob",
		props:{
			current: 0
			
		},
		data() {
			return {
				activeColor:"#5098FF",
				oldindex:this.current,
				 myCurrent:this.current,
				 tabbarList: [{
				 		iconPath: "home-3-line",
				 		selectedIconPath: "home-3-fill",
				 		text: '主页 ',
				 		count: 0,
				 		isDot: true,
				 		customIcon: true,
						pagePath2:"/pages/index/index",
				 	},
				 	{
				 		iconPath: "road-map-line",
				 		selectedIconPath: "road-map-fill",
				 		text: '找桩',
				 		midButton: true,
				 		customIcon: true,
						pagePath2:"/pages/searchPile/searchPile",
				 	},
				 	{
				 		iconPath: "user-5-line",
				 		selectedIconPath: "user-5-fill",
				 		text: '我的',
				 		count: 0,
				 		isDot: false,
				 		customIcon: true,
						pagePath2:"/pages/user/index",
				 	}
			 ],
			};
			
		},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>
