<template>
	<view class="tabBar_contaier flex around">
		 <view @click="selectFn(item,index)" class="tabBar_item flex jc column ac" v-for="(item,index) in tabBarList " :key="index">
			 <image :src="value==item.selectIndex?item.selectedIconPath:item.iconPath"></image>
			 <view :class=" 'tabBar_item_text' + (value==item.selectIndex?' .select_tabBar_item_text':'') ">{{item.text}}</view>
		 </view>
	</view>
</template>

<script>
	import station from '@/api/station.js'
	export default {
		name: "tabBar",
		props:{
			value:{
				type:Number,
				default:0
			},
			tabBarList:{
				type:Array,
				default:()=>[]
			}
		},
		data() {
			return {};
		},
		created() { 
			// debugger
		},
		methods:{
			async scanCode(){
				let res = await this.tool.scanCode();
				if(res.result){
					 uni.navigateTo({
					 	url:`/ChargingStation/pages/placeOrder/index?type=qrCode&id=${res.result}`
					 })
				} 
			},
			selectFn(e,index){  
				this.$emit('input',e.selectIndex);
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import 'index.scss';
</style>