<template>
  <div class="wrap" v-if="modules.length>=1">
    <el-carousel height="30rem" :interval="6000" :arrow="(modules[0] && modules[0].list.filter(e => e.isEnable).length > 1) ? 'hover' : 'never'" :indicator-position="modules[0].list.filter(e => e.isEnable).length > 1 ? '' : 'none'">
      <template v-for="(item, i) in modules[0].list">
        <el-carousel-item v-if="item.pic && item.isEnable" :key="i">
          <div :class="['banner-item', {'cursor-pointer': isLink(item.link.linkName)}]" @click="openLink(item)">
            <img :src="item.pic" alt="">
            <p class="banner-name">{{ item.title }}</p>
          </div>
        </el-carousel-item>
      </template>
    </el-carousel>
    
    <div class="block history gray">
      <div :class="['inner', {'cursor-pointer': isLink(modules[1].form.link.linkName)}]" @click="openLink(modules[1].form)">
        <h2 class="wow fadeInLeft" style="margin-left: 3.56rem">{{ modules[1].form.title }}</h2>
        <div class="texts wow fadeInDown" data-wow-delay="0.5s">
          <div class="left">
            <h2>{{ modules[1].form.subTitle }}</h2>
            <div class="line"></div>
            <div class="des">{{ modules[1].form.des }}</div>
          </div>
          <img class="bg" width="562" height="506" :src="modules[1].form.pic" alt="">
        </div>
      </div>
    </div>

    <div class="block">
      <div class="inner">
        <h2 class="b-title wow fadeInUp">{{ modules[2].form.title }}</h2>
        <p class="intro wow fadeInUp" data-wow-delay="0.5s">{{ modules[2].form.des }}</p>
        <ul class="card">
          <li :class="['item1 wow fadeInLeft', {'cursor-pointer': isLink(modules[3].form.link.linkName)}]" data-wow-delay="0.7s" @click="openLink(modules[3].form)">
            <h6>{{ modules[3].form.title }}</h6>
            <div class="des" v-html="modules[3].form.des"></div>
          </li>
          <li :class="['item2 wow fadeInRight', {'cursor-pointer': isLink(modules[4].form.link.linkName)}]" data-wow-delay="0.9s" @click="openLink(modules[4].form)">
            <h6>{{ modules[4].form.title }}</h6>
            <div class="des" v-html="modules[4].form.des"></div>
          </li>
          <li :class="['item3 wow fadeInLeft', {'cursor-pointer': isLink(modules[5].form.link.linkName)}]" data-wow-delay="1.1s" @click="openLink(modules[5].form)">
            <h6>{{ modules[5].form.title }}</h6>
            <div class="des" v-html="modules[5].form.des"></div>
          </li>
          <li :class="['item4 wow fadeInRight', {'cursor-pointer': isLink(modules[6].form.link.linkName)}]" data-wow-delay="1.3s" @click="openLink(modules[6].form)">
            <h6>{{ modules[6].form.title }}</h6>
            <div class="des" v-html="modules[6].form.des"></div>
          </li>
        </ul>
      </div>
    </div>

    <div class="block gray">
      <div class="inner">
        <h2 class="b-title wow fadeInUp">{{ modules[7].form.title }}</h2>
        <p class="intro wow fadeInUp" data-wow-delay="0.5s">{{ modules[7].form.des }}</p>
        <ul class="stat">
          <li class="wow fadeInLeft" data-wow-delay="0.2s">
            <p class="num">{{ modules[8].form.title }}</p>
            <p class="text">{{ modules[8].form.des }}</p>
          </li>
          <li class="wow fadeInLeft" data-wow-delay="0.4s">
            <p class="num">{{ modules[9].form.title }}</p>
            <p class="text">{{ modules[9].form.des }}</p>
          </li>
          <li class="wow fadeInLeft" data-wow-delay="0.6s">
            <p class="num">{{ modules[10].form.title }}</p>
            <p class="text">{{ modules[10].form.des }}</p>
          </li>
          <li class="wow fadeInLeft" data-wow-delay="0.9s">
            <p class="num">{{ modules[11].form.title }}</p>
            <p class="text">{{ modules[11].form.des }}</p>
          </li>
          <li class="wow fadeInLeft" data-wow-delay="1.1s">
            <p class="num">{{ modules[12].form.title }}</p>
            <p class="text">{{ modules[12].form.des }}</p>
          </li>
          <li class="wow fadeInLeft" data-wow-delay="1.3s">
            <p class="num">{{ modules[13].form.title }}</p>
            <p class="text">{{ modules[13].form.des }}</p>
          </li>
        </ul>
      </div>
    </div>

    <div class="plan">
      <div :class="['inner', {'cursor-pointer': isLink(modules[14].form.link.linkName)}]" @click="openLink(modules[14].form)">
        <img class="pic wow fadeInLeft" :src="modules[14].form.pic" alt="">
        <div class="texts wow fadeInRight">
          <h6>{{ modules[14].form.title }}</h6>
          <div class="des">{{ modules[14].form.des }}</div>
          <img src="@/assets/images/arrow-white.png" alt="">
        </div>
      </div>
    </div>

    <div class="block">
      <div class="inner">
        <h2 class="b-title wow fadeInUp">{{ modules[15].form.title }}</h2>
        <p class="intro wow fadeInUp" data-wow-delay="0.5s">{{ modules[15].form.des }}</p>
        <ul class="people">
          <template v-for="(item, i) in modules[16].list">
            <li v-if="item.isEnable" :key="i" class="wow fadeInDown" data-wow-delay="0.5s">
              <img class="pic" :src="item.pic" alt="">
              <div class="texts">
                <p class="sub">{{ item.subTitle }}</p>
                <h6>{{ item.title }}</h6>
                <p class="des">{{ item.des }}</p>
                <img :class="{'arrow': isLink(item.link.linkName)}" src="@/assets/images/arrow.png" alt="" @click="openLink(item)">
              </div>
            </li>
          </template>
        </ul>
      </div>
    </div>

    <div class="block list-block gray">
      <div class="inner">
        <h2 class="b-title wow fadeInUp">{{ modules[17].form.title }}</h2>
        <p class="intro wow fadeInUp" data-wow-delay="0.5s">{{ modules[17].form.des }}</p>
        <ul class="list">
          <li class="wow fadeInDown" data-wow-delay="0.6s" :class="{'cursor-pointer': isLink(modules[18].form.link.linkName)}" @click="openLink(modules[18].form)">
            <img class="pic" :src="modules[18].form.pic" alt="">
            <h6>{{ modules[18].form.title }}</h6>
            <p class="des">{{ modules[18].form.des }}</p>
          </li>
          <li class="wow fadeInDown" data-wow-delay="0.8s" :class="{'cursor-pointer': isLink(modules[19].form.link.linkName)}" @click="openLink(modules[19].form)">
            <img class="pic" :src="modules[19].form.pic" alt="">
            <h6>{{ modules[19].form.title }}</h6>
            <p class="des">{{ modules[19].form.des }}</p>
          </li>
          <li class="wow fadeInDown" data-wow-delay="1s" :class="{'cursor-pointer': isLink(modules[20].form.link.linkName)}" @click="openLink(modules[20].form)">
            <img class="pic" :src="modules[20].form.pic" alt="">
            <h6>{{ modules[20].form.title }}</h6>
            <p class="des">{{ modules[20].form.des }}</p>
          </li>
        </ul>
      </div>
    </div>

    <div class="block">
      <div class="inner staff-inner">
        <h2 class="b-title wow fadeInUp">{{ modules[21].form.title }}</h2>
        <p class="intro wow fadeInUp" data-wow-delay="0.5s">{{ modules[21].form.des }}</p>
        <div :class="['staff wow fadeInDown', {'cursor-pointer': isLink(modules[22].form.link.linkName)}]" data-wow-delay="0.7s" @click="openLink(modules[22].form)">
          <div class="left">
            <h6>{{ modules[22].form.title }}</h6>
            <div class="des">{{ modules[22].form.des }}</div>
          </div>
          <img class="pic" :src="modules[22].form.pic" alt="">
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import mixins from '@/mixins/page'
import Setting from '@/setting'
import Util from '@/libs/util'
import WOW from 'wow.js'
export default {
  mixins: [mixins],
  data() {
    return {
      
    }
  },
  mounted() {
    new WOW().init()
  },
  methods: {
    // 获取文章详情
    getInfo() {
      // 预览/详情
      this.$post(`${this.api[this.preview ? 'getRedisCache' : 'findPage']}?columnId=${this.id}`).then(({ data }) => {
        if (data.length) {
          // state：已发布（1）则取theEditedJson，草稿（0）则取jsonBeforeEditing
          const json = JSON.parse(this.preview ?
            data :
            data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing'])
          this.modules = json
          console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json)
        }
      }).catch(err => {})
    },
  }
};
</script>

