重置index,重置item
<block wx:for="{{index_data.banner_list}}" wx:for-index="idx" wx:for-item="itx">
<swiper-item>
<image class="top_img" src="{{itx.banner_img}}"/>
</swiper-item>
</block>
for,if
<view class="activity_show">
<block wx:for="{{index_data.hot_activity_list}}" wx:for-index="idx">
<block wx:if="{{idx % 2 == 0}}">
<image class="left_img" src="{{item.img}}"/>
</block>
<block wx:else>
<image class="right_img" src="{{item.img}}"/>
</block>
</block>
</view>
公告上下循环
<view class="ad_border">
<swiper class="ad" vertical="{{true}}">
<swiper-item style="width:100%;height:86rpx;">
公告:
<block wx:for="{{index_data.notice_list}}">
<text class="ad_text">{{item.content}}</text>
</block>
</swiper-item>
</swiper>
</view>