Files
fitness-coach/miniprogram/pages/category/category.wxml

52 lines
1.9 KiB
Plaintext

<view class="page">
<navbar title="{{title}}" show-back />
<view class="section" style="padding-top: 8rpx;">
<view wx:if="{{values.length}}" class="filterbar" style="top: calc({{statusBarHeight}}px + 88rpx);">
<filter-bar
items="{{values}}"
multiple="{{true}}"
title="{{dimTitle}}"
placeholder="全部类型"
bind:change="onPrimaryChange" />
<view wx:if="{{secondaryList.length}}" class="filterbar__sub">
<view class="filterbar__subhead">
<text class="filterbar__sublabel">{{secondaryLabel}}</text>
<text wx:if="{{secondarySelected.length}}" class="filterbar__clear" bindtap="onSecondaryClear">清除 ({{secondarySelected.length}})</text>
</view>
<filter-bar
items="{{secondaryList}}"
multiple="{{true}}"
title="{{secondaryLabel}}"
placeholder="筛选{{secondaryLabel}}"
bind:change="onSecondaryChange" />
</view>
</view>
<view wx:else class="filterbar__loading muted">{{ loading ? '加载分类中…' : '暂无分类' }}</view>
<view class="count muted" wx:if="{{!loading}}">共 {{total}} 个动作</view>
<view class="grid" wx:if="{{exercises.length}}">
<view class="grid__item" wx:for="{{exercises}}" wx:key="id">
<exercise-card exercise="{{item}}" catch:tap="onExercise" />
</view>
</view>
<view wx:if="{{exercises.length}}" class="loadmore">
<view wx:if="{{loadingMore}}" class="loadmore__loading">
<view class="spinner"></view>
<text>加载中…</text>
</view>
<view wx:elif="{{!hasMore}}" class="loadmore__end muted">已经到底啦</view>
<view wx:else class="loadmore__hint muted">上拉加载更多</view>
</view>
<view wx:elif="{{!loading}}" class="empty">暂无数据</view>
<view wx:else class="empty">加载中…</view>
</view>
<view style="height: 160rpx;"></view>
<bottom-nav active="category" />
</view>