123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <template>
- <view class="bottom_tabbar">
- <view v-for="(item,index) in list" :key="index" @tap="changeTabbar(index)">
- <image :src="tabbarIndex===index?item.activeImg:item.inactiveImg"></image>
- <text :class="{'active':tabbarIndex===index}">{{item.text}}</text>
- </view>
- </view>
- </template>
- <script>
- export default {
- props: {
- tabbarIndex: 0
- },
- data() {
- return {
- tabbarValue: 0,
- list: [
- {
- inactiveImg: this.$imgBase+'icon_home_grey.png',
- activeImg: this.$imgBase+'icon_home_blue.png',
- text: '首页',
- path: '/pagesHome/index'
- },
- {
- inactiveImg: this.$imgBase+'icon_xunjian_grey.png',
- activeImg: this.$imgBase+'icon_xunjian_blue.png',
- text: '智能巡检',
- path: '/pagesInspection/index'
- },
- {
- inactiveImg: this.$imgBase+'icon_storage_grey.png',
- activeImg: this.$imgBase+'icon_storage_blue.png',
- text: '仓储管理',
- path: '/pagesStorage/home'
- },
- ],
- loginSuccessUrl:''
- }
- },
- mounted() {
- this.tabbarValue = this.tabbarIndex;
- },
- methods: {
- changeTabbar(e) {
- this.tabbarValue = e;
- uni.reLaunch({
- url: this.list[e].path
- })
- }
- }
- }
- </script>
- <style scoped lang="less">
- .bottom_tabbar {
- width: 100%;
- height: 168rpx;
- background: #FFFFFF;
- display: flex;
- position: fixed;
- left: 0;
- bottom: 0;
- z-index: 999;
- padding-top: 10rpx;
- box-sizing: border-box;
- border-top: 1rpx solid lavender;
- &>view {
- width: calc(100% / 3);
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- image {
- width: 48rpx;
- height: 48rpx;
- }
- text {
- margin-top: 6rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #86909C;
- line-height: 33rpx;
- text-align: center;
- &.active{
- font-weight: bold;
- color: #198CFF;
- }
- }
- }
- }
- </style>
|