carousel.wxml 1.19 KB
<wxs src="../../../../wxs/helper.wxs" module="helper" />
<view class="resource-shop-carousel {{properties.isModuleMargin ? 'margin-bottom-20' : ''}}">
    <swiper class="swiper-wrapper" indicator-dots="{{indicatorDots}}"
            autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"
            circular="{{circular}}" bindchange="swiperChange">
        <block wx:for="{{images}}" wx:key="{{index}}">
            <swiper-item>
                <anchor
                    bindclickreport="report"
                    url="{{item.url}}" 
                    floor-id="{{floorId}}" 
                    floor-name="{{floorName}}"
                    floor-url="{{item.url}}"
                    floor-index="{{floorIndex}}" 
                    floor-item-index="{{index + 1}}">
                    <image mode="widthFix" src="{{helper.image(item.pic, 750, 480)}}" class="slide-image"/>
                </anchor>
            </swiper-item>
        </block>
    </swiper>
    <view class="dots" wx:if="{{images.length > 1}}">
        <block wx:for="{{images}}" wx:key="unique">
            <view class="dot{{index == swiperCurrent ? ' active' : ''}}"></view>
        </block>
    </view>
</view>