<template>
  <div class="wrap">
    <el-carousel :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">
      <div class="inner">
        <ul class="card">
          <li class="wow fadeInDown" data-wow-delay="0.1s">
            <img class="pic" :src="modules[1].form.pic" alt="">
            <div class="texts">
              <h6>{{ modules[1].form.title }}</h6>
              <p class="text">{{ modules[1].form.des }}</p>
            </div>
            <div class="arrow">
              <img src="@/assets/images/arrow-white.png" alt="" :class="{'cursor-pointer': isLink(modules[1].form.link.linkName)}" @click="openLink(modules[1].form)">
            </div>
          </li>
          <li class="wow fadeInDown" data-wow-delay="0.3s">
            <img class="pic" :src="modules[2].form.pic" alt="">
            <div class="texts">
              <h6>{{ modules[2].form.title }}</h6>
              <p class="text">{{ modules[2].form.des }}</p>
            </div>
            <div class="arrow">
              <img src="@/assets/images/arrow-white.png" alt="" :class="{'cursor-pointer': isLink(modules[2].form.link.linkName)}" @click="openLink(modules[2].form)">
            </div>
          </li>
          <li class="wow fadeInDown" data-wow-delay="0.5s">
            <img class="pic" :src="modules[3].form.pic" alt="">
            <div class="texts">
              <h6>{{ modules[3].form.title }}</h6>
              <p class="text">{{ modules[3].form.des }}</p>
            </div>
            <div class="arrow">
              <img src="@/assets/images/arrow-white.png" alt="" :class="{'cursor-pointer': isLink(modules[3].form.link.linkName)}" @click="openLink(modules[3].form)">
            </div>
          </li>
          <li class="wow fadeInDown" data-wow-delay="0.7s">
            <img class="pic" :src="modules[4].form.pic" alt="">
            <div class="texts">
              <h6>{{ modules[4].form.title }}</h6>
              <p class="text">{{ modules[4].form.des }}</p>
            </div>
            <div class="arrow">
              <img src="@/assets/images/arrow-white.png" alt="" :class="{'cursor-pointer': isLink(modules[4].form.link.linkName)}" @click="openLink(modules[4].form)">
            </div>
          </li>
        </ul>
      </div>
    </div>

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

    <ul class="shows">
      <template v-for="(item, i) in modules[7].list">
        <li v-if="item.isEnable" :key="i" class="wow fadeInDown" data-wow-delay="0.3s">
          <div class="left">
            <h6>{{ item.title }}</h6>
            <div class="sub">{{ item.subTitle }}</div>
            <div class="des">{{ item.des }}</div>
            <img src="@/assets/images/arrow-white.png" alt="" class="icon" :class="{'arrow': isLink(item.link.linkName)}" @click="openLink(item)">
          </div>
          <img class="pic" :src="item.pic" alt="">
        </li>
      </template>
    </ul>
  </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";
.wrap{
  /deep/ .el-carousel {
    height: 21.6rem;
    .el-carousel__container{
      height: 21.6rem;
    }
    img{
      height: 21.6rem;
    }
  }
}

