banner.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.path" class="swiperimg"></image>
  8. </swiper-item>
  9. </block>
  10. </swiper>
  11. </view>
  12. </template>
  13. <script>
  14. import config from '@/config.js';
  15. const baseUrl = config.baseUrl;
  16. export default{
  17. props:{
  18. bannerlist:{
  19. type: Array,
  20. default () {
  21. return []
  22. }
  23. },
  24. type:{
  25. type: String,
  26. default () {
  27. return 'zhao'
  28. }
  29. },
  30. currentdate:{
  31. type: String,
  32. default () {
  33. return ''
  34. }
  35. }
  36. },
  37. data(){
  38. return{
  39. background: ['color1', 'color2', 'color3'],
  40. activecolor:'#ffffff',
  41. indicatorDots: true,
  42. autoplay: false,
  43. interval: 2000,
  44. duration: 500,
  45. baseUrl:''
  46. }
  47. },
  48. mounted() {
  49. // this.baseUrl=baseUrl
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .swiper{height: 246rpx;position: relative;border-radius: 10rpx;overflow: hidden;
  55. .swiperimg{width: 100%;height: 100%;border-radius: 10rpx;overflow: hidden;}
  56. }
  57. .swiper /deep/ .uni-swiper-wrapper .uni-swiper-dot{
  58. width:12rpx;height:12rpx;border-radius: 50%;background: rgba(0, 0, 0, 0.5);
  59. }
  60. .swiper /deep/ .uni-swiper-wrapper .uni-swiper-dot-active{
  61. width: 20rpx;height: 12rpx;border-radius: 6rpx;background-color: #ffffff;
  62. }
  63. // wx
  64. .swiper /deep/ .wx-swiper-wrapper .wx-swiper-dot{
  65. width:12rpx;height:12rpx;border-radius: 50%;background: rgba(0, 0, 0, 0.5);
  66. }
  67. .swiper /deep/ .wx-swiper-wrapper .wx-swiper-dot-active{
  68. width: 20rpx;height: 12rpx;border-radius: 6rpx;background-color: #ffffff;
  69. }
  70. .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;}
  71. </style>