<template name="banner">
  <view class="banner">
    <swiper 
      class='banner_t' 
      autoplay='true' 
      interval='2000' 
      duration='300' 
      bindchange='switchTab'
      circular='true'
    >
      <block wx:for="{{banner}}" wx:key="id">
        <swiper-item>
          <image class='banner_item' src="{{item.banner_img}}"/>
        </swiper-item>
      </block>      
    </swiper>
    <view class="tab">
      <block wx:for="{{banner}}" wx:key="key">
        <view wx:if="{{item.selected}}" class='tab-item selected'></view>
        <view wx:else class="tab-item"></view>
      </block>
    </view>
  </view>
</template>