focus.wxml 1.6 KB
<wxs src="../../../wxs/helper.wxs" module="helper" />
<!--焦点图-->
<view class="resource-focus">
    <block wx:if="{{swiperList.data.length <= 1}}">
        <!--参数说明: tid:template_id(楼层id), t-name:template_name(楼层名称), t-index:楼层内部item对应index,t-findex:楼层所在的Index, is-floor:是否是资源位楼层-->
        <anchor url="{{item.url}}" wx:for="{{swiperList.data}}" wx:key="{{index}}" tid="{{swiperList.template_id}}" t-name="{{swiperList.template_name}}" t-index="{{index}}" t-findex="1" is-floor="1">
            <image mode="widthFix" src="{{helper.image(item.src, 750, 480)}}" class="slide-image"/>
        </anchor>
    </block>
    <block wx:else>
        <swiper class="swiper-wrapper" indicator-dots="{{indicatorDots}}"
                autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperChange" 
                circular="{{circular}}">
            <block wx:for="{{swiperList.data}}" wx:key="{{index}}">
                <swiper-item>
                    <anchor url="{{item.url}}" tid="{{swiperList.template_id}}" t-name="{{swiperList.template_name}}" t-index="{{index}}" t-findex="1" is-floor="1">
                        <image mode="widthFix" src="{{helper.image(item.src, 750, 480)}}" class="slide-image"/>
                    </anchor>
                </swiper-item>
            </block>
        </swiper>
        <view class="dots">
            <block wx:for="{{swiperList.data}}" wx:key="unique">
                <view class="dot{{index == swiperCurrent ? ' active' : ''}}"></view>
            </block>
        </view>
    </block>
</view>