banner.vue 3.5 KB

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