<!--pages/mine/shop/choose.wxml-->
<cu-custom isBack="{{true}}">
  <view slot="content">商品类目</view>
</cu-custom>
<scroll-view style="margin-bottom:64rpx;margin-top:10rpx" refresher-enabled="true" refresher-threshold="{{50}}"
  refresher-background="#fff" bindrefresherrefresh="dorefreshList" refresher-triggered="{{isRefreshing}}">
  <!-- 第一级 -->
  <view class="hint-title">
    <image src="../../../../images/title-bg.png" mode="scaleToFill"></image>
    <text>商品类目(一级)</text>
  </view>
  <view class="cu-card" wx:if="{{catalogOneList.length>0}}">
    <view class="cu-item">
      <view class="padding-sm flex flex-wrap">
        <view class="padding-xs" wx:for="{{catalogOneList}}" wx:key="index">
          <view class="cu-capsule radius" data-item="{{item}}" data-index="{{index}}" data-type="1"
            bindtap="selectItem">
            <view class="cu-tag {{item.isSel ? 'bg-red':'bg-grey'}}">
              <text class="{{item.isSel ? 'cuIcon-apps':'cuIcon-apps'}}"></text>
            </view>
            <view class="cu-tag {{item.isSel? 'line-red':'line-gray'}}">
              {{item.name}}
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
  <van-empty description="暂无数据" wx:else />
  <!-- 第二级 -->
  <view class="hint-title">
    <image src="../../../../images/title-bg.png" mode="scaleToFill"></image>
    <text>商品类目(二级)</text>
  </view>
  <view class="cu-card" wx:if="{{catalogTwoList.length>0}}">
    <view class="cu-item">
      <view class="padding-sm flex flex-wrap">
        <view class="padding-xs" wx:for="{{catalogTwoList}}" wx:key="index">
          <view class="cu-capsule radius" data-item="{{item}}" data-index="{{index}}" data-type="2"
            bindtap="selectItem">
            <view class="cu-tag {{item.isSel ? 'bg-red':'bg-grey'}}">
              <text class="{{item.isSel ? 'cuIcon-apps':'cuIcon-apps'}}"></text>
            </view>
            <view class="cu-tag {{item.isSel? 'line-red':'line-gray'}}">
              {{item.name}}
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
  <van-empty description="暂无数据" wx:else />
  <!-- 第三级 -->
  <view class="hint-title">
    <image src="../../../../images/title-bg.png" mode="scaleToFill"></image>
    <text>商品类目(三级)</text>
  </view>
  <view class="cu-card" wx:if="{{catalogThirdList.length>0}}">
    <view class="cu-item">
      <view class="padding-sm flex flex-wrap">
        <view class="padding-xs" wx:for="{{catalogThirdList}}" wx:key="index">
          <view class="cu-capsule radius">
            <view class="cu-tag {{item.isSel ? 'bg-red':'bg-grey'}}">
              <text class="{{item.isSel ? 'cuIcon-apps':'cuIcon-apps'}}"></text>
            </view>
            <view class="cu-tag {{item.isSel? 'line-red':'line-gray'}}" data-item="{{item}}" data-index="{{index}}"
              data-type="3" bindtap="selectItem">
              {{item.name}}
            </view>
            <view class="cu-tag bg-red text-white" data-item="{{item}}" data-index="{{index}}" bindtap="doDel">
              删除
            </view>
            <view class="cu-tag line-red" data-item="{{item}}" data-index="{{index}}" bindtap="doEdit">
              编辑
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
  <van-empty description="暂无数据" wx:else />
</scroll-view>

<view class="padding-xs foot bg-white">
  <button class="cu-btn bg-blue" style="width:100%" bindtap="toAddPage">添加</button>
</view>