banner.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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" @click.stop="NavToDetailPage(item)">
  6. <image :src="item.image" 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">5000+机构</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. NavToDetailPage(floor) {//跳转
  55. this.$api.FlooryNavigateTo(floor)
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="scss">
  61. .swiper-banner-box{
  62. width: 100%;
  63. height: 360rpx;
  64. padding-top:100rpx;
  65. position: relative;
  66. background-size: cover;
  67. }
  68. .tui-banner-swiper {
  69. width: 700rpx;
  70. margin: 0 auto;
  71. height: 340rpx;
  72. border-radius: 24rpx;
  73. overflow: hidden;
  74. transform: translateY(0);
  75. box-shadow:0px 3px 6px rgba(225,86,22,0.08);
  76. margin-top: 16rpx;
  77. .banner-item{
  78. border-radius: 24rpx;
  79. }
  80. .tui-slide-image {
  81. width: 100%;
  82. height: 340rpx;
  83. display: block;
  84. }
  85. }
  86. .swiper__dots-box{
  87. position: absolute;
  88. bottom: 30rpx;
  89. left: 0;
  90. right: 0;
  91. /* #ifndef APP-NVUE */
  92. display: flex;
  93. /* #endif */
  94. flex: 1;
  95. flex-direction: row;
  96. justify-content: center;
  97. align-items: center;
  98. .swiper__dots-item{
  99. width: 8rpx;
  100. height: 8rpx;
  101. border-radius: 100%;
  102. margin-left: 6px;
  103. background-color:rgba(255,255,255,.7);
  104. }
  105. .swiper__dots-long{
  106. width: 35rpx;
  107. height: 8rpx;
  108. border-radius: 4rpx;
  109. background-color: #ffff;
  110. transition: all 0.4s;
  111. }
  112. }
  113. .swiper-banner-msg{
  114. width: 100%;
  115. height: 54rpx;
  116. box-sizing: border-box;
  117. padding: 0 24rpx;
  118. margin-top: 20rpx;
  119. .content{
  120. width: 100%;
  121. height: 54rpx;
  122. box-sizing: border-box;
  123. padding: 0 34rpx;
  124. background-color: #fff0e9;
  125. border-radius: 16rpx;
  126. .item{
  127. width: 33.33%;
  128. height: 54rpx;
  129. line-height: 54rpx;
  130. font-size: $font-size-24;
  131. color: $color-system;
  132. float: left;
  133. &.le{
  134. text-align: left;
  135. }
  136. &.ce{
  137. text-align: center;
  138. }
  139. &.ri{
  140. text-align: right;
  141. }
  142. .iconfont{
  143. color: $color-system;
  144. font-size: $font-size-32;
  145. .sm{
  146. font-size: $font-size-26;
  147. }
  148. }
  149. }
  150. }
  151. }
  152. </style>