.banner-item {
  .banner-name {
    font-size: 2.16rem;
  }
}
.block  {
  padding: 3.15rem 0;
  .inner {
    .b-title  {
      font-size: 2.25rem;
      margin-bottom: 2.25rem;
    }
    .intro  {
      margin-bottom: 6.9rem;
    }
   
  }
}
.card {
  display: flex;
  justify-content: center;
  li {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    flex: 1;
    height: 23.67rem;
    color: #fff;
    &:hover {
      .arrow {
        opacity: 1;
      }
    }
    .pic {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }
    .texts {
      position: relative;
    }
    h6 {
      margin-bottom: 10px;
      font-size: 1.57rem;
    }
    .text {
      font-size: 1.08rem;
      text-align: center;
    }
    .arrow {
      position: absolute;
      bottom: 0;
      width: 100%;
      height: 7.9rem;
      text-align: center;
      background: #36404A;
      opacity: 0;
      transition: .3s;
      cursor: default;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
}
.people {
  position: relative;
  li {
    position: relative;
    padding: 4.5rem 3.15rem 4.5rem 2.565rem;
    margin-bottom: 100px;
    background-color: #fff;
    transition: .3s;
    &:hover {
      transform: scale(1.05);
    }
    &:nth-child(even) {
      display: flex;
      justify-content: flex-end;
      .comma {
        left: 70%;
      }
      .pic {
        left: 0;
        right: auto;
      }
    }
  }
  .comma {
    position: absolute;
    top: -22px;
    left: 57px;
  }
  .left {
    width: 50%;
  }
  h6 {
    font-size: 1.4rem;
    color: #333;
  }
  .des {
    margin-top: 20px;
    font-size: 1.2rem;
    color: #666;
    line-height: 32px;
  }
  .pic {
    position: absolute;
    top: -60px;
    right: 43px;
    width: 40%;
    height: auto;
  }
}
.shows {
  position: relative;
  li {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: auto;
    margin-bottom: 40px;
    color: #fff;
    &:hover .left {
      h6, .sub, .des, .icon {
        transform: translateY(20px);
      }
    }
    &:nth-child(even) {
      flex-direction: row-reverse;
    }
    &:nth-child(2) {
      .left {
        background-color: rgba(47, 79, 23, .65);
      }
    }
    &:nth-child(3) {
      .left {
        width: 43%;
        background-color: rgba(91, 58, 35, .65);
      }
    }
  }
  .left {
    position: relative;
    z-index: 1;
    width: 43.333%;
    height: 100%;
    padding: 138px 30px 130px 103px;
    background-color: rgba(54, 54, 54, .65);
  }
  .pic {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
  }
  h6 {
    font-size: 2.07rem;
    transition: .3s;
  }
  .sub {
    margin: 20px 0 20px 0;
    font-size: 1.35rem;
    transition: .3s;
  }
  .des {
    margin-bottom: 40px;
    font-size: 1.08rem;
    transition: .3s;
  }
  .icon {
    transition: .3s;
  }
}
@media (min-width: 280px) and (max-width: 1200px) {
  .wrap{
  /deep/ .el-carousel {
    height: 15rem;
    .el-carousel__container{
      height: 15rem;
    }
    img{
      height: 15rem;
    }
  }
}
 .block{ 
  padding: 50px 0;
  .inner {
    width: 95%;margin: 0 auto;
    .card{
      flex-direction: column;
      li{
        margin-top: 20px;
        width: 100%;
        height: 27rem;
      }
    }
    .people{
      li {
        padding: 200px 20px 30px;
        .left {
          width: 100%;
        }
        .pic{
          top: -60px;
          right: 13px;
          width: 60%;
          height: 12.5rem;
        }
      }
    }
    
  }
 }
 .shows{
    li {
      flex-direction: column;
      align-items:flex-start;
      height: 16rem;
      .left {
        padding: 10px ;
        h6{
          font-size: 1.5rem ;
        }
        .sub {
          margin: .5rem;
          font-size: 1rem;
        }
        .des{
          margin-bottom: 1.25rem;
        }
        .icon {
          width: 3.5rem;
          height: 3.5rem;
        }
      }
    }
  }
}
@media (max-width: 320px) {
  .wrap  {
    /deep/ .el-carousel{
      height: 12rem !important;
    }
    /deep/ .el-carousel__container{
      height: 12rem !important;
    }
    /deep/  .el-carousel__item {
      height: 12rem !important;
    }
  }
  .banner-item{
    img {
      height: 12rem !important;
    }
    .banner-name {
      font-size: 1.5rem;
      line-height: 1rem;
      left: 2rem;
      bottom: 2rem;
    }
  }
  .block {
     padding: 1.25rem 0;
     .inner {
      .card {
        li {
          flex: none;
          height: 25rem;
          .pic {
            height: 25rem;
          }
        }
      }
      .people {
        li {
          padding: 10rem 1.25rem 1.5rem;
          .pic {
            top: -40px;
            height: auto;
          }
        }
      }
      
     }
  }
  .shows {
    li {
      height: auto;
      .left {
        h6 {
          font-size: 1rem;
        }
        .sub {
          font-size: .9rem;
        }
        .des {
          font-size: .88rem;
          margin-bottom: .5rem;
        }
        .icon {
          width: 2rem;height: 2rem;
        }
      }
    }
  }
}
@media (min-width: 320px) and (max-width: 375px) {
  .wrap  {
    /deep/ .el-carousel{
      height: 12rem !important;
    }
    /deep/ .el-carousel__container{
      height: 12rem !important;
    }
    /deep/  .el-carousel__item {
      height: 12rem !important;
    }
  }
  .banner-item{
    img {
      height: 12rem !important;
    }
    .banner-name {
      font-size: 1.5rem;
      line-height: 1rem;
      left: 2rem;
      bottom: 2rem;
    }
  }
  .block {
     padding: 1.25rem 0;
     .inner {
      .card {
        li {
          flex: none;
          height: 25rem;
          .pic {
            height: 25rem;
          }
        }
      }
      .people {
        li {
          padding: 10rem 1.25rem 1.5rem;
          .pic {
            top: -40px;
            height: auto;
          }
        }
      }
      
     }
  }
  .shows {
    li {
      height: auto;
      .left {
        h6 {
          font-size: 1rem;
        }
        .sub {
          font-size: .9rem;
        }
        .des {
          font-size: .88rem;
          margin-bottom: .5rem;
        }
        .icon {
          width: 2rem;height: 2rem;
        }
      }
    }
  }
}
@media (min-width: 375px) and (max-width: 480px) {
  .wrap  {
    /deep/ .el-carousel{
      height: 12rem !important;
    }
    /deep/ .el-carousel__container{
      height: 12rem !important;
    }
    /deep/  .el-carousel__item {
      height: 12rem !important;
    }
  }
  .banner-item{
    img {
      height: 12rem !important;
    }
    .banner-name {
      font-size: 1.5rem;
      line-height: 1rem;
      left: 2rem;
      bottom: 2rem;
    }
  }
  .block {
     padding: 1.25rem 0;
     .inner {
      .card {
        li {
          flex: none;
          height: 25rem;
          .pic {
            height: 25rem;
          }
        }
      }
      .people {
        li {
          padding: 10rem 1.25rem 1.5rem;
          .pic {
            top: -40px;
            height: auto;
          }
        }
      }
      
     }
  }
  .shows {
    li {
      height: auto;
      .left {
        h6 {
          font-size: 1rem;
        }
        .sub {
          font-size: .9rem;
        }
        .des {
          font-size: .88rem;
          margin-bottom: .5rem;
        }
        .icon {
          width: 2rem;height: 2rem;
        }
      }
    }
  }
}
@media (min-width: 480px) and (max-width: 640px)  {
  .wrap  {
    /deep/ .el-carousel{
      height: 12rem !important;
    }
    /deep/ .el-carousel__container{
      height: 12rem !important;
    }
    /deep/  .el-carousel__item {
      height: 12rem !important;
    }
  }
  .banner-item{
    img {
      height: 12rem !important;
    }
    .banner-name {
      font-size: 1.5rem;
      line-height: 1rem;
      left: 2rem;
      bottom: 2rem;
    }
  }
  .block {
     padding: 1.25rem 0;
     .inner {
      .card {
        li {
          flex: none;
          height: 25rem;
          .pic {
            height: 25rem;
          }
        }
      }
      .people {
        li {
          margin-bottom: 15rem;
          padding: 10rem 1.25rem 1.5rem;
          .pic {
            top: -40%;
            height: auto;
          }
        }
      }
      
     }
  }
  .shows {
    li {
      height: auto;
      .left {
        padding: 2rem 2rem;
      }
    }
  }
}
@media (min-width: 640px) and (max-width: 768px) {
  .wrap  {
    /deep/ .el-carousel{
      height: 12rem !important;
    }
    /deep/ .el-carousel__container{
      height: 12rem !important;
    }
    /deep/  .el-carousel__item {
      height: 12rem !important;
    }
  }
  .banner-item{
    img {
      height: 12rem !important;
    }
    .banner-name {
      font-size: 1.5rem;
      line-height: 1rem;
      left: 2rem;
      bottom: 2rem;
    }
  }
  .block {
     padding: 1.25rem 0;
     .inner {
      .card {
        li {
          flex: none;
          height: 25rem;
          .pic {
            height: 25rem;
          }
        }
      }
      .people {
        li {
          padding: 10rem 1.25rem 1.5rem;
          margin-bottom: 15rem;
          .pic {
            top: -60%;
            height: auto;
          }
        }
      }
      
     }
  }
  .shows {
    li {
      height: auto;
      .left {
        padding: 3rem 2rem;
      }
    }
  }
}
@media (min-width: 768px) and (max-width: 980px) {
  .wrap  {
    /deep/ .el-carousel{
      height: 12rem !important;
    }
    /deep/ .el-carousel__container{
      height: 12rem !important;
    }
    /deep/  .el-carousel__item {
      height: 12rem !important;
    }
  }
  .banner-item{
    img {
      height: 12rem !important;
    }
    .banner-name {
      font-size: 1.5rem;
      line-height: 1rem;
      left: 2rem;
      bottom: 2rem;
    }
  }
  .block {
     padding: 1.25rem 0;
     .inner {
      .card {
        li {
          flex: none;
          height: 25rem;
          .pic {
            height: 25rem;
          }
        }
      }
      .people {
        li {
          margin-bottom: 20rem;
          padding: 10rem 1.25rem 1.5rem;
       
          .pic {
            top: -85%;
            height: auto;
          }
        }
      }
      
     }
  }
  .shows {
    li {
      height: auto;
      .left {
        padding: 4rem 2rem;
      }
    }
  }
}
@media (min-width: 980px) and (max-width: 1200px) {
  .wrap  {
    /deep/ .el-carousel{
      height: 12rem !important;
    }
    /deep/ .el-carousel__container{
      height: 12rem !important;
    }
    /deep/  .el-carousel__item {
      height: 12rem !important;
    }
  }
  .banner-item{
    img {
      height: 12rem !important;
    }
    .banner-name {
      font-size: 1.5rem;
      line-height: 1rem;
      left: 2rem;
      bottom: 2rem;
    }
  }
  .block {
     padding: 1.25rem 0;
     .inner {
      .card {
        li {
          flex: none;
          height: 25rem;
          .pic {
            height: 25rem;
          }
        }
      }
      .people {
        li {
          margin-bottom: 30rem;
          padding: 10rem 1.25rem 1.5rem;
          .pic {
            top: -115%;
            height: auto;
          }
        }
      }
      
     }
  }
  .shows {
    li {
      height: auto;
      .left {
        padding: 4rem 2rem;
      }
    }
  }
}
</style>