Compare commits
1 Commits
ba2d9245ef
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a76696c37b |
@@ -5,9 +5,6 @@ const auth = require('../../utils/auth');
|
||||
const TYPES = ['weekly', 'monthly', 'yearly'];
|
||||
const TYPE_LABELS = ['周计划', '月计划', '年计划'];
|
||||
|
||||
// 个人历史卡片里最多展示的缩略图数量,其余图片在「查看详情」弹层里看全部
|
||||
const HISTORY_THUMB_LIMIT = 2;
|
||||
|
||||
// 说明:本页所有「切换状态 + 紧跟一次加载」的流程,都要求把 loading 合并进
|
||||
// 调用方那一次 setData(加载函数传 silent=true),不要在同一个 tick 里连发两次
|
||||
// setData —— 否则会触发 "recursive update detected: a data update is applying
|
||||
@@ -64,11 +61,19 @@ Page({
|
||||
setTimeout(() => wx.switchTab({ url: '/pages/profile/profile' }), 500);
|
||||
return;
|
||||
}
|
||||
// 从提交/修改页返回(plan-submit 保存成功后写入 dirty 标记)时,除了刷新总览,
|
||||
// 还要刷新「个人」tab 的历史列表:否则停留在个人 tab 时,刚提交/修改的内容
|
||||
// 不会回显,列表会一直显示提交前的旧数据。
|
||||
const dirty = !!wx.getStorageSync('plan_overview_dirty');
|
||||
wx.removeStorageSync('plan_overview_dirty');
|
||||
this.setData({ view: 'overview' });
|
||||
// 先加载周期列表,再加载总览(总览接口会返回 is_teacher)
|
||||
this.loadPeriods().then(() => {
|
||||
this.loadOverview();
|
||||
return this.loadOverview();
|
||||
}).then(() => {
|
||||
if (dirty && !this.data.isTeacher) {
|
||||
return this.loadHistory();
|
||||
}
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.error('plan page init error:', err);
|
||||
@@ -286,8 +291,8 @@ Page({
|
||||
const all = api.attachmentThumbs(item);
|
||||
return {
|
||||
...item,
|
||||
// 卡片里只铺前 2 张缩略图,弹层用 allThumbs 看全部
|
||||
thumbs: all.slice(0, HISTORY_THUMB_LIMIT),
|
||||
// 卡片直接铺全部缩略图;allThumbs 仍保留给详情弹层(现在两者一致)
|
||||
thumbs: all,
|
||||
allThumbs: all,
|
||||
statusColor: item.status === '未完成' ? '#C67B30' : '#2E7D32',
|
||||
statusBg: item.status === '未完成' ? '#FFF3E6' : '#E8F4EB',
|
||||
|
||||
@@ -12,8 +12,8 @@ function _getBaseUrls() {
|
||||
case 'develop':
|
||||
// 开发版:本地服务
|
||||
return {
|
||||
//baseUrl: 'https://test.muguaclub.cn/clock',
|
||||
baseUrl: 'http://localhost:8000',
|
||||
baseUrl: 'https://test.muguaclub.cn/clock',
|
||||
//baseUrl: 'http://localhost:8000',
|
||||
staticUrl: 'https://test.muguaclub.cn',
|
||||
h5Url: 'https://test.muguaclub.cn'
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user