bottomNav.vue 2.44 KB
<template>
    <div class="container">
        <div class="wrapper">
            <div class="nav-box" :class="[isYZT?'selected':'no-selected']" @click="jumpNav('isYZT')">
                <span>一张图</span>
            </div>
            <div class="nav-box" :class="[isCGSC?'selected':'no-selected']" @click="jumpNav('isCGSC')">
                <span>成果审查管理</span>
            </div>
            <div class="nav-box" :class="[isSSJD?'selected':'no-selected']" @click="jumpNav('isSSJD')">
                <span>实施监督预警</span>
            </div>
            <div class="nav-box" :class="[isPGJG?'selected':'no-selected']" @click="jumpNav('isPGJG')">
                <span>批后监管</span>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: 'bottomNav',
        components: {},
        data() {
            return {
                isYZT: false, // 一张图
                isCGSC: true, // 成果审查管理
                isSSJD: false, // 实施监督预警
                isPGJG: false, // 批后监管
                flagArr: ['isYZT', 'isCGSC', 'isSSJD', 'isPGJG']
            }
        },
        mounted() {},
        methods: {
            jumpNav(val) {
                this.flagArr.forEach(ele => {
                    if (ele == val) this[val] = true;
                    else this[ele] = false;
                });
            },
        }
    }
</script>

<style scoped>
    .container {
        width: 100%;
    }

    .wrapper {
        width: 50%;
        margin: 0 auto;
        display: flex;
        justify-content: space-around;
        font-size: 24px;
        color: #FFFFFF;
        cursor: pointer;
    }

    .nav-box {
        width: 306px !important;
        text-align: center;
        cursor: pointer;
    }

    .selected {
        background-image: url('../assets/一张图/bg-选中.png');
        background-size: 100% 100%;
        background-repeat: no-repeat;
        height: 39.2px;
    }

    .selected span {
        display: inline-block;
        transform: translateY(-15.2px);
        font-size: 30px;
    }

    .no-selected {
        background-image: url('../assets/一张图/bg-未选中.png');
        background-size: 100% 100%;
        background-repeat: no-repeat;
        height: 24px;
        transform: translateY(16px);
    }

    .no-selected span {
        display: inline-block;
        transform: translateY(-17.2px);
        font-size: 24px;
    }
</style>