<!-- -->
<template>
  <div class="home-cr">
    <div class="title">
      <div class="ch">每日推送</div>
      <div class="en">Daily Exhibition Push</div>
    </div>
    <div class="text">文物</div>
    <div class="list">
      <el-carousel indicator-position="outside" :autoplay="false" arrow="never">
        <el-carousel-item>
          <el-row :gutter="14">
            <el-col
              :span="6"
              v-for="item in list1"
              :key="item.crId"
              class="container"
            >
              <img :src="item.faceImageUrl" alt="" width="100%" />
            </el-col>
          </el-row>
        </el-carousel-item>
        <el-carousel-item>
          <el-row :gutter="14">
            <el-col
              :span="6"
              v-for="item in list2"
              :key="item.crId"
              class="container"
            >
              <img :src="item.faceImageUrl" alt="" width="100%" />
            </el-col>
          </el-row>
        </el-carousel-item>
      </el-carousel>
    </div>
  </div>
</template>

<script>
import { getRecommendCr } from "@/api/culturalRelic";
export default {
  data() {
    return {
      list1: [],
      list2: [],
    };
  },
  mounted() {
    this.loadList();
  },
  methods: {
    async loadList() {
      let res = await getRecommendCr();
      this.list1 = res.data.slice(0, 8);
      this.list2 = res.data.slice(-8);
    },
  },
};
</script>

<style lang="scss" scoped>
.home-cr {
  background-image: url("@/assets/imgs/home/display-bg.png");
  background-size: cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  .title {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 0 0 0;
    font-family: "Alibaba PuHuiTi";
    .ch {
      font-size: 30px;
      font-weight: bold;
      color: #fff;
      margin-bottom: 12px;
    }
    .en {
      font-size: 14px;
      color: #fff;
      margin-bottom: 80px;
    }
  }
  .text {
    color: #fff;
    margin-bottom: 36px;
    font-family: "Alibaba PuHuiTi";
  }
  .list {
    width: 100%;
    padding: 0 14% 0 14%;
    height: 492px;
  }

  .container {
    // width: 339px;
    height: 226px;
    margin-bottom: 40px;
    cursor: pointer;
    img {
      width: 100%;
      height: 100%;
    }
  }
}
::v-deep .el-carousel__container {
  height: 492px;
}
.el-carousel--horizontal{
  overflow: hidden;
}
</style>
