Tabbar4.vue 2.03 KB
<template>
  <div id="tabbar">
    <div class="tab" :class="active=='KQ'?'active':''" @click="handleKQ">
      <img v-if="active=='KQ'" src="../assets/tabbar4/tab3_on.png" alt="">
      <img v-else src="../assets/tabbar4/tab3_off.png" alt="">
      <p>柯桥研学</p>
    </div>
    <div class="tab" :class="active=='ZZY'?'active':''" @click="handZZY">
      <img v-if="active=='ZZY'" src="../assets/tabbar4/tab2_on.png" alt="">
      <img v-else src="../assets/tabbar4/tab2_off.png" alt="">
      <p>周周营</p>
    </div>
    <div class="tab" :class="active=='center'?'active':''" @click="handleCenter">
      <img v-if="active=='center'" src="../assets/tabbar4/tab4_on.png" alt="">
      <img v-else src="../assets/tabbar4/tab4_off.png" alt="">
      <p>我的</p>
    </div>
  </div>
</template>
<script>
export default {
  name: 'Tabbar4',
  props: {
    active: String
  },
  methods: {
    handZZY () {
      this.$router.push({ name: 'ServiceKQ', query: { showTab: 'ZZY' } })
    },
    handleKQ () {
      this.$router.push({ name: 'ServiceKQ', query: { showTab: 'KQ' } })
    },
    handleCenter () {
      this.$router.push({ name: 'HomeKQ' })
    }
  }
}
</script>
<style lang="scss" scoped>
#tabbar {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 100px;
  background: #fff;
  display: flex;
  justify-content: space-around;
  padding-bottom: 40px;
  z-index: 99;
  .tab {
    padding: 18px;
    img {
      width: 36px;
      padding: 20px;
      display: block;
      margin: 0 auto;
    }
    .block {
      width: 52px;
      height: 52px;
    }
    p {
      font-size: 20px;
      color: #999999;
      text-align: center;
    }
    &.active {
      p {
        color: red;
      }
    }
  }
  .center {
    width: 92px;
    height: 92px;
    padding: 30px;
    background: transparent;
    position: absolute;
    top: -60px;
    left: 299px;
    overflow: hidden;
    z-index: 1;
    .tip {
      width: 92px;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: -1;
    }
  }
}
</style>