<template>
  <div>
    <tab-nav active="1"></tab-nav>
    <img src="https://webapp-pub.ezijing.com/www/h5/images/about_banner_01.png" class="main-banner" />
    <div class="main-container">
      <div class="main-content">
        <h1 class="title">{{ $t('about.project.title') }}</h1>
        <p v-html="$t('about.project.text')"></p>
      </div>
      <div class="total" v-if="false">
        <ul>
          <li>
            <p class="t1"><span>12</span>{{ $t('about.project.unit1') }}</p>
            <p class="t2">{{ $t('about.project.itemText1') }}</p>
          </li>
          <li>
            <p class="t1"><span>547</span>{{ $t('about.project.unit2') }}</p>
            <p class="t2">{{ $t('about.project.itemText2') }}</p>
          </li>
        </ul>
        <ul>
          <li>
            <p class="t1"><span>1000</span>+</p>
            <p class="t2">{{ $t('about.project.itemText3') }}</p>
          </li>
          <li>
            <p class="t1"><span>700</span>+</p>
            <p class="t2">{{ $t('about.project.itemText4') }}</p>
          </li>
        </ul>
        <ul>
          <li>
            <p class="t1"><span>6000</span>+</p>
            <p class="t2">{{ $t('about.project.itemText7') }}</p>
          </li>
          <li>
            <p class="t1">
              <span>{{ $t('about.project.unit3Text') }}</span
              ><span>{{ $t('about.project.unit3') }}</span
              >+
            </p>
            <p class="t2">{{ $t('about.project.itemText8') }}</p>
          </li>
        </ul>
        <ul>
          <li>
            <p class="t1"><span>1100</span>+</p>
            <p class="t2">{{ $t('about.project.itemText5') }}</p>
          </li>
          <li>
            <p class="t1"><span>4900</span>+</p>
            <p class="t2">{{ $t('about.project.itemText6') }}</p>
          </li>
        </ul>
      </div>
      <div class="tabs" v-if="false">
        <ul class="tab-nav">
          <li :class="{ 'is-active': indexActive === 0 }" @click="changeIndex(0)">
            <p class="t1">{{ $t('about.project.tabBtn1Tit') }}</p>
            <p class="t2" v-html="$t('about.project.tabBtn1Txt')"></p>
          </li>
          <li :class="{ 'is-active': indexActive === 1 }" @click="changeIndex(1)">
            <p class="t1">{{ $t('about.project.tabBtn2Tit') }}</p>
            <p class="t2" v-html="$t('about.project.tabBtn2Txt')"></p>
          </li>
          <li :class="{ 'is-active': indexActive === 2 }" @click="changeIndex(2)">
            <p class="t1">{{ $t('about.project.tabBtn3Tit') }}</p>
            <p class="t2" v-html="$t('about.project.tabBtn3Txt')"></p>
          </li>
        </ul>
        <div class="tab-content" v-show="indexActive === 0" v-html="$t('about.project.tabCon1')"></div>
        <div class="tab-content" v-show="indexActive === 1" v-html="$t('about.project.tabCon2')"></div>
        <div class="tab-content" v-show="indexActive === 2" v-html="$t('about.project.tabCon3')"></div>
      </div>
    </div>
  </div>
</template>

<script>
import TabNav from '@/components/about/TabNav'
export default {
  components: { TabNav },
  data() {
    return {
      indexActive: 0
    }
  },
  methods: {
    changeIndex(n) {
      this.indexActive = n
    }
  }
}
</script>

<style lang="scss" scoped>
.total {
  padding-top: 0.3rem;
  ul {
    display: flex;
    li {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      // height: 0.48rem;
      margin-bottom: 0.2rem;
      .t1 {
        font-size: 0.16rem;
        font-weight: 500;
        color: #aa1941;
        span {
          font-size: 0.23rem;
        }
      }
      .t2 {
        font-size: 0.11rem;
        color: #666;
        white-space: nowrap;
      }
      &:first-child {
        padding-right: 0.3rem;
        text-align: right;
      }
      &:last-child {
        padding-left: 0.3rem;
        text-align: left;
      }
    }
    li + li {
      border-left: 1px solid #c3c3c3;
    }
  }
}

.tabs {
  margin-top: 0.3rem;
  .tab-nav {
    display: flex;
    li {
      position: relative;
      flex: 1;
      height: 0.75rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      box-sizing: border-box;
      background: #fbfbfb;
      cursor: pointer;

      &.is-active {
        background: #fff;
        border-top: 0.04rem solid #aa1941;
        box-shadow: 0px 1px 13px rgba(0, 0, 0, 0.06);
        &::after {
          content: '';
          position: absolute;
          left: 50%;
          bottom: -0.2rem;
          width: 0;
          height: 0;
          border-left: 0.1rem solid transparent;
          border-right: 0.1rem solid transparent;
          border-bottom: 0.1rem solid #fff;
          transform: translateX(-50%);
          z-index: 1;
        }
      }

      .t1 {
        font-size: 0.13rem;
        font-weight: 500;
        color: #aa1941;
        text-align: center;
      }
      .t2 {
        margin-top: 0.1rem;
        font-size: 0.1rem;
        text-align: center;
      }
    }
    li + li {
      margin-left: 0.07rem;
    }
  }
  .tab-content {
    position: relative;
    padding: 0.24rem;
    margin-top: 0.2rem;
    font-size: 0.12rem;
    line-height: 0.3rem;
    color: #333;
    background: #fff;
    box-shadow: 0px 1px 13px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    ::v-deep {
      span {
        font-size: 0.2rem;
        font-weight: bold;
        color: #aa1941;
      }
    }
  }
}
</style>
