index.wxml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <view class="banner relative overflow-hidden rounded-2xl border border-[#d1aa58] bg-[#7a2f27]">
  2. <swiper
  3. class="banner__swiper"
  4. circular
  5. autoplay
  6. interval="{{4200}}"
  7. duration="{{450}}"
  8. current="{{current}}"
  9. bindchange="onChange"
  10. >
  11. <swiper-item wx:for="{{list}}" wx:key="id">
  12. <view class="relative w-full h-full">
  13. <image class="w-full h-full" src="{{item.image}}" mode="aspectFill" />
  14. <view wx:if="{{item.tag}}" class="absolute top-3 right-3 rounded-full bg-[#f6e2aa]/90 px-2 py-1 text-xs font-semibold text-[#873325]">{{item.tag}}</view>
  15. <view wx:if="{{item.subtitle}}" class="absolute inset-x-4 bottom-4 text-white">
  16. <view class="mt-1 text-sm text-[#f7e9d2]">{{item.subtitle}}</view>
  17. </view>
  18. </view>
  19. </swiper-item>
  20. </swiper>
  21. <view class="absolute left-2 top-1/2 -translate-y-1/2 w-7 h-7 rounded-full bg-black/20 text-white flex items-center justify-center" bindtap="onPrev">
  22. <svg-icon name="solar:alt-arrow-left-linear" size="16px" color="#ffffff" />
  23. </view>
  24. <view class="absolute right-2 top-1/2 -translate-y-1/2 w-7 h-7 rounded-full bg-black/20 text-white flex items-center justify-center" bindtap="onNext">
  25. <svg-icon name="solar:alt-arrow-right-linear" size="16px" color="#ffffff" />
  26. </view>
  27. <view class="absolute bottom-3 right-4 flex gap-1.5">
  28. <view
  29. wx:for="{{list}}"
  30. wx:key="index"
  31. class="{{current === index ? 'w-4 h-1.5 bg-[#f8dc99]' : 'w-1.5 h-1.5 bg-white/65'}} rounded-full"
  32. ></view>
  33. </view>
  34. </view>