<template>
  <div class="virtual">
    <!-- <NavBar /> -->
    <!-- <h1>虚拟展厅</h1> -->
    <!-- <Footer /> -->
    <el-row :gutter="40" class="list">
      <el-col :span="8" v-for="(item, index) in list.records" :key="index">
        <div class="img" @click="handleClick(item.url)">
          <img :src="item.faceImageUrl" alt="" />
          <div class="desc">
            <span class="name">{{ item.name }}</span
            >
            <!-- <span class="deptName">{{ item.deptName }}</span> -->
          </div>
          <div class="play">
            <i class="el-icon-caret-right"></i>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import NavBar from "@/components/NavBar";
import Footer from "@/components/Footer";
import { getVirtualList } from "@/api/vitual";
export default {
  name: "Virtual",
  components: { NavBar, Footer },
  data() {
    return {
      list: {
        records: [],
        size: 10,
        current: 1,
        total: 0,
      },
    };
  },
  mounted() {
    this.loadData();
  },
  methods: {
    //   加载表格数据
    async loadData() {
      var params = {
        page: this.list.current,
        limit: this.list.size,
      };
      let res = await getVirtualList(params);
      if (res.code == 0) {
        this.list = res.data;
      }
    },
    handleClick(url) {
      window.open(url);
    },
  },
};
</script>

<style lang='scss' scoped>
.virtual {
  display: flex;
  justify-content: center;
  .list {
    max-width: 1200px;
    .img {
      width: 100%;
      position: relative;
      overflow: hidden;
      height: 200px;
      // background-color: #fff;
      cursor: pointer;
      &:hover {
        img {
          transform: scale(1.1);
        }
      }
      img {
        width: 100%;
        height: 100%;
        transition: all 0.5s ease;
        
      }
      .desc {
        position: absolute;
        width: 100%;
        padding: 10px;
        background-color: #fff;
        opacity: 0.7;
        bottom: 0;
        left: 0;
      }
      .play {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        border: 2px solid #fff;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        justify-content: center;
        align-items: center;
        i {
          font-size: 40px;
          color: #fff;
        }
      }
    }
  }
}
</style>