<template>
	<view class="footer flex p-y-xs2 bg-tab-nav">
		<view class="flex-fill" :class="{ 'router-link-active': tab == item.tel }"
			v-for="item in navList" :key="item.tel" @click="tabChange(item.tel)">
			<view class="icon">
				<img class="h-15" v-if="tab == item.tel" :src="item.activeIcon" alt="" />
				<img class="h-15" v-else :src="item.icon" alt="" />
			</view>
			<view class="fn-12">{{ $t(item.label) }}</view>
		</view>
	</view>
</template>
<script>
	import {
		navList
	} from "./list.js";
	export default {
		props: {
			tab: {
				type: String,
				default: "index",
			},
		},
		data() {
			return {
				navList: navList(this),
			};
		},
		created() {
			// console.log(navList,'navList');
		},
		methods: {
			tabChange(v) {
				uni.switchTab({
					url: "/pages/index/" + v,
				});
				// console.log(v);
				// console.log(this.$router);
			},
		},
	};
</script>
<style lang="scss" scoped>
	.flex-fill{
		text-align: center;
		line-height: 1;
	}
	.p-y-xs2 {
		padding: 5px 10px;
	}
	.h-15{
		height: 20px;
		width: 20px;
	}
	.footer {
		box-shadow:  0px -7px 20px 0px rgba(37, 37, 48, 0.83);
		position: fixed;
		bottom: 0;
		width: 100%;
		z-index: 999 !important;
		// height: 102rpx;
		color: rgba(#fff, 0.3);
		justify-content: space-around !important;
	}
	.fn-12{
		margin-top: 4px;
		font-size: 10px;
	}
	.router-link-active {
		// color: $theme-1;
		color:#FEB041;
	}

	.bg-tab-nav {
		background-color: #000000;
	}
</style>