banner.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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>
  18. </template>
  19. <script>
  20. export default{
  21. name:"address",
  22. props:{
  23. list:{
  24. type:Array
  25. }
  26. },
  27. data() {
  28. return{
  29. current:0
  30. }
  31. },
  32. created(){
  33. },
  34. computed: {
  35. },
  36. methods:{
  37. swiperChange(e) {//轮播图切换
  38. const index = e.detail.current;
  39. this.current = index;
  40. },
  41. NavToDetailPage(floor) {//跳转
  42. this.$api.FlooryNavigateTo(floor)
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="scss">
  48. .swiper-banner-box{
  49. width: 100%;
  50. height: 360rpx;
  51. padding-top:100rpx;
  52. position: relative;
  53. background-size: cover;
  54. }
  55. .tui-banner-swiper {
  56. width: 700rpx;
  57. margin: 0 auto;
  58. height: 340rpx;
  59. border-radius: 16rpx;
  60. overflow: hidden;
  61. transform: translateY(0);
  62. margin-top: 16rpx;
  63. .banner-item{
  64. border-radius: 16rpx;
  65. }
  66. .tui-slide-image {
  67. width: 100%;
  68. height: 340rpx;
  69. display: block;
  70. }
  71. }
  72. .swiper__dots-box{
  73. position: absolute;
  74. bottom: 30rpx;
  75. left: 0;
  76. right: 0;
  77. /* #ifndef APP-NVUE */
  78. display: flex;
  79. /* #endif */
  80. flex: 1;
  81. flex-direction: row;
  82. justify-content: center;
  83. align-items: center;
  84. .swiper__dots-item{
  85. width: 10rpx;
  86. height: 10rpx;
  87. border-radius: 100%;
  88. margin-left: 6px;
  89. background-color:rgba(255,255,255,.7);
  90. }
  91. .swiper__dots-long{
  92. width: 10rpx;
  93. height: 10rpx;
  94. border-radius: 4rpx;
  95. background-color: #fa55bf;
  96. transition: all 0.4s;
  97. }
  98. }
  99. </style>