cankao-h5/src/pages/realtimeInfoV1/home.vue

90 lines
1.9 KiB
Vue

<template>
<!-- 顶部 banner 区域 -->
<view class="all">
<view class="tabbar">
<view class="tabbar_item" @click="tabChange(0)">
<image
v-if="tabIndex == 1"
src=" @/assets/zixun/home_icon_normal.png"
class="tabbar_img"
/>
<image
v-if="tabIndex == 0"
src=" @/assets/zixun/home_icon_press.png"
class="tabbar_img"
/>
<text
class="tabbar_title"
:style="{ color: tabIndex == 0 ? '#3F80FA' : '#666666' }"
>首页</text
>
</view>
<view class="tabbar_item" @click="tabChange(1)">
<image
v-if="tabIndex == 0"
src=" @/assets/zixun/all_icon_normal.png"
class="tabbar_img"
/>
<image
v-if="tabIndex == 1"
src=" @/assets/zixun/all_icon_press.png"
class="tabbar_img"
/>
<text
class="tabbar_title"
:style="{ color: tabIndex == 1 ? '#3F80FA' : '#666666' }"
>全部</text
>
</view>
</view>
</view>
</template>
<script setup>
import { ref, onMounted, onUnmounted, reactive } from "vue";
const tabIndex = ref(0);
function tabChange(index) {
tabIndex.value = index;
}
onMounted(async () => {});
</script>
<style scoped lang="scss">
.tabbar {
display: flex;
height: 150rpx;
position: fixed;
bottom: 0;
box-shadow: 0 -2rpx 10rpx rgba(128, 128, 128, 0.2);
width: 100vw;
.tabbar_item {
width: 50%;
display: flex;
flex-direction: column;
align-items: center;
margin-top: 30rpx;
}
.tabbar_img {
width: 44rpx;
height: 44rpx;
}
.tabbar_title {
display: flex;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 20rpx;
color: #666666;
line-height: 28rpx;
text-align: left;
font-style: normal;
margin-top: 5rpx;
}
}
</style>