<!-- -->
<template>
  <div class="home-virtural">
    <div class="title">
      <div class="ch">虚拟展厅</div>
      <div class="en">Virtual Exhibition Hall</div>
    </div>
    <div class="bar">
      <img
        src="@/assets/imgs/home/virtual-bg.png"
        alt=""
        class="bg"
        width="100%"
      />
      <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">
          {{ list[0].intro }}
        </div>
        <div class="entrance" @click="handleClick(list[0])">
          <span style="margin-right: 12px">点击进入</span>
          <img src="@/assets/imgs/home/entrance.png" alt="" />
        </div>
      </div>
      <div class="virtual-items">
        <el-row :gutter="10">
          <el-col
            :span="8"
            v-for="(item, index) in list"
            :key="index"
            class="item"
            @click.native="handleClick(item)"
          >
            <img :src="item.faceImageUrl" alt="" />
          </el-col>
        </el-row>
      </div>
    </div>
  </div>
</template>

<script>
import { getVrRecommend } from "@/api/vitual";
export default {
  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>
.home-virtural {
  display: flex;
  flex-direction: column;

  .title {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 0 120px 0;
    font-family: "Alibaba PuHuiTi";
    .ch {
      font-size: 30px;
      font-weight: bold;
      color: #333333;
      margin-bottom: 12px;
    }
    .en {
      font-size: 14px;
      color: #333333;
    }
  }
  .bar {
    height: 524px;
    position: relative;
    .bg {
      height: 100%;
    }
    .intro {
      position: absolute;
      left: 13%;
      top: 45px;
      width: 323px;
      font-family: "Alibaba PuHuiTi";
      color: #ffffff;
      .name {
        margin-bottom: 27px;
        font-size: 20px;

        font-weight: bold;
      }
      .deptName {
        font-size: 16px;
        margin-bottom: 50px;
      }
      .intro-content {
        width: 324px;
        margin-bottom: 85px;
      }
      .entrance {
        font-size: 16px;
        cursor: pointer;
      }
    }
    .virtual-items {
      position: absolute;
      width: 965px;
      top: -58px;
      right: 13%;
      img {
        width: 316px;
        height: 238px;
      }
      .item {
        margin-bottom: 5px;
        cursor: pointer;
      }
    }
  }
}
</style>
