category.ttml 2.98 KB

<genderSwitcher data="{{currentChannelId}}" bindswitchChannel="switchChannel"></genderSwitcher>

<view class="s"></view>
<scroll-view class="left-view" style="height:{{scrollHeight}}px;" scroll-y>

    <view class="category-item " bindtap="onBrandItemSelected" >
      <view class="item-left"/>
      <view class="item-name">品牌</view>
      <view class="divide-line" />
    </view>

  <block tt:for="{{categoryList[currentChannelId]}}" tt:key="{{item.category_id}}">
    <view class="category-item {{currentCateId == item.category_id ? 'selected' : ''}}" data-id="{{item.category_id}}" data-name="{{item.category_name}}" data-index="{{index}}" bindtap="onCategoryItemSelected" >
      <view class="item-left"/>
      <view class="item-name">{{item.category_name}}</view>
      <view class="divide-line" />
    </view>
  </block>
</scroll-view>

<scroll-view class="right-view" style="height:{{scrollHeight}}px;" scroll-y>
  <view tt:if="{{currentSubCateData.salesInfo && currentSubCateData.salesInfo.length > 0}}" class="category-block">
    <view class="category-block-header"> — 热门推荐 — </view>
    <view class="category-block-body">
      <block tt:for="{{currentSubCateData.salesInfo}}" tt:key="{{item.category_id}}">
        <view class="category-item-block" data-url="{{item.url}}" data-cate_id="{{item.category_id}}"data-f_id="1001" bindtap="onHotRecommendItemTapped">
          <image src="{{item.default_images}}" class="category-item-img"></image>
          <view class="category-item-name">{{item.category_name}}</view>
        </view>
      </block>
    </view>
  </view>

  <view tt:if="{{currentSubCateData.sortInfo && currentSubCateData.sortInfo.length > 0}}" class="category-block">
    <view class="category-block-header"> — 全部{{currentCateValue}} — </view>
    <view class="category-block-body">
      <block tt:for="{{currentSubCateData.sortInfo}}" tt:key="{{item.category_id}}">
        <view class="category-item-block" data-data="{{item}}" bindtap="onCategoryItemTapped">
          <image src="{{item.default_images}}" class="category-item-img"></image>
          <view class="category-item-name">{{item.category_name}}</view>
        </view>
      </block>
      <view class="category-item-block" data-id="{{currentCateId}}"  bindtap="onCategoryMoreTapped">
        <view class="category-item-more">MORE</view>
      </view>
    </view>
  </view>

  <view tt:if="{{currentSubCateData.brandInfo && currentSubCateData.brandInfo.length > 0}}" class="category-block">
    <view class="category-block-header"> — 热门品牌 — </view>
    <view class="category-block-body">
      <block tt:for="{{currentSubCateData.brandInfo}}" tt:key="{{item.id}}">
        <view class="brand-item-block" data-data="{{item}}" bindtap="onHotBrandItemTapped">
          <image src="{{item.brand_ico}}" class="brand-item-img"></image>
          <view class="brand-item-name">{{item.brand_name}}</view>
        </view>
      </block>
    </view>
  </view>
</scroll-view>

<loading tt:if="{{isFetching}}">加载中</loading>