v26110805 首页孕期假数据与加载性能修复——接口未返回/失败时不再按默认预产期显示假孕周(显示正在加载/点击重试);去掉演示名小汤圆/小满妈妈,空昵称小名不提交,孕期未加载时禁止保存;预产期范围校验(今天-14天~+280天,仅改动时校验);「已连续记录42天」写死值改为「和宝宝一起走过N天」,去掉我的页设计稿占位;/profile+/pregnancy 改为脚本解析时预取(原来等 window load 约10秒后才发),birth-flow 复用、ugc 的 /config 合并;首页广场图改用缩略图(首页图片约4MB→1.9MB)。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -395,6 +395,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
var loadedOnce = false;
|
||||
function load() {
|
||||
if (DEMO) {
|
||||
var t = midnight(new Date());
|
||||
@@ -405,10 +406,14 @@
|
||||
mountCards(); maybeAsk(); return;
|
||||
}
|
||||
if (!openid) return;
|
||||
Promise.all([
|
||||
/* 11-08:首次加载复用 app.js 已经发出去的 /profile + /pregnancy(window.__mbPfPre,顺序是 [profile, pregnancy]),
|
||||
不再同一时刻各拉一遍;之后的重读(回到前台、保存资料后)照旧自己拉 */
|
||||
var pre = !loadedOnce && window.__mbPfPre && window.__mbPfPre.openid === openid ? window.__mbPfPre.p : null;
|
||||
loadedOnce = true;
|
||||
(pre ? pre.then(function (r) { return [r[1], r[0]]; }, function () { return [null, null]; }) : Promise.all([
|
||||
getJSON(API + 'mama-box/pregnancy?openid=' + encodeURIComponent(openid)),
|
||||
getJSON(API + 'mama-box/profile?openid=' + encodeURIComponent(openid))
|
||||
]).then(function (r) {
|
||||
])).then(function (r) {
|
||||
apply(r[0] && r[0].code === 200 ? r[0].result : null, r[1] && r[1].code === 200 ? r[1].result : null);
|
||||
mountCards(); maybeAsk();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user