<!-- mycomponent/multistageTab/multistageTab.wxml -->
<wxs module="util">
  var inOf = function (str) {
    return str.length
  };
  module.exports.inOf = inOf;
  var sliceMethod = function(info = [], status, show,minR,list){
    var selist = list[minR].second_list;
    var tapind = '';
    if (show && status) {
      if(info.length<selist.length){
        for (var j = 0; j < selist.length; ++j) {
          selist.tabSelectShow = info[0].tabSelectShow
        }
        console.log('ssssssssssssssssssss21',info.length)
        return selist
      }
      return info;
    } else {
      if(info.length <= 7){
        return info
      }
      var ainfo = info.slice(0, 7);
      return ainfo;
    }
  }
  module.exports.sliceMethod = sliceMethod;
</wxs>
<view id="tabNode">

  <view style="background-color: {{datas.preview_color}};" class="u_moretabcontrol">
    <!-- 左边滚动 -->
    <view style="width: 100rpx;" wx:if="{{datas.show_first_tab}}">
      <view style="width: 100rpx;" class="leftWrapper">
        <scroll-view style="height:100vh;width:100rpx;color:{{datas.first_tab_color}};background-color: {{datas.first_tab_bg_color}};" scroll-y="{{true}}" enhanced="true" scroll-top="{{leftScrollTop}}" scroll-with-animation="{{true}}">
          <view style="padding-bottom:130rpx;" class="leftConten">
            <view wx:for="{{datas.list}}" wx:key="index" class="intoView leftinto {{index == intoSelect ? 'intoViewSelect':'noneViewSelect'}}" catchtap="tapIntoSelect" data-ind="{{index}}" style="color:{{index == intoSelect ?datas.first_tab_active_color:''}};background-color: {{index == intoSelect ?datas.first_tab_active_bg_color:''}};">
              <image src="{{item.image}}" wx:if="{{item.image}}" mode="widthFix"></image>
              <view wx:else style="text-indent: {{util.inOf(item.text) == '5'?'16rpx':''}};padding:{{util.inOf(item.text) == '4'?'0px 25rpx;':' 0 10rpx 0 12rpx;'}}">
                {{item.text}}
              </view>
            </view>
          </view>
        </scroll-view>
      </view>
    </view>

    <!-- 右边滚动 -->
    <view class="rightConten" style="width: 650rpx;z-index: 10;">
      <!-- 分类 -->
      <block wx:for="{{datas.list}}">
        <view id="a{{index}}" wx:key="index" class="rightScrollViewNode">
          <!-- 一级分类标题 -->
          <view class="featured" wx:if="{{datas.is_show_first_tab_title}}" style="color:{{datas.first_tab_title_color}}">
            <view class="beforeLine" style="background-color:{{datas.first_tab_title_color}}"></view>
            {{ item.text }}
          </view>
          <van-sticky z-index="{{10}}" binddisplay="ondisplayListView1" data-index="{{index}}" index="{{index}}" offsetTop="{{1}}">
            <view style="height: 1rpx;"></view>
          </van-sticky>
          <!-- 二级导航定位模块  classView 一排 classViewTwo 二排 isFixed  二级分类数组 margin-left: {{datas.show_first_tab?'20%':''}};-->
          <view wx:if="{{datas.show_second_tab}}" class="{{ datas.show_first_tab ? item.childPos?'classView nonefix':'classViewTwo' : 'classView'}}" style="background-color: {{datas.preview_color}};display: flex;">
            <view catchtap="tapClassDiv" data-all='{{util.sliceMethod(allDatas[index],item.childPos,datas.show_first_tab,intoSelect,datas.list)}}' data-index="{{index}}" data-ind="{{ind}}" class="classDiv" wx:for-item="indata" wx:for="{{util.sliceMethod(allDatas[index],item.childPos,datas.show_first_tab,intoSelect,datas.list) }}" wx:key="{{index}}" wx:for-index='ind' style="background-color:{{indata.tabSelectShow == indata.id?datas.second_tab_active_bg_color:datas.second_tab_bg_color}};color: {{indata.tabSelectShow == indata.id?datas.second_tab_active_color:datas.second_tab_color}};border: {{datas.show_second_border?'solid 1rpx'+datas.second_border_color:''}};">
              <view class="lisTxt ">{{indata.title}}</view>
            </view>
            <view class="classDiv" catchtap="tapChange" data-all='{{util.sliceMethod(allDatas[index],item.childPos,datas.show_first_tab,intoSelect,datas.list)}}' data-index="{{index}}" wx:if="{{item.second_list.length > 7 && datas.show_first_tab && !item.childPos}}" style="background-color:{{datas.second_tab_bg_color}};color: {{datas.second_tab_color}};border: {{datas.show_second_border?'solid 1rpx'+datas.second_border_color:''}};">
              <view class="lisTxt ">
                换一换
                <icon class="iconfont icon-fontclass-tequanzhekou" style="color: {{datas.second_tab_color}}">
                </icon>
              </view>
            </view>
          </view>

          <!-- 商品组,单图模块 bindscroll="onscroll"-->
          <van-sticky z-index="{{10}}" binddisplay="ondisplayListView" data-index="{{index}}" index="{{index}}" offsetTop="{{0}}">
            <view class="lisView">
              <template name="simplegraph">
                <simplegraph datas="{{remote_data}}" component_id="{{id}}"></simplegraph>
              </template>
              <template name="goods">
                <goods bind:formSubmit="childMore" infoTab="{{kitem}}" all="{{allDatas}}" totalAll="{{item}}" indexTab="{{index}}" indTab="{{ind}}" childStyle="{{datas}}" childComponent="tab" bindcomponentGoodShare="componentGoodShares" datas="{{remote_data}}" component_id="{{component_id}}" page_id="{{page_id}}" index="{{ind}}"></goods>
              </template>
              <block wx:for="{{infoDatas[index]}}" wx:for-index="ind" wx:key="{{index}}" wx:for-item="kitem">

                <template wx:if="{{kitem.uikey =='U_simplegraph'}}" is="simplegraph" data="{{...kitem}}" />

                <template wx:if="{{kitem.uikey =='U_goods'}}" is="goods" data="{{...kitem,page_id,bottomShowBolIndex,bottomShowBol,ind,datas,index,kitem,component_id,item,allDatas}}" />

              </block>
            </view>
          </van-sticky>
        </view>
      </block>
    </view>
  </view>
</view>