Files
fitness-coach/miniprogram/pages/plan-select/plan-select.wxml
wm ff3a120b55 feat(plan): 新增「加入计划」选择器页 + 增强官方计划浏览,修复返回不刷新
1) 新增 pages/plan-select(加入我的计划选择器,替换详情页 actionSheet)
   - 默认展示我全部计划(浏览,不再强制搜索),支持 最近创建/动作最多 排序 + 名称搜索
   - 点选即把动作加入该计划并返回;无计划时引导新建
   - 入口接在 detail 页「加入计划」(无 planId 时 navigate 至此)
2) 增强 pages/collection(官方训练计划)
   - 默认展示全部分级,新增 等级筛选 chips + 名称搜索(均用现有字段,不改后端)
   - 筛选/搜索纯前端,viewGroups 驱动渲染
3) 修复 plan-detail 从「添加动作」返回后列表不刷新(上轮已单独提交 7ff55a6)
4) app.json 注册 plan-select 页面
2026-07-23 14:15:41 +08:00

57 lines
2.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<view class="page">
<navbar title="加入计划" show-back />
<view class="hint" wx:if="{{exerciseName}}">将动作「{{exerciseName}}」加入以下计划:</view>
<view class="filterbar">
<scroll-view scroll-x class="filterbar__scroll">
<chip label="全部" value="all" active="{{filter === 'all'}}" bind:select="onFilter" />
<chip label="最近创建" value="recent" active="{{filter === 'recent'}}" bind:select="onFilter" />
<chip label="动作最多" value="count" active="{{filter === 'count'}}" bind:select="onFilter" />
</scroll-view>
</view>
<view class="searchbar">
<view class="searchbar__box">
<fc-icon name="search" size="28" color="var(--text-2)" />
<input
class="searchbar__input"
placeholder="搜索计划名称"
placeholder-class="ph"
value="{{keyword}}"
confirm-type="search"
bindinput="onSearch" />
</view>
</view>
<view class="section" style="padding-top: 8rpx;">
<view wx:if="{{status === 'list'}}" class="grid">
<view
class="grid__item"
wx:for="{{plans}}"
wx:key="id"
bindtap="onSelect"
data-id="{{item.id}}"
data-name="{{item.name}}">
<plan-card plan="{{item}}" />
</view>
</view>
<view wx:elif="{{status === 'empty'}}" class="empty-box">
<view class="empty-box__emoji"><fc-icon name="clipboard-list" size="64" color="var(--text-3)" /></view>
<view class="empty-box__t">还没有计划,先创建一个吧</view>
<view class="empty-box__btn" bindtap="onCreate"> 新建计划</view>
</view>
<view wx:elif="{{status === 'error'}}" class="empty-box">
<view class="empty-box__emoji"><fc-icon name="alert-circle" size="64" color="var(--danger)" /></view>
<view class="empty-box__t">{{errorMsg}}</view>
<view class="empty-box__btn" bindtap="onRetry">重新加载</view>
</view>
<view wx:else class="empty">加载中…</view>
</view>
<view style="height: 60rpx;"></view>
</view>