<template>
|
<view class="tabbar">
|
<view class="tab-item" :class="{ active: active === 'home' }" @click="goHome">
|
<uni-icons type="home" :color="active === 'home' ? '#1E88E5' : '#666'" size="36"></uni-icons>
|
<text class="label">首页</text>
|
</view>
|
<view class="tab-item" :class="{ active: active === 'progress' }" @click="goProgress">
|
<uni-icons type="list" :color="active === 'progress' ? '#1E88E5' : '#666'" size="36"></uni-icons>
|
<text class="label">总进度</text>
|
</view>
|
<view class="tab-item" :class="{ active: active === 'projects' }" @click="goReport">
|
<uni-icons type="list" :color="active === 'projects' ? '#1E88E5' : '#666'" size="36"></uni-icons>
|
<text class="label">上报</text>
|
</view>
|
<view class="tab-item" :class="{ active: active === 'mine' }" @click="goMine">
|
<uni-icons type="person" :color="active === 'mine' ? '#1E88E5' : '#666'" size="36"></uni-icons>
|
<text class="label">我的</text>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
|
export default {
|
name: 'BottomTabBar',
|
props: {
|
active: {
|
type: String,
|
default: 'home'
|
}
|
},
|
methods: {
|
goHome() {
|
uni.redirectTo({ url: '/pages/index/index', });
|
},
|
goProgress() {
|
uni.redirectTo({ url: '/subpackage/manager/progress', });
|
},
|
goMine() {
|
uni.redirectTo({ url: '/subpackage/user/mine', });
|
},
|
goReport() {
|
uni.redirectTo({ url: '/subpackage/manager/report', });
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.tabbar {
|
position: fixed;
|
left: 0;
|
right: 0;
|
bottom: 0;
|
height: 100rpx;
|
background-color: #ffffff;
|
border-top: 1rpx solid #eee;
|
box-shadow: 0 -4rpx 10rpx rgba(0, 0, 0, 0.06);
|
display: flex;
|
z-index: 99;
|
padding-bottom: env(safe-area-inset-bottom);
|
}
|
|
.tab-item {
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
justify-content: center;
|
color: #666;
|
font-size: 24rpx;
|
}
|
|
.tab-item .icon {
|
font-size: 36rpx;
|
line-height: 40rpx;
|
margin-bottom: 6rpx;
|
}
|
|
.tab-item.active {
|
color: #1E88E5;
|
font-weight: 600;
|
}
|
</style>
|