<template>
  <AppCard title="优秀师资">
    <swiper ref="mySwiper" :options="swiperOptions" class="teacher-list">
      <swiper-slide v-for="(item, index) in list" :key="index" class="teacher-item">
        <div class="teacher-item-hd-text">
          <img :src="item.imgUrl" />
          <div class="name">{{ item.name }}</div>
          <div class="project">{{ item.project }}</div>
          <div class="desc" v-html="item.desc"></div>
        </div>
      </swiper-slide>
    </swiper>
  </AppCard>
</template>
<script>
import AppCard from '@/components/Card.vue'
export default {
  name: 'TeacherCard',
  props: { list: { type: Array, default: () => [] } },
  components: { AppCard },
  data() {
    return {
      swiperOptions: {
        autoplay: true,
        loop: true,
        slidesPerView: 'auto',
        spaceBetween: 10
      }
    }
  }
}
</script>

<style lang="scss">
.teacher-list {
  margin-bottom: 60px;
}
.teacher-item {
  padding: 0.12rem 0.1rem 0.23rem 0.1rem;
  width: 1.68rem;
  height: 3.4rem;
  background: rgba(255, 255, 255, 0.39);
  box-shadow: 0px 1px 11px rgba(0, 0, 0, 0.1);
  color: #fff;
  box-sizing: border-box;
}

.teacher-item-hd-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  img {
    width: 1.48rem;
    height: 1.65rem;
    object-fit: cover;
  }
  .name {
    font-size: 0.14rem;
    color: #000000;
    margin-top: 0.13rem;
    font-weight: bold;
  }
  .project {
    margin-top: 0.05rem;
    font-size: 0.12rem;
    color: #333333;
    white-space: nowrap;
  }
  .desc {
    margin-top: 0.17rem;
    font-size: 0.11rem;
    font-weight: 400;
    color: #575964;
    text-align: left;
  }
}
</style>
