fix(plan-detail): onShow 重载,修复从「添加动作」页返回后列表不刷新

- 根因:plan-detail 仅在 onLoad 加载数据;从 search(selectMode) 选完动作返回时
  onLoad 不再触发,导致新增的动作不显示,用户感知为『选择动作后返回页面没更新』。
- 修复:load() 从 onLoad 移至 onShow,首次进入与返回均会刷新;onLoad 仅做参数初始化。
This commit is contained in:
2026-07-23 13:31:48 +08:00
parent 8cf962f662
commit 7ff55a6257

View File

@@ -17,7 +17,11 @@ Page({
const id = query.id || ''; const id = query.id || '';
const h = (app && app.globalData && app.globalData.statusBarHeight) || 20; const h = (app && app.globalData && app.globalData.statusBarHeight) || 20;
this.setData({ statusBarHeight: h, id }); this.setData({ statusBarHeight: h, id });
this.load(); },
onShow() {
// 首次进入与从「添加动作」/「编辑」页返回都会触发,保证选完动作后列表实时刷新
if (this.data.id) this.load();
}, },
load() { load() {