<template>
  <!-- 教师团队 -->
  <div class="teacherTeam">
    <div class="bg">
      <div class="tea_name">教师团队</div>
      <div class="tea_subname">副标题</div>
    </div>
    <div class="tea_swiper">
      <Swiper :options="swiperOption">
        <Swiper-slide v-for="(item, index) in teacherList" :key="index">
          <div
            v-if="!item.showDetail"
            class="slideItem"
            @mouseenter="enter(item)"
            @mouseleave="leave(item)"
          >
            <img :src="item.src" alt="" class="headImg" />
            <div class="tea_name">{{ item.name }}</div>
            <div class="tea_desc">{{ item.desc }}</div>
          </div>
          <div
            v-else
            class="slideItem2"
            @mouseenter="enter(item)"
            @mouseleave="leave(item)"
          >
            <div class="tea_name">{{ item.name }}</div>
            <div class="tea_desc">{{ item.desc }}</div>
          </div>
        </Swiper-slide>
      </Swiper>
    </div>
  </div>
</template>
<script>
import { Swiper, SwiperSlide } from "vue-awesome-swiper";
import "swiper/swiper.scss";
export default {
  components: {
    Swiper,
    SwiperSlide,
  },
  props: {
    viewNum: {
      type: Number,
      default: 1,
    },
    slideSpaceBetween: {
      type: Number,
      default: 20,
    },
  },
  data() {
    return {
      // 轮播图
      swiperOption: {
        observer: true,
        observeParents: true,
        freeMode: true,
        // loop: true,
        slidesPerView: this.viewNum,
        slideSpaceBetween: this.slideSpaceBetween,
        navigation: {
          //   nextEl: ".swiper-button-next",
          //   prevEl: ".swiper-button-prev",
        },
      },
      teacherList: [
        {
          name: "黄群",
          url: "",
          showDetail: false,
          desc:
            "都中医药大学英语学士，拥有八年日本旅游出境线路操作经验，8年的经验累积熟悉各类日本企业运作模式和企业文化。一直和日本企业保持密...联系，现在主要负责人才就业输送。",
        },
        {
          name: "唐雪梅",
          url: "",
          showDetail: false,
          desc:
            "都中医药大学英语学士，拥有八年日本旅游出境线路操作经验，8年的经验累积熟悉各类日本企业运作模式和企业文化。一直和日本企业保持密...联系，现在主要负责人才就业输送。",
        },
        {
          name: "唐雪梅",
          url: "",
          showDetail: false,
          desc:
            "都中医药大学英语学士，拥有八年日本旅游出境线路操作经验，8年的经验累积熟悉各类日本企业运作模式和企业文化。一直和日本企业保持密...联系，现在主要负责人才就业输送。",
        },
        {
          name: "唐雪梅",
          url: "",
          showDetail: false,
          desc:
            "都中医药大学英语学士，拥有八年日本旅游出境线路操作经验，8年的经验累积熟悉各类日本企业运作模式和企业文化。一直和日本企业保持密...联系，现在主要负责人才就业输送。",
        },
        {
          name: "唐雪梅",
          url: "",
          showDetail: false,
          desc:
            "都中医药大学英语学士，拥有八年日本旅游出境线路操作经验，8年的经验累积熟悉各类日本企业运作模式和企业文化。一直和日本企业保持密...联系，现在主要负责人才就业输送。",
        },
      ],
    };
  },
  methods: {
    enter(i) {
      i.showDetail = true;
    },
    leave(i) {
      i.showDetail = false;
    },
  },
  mounted() {},
};
</script>
<style lang="scss" scoped>
.teacherTeam {
  width: 100%;
  height: 45.3125vw;
  position: relative;

  .bg {
    width: 100%;
    height: 27.604vw;
    position: absolute;
    top: 0;
    left: 0;
    padding-top: 12.5vw;
    background-color: #eee;
    .tea_name {
      text-align: center;
      font-size: 1.562vw;
      // font-family: Microsoft YaHei;
      // font-weight: bold;
      font-family: "pingfang-b" !important;
      color: #000000;
      z-index: 5;
    }
    .tea_subname {
      text-align: center;
      font-size: 0.833vw;
      color: #000000;
      z-index: 5;
    }
  }
  .tea_swiper {
    width: 62.5vw;
    height: 21.875vw;
    box-sizing: border-box;
    background-color: #fff;
    position: absolute;
    top: 17.968vw;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 2.604vw;
  }
}
.slideItem {
  width: 13.541vw !important;
  height: 18.333vw;
  box-shadow: 0px 6px 10px 0px rgba(116, 116, 116, 0.1);
  background-color: #ffffff;
  padding: 0 1.458vw;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-right: 20px;
  .headImg {
    width: 52px;
    height: 56px;
  }
  .tea_name {
    width: 100%;
    text-align: center;
    font-size: 1.145vw;
    // font-family: Microsoft YaHei;
    // font-weight: bold;
    font-family: "pingfang-b" !important;
    color: #000000;
  }
  .tea_desc {
    width: 11.666vw;
    height: 4.843vw;
    font-size: 0.729vw;
    // overflow-x: hidden;
    // overflow-y: auto;
    overflow: hidden;
    // font-family: Microsoft YaHei;
    // font-weight: 400;
    color: #999999;
    line-height: 1.354vw;
  }
}
.slideItem2 {
  width: 13.541vw;
  height: 18.333vw;
  background-color: #45766d;
  overflow-x: hidden;
  overflow-y: auto;
  cursor: pointer;
  box-sizing: border-box;
  padding: 2vw 1vw;
  box-shadow: 0px 6px 10px 0px rgba(116, 116, 116, 0.1);
  .tea_name {
    font-size: 1.145vw;
    // font-family: Microsoft YaHei;
    // font-weight: bold;
    font-family: "pingfang-b" !important;
    color: #ffffff;
    line-height: 1.5625vw;
    margin-bottom: 1.145vw;
  }
}
.swiper-button-prev,
.swiper-button-next {
  width: 200px;
  height: 28px;
  color: #45766d;
}
</style>