35fc57e8de
AI 从底部弹层改成独立页面 pages/ai/ai: - 整屏聊天,输入框固定在底部,不再是「问题都打不完」的小格子 - 回复逐字吐出(30ms/2 字),点一下可跳过 - 会话 session 从 sheet 改为 chat,历史拉 50 条 - 组件里对应的 ai 分支和 aiMessages/aiInput/sendAI 一并删掉, 避免两套实现并存 快速记录九个入口逐个排查,修掉 6 处: 1. 疫苗/驱虫的默认日期写死成 2026-07-21 / 2026-07-15,早已是过去的 日期 —— 改成打开时按今天 +30 / +90 天算 2. 异常观察没选症状时,optIdx 返回 0 会被当成选了「呕吐」,等于替 用户瞎填 —— 加 optPicked 判断,没选就提示 3. 体重为空时会静默存成「上次的体重」,凭空造一条假数据 —— 改为必填校验 4. 消费金额为空会存成 ¥0 —— 必填校验 5. 用药药品名为空 —— 必填校验 6. 照片弹层里「模拟上传预览」是没删掉的假文案 顺带清理:保存按钮上的 data-text / data-icon 从来没被读过(onSave 只用 buildRecord 的返回值),是纯误导的死属性,删掉。我上一条 commit 把它们 说成「写库值」是说错了 —— 真正写库的是 buildRecord 里的 icon 字段,那部分 仍然没动。 导航栏原来是一整条半透明色块,底边和页面渐变硬碰硬,屏幕上横着一道接缝。 改成上实下虚的渐变,并用同一条 mask 把毛玻璃一起淡出(只淡背景不淡 blur 的话,接缝会从色差变成糊边)。返回键做成圆形,和右上角胶囊视觉对称。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
102 lines
4.5 KiB
Plaintext
102 lines
4.5 KiB
Plaintext
<nav-bar title="肉垫计划"></nav-bar>
|
||
|
||
<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>
|
||
|
||
<pet-switch bind:add="onAddPet"></pet-switch>
|
||
|
||
<!-- 门面:完成度环 + 当下状态。点进去编辑档案 -->
|
||
<view class="card hero-card" bindtap="onEditPet">
|
||
<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">{{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>
|