<!-- -->
<template>
  <div class="home-virtural">
    <div class="content-wrapper">
      <div
        class="title wow animate__animated animate__fadeInUp"
        data-wow-offset="200"
      >
        <div class="ch">虚拟展厅</div>
        <div class="en">Virtual Exhibition Hall</div>
      </div>
      <el-row class="content" :gutter="60">
        <el-col :span="6">
          <div
            class="intro wow animate__animated animate__fadeInLeft"
            v-if="list.length > 0"
          >
            <div class="name">{{ list[0].name }}</div>
            <div class="deptName">{{ list[0].deptName }}</div>
            <div class="intro-content">
              {{ list[0].intro }}
            </div>
            <!-- <div class="entrance" @click="handleClick(list[0])">
              <span class="entrance-text">点击进入</span>
              <img src="@/assets/imgs/home/entrance.png" alt="" />
            </div> -->
            <EntranceIcon color="#fff" />
          </div>
        </el-col>
        <el-col :span="18">
          <div class="virtual-items wow animate__animated animate__fadeInRight">
            <el-row :gutter="10">
              <el-col
                :span="8"
                v-for="(item, index) in list"
                :key="index"
                @click.native="handleClick(item)"
              >
                <div class="item">
                  <img
                    v-if="$getFullUrl(item.faceImagePressUrl)"
                    :src="$getFullUrl(item.faceImagePressUrl)"
                    alt=""
                  />
                  <img v-else :src="$getFullUrl(item.faceImageUrl)" alt="" />
                  <div class="name">{{ item.name }}</div>
                </div>
              </el-col>
            </el-row>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import EntranceIcon from "@/components/EntranceIcon";
import { getVrRecommend } from "@/api/virtual";
export default {
  name: "Virtural",
  components: { EntranceIcon },
  data() {
    return {
      list: [],
    };
  },
  mounted() {
    this.loadData();
  },
  methods: {
    async loadData() {
      let res = await getVrRecommend();
      if (res.code == 0) {
        this.list = res.data;
      }
    },
    handleClick(item) {
      window.open(item.url);
    },
  },
};
</script>

<style lang="scss" scoped>
$blue: #2069c4;
.home-virtural {
  display: flex;
  flex-direction: column;
  align-items: center;
  // background: url("@/assets/imgs/home/virtual-bg.png") 100% 50% 0% center no-repeat;
  background-image: url("@/assets/imgs/home/virtual-bg.png");
  background-size: 100% 50%;
  background-repeat: no-repeat;
  background-position-y: 70%;
  overflow: hidden;
  .content-wrapper {
    .title {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 60px 0 80px 0;
      font-family: "Alibaba PuHuiTi";
      .ch {
        font-size: 30px;
        font-weight: bold;
        color: #333333;
        margin-bottom: 12px;
      }
      .en {
        font-size: 14px;
        color: #333333;
      }
    }
    .content {
      .intro {
        font-family: "Alibaba PuHuiTi";
        color: #ffffff;
        margin-top: 74px;
        .name {
          margin-bottom: 27px;
          font-size: 20px;
          font-weight: bold;
        }
        .deptName {
          font-size: 16px;
          margin-bottom: 50px;
        }
        .intro-content {
          margin-bottom: 60px;
          width: 258px;
          overflow: hidden;
          -webkit-line-clamp: 3;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-box-orient: vertical;
        }
        .entrance {
          font-size: 16px;
          cursor: pointer;
          .entrance-text {
            margin-right: 12px;
          }
        }
      }
      .virtual-items {
        .item {
          margin-bottom: 5px;
          cursor: pointer;
          position: relative;
          overflow: hidden;
          &:hover {
            .name {
              transform: translateY(0);
            }
            img {
              transform: scale(1.1);
            }
          }
          img {
            width: 100%;
            height: 25vh;
            max-height: 225px;
            transition: all 0.5s ease;
          }
          .name {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: rgba($color: #000000, $alpha: 0.2);
            color: #fff;
            // height: 80px;
            padding: 16px;
            transform: translateY(100px);
            width: 100%;
            transition: all 0.5s ease;
          }
        }
      }
    }
  }

  // .bar {
  //   height: 524px;
  //   // position: relative;
  //   .bg {
  //     height: 100%;
  //   }

  // }
}
</style>
