535ef08da7
## 评论图片传了等于没传 上次只做了一半:model 加了 Images 字段、前端做了上传 UI,但 handler 的 commentReq 没有 images、service 的 CreateComment 连 参数都没有,图片上传完就丢了;评论列表也从没渲染过图片。 补齐:请求体 → service 落库(JSON 数组) → 列表回显 → 点击大图预览。 实测带两张图的评论和纯文字评论各存各的,互不影响。 ## 宠物切换条吸顶 首页/计划/记录/报告四页的 pet-switch 原本在 scroll-view 里,滚下去 就找不到了。而切宠物是随时要用的动作——多宠用户看着 A 的数据想切到 B,还得先滚回顶部。 移出滚动区,放在导航栏下方做成固定的一条,带毛玻璃和分隔线。首页的 问候语留在滚动区里,滚走就滚走,反正它只在刚进页面时有意义。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
102 lines
4.6 KiB
Plaintext
102 lines
4.6 KiB
Plaintext
<nav-bar title="肉垫计划"></nav-bar>
|
||
|
||
<view class="pet-bar"><pet-switch bind:add="onAddPet"></pet-switch></view>
|
||
|
||
<scroll-view class="page-scroll" scroll-y="{{true}}" enhanced="{{true}}" show-scrollbar="{{false}}">
|
||
<view class="page-body">
|
||
<view class="top-row">
|
||
<view class="greeting">
|
||
<view class="greet-h2">{{summary.greeting || '你好'}}</view>
|
||
<view class="greet-p">今天也要照顾好 {{pet.name}}</view>
|
||
</view>
|
||
<view class="icon-stack">
|
||
<view class="icon-btn" data-type="reminders" bindtap="openSheet"><pt-icon name="bell" size="{{36}}"></pt-icon></view>
|
||
<view class="icon-btn" bindtap="goProfile"><pt-icon name="settings" size="{{36}}"></pt-icon></view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 门面:完成度环 + 当下状态。点进去编辑档案 -->
|
||
<view class="card hero-card" bindtap="onHeroTap">
|
||
<view class="hero-row">
|
||
<stat-ring percent="{{summary.health_pct}}" size="{{168}}">
|
||
<view class="ring-num">{{summary.health_pct}}<text class="ring-unit">%</text></view>
|
||
<view class="ring-cap">完成度</view>
|
||
</stat-ring>
|
||
<view class="hero-main">
|
||
<view class="hero-title">{{pet.name || '还没有毛孩子'}}</view>
|
||
<view class="hero-sub">{{pet.id ? undoneText : '点这里建一份档案,任务和提醒会自动排好'}}</view>
|
||
<view class="chip-row">
|
||
<view wx:for="{{heroChips}}" wx:key="text" class="chip {{item.tone}}">
|
||
<pt-icon name="{{item.icon}}" size="{{22}}"></pt-icon>{{item.text}}
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="hero-meta">{{pet.age}}|{{pet.weight}}|{{pet.stage}}</view>
|
||
</view>
|
||
|
||
<view class="date-strip">
|
||
<view wx:for="{{summary.week}}" wx:key="date"
|
||
class="day {{item.active ? 'active' : ''}} {{item.date === selectedDate ? 'sel' : ''}} {{item.has_dot ? 'has-dot' : ''}}"
|
||
data-date="{{item.date}}" data-active="{{item.active}}" bindtap="onTapDay">
|
||
<text>{{item.weekday}}</text><text class="day-b">{{item.day}}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="card">
|
||
<view class="section-head">
|
||
<view class="sh-title">{{taskLabel}}</view>
|
||
<view class="head-links">
|
||
<view class="link" data-type="manageTasks" bindtap="openSheet">管理</view>
|
||
<view wx:if="{{selectedDate && selectedDate !== todayDate}}" class="link" bindtap="backToToday">回今天</view>
|
||
<view wx:else class="link" bindtap="completeTasks">全部完成</view>
|
||
</view>
|
||
</view>
|
||
<view class="task-list">
|
||
<view wx:for="{{tasks}}" wx:key="title" class="task {{item.done ? 'done' : ''}}" data-index="{{index}}" bindtap="onTapTask">
|
||
<view class="circle"><pt-icon wx:if="{{item.done}}" name="check" size="{{22}}"></pt-icon></view>
|
||
<view class="task-text"><text class="tt-b">{{item.title}}</text><view wx:if="{{item.sub}}" class="tt-p">{{item.sub}}</view></view>
|
||
<view wx:if="{{item.priority}}" class="priority">{{item.priority}}</view>
|
||
</view>
|
||
<view wx:if="{{tasks.length === 0}}" class="empty">这天没有任务记录</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="card">
|
||
<view class="section-head">
|
||
<view class="sh-title">快速记录</view>
|
||
<view class="link" bindtap="goRecord">更多</view>
|
||
</view>
|
||
<view class="quick-grid">
|
||
<view wx:for="{{quickItems}}" wx:key="type" class="quick {{item.tone}}" data-type="{{item.type}}" bindtap="openSheet">
|
||
<pt-icon name="{{item.icon}}" size="{{44}}"></pt-icon>{{item.label}}
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="card">
|
||
<view class="section-head">
|
||
<view class="sh-title">AI 今日建议</view>
|
||
</view>
|
||
<view class="ai-text">{{summary.advice || '正在生成今日建议…'}}</view>
|
||
<view class="btn btn-dark btn-block ai-cta" bindtap="onFab">
|
||
<pt-icon name="ai" size="{{32}}"></pt-icon>问问 AI 养宠助手
|
||
</view>
|
||
</view>
|
||
|
||
<view class="card">
|
||
<view class="section-head">
|
||
<view class="sh-title">新手内容</view>
|
||
<view class="link" bindtap="goLearn">查看</view>
|
||
</view>
|
||
<view wx:if="{{firstArticle}}" class="article-card no-shadow" style="margin-bottom:0" bindtap="openFirstArticle">
|
||
<view class="article-icon"><pt-icon name="{{firstArticle.icon}}" size="{{48}}" fallback="book"></pt-icon></view>
|
||
<view><text class="ac-b">{{firstArticle.title}}</text><view class="ac-p">{{firstArticle.desc}}</view></view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</scroll-view>
|
||
|
||
<fab bind:tap="onFab"></fab>
|
||
<bottom-sheet show="{{sheetShow}}" type="{{sheetType}}" bind:close="closeSheet" bind:saved="onSheetSave"></bottom-sheet>
|