<template >
	<view>
		<u-tabbar v-model="myCurrent" :list="tabbarList" 
		inactive-color="#A8B0AD"
		:before-switch="beforeSwitch" active-color="#009143" :height="elderStatus ? '110rpx' : '100rpx'" :icon-size="elderStatus ? '56rpx' : '40rpx'"></u-tabbar>
		
	</view>
</template>

<script>
	var img1=require('@/assets/img/riLine-vip-crown-2-line.svg')
	var img2=require('@/assets/img/riFill-vip-crown-2-fill.svg')
 
 	export default {
		name:"tabbarJob",
		props:{
			current: 0,
			elderStatus: false
		},
		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: img1,
						selectedIconPath: img2,
					
						text: '会员',
						midButton: true,
						//customIcon: true,
						pagePath2:"/pages/monthlyCardActivity/monthlyCardBuy",
					},
				 	{
				 		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>
