<template>
	<view class="bar">
		<view class="barbox" @click="gogogo(0)">
			<view class="bar-img">
				<!-- <image  src="../../static/imgs/homex.png" mode=""></image>
			
				<image v-show="actindex != 0" src="../../static/imgs/home.png" mode=""></image> -->

				<u-icon name="home-fill" v-if="actindex == 0" color="#2979ff" size="28"></u-icon>
				<u-icon name="home" v-if="actindex != 0" size="28"></u-icon>
			</view>
			<view class="">้ฆ–้กต</view>
		</view>

		<view class="barbox" @click="gogogo(1)">
			<view class="bar-img">
				<u-icon name="account-fill" v-if="actindex == 1" color="#2979ff" size="28"></u-icon>
				<u-icon name="account" v-if="actindex != 1" size="28"></u-icon>

			</view>
			<view class="">ๆˆ‘็š„</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				actindex: 0,
			}
		},
		props: {
			msg: String
		},
		mounted() {
			this.actindex = this.msg
		},
		methods: {
			gogogo(id) {
				this.actindex = id
				if (id == 0) {
					uni.reLaunch({
						url: '/pages/index/index'
					})
				}
				if (id == 1) {
					uni.reLaunch({
						url: '/pages/my/my'
					})
				}

			}
		}
	}
</script>

<style scoped lang="scss">
	.bar {
		width: 100%;
		height: 68px;
		background-color: white;
		position: fixed;
		bottom: 0px;
		display: flex;
		align-items: center;
		justify-content: space-around;
		font-size: 12px;
		font-weight: 400;
		color: #666666;
		box-shadow: 0px -3px 13px 0px rgba(0, 0, 0, 0.1);
		border-radius: 22px 22px 0px 0px;
	}

	.barbox {
		width: 33%;
		text-align: center;
	}

	.centerbox {
		width: 50px;
		height: 50px;
		background-color: white;
		border-radius: 50%;
		margin: 0 auto;
		margin-top: -30px;
		box-sizing: border-box;
		padding: 5px;


	}

	.qiu {
		width: 100%;
		height: 100%;
		border-radius: 50%;
		background: linear-gradient(135deg, #2FF7D3 0%, #2F72F7 100%);
		display: flex;
		align-items: center;
		justify-content: center;

		image {
			width: 20px;
			height: 20px;
		}

	}

	.bar-img {
		width: 25px;
		height: 25px;
		margin: 0px auto;

		image {
			width: 100%;
			height: 100%;
		}
	}
</style>