保誠-保戶業務員媒合平台
Mila
2021-10-25 df7e9c57ee754752e11ae0b4e2adb293d27e2f92
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<template>
<div>
    <swiper ref="mySwiper"
      :options="swiperOptions"
      class="swiperStyle"
      @click-slide="clkItem"
    >
        <swiper-slide
          v-for="(info, index) in agents"
          :key="index"
        >
            <SwiperConsultantCard :agentInfo="info"></SwiperConsultantCard>
        </swiper-slide>
 
        <div class="swiper-button-prev" slot="button-prev"></div>
        <div class="swiper-button-next" slot="button-next"></div>
    </swiper>
</div>
</template>
 
<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator';
import { SwiperOptions } from 'swiper';
import { Agents } from '~/plugins/api/home'
 
@Component
export default class UiSwiper extends Vue {
    @Prop() agents!: Agents;
 
    swiperOptions: SwiperOptions = {
        loop: true,
        slideToClickedSlide: false,
        navigation: {
          nextEl: '.swiper-button-next',
          prevEl: '.swiper-button-prev'
        },
        breakpoints: {
          320: {
            slidesPerView: 3,
            slidesPerGroup: 3,
            spaceBetween: 3
          },
          768: {
            slidesPerView: 6,
            slidesPerGroup: 6,
            spaceBetween: 3
          }
        }
    }
 
    clkItem(loopIndex: number, realIndex: number) {
      this.$router.push('/agentInfo')
    }
}
 
 
</script>
 
<style lang="scss" scoped>
.swiperStyle {
  box-shadow: 0 0 6px #22222229;
  border-radius: 10px;
  padding: 45px 0 37px 0;
  background-color: #FFFFFF;
 
  .swiper-slide {
    cursor: pointer;
  }
 
  .swiper-button-next,.swiper-button-prev {
    background-color: white;
    top: 20px;
    height: 100%;
 
    &:after {
      font-size: 20px;
      font-weight: bold;
      color: #707A81;
    }
  }
 
  .swiper-button-prev {
    left: 0;
  }
 
  .swiper-button-next {
    right: 0;
  }
}
</style>