123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <template>
- <div class="wrapper-tools">
- <div
- ref="mySwiper"
- v-swiper:mySwiper="swiperOption"
- class="swiper-container"
- @mouseenter="handleEnter" @mouseleave="handleLeave"
- >
- <div class="carousel-indicators">
- <span class="swiper-pagination-bullet swiper-pagination-bullet-active" tabindex="0" role="button" aria-label="Go to slide 1"></span>
- <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 2"></span>
- <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 3"></span>
- <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 4"></span>
- <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 5"></span>
- </div>
- <div ref="myWrapper" class="swiper-wrapper">
- <div v-for="(item, index) in lists" :key="index" class="swiper-slide">
- <div class="list">
- <div class="header">
- <img :src="item.src" alt="item.title">
- <div class="context">
- <div class="title">{{ item.title }}</div>
- <component :is='item.rate'></component>
- </div>
- </div>
- <div class="des">
- {{ item.des }}
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { directive } from 'vue-awesome-swiper'
- import Array from '~/assets/images/PDFReaderPro/array.svg?inline'
- import Rate from '~/assets/images/PDFReaderPro/rate.svg?inline'
- import FiveRate from '~/assets/images/PDFReaderPro/fiveRate.svg?inline'
- export default {
- directives: {
- swiper: directive
- },
- components: {
- Array,
- Rate,
- FiveRate
- },
- props: ['lists'],
- data() {
- return {
- swiperOption: {
- autoplay: {
- delay: 5000,
- disableOnInteraction: false,
- },
- centeredSlides: true,
- loop: true,
- slidesPerView: 1,
- pagination: {
- el: '.carousel-indicators',
- clickable: true
- },
- }
- }
- },
- methods: {
- handleEnter () {
- this.$refs.mySwiper.swiper.autoplay.stop()
- },
- handleLeave () {
- this.$refs.mySwiper.swiper.autoplay.start()
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep .swiper-container {
- position: relative;
- overflow: hidden;
- z-index: 1;
- .swiper-wrapper {
- position: relative;
- width: 100%;
- height: 100%;
- z-index: 1;
- display: flex;
- transition-property: transform;
- box-sizing: content-box;
- .swiper-slide {
- flex-shrink: 0;
- width: 408px;
- height: 100%;
- position: relative;
- transition-property: transform;
- margin-bottom: 70px;
- justify-content: center;
- align-items: center;
- display: flex;
- }
- }
- .carousel-indicators {
- position: absolute;
- bottom: 24px;
- z-index: 2;
- width: 100%;
- font-size: 0;
- margin: 0;
- text-align: center;
- .swiper-pagination-bullet {
- display: inline-block;
- width: 8px;
- height: 8px;
- margin: 0;
- margin-right: 6px;
- background: #0000001f;
- border-radius:4px;
- transition: width 0.3s;
- &.swiper-pagination-bullet-active {
- background: #00000066;
- }
- }
- }
- }
- .swiper-container-free-mode .swiper-wrapper {
- /* 默认是ease-out */
- -webkit-transition-timing-function: linear;
- -ms-transition-timing-function: linear;
- -moz-transition-timing-function: linear;
- -o-transition-timing-function: linear;
- transition-timing-function: linear;
- }
- div.wrapper-tools {
- .list {
- width: 100%;
- max-width: 400px;
- margin: 0 10px;
- height: 320px;
- margin-top: 40px;
- background: #F5F9FF;
- border-radius: 16px;
- padding: 40px;
- padding-bottom: 0;
- .header {
- display: flex;
- img {
- width: 64px;
- vertical-align: middle;
- }
- .context {
- margin-left: 16px;
- display: flex;
- flex-direction: column;
- justify-content: center;
- .title {
- font-size: 18px;
- font-weight: 700;
- line-height: 24px;
- color: #192233;
- margin-bottom: 8px;
- }
- }
- }
- .des {
- margin-top: 32px;
- font-size: 16px;
- line-height: 32px;
- color: #404754;
- }
- }
- }
- </style>
|