category.wxml 2.82 KB
<!--category.wxml-->
<import src="./genderSwitcher.wxml"/>

<template is='genderSwitcher' data='{{currentChannelId}}'/>

<view class="s"></view>
<scroll-view class="left-view" style="height:{{scrollHeight}}px;" scroll-y>
  <block wx:for="{{categoryList[currentChannelId]}}" wx: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 wx:if="{{currentSubCateData.salesInfo && currentSubCateData.salesInfo.length > 0}}" class="category-block">
    <view class="category-block-header"> — 热门推荐 — </view>
    <view class="category-block-body">
      <block wx:for="{{currentSubCateData.salesInfo}}" wx: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 wx:if="{{currentSubCateData.sortInfo && currentSubCateData.sortInfo.length > 0}}" class="category-block">
    <view class="category-block-header"> — 全部{{currentCateValue}} — </view>
    <view class="category-block-body">
      <block wx:for="{{currentSubCateData.sortInfo}}" wx: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 wx:if="{{currentSubCateData.brandInfo && currentSubCateData.brandInfo.length > 0}}" class="category-block">
    <view class="category-block-header"> — 热门品牌 — </view>
    <view class="category-block-body">
      <block wx:for="{{currentSubCateData.brandInfo}}" wx: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 wx:if="{{isFetching}}">加载中</loading>