<template>
  <div class="wrap">
    <div class="actions">
      <p class="page-name">页面设置/科普之窗</p>
      <div>
        <el-button type="primary" @click="preview">预览</el-button>
        <el-button @click="save(0)">保存为草稿</el-button>
        <el-button type="primary" @click="save(1)">发布</el-button>
        <el-button @click="back">放弃编辑</el-button>
      </div>
    </div>

    <div class="modules">
      <div class="relative">
        <el-carousel height="480px" :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">
              <img width="100%" height="100%" :src="item.pic" alt="">
            </el-carousel-item>
          </template>
        </el-carousel>
        <div class="cover" @click="toSet(0)">点击更换banner与链接</div>
      </div>

      <div class="block">
        <div class="inner">
          <div class="item">
            <img src="@/assets/images/science/1.png" alt="">
            <div class="texts">
              <h6>{{ modules[1].form.title }}</h6>
              <div class="des">{{ modules[1].form.des }}</div>
            </div>
            <div class="cover" style="left: -35px" @click="toSet(1)">点击更改图片、标题概述与链接</div>
          </div>
          <div class="item">
            <img src="@/assets/images/science/2.png" alt="">
            <div class="texts">
              <h6>{{ modules[2].form.title }}</h6>
              <div class="des">{{ modules[2].form.des }}</div>
            </div>
            <div class="cover" style="right: -35px" @click="toSet(2)">点击更改图片、标题概述与链接</div>
          </div>
          <div class="item">
            <img src="@/assets/images/science/3.png" alt="">
            <div class="texts">
              <h6>{{ modules[3].form.title }}</h6>
              <div class="des">{{ modules[3].form.des }}</div>
            </div>
            <div class="cover" style="left: -35px" @click="toSet(3)">点击更改图片、标题概述与链接</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import mixins from '@/mixins/page'
import Modules from '@/const/modules'
export default {
  mixins: [mixins],
  data() {
    return {
      modules: Modules.science
    }
  },
  mounted() {
    this.$store.commit('user/setCrumbs', [
      {
        name: '站点管理',
        route: '/site'
      },
      {
        name: '内容管理',
        route: '/column'
      },
      {
        name: '栏目管理',
        route: '/column'
      },
      {
        name: '科普之窗'
      }
    ])
  },
  methods: {
    
  }
};
</script>

<style lang="scss" scoped>
@import "../../../styles/page/page.scss";
.inner {
  width: 1200px;
}
.item {
  position: relative;
  margin-bottom: 58px;
  img {
    width: 100%;
    height: 508px;
  }
  &:nth-child(2) .texts {
    color: #fff;
    background: #33B3C1;
  }
  &:nth-child(3) .texts {
    color: #fff;
    background: #E47C22;
  }
  &:nth-child(even) .texts {
    left: auto;
    right: -28px;
  }
  .texts {
    position: absolute;
    top: 79px;
    left: -28px;
    width: 532px;
    padding: 70px 38px;
    color: #333;
    background: #FFF6E9;
  }
  h6 {
    margin-bottom: 14px;
    font-size: 36px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
  }
  .des {
    font-size: 18px;
  }
}
</style>