<!--packageE/tabcontrol/tabcontrol.wxml-->
<view class="component-wrapper">

  <template name="article">
    <article datas="{{remote_data}}"  component_id="{{component_id}}" U_tabcontrol="{{U_tabcontrol}}" index="{{index}}"></article>
  </template>
  <template name="community">
    <community datas="{{remote_data}}" component_id="{{component_id}}" U_tabcontrol="{{U_tabcontrol}}" index="{{index}}"></community>
  </template>
  <template name="cube">
    <cube datas="{{remote_data}}" component_id="{{component_id}}" U_tabcontrol="{{U_tabcontrol}}" index="{{index}}"></cube>
  </template>
  <template name="goods">
    <goods datas="{{remote_data}}"  component_id="{{component_id}}" page_id="{{page_id}}" U_tabcontrol="{{U_tabcontrol}}" index="{{index}}" bottomShowBol="{{bottomShowBol}}" isLast="{{isLast}}"></goods>
  </template>
  <template name="goodsgroup">
    <goodsgroup datas="{{remote_data}}" page_id="{{page_id}}" component_id="{{component_id}}" U_tabcontrol="{{U_tabcontrol}}" index="{{index}}"></goodsgroup>
  </template>
  <template name="goodsrush">
    <goodsrush datas="{{remote_data}}"  component_id="{{component_id}}" U_tabcontrol="{{U_tabcontrol}}" index="{{index}}"></goodsrush>
  </template>
  <template name="goodsnearby">
    <goodsnearby datas="{{remote_data}}"  component_id="{{component_id}}" U_tabcontrol="{{U_tabcontrol}}" index="{{index}}"></goodsnearby>
  </template>
  <template name="livestreaming">
    <livestreaming datas="{{remote_data}}"  component_id="{{component_id}}" U_tabcontrol="{{U_tabcontrol}}" index="{{index}}"></livestreaming>
  </template>
  <template name="lottery">
    <lottery datas="{{remote_data}}"  component_id="{{component_id}}" U_tabcontrol="{{U_tabcontrol}}" index="{{index}}"></lottery>
  </template>
  <template name="shortvideo">
    <shortvideo datas="{{remote_data}}"  component_id="{{component_id}}" page_id="{{page_id}}" U_tabcontrol="{{U_tabcontrol}}" index="{{index}}"></shortvideo>
  </template>
  <template name="simplegraph">
    <simplegraph datas="{{remote_data}}"  component_id="{{component_id}}" U_tabcontrol="{{U_tabcontrol}}" index="{{index}}"></simplegraph>
  </template>
  <template name="stores">
    <stores datas="{{remote_data}}"  component_id="{{component_id}}" U_tabcontrol="{{U_tabcontrol}}" index="{{index}}"></stores>
  </template>

  <!--选项卡静态-->
  <view>
    <view class="tab">
      <view class="ul tab_list" style="min-height: {{datas.is_tab_high ? '' :'100vh'}}">
        <van-tabs active="{{active}}"
                  z-index="99"
                  sticky="{{btnFlag}}"
                  bind:change="onClick"
                  color="{{datas.tab_active_color}}"
                  tab-class="tag"
                  swipe-threshold="4">
          <van-tab title="{{item.name || item.component}}" wx:for="{{datas.list}}"  name="{{index}}" wx:key="index" title-style="padding: 0;overflow: visible;white-space: nowrap;text-overflow: clip;background: {{datas.tab_bg_color}};color:{{active==index?datas.tab_active_color:datas.tab_color}};">
            <block wx:if="{{show_page}}">
              <view class="tab-item">
                <template wx:if="{{item.uikey =='U_article' && active == index && item}}" is="article" data="{{...item,component_id,U_tabcontrol,index}}" />
                <template wx:if="{{item.uikey =='U_community' && active == index && item}}" is="community" data="{{...item,component_id,U_tabcontrol,index}}" />
                <template wx:if="{{item.uikey =='U_cube' && active == index && item}}" is="cube" data="{{...item,component_id,U_tabcontrol,index}}" />
                <template wx:if="{{item.uikey =='U_goods' && active == index && item}}" is="goods" data="{{...item,component_id,page_id,U_tabcontrol,bottomShowBol,index,isLast}}" />
                <template wx:if="{{item.uikey =='U_goodsgroup' && active == index && item}}" is="goodsgroup" data="{{...item,component_id,page_id,U_tabcontrol,index}}" />
                <template wx:if="{{item.uikey =='U_goodsrush' && active == index && item}}" is="goodsrush" data="{{...item,component_id,U_tabcontrol,index}}" />
                <template wx:if="{{item.uikey =='U_goodsnearby' && active == index && item}}" is="goodsnearby" data="{{...item,component_id,U_tabcontrol,index}}" />
                <template wx:if="{{item.uikey =='U_livestreaming' && active == index && item}}" is="livestreaming" data="{{...item,component_id,U_tabcontrol,index}}" />
                <template wx:if="{{item.uikey =='U_lottery' && active == index && item}}" is="lottery" data="{{...item,component_id,U_tabcontrol,index}}" />
                <template wx:if="{{item.uikey =='U_shortvideo' && active == index && item}}" is="shortvideo" data="{{...item,component_id,page_id,U_tabcontrol,index}}" />
                <template wx:if="{{item.uikey =='U_simplegraph' && active == index && item}}" is="simplegraph" data="{{...item,component_id,U_tabcontrol,index}}" />
                <template wx:if="{{item.uikey =='U_stores' && active == index && item}}" is="stores" data="{{...item,component_id,U_tabcontrol,index}}" />
              </view>
            </block>

            <block wx:if="{{!show_page}}">
              <view style="padding: 100px 15px;text-align: center;background-color: {{datas.tab_bg_color}}">
                {{show_text}}
              </view>
            </block>
          </van-tab>
        </van-tabs>
      </view>

      <view wx:if="{{datas.list.length <= 1 && datas.list[0] && !datas.list[0].list_id}}"
           style="padding: 100px 15px;text-align: center;background-color: {{datas.tab_bg_color}}" >
        暂无设置选项卡或数据
      </view>

    </view>
  </view>
</view>
