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}} 件 -