banner.wxml 1015 B

123456789101112131415161718192021
  1. <view class="swiper" wx:if="{{imgList.length && imgList.length>0}}">
  2. <swiper indicator-dots="{{indicatorDots}}" current="{{current}}" bindchange="swiperChange"
  3. circular autoplay="autoplay"
  4. class="banner-container">
  5. <block wx:for="{{imgList}}" wx:key="index">
  6. <swiper-item class="banner-content">
  7. <van-image src="{{item.imgPath}}" fit="cover" width="{{imgWidth}}" height="{{imgHeight}}"
  8. radius="{{imgRadius}}" bindtap="onTap" data-index="{{index}}"
  9. custom-class="banner-img"/>
  10. </swiper-item>
  11. </block>
  12. </swiper>
  13. <view class="indication" wx:if="{{imgList.length > 1}}">
  14. <block wx:for="{{imgList}}" wx:key="index">
  15. <view class="{{index == currentIndex? 'active' : 'default'}}"></view>
  16. </block>
  17. </view>
  18. </view>
  19. <view wx:else class="default-banner banner-container">
  20. <van-image src="" width="{{imgWidth}}" height="{{imgHeight}}"/>
  21. </view>