<view class="container">
  <view class="search">
    <navigator url="/pages/search/search" class="input">
      <van-icon name="search"/>
      <text class="txt">商品搜索, 共{{goodsCount}}款好物</text>
    </navigator>
  </view>
  <view class="catalog">
    <scroll-view class="nav" scroll-y="true">
      <view class="item {{ currentCategory.id == item.id ? 'active' : ''}}" wx:for="{{categoryList}}" wx:key="id" data-id="{{item.id}}" data-index="{{index}}" bindtap="switchCate">{{item.name}}</view>
    </scroll-view>
    <scroll-view class="cate" scroll-y="true">
      <navigator url="url" class="banner">
        <image class="image" src="{{currentCategory.picUrl}}"></image>
        <view class="txt">{{currentCategory.frontName}}</view>
      </navigator>
      <view class="hd">
        <text class="line"></text>
        <text class="txt">{{currentCategory.name}}分类</text>
        <text class="line"></text>
      </view>
      <view class="bd">
        <navigator url="/pages/category/category?id={{item.id}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:key="id" wx:for="{{currentSubCategoryList}}">
          <image class="icon" src="{{item.picUrl}}"></image>
          <text class="txt">{{item.name}}</text>
        </navigator>
      </view>
    </scroll-view>
  </view>
</view>