successCases.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view class="successCases">
  3. <slot name="supplier-title"></slot>
  4. <scroll-view scroll-x="true" class="scroll-view" @scroll="scrollX" :scroll-into-view="activeMenu" scroll-with-animation="true">
  5. <view
  6. class="swiper-item"
  7. v-for="(item, index) in successList"
  8. :key="item.id"
  9. :id="`item${index}`"
  10. :style="{ margin: item.id === 2 ? '40rpx' : '' }"
  11. v-if="item.appStatus == '1'"
  12. >
  13. <view class="swiper-item-title">{{ item.title }}</view>
  14. <view class="swiper-item-contant" v-html="item.content"></view>
  15. <image :src="item.headAppBanner" mode="" class="swiper-item-img"></image>
  16. </view>
  17. </scroll-view>
  18. <view class="scroll-dots">
  19. <page-dots :pageAll="successList.length" :isActive="isSuccess" @hanlder-click="hanlderClick" />
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import PageDots from './swiper-dots.vue'
  25. export default {
  26. props: {
  27. successList: {
  28. type: Array,
  29. default: () => []
  30. }
  31. },
  32. components: {
  33. PageDots
  34. },
  35. data() {
  36. return {
  37. isSuccess: 0,
  38. activeMenu: 'item0'
  39. }
  40. },
  41. methods: {
  42. scrollX($event) {
  43. const data = Math.floor($event.detail.scrollLeft / 192)
  44. this.isSuccess = data
  45. },
  46. hanlderClick($event) {
  47. this.isSuccess = $event
  48. this.activeMenu = `item${$event}`
  49. },
  50. }
  51. }
  52. </script>
  53. <style scoped lang="scss">
  54. .successCases {
  55. padding: 1px;
  56. box-sizing: border-box;
  57. background-color: #fff;
  58. position: relative;
  59. }
  60. .scroll-view {
  61. height: 1400rpx;
  62. padding-left: 32rpx;
  63. width: 100%;
  64. box-sizing: border-box;
  65. white-space: nowrap;
  66. position: relative;
  67. background-color: #fff;
  68. }
  69. .swiper-item {
  70. width: 566rpx;
  71. height: 1124rpx;
  72. box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(102, 102, 102, 0.3);
  73. background: #ffffff;
  74. margin: 40rpx 0 40rpx 40rpx;
  75. box-sizing: border-box;
  76. padding: 50rpx;
  77. overflow-wrap: break-word;
  78. white-space: normal;
  79. display: inline-flex;
  80. flex-direction: column;
  81. position: relative;
  82. align-items: center;
  83. }
  84. .swiper-item-title {
  85. color: #333333;
  86. font-size: 32rpx;
  87. font-weight: 600;
  88. text-align: center;
  89. }
  90. .swiper-item-contant {
  91. font-size: 24rpx;
  92. color: #666666;
  93. line-height: 48rpx;
  94. overflow-wrap: break-word;
  95. white-space: normal;
  96. margin-top: 40rpx;
  97. overflow: hidden;
  98. text-overflow: ellipsis;
  99. display: -webkit-box;
  100. -webkit-line-clamp: 14;
  101. -webkit-box-orient: vertical;
  102. }
  103. .swiper-item-img {
  104. width: 468rpx;
  105. height: 274rpx;
  106. position: absolute;
  107. left: 48rpx;
  108. bottom: 40rpx;
  109. }
  110. .scroll-dots {
  111. position: absolute;
  112. left: 50%;
  113. bottom: 140rpx;
  114. display: flex;
  115. justify-content: center;
  116. align-items: center;
  117. transform: translateX(-50%);
  118. .scroll-dot {
  119. width: 12rpx;
  120. height: 12rpx;
  121. border-radius: 50%;
  122. background-color: #FFBD99;
  123. margin-right: 16rpx;
  124. }
  125. }
  126. .isActive {
  127. background: #ff5b00 !important;
  128. }
  129. </style>