<template>
  <div :class="isMobile ? 'is-h5' : 'is-pc'">
    <app-frame :data="frameParams">
      <div class="content-mian" v-if="isMobile">
        <tab-content @tabChange="tabChange"></tab-content>
        <div class="content-mod1" v-if="showIndex === 0">
          <img
            src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/kelley-h5/project-mod1-banner.png"
            class="main-banner"
          />
          <div class="content-txt">
            <!-- <div class="tit">{{ $t('bg.brief') }}</div> -->
            <div class="text">
              <div class="p" v-html="$t('bg.con1Txt')"></div>
            </div>
            <img src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/kelley-h5/project-mod1-img.png" alt="" />
          </div>
        </div>
        <div class="content-mod2" v-if="showIndex === 1">
          <img src="https://webapp-pub.ezijing.com/project/seg-shms/project-intor-bg.jpg" class="main-banner" />
          <div class="content-txt">
            <div class="p" v-html="$t('bg.con2Txt')"></div>
          </div>
        </div>
        <div class="content-mod2" v-if="showIndex === 2">
          <img src="https://webapp-pub.ezijing.com/project/kelley/project-intro-bg-lhbx.png" class="main-banner" />
          <div class="content-txt">
            <div class="p" v-html="$t('bg.con3Txt')"></div>
          </div>
        </div>
      </div>
      <div class="project-bg-main" v-else>
        <ul class="tabs">
          <li
            v-for="item in list"
            :key="item.name"
            :class="{ 'is-active': tabActive === item.name }"
            @click="tabActive = item.name"
          >
            {{ item.label }}
          </li>
        </ul>
        <div class="zjjy" v-if="tabActive === 'zjjy'">
          <div class="sub-banner">
            <img src="https://webapp-pub.ezijing.com/project/kelley/project-intro-bg-zjjy.png" />
          </div>
          <div class="text" v-html="$t('bg.con1Txt')"></div>
          <div class="tags">
            <div
              :class="{ 'tag-item': true, big: (index + 2) % 4 === 0 }"
              v-for="(item, index) in tags"
              :key="item.text"
            >
              <div class="tag-item-inner">
                <p>
                  <span>{{ item.num }}</span
                  >{{ item.unit }}
                </p>
                <span>{{ item.text }}</span>
              </div>
              <el-divider direction="vertical" v-if="(index + 1) % 4 !== 0"></el-divider>
            </div>
          </div>
        </div>
        <div class="kelley" v-if="tabActive === 'kelley'">
          <div class="sub-banner">
            <img src="https://webapp-pub.ezijing.com/project/seg-shms/project-intor-bg.jpg" />
          </div>
          <div class="text" v-html="$t('bg.con2Txt')"></div>
        </div>
        <div class="lhbx" v-if="tabActive === 'lhbx'">
          <div class="sub-banner">
            <img src="https://webapp-pub.ezijing.com/project/kelley/project-intro-bg-lhbx.png" />
          </div>
          <div class="text" v-html="$t('bg.con3Txt')"></div>
        </div>
      </div>
    </app-frame>
  </div>
