banner.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view class="hometop">
  3. <swiper class="swiper" circular :indicator-active-color="activecolor" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
  4. :duration="duration">
  5. <block v-for="(ite,idx) in bannerlist" :key='idx'>
  6. <swiper-item>
  7. <image :src="baseUrl+ite" class="swiperimg"></image>
  8. </swiper-item>
  9. </block>
  10. </swiper>
  11. </view>
  12. </template>
  13. <script>
  14. import config from '@/config.js';
  15. export default{
  16. props:{
  17. bannerlist:{
  18. type: Array,
  19. default () {
  20. return []
  21. }
  22. },
  23. type:{
  24. type: String,
  25. default () {
  26. return 'zhao'
  27. }
  28. },
  29. currentdate:{
  30. type: String,
  31. default () {
  32. return ''
  33. }
  34. }
  35. },
  36. data(){
  37. return{
  38. background: ['color1', 'color2', 'color3'],
  39. activecolor:'#ffffff',
  40. indicatorDots: true,
  41. autoplay: false,
  42. interval: 2000,
  43. duration: 500,
  44. baseUrl:config.baseUrl
  45. }
  46. },
  47. mounted() {
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .swiper{height: 246rpx;position: relative;border-radius: 10rpx;overflow: hidden;
  53. .swiperimg{width: 100%;height: 100%;border-radius: 10rpx;overflow: hidden;}
  54. }
  55. .swiper /deep/ .uni-swiper-wrapper .uni-swiper-dot{
  56. width:12rpx;height:12rpx;border-radius: 50%;background: rgba(0, 0, 0, 0.5);
  57. }
  58. .swiper /deep/ .uni-swiper-wrapper .uni-swiper-dot-active{
  59. width: 20rpx;height: 12rpx;border-radius: 6rpx;background-color: #ffffff;
  60. }
  61. // wx
  62. .swiper /deep/ .wx-swiper-wrapper .wx-swiper-dot{
  63. width:12rpx;height:12rpx;border-radius: 50%;background: rgba(0, 0, 0, 0.5);
  64. }
  65. .swiper /deep/ .wx-swiper-wrapper .wx-swiper-dot-active{
  66. width: 20rpx;height: 12rpx;border-radius: 6rpx;background-color: #ffffff;
  67. }
  68. .bannerfot{position: absolute;left: 0;right: 0;height: 70rpx;background-color: rgba(0, 0, 0, 0.5);padding: 0 32rpx;bottom: 0;display: flex;align-items: center;justify-content: space-between;}
  69. </style>