- chip 组件 triggerEvent 原为 'tap'(微信原生触摸事件名),嵌在 scroll-view scroll-x 内时手势可能被当滚动消费,导致 onValue 收不到 e.detail.value -> 不筛选 -> 仍显示全部动作 - 改为非原生事件名 'select',category.wxml 绑定同步改 bind:select - 选中态配色从旧金色(gold-soft/gold-2/gold-line)换成 Volt 绿(accent-soft/accent/accent-ring)+加粗,当前分类一眼可见 - 前端筛选逻辑与后端筛选均经沙箱+真机 API 验证正确(bodyPart=chest/back 返回不同数据)
30 lines
968 B
Plaintext
30 lines
968 B
Plaintext
<view class="page">
|
|
<navbar title="{{title}}" show-back />
|
|
|
|
<view class="section" style="padding-top: 8rpx;">
|
|
<scroll-view wx:if="{{values.length}}" scroll-x class="filterbar">
|
|
<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 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:elif="{{!loading}}" class="empty">暂无数据</view>
|
|
<view wx:else class="empty">加载中…</view>
|
|
</view>
|
|
|
|
<view style="height: 160rpx;"></view>
|
|
<bottom-nav active="category" />
|
|
</view>
|