<view class="container">
  <auth bindlogin="onShow" />
	
  <lip-sync />
  <!-- <view class="search">
    <navigator hover-class="none" url="/pages/search/search" class="input">
      <text class="txt">搜索商品名称</text>
      <image class="icon"></image>
    </navigator>
  </view> -->
  <view class="search-a">
    <view class="search" bindtap="gotoSearch">
      <input placeholder="搜索商品" value="{{keyword}}" bindinput="inputChange" bindconfirm="search" confirm-type="search" type="text"></input>
      <image wx:if="{{imgServer}}" src="{{imgServer + '/search.png'}}"></image>
    </view>
  </view>
  <view class="catalog">
    <scroll-view class="nav" scroll-y="true" scroll-top="{{navtop}}">
      <view class="item {{ currentCategory.id == item.id ? 'active' : ''}}" wx:for="{{navList}}"  data-id="{{item.id}}" data-index="{{index}}" bindtap="switchCate">{{item.name}}</view>
    </scroll-view>
    <scroll-view class="cate" scroll-y="true" scroll-top="{{top}}" bindscroll="scroll" id="cate-layout">
      <view wx:for="{{categorys}}" :key="{{pitem.id}}" wx:for-item="pitem" id="index-nav-{{pitem.id}}">
        <view class="hd">
            <text class="txt">{{pitem.name}}分类</text>
        </view>
        <view class="bd">
            <navigator
              hover-class="none" url="/pages/category/category?id={{item.id}}&title={{pitem.name}}"
              class="item"
              wx:for="{{pitem.subCategoryList}}">
                <view class="icon" style="background-image: url({{item.wap_banner_url}})" ></view>
                <text class="txt">{{item.name}}</text>
            </navigator>
            <view class="no-data" wx-if="{{item.subCategoryList && !item.subCategoryList.length}}">暂无商品</view>
        </view>
      </view>
      <view class="zw"></view>
    </scroll-view>
  </view>
</view>