<style lang="scss" scoped>
@import url(../../plugins/wow/animate.css);
@import "../../styles/page/page.scss";
.history {
  h2 {
    font-size: 2.14rem;
    color: #333;
  }
  .texts {
    display: flex;
    justify-content: space-between;
    padding: 5.125rem 3.5625rem 1.875rem;
    margin-top: 20px;
    background-color: #fff;
    border-radius: 6.25rem 0px 0px 0px;
    transition: .3s;
    &:hover {
      transform: scale(1.05);
    }
  }
  .left {
    width: 43.4375rem;
  }
  .line {
    width: 8.5rem;
    height: 2px;
    margin: 1.25rem 0;
    background: #D7D7D7;
  }
  .des {
    font-size: 1.57rem;
    color: #181818;
    line-height: 31px;
    -webkit-line-clamp: 6;
  }
  .bg {
    margin: -122px 0 0 0;
    border-top-right-radius: 40px;
  }
}
.card {
  display: flex;
  flex-wrap: wrap;
  li {
    width: calc((100% - 28px) / 2);
    height: 17.3125rem;
    padding: 4.375rem 4.18rem 1.25rem;
    margin-bottom: 28px;
    color: #fff;
    transition: .3s;
    &:hover {
      transform: scale(1.05);
    }
    &:nth-child(odd) {
      margin-right: 1.75rem;
    }
  }
  .item1 {
    background: url(../../assets/images/about/3.png) 0 0/100% 100% no-repeat;
  }
  .item2 {
    background-color: #4984B6;
  }
  .item3 {
    background-color: #567180;
  }
  .item4 {
    background: url(../../assets/images/about/4.png) 0 0/100% 100% no-repeat;
  }
  h6 {
    margin-bottom: 10px;
    font-size: 2.85rem;
    font-family: toppan;
  }
  .des {
    font-size: 1.28rem;
  }
}
.plan {
  padding: 4.5625rem 0;
  background: #072947;
  .inner {
    display: flex;
    justify-content: space-between;
    width: 98.4375rem;
  }
  .pic {
    width: 42%;
    height: 30.5rem;
    margin-bottom: -7.5rem;
    transition: .3s;
    &:hover {
      transform: scale(1.05);
    }
  }
  .texts {
    width: 51%;
    margin-top: 2.25rem;
    color: #fff;
    transition: .3s;
    &:hover {
      transform: translateY(20px);
    }
  }
  h6 {
    font-size: 2.57rem;
  }
  .des {
    margin: 20px 0;
    font-size: 1.428rem;
  }
}
.people {
  li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 7.87rem;
    transition: .3s;
    &:hover {
      transform: scale(1.05);
    }
    &:nth-child(even) {
      flex-direction: row-reverse;
    }
  }
  .pic {
    width: 47%;
    height: 29.0625rem;
  }
  .texts {
    width: 49%;
    padding-top: 5.5625rem;
  }
  h6 {
    margin: 1.25rem 0;
    font-size: 2.85rem;
  }
  .sub {
    font-size: 1.428rem;
    color: #020202;
  }
  .des {
    font-size: 1.28rem;
    color: #020202;
    line-height: 30px;
  }
}
.list-block {
  .inner {
    width: 80%;
    padding: 5.625rem 0;
    background-color: #fff;
  }
}
.list {
  display: flex;
  justify-content: center;
  li {
    width: calc((100% - 100px) / 3);
    padding-bottom: 1.875rem;
    margin-right: 1.75rem;
    text-align: center;
    background-color: #F5F5F5;
    transition: .3s;
    &:hover {
      background-color: #1f5793;
      h6, .des {
        color: #fff;
      }
    }
    &:last-child {
      margin-right: 0;
    }
  }
  .pic {
    width: 100%;
    height: 22.065rem;
  }
  h6 {
    margin: 2.1875rem 0 5px;
    font-size: 1.71rem;
    color: #272727;
    transition: .3s;
  }
  .des {
    font-size: 1.14rem;
    color: #757575;
    transition: .3s;
  }
}
.staff {
  display: flex;
  justify-content: space-between;
  background: #F8F8F8;
  transition: .3s;
  &:hover {
    transform: scale(1.05);
    background-color: #165191;
    h6, .des {
      color: #fff;
    }
  }
  .staff-inner {
    width: 98.8125rem;
  }
  .left {
    width: 50%;
    padding: 6.75rem 2.6875rem 0 2.875rem;
  }
  h6 {
    margin-bottom: 1.875rem;
    font-size: 2.14rem;
    color: #333;
    transition: .3s;
    @include mul-ellipsis(3);
  }
  .des {
    font-size: 1.42rem;
    color: #333;
    line-height: 34px;
  transition: .3s;
  }
  .pic {
    width: 53%;
    height: 30.4375rem;
  }
}
.stat {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  margin-top: 3.75rem;
  li {
    width: 30%;
    margin-bottom: 3.125rem;
  }
  .num {
    margin-bottom: 10px;
    font-size: 4.28rem;
    font-weight: 800;
    font-family: toppan;
    color: #035CE1;
    line-height: 49px;
  }
  .text {
    font-size: 1.71rem;
  }
}
@media (max-width: 1590px) {
  .plan {
    .inner {
      width: 98%;
    }
  }
  .staff .staff-inner {
    width: 98%;
  }
}

