believeMobile.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <div class="wrapper-tools">
  3. <div
  4. ref="mySwiper"
  5. v-swiper:mySwiper="swiperOption"
  6. class="swiper-container"
  7. @mouseenter="handleEnter" @mouseleave="handleLeave"
  8. >
  9. <div class="carousel-indicators">
  10. <span class="swiper-pagination-bullet swiper-pagination-bullet-active" tabindex="0" role="button" aria-label="Go to slide 1"></span>
  11. <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 2"></span>
  12. <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 3"></span>
  13. <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 4"></span>
  14. <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 5"></span>
  15. </div>
  16. <div ref="myWrapper" class="swiper-wrapper">
  17. <div v-for="(item, index) in lists" :key="index" class="swiper-slide">
  18. <div class="list">
  19. <div class="header">
  20. <img :src="item.src" alt="item.title">
  21. <div class="context">
  22. <div class="title">{{ item.title }}</div>
  23. <component :is='item.rate'></component>
  24. </div>
  25. </div>
  26. <div class="des">
  27. {{ item.des }}
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. import { directive } from 'vue-awesome-swiper'
  37. import Array from '~/assets/images/PDFReaderPro/array.svg?inline'
  38. import Rate from '~/assets/images/PDFReaderPro/rate.svg?inline'
  39. import FiveRate from '~/assets/images/PDFReaderPro/fiveRate.svg?inline'
  40. export default {
  41. directives: {
  42. swiper: directive
  43. },
  44. components: {
  45. Array,
  46. Rate,
  47. FiveRate
  48. },
  49. props: ['lists'],
  50. data() {
  51. return {
  52. swiperOption: {
  53. autoplay: {
  54. delay: 5000,
  55. disableOnInteraction: false,
  56. },
  57. centeredSlides: true,
  58. loop: true,
  59. slidesPerView: 1,
  60. pagination: {
  61. el: '.carousel-indicators',
  62. clickable: true
  63. },
  64. }
  65. }
  66. },
  67. methods: {
  68. handleEnter () {
  69. this.$refs.mySwiper.swiper.autoplay.stop()
  70. },
  71. handleLeave () {
  72. this.$refs.mySwiper.swiper.autoplay.start()
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. ::v-deep .swiper-container {
  79. position: relative;
  80. overflow: hidden;
  81. z-index: 1;
  82. .swiper-wrapper {
  83. position: relative;
  84. width: 100%;
  85. height: 100%;
  86. z-index: 1;
  87. display: flex;
  88. transition-property: transform;
  89. box-sizing: content-box;
  90. .swiper-slide {
  91. flex-shrink: 0;
  92. width: 408px;
  93. height: 100%;
  94. position: relative;
  95. transition-property: transform;
  96. margin-bottom: 70px;
  97. justify-content: center;
  98. align-items: center;
  99. display: flex;
  100. }
  101. }
  102. .carousel-indicators {
  103. position: absolute;
  104. bottom: 24px;
  105. z-index: 2;
  106. width: 100%;
  107. font-size: 0;
  108. margin: 0;
  109. text-align: center;
  110. .swiper-pagination-bullet {
  111. display: inline-block;
  112. width: 8px;
  113. height: 8px;
  114. margin: 0;
  115. margin-right: 6px;
  116. background: #0000001f;
  117. border-radius:4px;
  118. transition: width 0.3s;
  119. &.swiper-pagination-bullet-active {
  120. background: #00000066;
  121. }
  122. }
  123. }
  124. }
  125. .swiper-container-free-mode .swiper-wrapper {
  126. /* 默认是ease-out */
  127. -webkit-transition-timing-function: linear;
  128. -ms-transition-timing-function: linear;
  129. -moz-transition-timing-function: linear;
  130. -o-transition-timing-function: linear;
  131. transition-timing-function: linear;
  132. }
  133. div.wrapper-tools {
  134. .list {
  135. width: 100%;
  136. max-width: 400px;
  137. margin: 0 10px;
  138. height: 320px;
  139. margin-top: 40px;
  140. background: #F5F9FF;
  141. border-radius: 16px;
  142. padding: 40px;
  143. padding-bottom: 0;
  144. .header {
  145. display: flex;
  146. img {
  147. width: 64px;
  148. vertical-align: middle;
  149. }
  150. .context {
  151. margin-left: 16px;
  152. display: flex;
  153. flex-direction: column;
  154. justify-content: center;
  155. .title {
  156. font-size: 18px;
  157. font-weight: 700;
  158. line-height: 24px;
  159. color: #192233;
  160. margin-bottom: 8px;
  161. }
  162. }
  163. }
  164. .des {
  165. margin-top: 32px;
  166. font-size: 16px;
  167. line-height: 32px;
  168. color: #404754;
  169. }
  170. }
  171. }
  172. </style>