From 2aaae2b917e4d3be038b183551a83cc35d26ce06 Mon Sep 17 00:00:00 2001 From: Blizzard Date: Thu, 30 Jul 2026 11:12:46 +0800 Subject: [PATCH] =?UTF-8?q?style(fe):=20=E8=AE=A1=E5=88=92=E9=A1=B5?= =?UTF-8?q?=E5=8F=AA=E7=95=99=E6=97=A5=E5=8E=86=E5=92=8C=E5=BD=93=E5=A4=A9?= =?UTF-8?q?=E5=AE=89=E6=8E=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 去掉完成度卡和完整路线图。这页的用途是「排/看某一天要做什么」, 完成度是个统计(报告页的活),完整路线图和日历在说同一件事、 只是换了个排法——两张卡加起来把日历挤到了第二屏。 跟着清掉 doneCount / allOpen / toggleAll / dateLabel 和一个没人绑的 openSheet (路线图里的 pk-body 原来绑它,现在那块没了)。 一个前提确认过:删掉路线图不会让节点变孤儿。模板从计划开始日生成 day 0-30, 正好落在本月和下月,两个月都能从日历翻到。只有很旧的计划(开始日在上个月之前) 会有节点翻不到,那些已经是过去的事。 Co-Authored-By: Claude Opus 5 --- pets-fe/pages/plan/plan.js | 13 +------------ pets-fe/pages/plan/plan.wxml | 29 ----------------------------- 2 files changed, 1 insertion(+), 41 deletions(-) diff --git a/pets-fe/pages/plan/plan.js b/pets-fe/pages/plan/plan.js index 416c2d5..0f8440f 100644 --- a/pets-fe/pages/plan/plan.js +++ b/pets-fe/pages/plan/plan.js @@ -50,7 +50,6 @@ Page({ data: { pet: {}, plan: null, - doneCount: 0, cells: [], monthOff: 0, monthLabel: '', @@ -61,7 +60,6 @@ Page({ selDate: '', selLabel: '', dayTasks: [], - allOpen: false, editShow: false, editId: '', form: { title: '', date: '', description: '', daily: false }, @@ -97,7 +95,7 @@ Page({ .catch(() => this.setData({ plan: null, cells: [], dayTasks: [] })); }, apply(plan) { - const tasks = (plan.tasks || []).map((t) => ({ ...t, dateLabel: fmtMD(t.date) })); + const tasks = plan.tasks || []; const byDate = {}; tasks.forEach((t) => { if (!t.date) return; @@ -106,7 +104,6 @@ Page({ this._byDate = byDate; this.setData({ plan: { ...plan, tasks }, - doneCount: tasks.filter((t) => t.done).length, // 能排的区间:不早于计划开始日,不晚于下月月底。和后端 dayOffset 的校验一致 pickStart: (plan.start_date || '').slice(0, 10), pickEnd: monthEnd(1), @@ -151,9 +148,6 @@ Page({ if (d) this.selectDay(d); }, - toggleAll() { - this.setData({ allOpen: !this.data.allOpen }); - }, toggleTask(e) { api .togglePlanTask(e.currentTarget.dataset.id) @@ -230,11 +224,6 @@ Page({ }); }, - openSheet(e) { - const type = e.currentTarget.dataset.type; - if (!type) return; - this.setData({ sheetType: type, sheetShow: true }); - }, closeSheet() { this.setData({ sheetShow: false }); }, diff --git a/pets-fe/pages/plan/plan.wxml b/pets-fe/pages/plan/plan.wxml index f802031..ef7680d 100644 --- a/pets-fe/pages/plan/plan.wxml +++ b/pets-fe/pages/plan/plan.wxml @@ -12,15 +12,6 @@ - - - {{pet.name}}的 30 天计划 - {{plan.completion_pct || 0}}% - - 完成度{{plan.completion_pct || 0}}% - - - @@ -64,26 +55,6 @@ 这天还没有安排,点右上角加一件 - - - - 完整路线图 - {{allOpen ? '收起' : '展开全部'}} - - - - {{item.day_label}}{{item.dateLabel}} - - - - - {{item.title}}{{item.description}} - - - 暂无计划 - - 共 {{plan.tasks.length || 0}} 件事,已完成 {{doneCount}} 件 -