banner.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="banner">
  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. StatusBar: this.StatusBar,
  48. }
  49. },
  50. created(){
  51. },
  52. computed: {
  53. },
  54. methods:{
  55. swiperChange(e) {//轮播图切换
  56. const index = e.detail.current
  57. this.current = index
  58. },
  59. NavToDetailPage(floor) {//跳转
  60. this.cmsSysStatistics(1)
  61. this.$api.FlooryNavigateTo(floor)
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .banner {
  68. background-color: #f7f7f7;
  69. }
  70. .swiper-banner-content{
  71. width: 100%;
  72. height: auto;
  73. margin-top: 55px;
  74. background: url(https://static.caimei365.com/app/img/bg/new_home_cumres@2x.png) no-repeat;
  75. position: relative;
  76. background-size: cover;
  77. background-position-y: -170rpx;
  78. }
  79. .swiper-banner-box{
  80. width: 100%;
  81. height: 360rpx;
  82. position: relative;
  83. background-size: cover;
  84. display: flex;
  85. }
  86. .tui-banner-swiper {
  87. width: 700rpx;
  88. margin: 0 auto;
  89. height: 340rpx;
  90. border-radius: 24rpx;
  91. overflow: hidden;
  92. transform: translateY(0);
  93. box-shadow:0px 3px 6px rgba(225,86,22,0.08);
  94. margin-top: 16rpx;
  95. .banner-item{
  96. border-radius: 24rpx;
  97. }
  98. .tui-slide-image {
  99. width: 100%;
  100. height: 340rpx;
  101. display: block;
  102. }
  103. }
  104. .swiper__dots-box{
  105. position: absolute;
  106. bottom: 30rpx;
  107. left: 0;
  108. right: 0;
  109. /* #ifndef APP-NVUE */
  110. display: flex;
  111. /* #endif */
  112. flex: 1;
  113. flex-direction: row;
  114. justify-content: center;
  115. align-items: center;
  116. .swiper__dots-item{
  117. width: 8rpx;
  118. height: 8rpx;
  119. border-radius: 100%;
  120. margin-left: 6px;
  121. background-color:rgba(255,255,255,.7);
  122. }
  123. .swiper__dots-long{
  124. width: 35rpx;
  125. height: 8rpx;
  126. border-radius: 4rpx;
  127. background-color: #ffff;
  128. transition: all 0.4s;
  129. }
  130. }
  131. .swiper-banner-msg{
  132. width: 100%;
  133. height: 54rpx;
  134. box-sizing: border-box;
  135. padding: 0 24rpx;
  136. margin-top: 24rpx;
  137. .content{
  138. width: 100%;
  139. height: 54rpx;
  140. box-sizing: border-box;
  141. padding: 0 34rpx;
  142. background-color: #fff0e9;
  143. border-radius: 16rpx;
  144. .item{
  145. width: 33.33%;
  146. height: 54rpx;
  147. line-height: 54rpx;
  148. font-size: $font-size-24;
  149. color: $color-system;
  150. float: left;
  151. &.le{
  152. text-align: left;
  153. }
  154. &.ce{
  155. text-align: center;
  156. }
  157. &.ri{
  158. text-align: right;
  159. }
  160. .iconfont{
  161. color: $color-system;
  162. font-size: $font-size-32;
  163. .sm{
  164. font-size: $font-size-26;
  165. }
  166. }
  167. }
  168. }
  169. }
  170. </style>