<template>
  <div class="wrap">
    <el-carousel height="480px" :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': 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': modules[1].form.link.linkName !== '无'}]" @click="openLink(modules[1].form)">
        <h2 style="margin-left: 57px">{{ modules[1].form.title }}</h2>
        <div class="texts">
          <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">{{ modules[2].form.title }}</h2>
        <p class="intro">{{ modules[2].form.des }}</p>
        <ul class="card">
          <li :class="['item1', {'cursor-pointer': modules[3].form.link.linkName !== '无'}]" @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', {'cursor-pointer': modules[4].form.link.linkName !== '无'}]" @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', {'cursor-pointer': modules[5].form.link.linkName !== '无'}]" @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', {'cursor-pointer': modules[6].form.link.linkName !== '无'}]" @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">{{ modules[7].form.title }}</h2>
        <p class="intro">{{ modules[7].form.des }}</p>
        <ul class="stat">
          <li>
            <p class="num">{{ modules[8].form.title }}</p>
            <p class="text">{{ modules[8].form.des }}</p>
          </li>
          <li>
            <p class="num">{{ modules[9].form.title }}</p>
            <p class="text">{{ modules[9].form.des }}</p>
          </li>
          <li>
            <p class="num">{{ modules[10].form.title }}</p>
            <p class="text">{{ modules[10].form.des }}</p>
          </li>
          <li>
            <p class="num">{{ modules[11].form.title }}</p>
            <p class="text">{{ modules[11].form.des }}</p>
          </li>
          <li>
            <p class="num">{{ modules[12].form.title }}</p>
            <p class="text">{{ modules[12].form.des }}</p>
          </li>
          <li>
            <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': modules[14].form.link.linkName !== '无'}]" @click="openLink(modules[14].form)">
        <img class="pic" :src="modules[14].form.pic" alt="">
        <div class="texts">
          <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">{{ modules[15].form.title }}</h2>
        <p class="intro">{{ modules[15].form.des }}</p>
        <ul class="people">
          <template v-for="(item, i) in modules[16].list">
            <li v-if="item.isEnable" :key="i">
              <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': 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">{{ modules[17].form.title }}</h2>
        <p class="intro">{{ modules[17].form.des }}</p>
        <ul class="list">
          <li :class="{'cursor-pointer': 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="{'cursor-pointer': 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="{'cursor-pointer': 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" style="width: 1581px">
        <h2 class="b-title">{{ modules[21].form.title }}</h2>
        <p class="intro">{{ modules[21].form.des }}</p>
        <div :class="['staff', {'cursor-pointer': modules[22].form.link.linkName !== '无'}]" @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'
export default {
  mixins: [mixins],
  data() {
    return {
      
    }
  },
  mounted() {
    
  },
  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[0])
        }
      }).catch(err => {})
    },
  }
};
</script>

<style lang="scss" scoped>
@import "../../styles/page/page.scss";
.history {
  h2 {
    font-size: 30px;
    color: #333;
  }
  .texts {
    display: flex;
    justify-content: space-between;
    padding: 82px 57px 30px;
    margin-top: 20px;
    background-color: #fff;
    border-radius: 100px 0px 0px 0px;
  }
  .left {
    width: 695px;
  }
  .line {
    width: 136px;
    height: 2px;
    margin: 20px 0;
    background: #D7D7D7;
  }
  .des {
    font-size: 22px;
    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: 686px;
    height: 277px;
    padding: 70px 67px 20px;
    margin-bottom: 28px;
    color: #fff;
    &:nth-child(odd) {
      margin-right: 28px;
    }
  }
  .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: 40px;
    font-family: toppan;
  }
  .des {
    font-size: 18px;
  }
}
.plan {
  padding: 73px 0;
  background: #072947;
  .inner {
    display: flex;
    justify-content: space-between;
    width: 1575px;
  }
  .pic {
    width: 664px;
    height: 488px;
    margin-bottom: -120px;
  }
  .texts {
    width: 802px;
    margin-top: 36px;
    color: #fff;
  }
  h6 {
    font-size: 36px;
  }
  .des {
    margin: 20px 0;
    font-size: 20px;
  }
}
.people {
  li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 126px;
    &:nth-child(even) {
      flex-direction: row-reverse;
    }
  }
  .pic {
    width: 660px;
    height: 465px;
  }
  .texts {
    width: 680px;
    padding-top: 90px;
  }
  h6 {
    margin: 20px 0;
    font-size: 40px;
  }
  .sub {
    font-size: 20px;
    color: #020202;
  }
  .des {
    font-size: 18px;
    color: #020202;
    line-height: 30px;
  }
}
.list-block {
  .inner {
    width: 80%;
    padding: 90px 0;
    background-color: #fff;
  }
}
.list {
  display: flex;
  justify-content: center;
  li {
    width: calc((100% - 100px) / 3);
    padding-bottom: 30px;
    margin-right: 28px;
    text-align: center;
    background-color: #F5F5F5;
    &:last-child {
      margin-right: 0;
    }
  }
  .pic {
    width: 100%;
    height: 353px;
  }
  h6 {
    margin: 35px 0 5px;
    font-size: 24px;
    color: #272727;
  }
  .des {
    font-size: 16px;
    color: #757575;
  }
}
.staff {
  display: flex;
  justify-content: space-between;
  background: #F8F8F8;
  .left {
    width: 743px;
    padding: 108px 43px 0 46px;
  }
  h6 {
    margin-bottom: 30px;
    font-size: 30px;
    color: #333;
    @include mul-ellipsis(3);
  }
  .des {
    font-size: 20px;
    color: #333;
    line-height: 34px;
  }
  .pic {
    width: 838px;
    height: 487px;
  }
}
.stat {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  margin-top: 60px;
  li {
    width: 30%;
    margin-bottom: 50px;
  }
  .num {
    margin-bottom: 10px;
    font-size: 60px;
    font-weight: 800;
    font-family: toppan;
    color: #035CE1;
    line-height: 49px;
  }
  .text {
    font-size: 24px;
  }
}
</style>