<!-- -->
<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="100">
        <el-col :span="6" class="wow animate__animated animate__fadeInLeft">
          <div class="intro" v-if="list.length > 0">
            <div class="name">{{ list[0].name }}</div>
            <div class="deptName">{{ list[0].deptName }}</div>
            <div class="intro-content" v-html="list[0].intro"></div>
            <!-- <EntranceIcon color="#fff" @click.native="handleClick(list[0])" /> -->
            <div class="entrance" @click="handleClick(list[0])">
              <svg-icon icon-class="quanjing"></svg-icon>
              <span>点击体验</span>
            </div>
          </div>
        </el-col>
        <el-col :span="18">
          <div class="virtual-items wow animate__animated animate__fadeInRight">
            <el-row :gutter="10">
              <el-col
                :span="12"
                v-for="(item, index) in list"
                :key="index"
                @click.native="handleClick(item)"
              >
                <div class="item">
                  <img
                    :src="
                      $getFullUrl(item.faceImagePressUrl || 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) {
      this.$message(`即将打开${item.name}虚拟展厅...`);
      setTimeout(() => {
        window.open(item.url);
      }, 1000);
    },
  },
};
</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: 100px 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: 110px;
        .name {
          margin-bottom: 27px;
          font-size: 22px;
          font-weight: bold;
        }
        .deptName {
          font-size: 16px;
          margin-bottom: 50px;
        }
        .intro-content {
          margin-bottom: 60px;
          width: 258px;
          overflow: hidden;
          font-size: 14px;
          -webkit-line-clamp: 4;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-box-orient: vertical;
          line-height: 2;
        }
        .entrance {
          display: flex;
          justify-content: center;
          align-items: center;
          border: 1px solid #fff;
          width: 120px;
          height: 32px;
          font-size: 14px;
          cursor: pointer;
          transition: all ease 0.3s;
          &:hover {
            box-shadow: 2px 4px 4px 2px rgba(0, 0, 0, 0.3);
          }
          .svg-icon{
            font-size: 20px;
            margin-right: 4px;
           
          }
        }
      }
      .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.4);
            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>
