fix(fe): 补齐无宠物状态 + 用户操作失败不再静默
自查发现的四处,都属于「不报错但用户懵」:
1. record/plan/report 三页在 currentPetId 为空时直接 return,留下一堆
空卡片却不解释——用户以为坏了。加统一的 .no-pet 引导块,说清建档后
会有什么,并给一个建档按钮。
2. 首页门面卡在没建档时点击会打开「编辑宠物」的空表单。改成没档案就走
「添加」,文案也跟着变成「点这里建一份档案」。
3. 没建档时在快速记录弹层点「保存」,createAndClose 因为拿不到 petID
直接 close 掉——用户以为存上了,其实什么都没发生。改成明确提示。
4. 用户主动触发的操作失败不再静默:勾任务、全部完成、勾计划节点、点赞
四处的 .catch(() => {}) 换成 toast。后台加载类的静默保持不变——
那些失败了重进页面会自愈,弹 toast 反而是噪音。
事件绑定做了一次全量扫描:18 个 wxml 里所有 bind/catch 绑的方法在对应
js 里都有实现,没有「点了没反应」的死按钮。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const store = require('../../utils/store.js');
|
||||
const api = require('../../utils/api.js');
|
||||
const { toastErr } = require('../../utils/ui.js');
|
||||
|
||||
// "2026-07-04" → "7月4日"
|
||||
function fmtMD(date) {
|
||||
@@ -131,7 +132,7 @@ Page({
|
||||
// 计划明细勾选
|
||||
toggleTimelineTask(e) {
|
||||
const id = e.currentTarget.dataset.id;
|
||||
api.togglePlanTask(id).then(() => this.loadTimeline()).catch(() => {});
|
||||
api.togglePlanTask(id).then(() => this.loadTimeline()).catch((e) => toastErr(e, '操作失败'));
|
||||
},
|
||||
// AI 计划
|
||||
onAiInput(e) {
|
||||
|
||||
Reference in New Issue
Block a user