@media (max-width: 1200px) {
  .card li {
    padding:3.5rem 1rem;
  }
  .history{
    .texts{
      padding: 3.14rem 1.5rem;
    }
  }
 .texts {
  flex-direction: column;
  .left{
    width: 100%;
    h2{
      font-size: 1.42rem;
    }
    
  }
  .bg{ 
      margin: 0;
      width: 100%;
      height: 28.125rem;
    }
 }
 .block{
  padding: 50px 0;
  .intro{
    margin-bottom: 3.125rem;
  }
  .inner {
    .card{
      flex-direction: column;
      li {
        width: 100%;
      }
    }
  }
  
 }
 .gray {
    .inner{
      .stat{
        flex-direction: column;
        li{
          width: 100%;
          text-align: center;
        }
      } 
    }
    
  }
  .plan{
    .inner{
       flex-direction: column;
       .pic{
        width: 95%;margin: 0 auto;
       }
       .texts {
        width: 100%;
        text-align: center;
       }
    }
  }
  .block {
    .inner {
      .b-title {
        font-size: 1.5rem;
      }
      .people{
        .wow {
          flex-direction: column;
          .pic {
            width: 95%;
            margin: 0 auto;
          }
          .texts{
            padding-top: 3.125rem;
            width: 100%;
          }
        }
      }
      .list{
        flex-direction: column;
        .wow {
          width: 100%;
        }
      }
      .staff {
        flex-direction: column;
        .left{
          width: 100%;
          h6 {
            font-size: 1.42rem;
          }
          .des{
             font-size: 1.07rem;
          }
        }
        .pic {
          width: 95%;margin: 0 auto;
          height: 25rem;
        }
      }
    }
  }
}

@media (min-width: 280px) and (max-width: 750px) {

  .wrap  {
    /deep/ .el-carousel {
      height: 12rem;
      .el-carousel__container{
        height: 12rem !important;
      }
      img {
        height: 12rem;
      }
    }
  }
  .inner{
    .texts {
      .bg {
        height: 21.875rem;
        margin-top: 1rem;
      }
    }
    .card {
      li {
        h6 {
          font-size: 2rem;
        }
      }
    }
    .people{
      li {
        margin-bottom: 30px;
        .pic {
          height: 18.875rem;
        }
      }
    }
  }
  .plan {
    .pic {
      height: 25rem;
    }
  }
  .list {
    .pic {
      height: 19rem;
    }
  }
  .staff {
    .pic {
      height: 20rem !important;
    }
  }
}
</style>