banner.vue 3.2 KB

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