Files
fitness-coach/miniprogram/pages/category/category.wxml
wm 393157e56b feat: 器械分类网格化 + 分类页标题防乱码 + 按器械/部位多维度筛选
- 首页『热门器械』由横滑 chips 改为与『按部位浏览』一致的网格
- 分类页 navbar 标题改由本地分类枚举回写,避免外部传入标题乱码
- 分类页新增二级维度多选筛选:器械维度交叉按部位,其余维度交叉按器械
- 后端 exercises.service 支持 equipment/bodyPart 逗号分隔多值 OR 过滤(向后兼容)
2026-07-24 10:28:40 +08:00

60 lines
2.2 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);">
<scroll-view scroll-x class="filterbar__row">
<chip
wx:for="{{values}}"
wx:key="value"
label="{{item.label}}"
value="{{item.value}}"
active="{{activeValue === item.value}}"
bind:select="onValue" />
<view class="filterbar__spacer"></view>
</scroll-view>
<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>
<scroll-view scroll-x class="filterbar__row">
<chip
wx:for="{{secondaryList}}"
wx:key="value"
label="{{item.label}}"
value="{{item.value}}"
active="{{item.active}}"
bind:select="onSecondary" />
<view class="filterbar__spacer"></view>
</scroll-view>
</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>