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

<script>
 	
 	export default {
		name:"tabbarJob",
		props:{
			current: 0
			
		},
		data() {
			return {
				activeColor:"#5098FF",
				oldindex:this.current,
				 myCurrent:this.current,
				 tabbarList: [{
				 		iconPath: "bar-chart-box-fill",
				 		selectedIconPath: "bar-chart-box-fill",
				 		text: '统计',
				 		count: 0,
				 		isDot: true,
				 		customIcon: true,
						pagePath2:"/pagesFinance/statistics/index",
						
				 	},
				 
					{
						iconPath: "article-fill",
						selectedIconPath: "article-fill",
						text: '明细',
						midButton: true,
						customIcon: true,
						pagePath2:"/pagesFinance/detailed/index",
						
					},
					{
						iconPath: "money-cny-box-fill",
						selectedIconPath: "money-cny-box-fill",
						text: '分润',
						midButton: true,
						customIcon: true,
						pagePath2:"/pagesFinance/share/index",
						
					},
				 	{
				 		iconPath: "account-pin-box-fill",
				 		selectedIconPath: "account-pin-box-fill",
				 		text: '我的',
				 		count: 0,
				 		isDot: false,
				 		customIcon: true,
						pagePath2:"/pagesFinance/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>
