<!--pages/sub-category/sub-category.wxml-->
<view class="container">
  <!-- 顶部子分类tab -->
  <scroll-view wx:if="{{subCategoryList.length>0}}" scroll-x="true" class="category-tit" scroll-into-view="{{intoView}}" scroll-with-animation="{{true}}">
    <block wx:for="{{subCategoryList}}" wx:key="categoryId">
      <view class="category-item {{item.categoryId==categoryId? 'on':''}}" bindtap='onSubCategoryTap' id="{{'sw' + item.categoryId}}" data-id="{{item.categoryId}}">{{item.categoryName}}</view>
    </block>
  </scroll-view>
  <!-- 商品列表 -->
  <view class="prod-item" wx:if="{{prodList.length}}" >
    <block wx:for="{{prodList}}" wx:key="prodId">
      <prod item="{{item}}"></prod>
    </block>
  </view>

  <!-- 空 || 加载完毕 -->
  <view class="empty {{current==pages? 'all': ''}}"  wx:if="{{prodList.length==0 || current==pages}}">
    <view class="empty-icon" wx:if="{{prodList.length==0}}">
      <image src="../../images/icon/empty.png"></image>
    </view>
    <view class="empty-text">{{prodList.length==0? '此分类下暂无商品':'已经到底啦~'}}</view>
  </view>
</view>