</template>
<script>
import TabNav from './components/TabNav'
import TabContent from './components/TabContent'
export default {
  layout: 'normal',
  components: {
    TabNav,
    TabContent
  },
  data() {
    return {
      showIndex: 0,
      tabActive: 'zjjy',
      list: [
        { name: 'zjjy', label: this.$t('bg.tabBtn1') },
        { name: 'kelley', label: this.$t('bg.tabBtn2') },
        { name: 'lhbx', label: this.$t('bg.tabBtn3') }
      ],
      tags: [
        { num: 12, unit: this.$t('bg.unit1'), text: this.$t('bg.con1ItemT1') },
        { num: 522, unit: this.$t('bg.unit2'), text: this.$t('bg.con1ItemT2') },
        { num: 600, unit: '+', text: this.$t('bg.con1ItemT3') },
        { num: 700, unit: '+', text: this.$t('bg.con1ItemT4') },
        { num: 1000, unit: '+', text: this.$t('bg.con1ItemT5') },
        { num: 4800, unit: '+', text: this.$t('bg.con1ItemT6') },
        { num: 5000, unit: '+', text: this.$t('bg.con1ItemT7') },
        { num: 500, unit: this.$t('bg.unit3'), text: this.$t('bg.con1ItemT8') }
      ],
      frameParams: {
        banner: 'https://webapp-pub.ezijing.com/project/seg-shms/banner-bg-xmbj.png',
        slider: [
          {
            name: this.$t('menu.projectChild.bg'),
            path: '/project-intro/bg'
          },
          {
            name: this.$t('menu.projectChild.feature'),
            path: '/project-intro/charac'
          },
          {
            name: this.$t('menu.projectChild.cert'),
            path: '/project-intro/certificate'
          }
        ]
      }
    }
  },
  methods: {
    tabChange(n) {
      this.showIndex = n
    }
  },
  computed: {
    isMobile() {
      return this.$store.state.isMobile
    }
  }
}
</script>
<style lang="scss" scoped>
.is-pc {
  .project-bg-main {
    padding: 42px 64px 50px;
    .tabs {
      margin-top: 42px;
      display: flex;
      justify-content: space-between;
      li {
        background: #fbfbfb;
        width: 32%;
        height: 83px;
        line-height: 83px;
        border-top: 8px solid #fbfbfb;
        font-size: 26px;
        font-family: Source Han Sans CN;
        color: #333;
        text-align: center;
        cursor: pointer;
      }
      li.is-active {
        border-color: #aa1941;
        color: #aa1941;
        background-color: #fff;
        box-shadow: 0px 1px 25px rgba(0, 0, 0, 0.06);
      }
    }
    .sub-banner {
      margin-top: 18px;
      height: 302px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .text {
      font-size: 16px;
      font-family: Source Han Sans CN;
      line-height: 32px;
      color: #424242;
      letter-spacing: 1px;
      margin-top: 40px;
    }
    .tags {
      width: 780px;
      margin: 40px auto 0;
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      // justify-content: space-between;
      .tag-item {
        width: 180px;
        margin-bottom: 10px;
        .tag-item-inner {
          display: inline-block;
          text-align: center;
          width: calc(100% - 17px);
          p {
            font-size: 20px;
            color: #aa1941;
            span {
              font-size: 28px;
              font-weight: bold;
            }
          }
          > span {
            font-size: 16px;
            line-height: 34px;
            color: #666666;
          }
        }
        .el-divider {
          height: 100%;
          float: right;
        }
      }
      .tag-item.big {
        width: 240px;
      }
    }
  }
}
::v-deep {
  // .is-h5{
  .main-page-content {
    background-color: #eee !important;
    // }
  }
}
.is-h5 {
  .content-mian {
    padding: 0 0.16rem;
    .content-mod1 {
      padding-top: 0.18rem;
      img {
        width: 100%;
        display: block;
      }
      .content-txt {
        background: #fff;
        padding: 0 0.16rem 0.42rem;
        margin-bottom: 0.36rem;
        .tit {
          font-size: 0.14rem;
          font-weight: bold;
          line-height: 100%;
          color: #333333;
          padding-top: 0.23rem;
          padding-bottom: 0.1rem;
        }
        .text {
          .p {
            font-size: 0.12rem;
            line-height: 0.24rem;
            color: #424242;
          }
        }
        img {
          width: 2.59rem;
          margin-left: 0.08rem;
          margin-top: 0.27rem;
          display: block;
        }
      }
    }
    .content-mod2 {
      margin-top: 0.18rem;
      background: #fff;
      img {
        width: 100%;
      }
      .content-txt {
        background: #fff;
        padding: 0 0.16rem 0.42rem;
        margin-bottom: 0.36rem;
        .p {
          font-size: 0.12rem;
          line-height: 0.24rem;
          color: #424242;
          margin-top: 0.35rem;
        }
      }
    }
  }
}
</style>
