banner.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. <image :src="bannerbg" class="bange"></image>
  12. </view>
  13. </template>
  14. <script>
  15. import config from '@/config.js';
  16. const baseUrl = config.baseUrl;
  17. export default{
  18. props:{
  19. bannerlist:{
  20. type: Array,
  21. default () {
  22. return []
  23. }
  24. },
  25. },
  26. data(){
  27. return{
  28. bannerbg:require("@/static/images/banbg.png"),
  29. activecolor:'#ffffff',
  30. indicatorDots: true,
  31. autoplay: false,
  32. interval: 2000,
  33. duration: 500,
  34. baseUrl:''
  35. }
  36. },
  37. mounted() {
  38. // this.baseUrl=baseUrl
  39. }
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. .hometop{position: relative;}
  44. .swiper{height: 560rpx;position: relative;
  45. .swiperimg{width: 100%;height: 100%;}
  46. }
  47. .swiper /deep/ .uni-swiper-wrapper .uni-swiper-dot{
  48. width:10rpx;height:10rpx;border-radius: 50%;background: transparent;border: 2rpx solid #ffffff;box-sizing: border-box;
  49. }
  50. .swiper /deep/ .uni-swiper-wrapper .uni-swiper-dot-active{
  51. width: 22rpx;height: 10rpx;border-radius: 5rpx;background-color: #ffffff;
  52. }
  53. .swiper /deep/ .uni-swiper-wrapper .uni-swiper-dots-horizontal{
  54. left: auto;right: 48rpx;bottom: 260rpx;transform: none;
  55. }
  56. // wx
  57. .swiper /deep/ .wx-swiper-wrapper .wx-swiper-dot{
  58. width:10rpx;height:10rpx;border-radius: 50%;background: transparent;border: 2rpx solid #ffffff;box-sizing: border-box;
  59. }
  60. .swiper /deep/ .wx-swiper-wrapper .wx-swiper-dot-active{
  61. width: 22rpx;height: 10rpx;border-radius: 5rpx;background-color: #ffffff;
  62. }
  63. .swiper /deep/ .wx-swiper-wrapper .wx-swiper-dots-horizontal{
  64. left: auto;right: 48rpx;bottom: 260rpx;transform: none;
  65. }
  66. .bange{position: absolute;left: 0;right: 0;height: 276rpx;bottom: -44rpx;width: 100%;}
  67. </style>