banner.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view class="banner">
  3. <view class="swiper-banner-content">
  4. <view class="swiper-banner-box">
  5. <swiper
  6. class="tui-banner-swiper tui-banner tui-skeleton-fillet"
  7. :autoplay="true"
  8. :interval="5000"
  9. :duration="500"
  10. @change="swiperChange"
  11. :circular="true"
  12. >
  13. <swiper-item v-for="(item, index) in list" :key="index" @click.stop="NavToDetailPage(item)">
  14. <image :src="item.image" class="tui-slide-image" mode="scaleToFill" />
  15. </swiper-item>
  16. </swiper>
  17. <view class="swiper__dots-box" v-if="list.length > 1">
  18. <view
  19. v-for="(item, idx) in list"
  20. :key="idx"
  21. :class="[idx === current ? 'swiper__dots-long' : 'none']"
  22. :data-index="current"
  23. class="swiper__dots-item"
  24. >
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="swiper-banner-msg">
  30. <view class="content">
  31. <view class="item le">
  32. <text class="iconfont icon-zhengpin"><text class="sm">正品保证</text></text>
  33. </view>
  34. <view class="item ce">
  35. <text class="iconfont icon-jigou"><text class="sm">12000+机构</text></text>
  36. </view>
  37. <view class="item ri">
  38. <text class="iconfont icon-gongyingshang"><text class="sm">100+供应商</text></text>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import cmsMixins from '@/mixins/cmsMixins.js'
  46. export default {
  47. mixins: [cmsMixins],
  48. name: 'banner',
  49. props: {
  50. list: {
  51. type: Array
  52. }
  53. },
  54. data() {
  55. return {
  56. current: 0,
  57. StatusBar: this.StatusBar
  58. }
  59. },
  60. created() {},
  61. computed: {},
  62. methods: {
  63. swiperChange(e) {
  64. //轮播图切换
  65. const index = e.detail.current
  66. this.current = index
  67. },
  68. NavToDetailPage(item) {
  69. //跳转
  70. this.cmsSysStatistics(1,item.id)
  71. this.$api.FlooryNavigateTo(item)
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .banner {
  78. background-color: #f7f7f7;
  79. }
  80. .swiper-banner-content {
  81. width: 100%;
  82. height: auto;
  83. margin-top: 55px;
  84. background: url(https://static.caimei365.com/app/img/bg/new_home_cumres@2x.png) no-repeat;
  85. position: relative;
  86. background-size: cover;
  87. background-position-y: -170rpx;
  88. }
  89. .swiper-banner-box {
  90. width: 100%;
  91. height: 360rpx;
  92. position: relative;
  93. background-size: cover;
  94. display: flex;
  95. }
  96. .tui-banner-swiper {
  97. width: 700rpx;
  98. margin: 0 auto;
  99. height: 340rpx;
  100. border-radius: 24rpx;
  101. overflow: hidden;
  102. transform: translateY(0);
  103. box-shadow: 0px 3px 6px rgba(225, 86, 22, 0.08);
  104. margin-top: 16rpx;
  105. .banner-item {
  106. border-radius: 24rpx;
  107. }
  108. .tui-slide-image {
  109. width: 100%;
  110. height: 340rpx;
  111. display: block;
  112. }
  113. }
  114. .swiper__dots-box {
  115. position: absolute;
  116. bottom: 30rpx;
  117. left: 0;
  118. right: 0;
  119. /* #ifndef APP-NVUE */
  120. display: flex;
  121. /* #endif */
  122. flex: 1;
  123. flex-direction: row;
  124. justify-content: center;
  125. align-items: center;
  126. .swiper__dots-item {
  127. width: 8rpx;
  128. height: 8rpx;
  129. border-radius: 100%;
  130. margin-left: 6px;
  131. background-color: rgba(255, 255, 255, 0.7);
  132. }
  133. .swiper__dots-long {
  134. width: 35rpx;
  135. height: 8rpx;
  136. border-radius: 4rpx;
  137. background-color: #ffff;
  138. transition: all 0.4s;
  139. }
  140. }
  141. .swiper-banner-msg {
  142. width: 100%;
  143. height: 54rpx;
  144. box-sizing: border-box;
  145. padding: 0 24rpx;
  146. margin-top: 24rpx;
  147. .content {
  148. width: 100%;
  149. height: 54rpx;
  150. box-sizing: border-box;
  151. padding: 0 34rpx;
  152. background-color: #fff0e9;
  153. border-radius: 16rpx;
  154. .item {
  155. width: 33.33%;
  156. height: 54rpx;
  157. line-height: 54rpx;
  158. font-size: $font-size-24;
  159. color: $color-system;
  160. float: left;
  161. &.le {
  162. text-align: left;
  163. }
  164. &.ce {
  165. text-align: center;
  166. }
  167. &.ri {
  168. text-align: right;
  169. }
  170. .iconfont {
  171. color: $color-system;
  172. font-size: $font-size-32;
  173. .sm {
  174. font-size: $font-size-26;
  175. }
  176. }
  177. }
  178. }
  179. }
  180. </style>