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:
@@ -25,8 +25,10 @@
|
||||
预览站想临时看效果用 ?gift=1 */
|
||||
var pvSite = /\/mama-box-preview\//.test(location.pathname) && /[?&#]gift=1/.test(location.search + location.hash);
|
||||
if (!pvSite) try { de.classList.toggle('gift-off', localStorage.getItem('mmbox.gift.v1') === '0'); } catch (e) {}
|
||||
if (!pvSite) fetch('/api/mp/public/mama-box/config', { cache: 'no-store' })
|
||||
.then(function (r) { return r.json(); })
|
||||
/* 11-08:giftEnabled 和下面的 ugcEnabled 在同一个 /config 里,原来各发一次 → 合成一个请求 */
|
||||
var cfgP = null;
|
||||
function cfg() { return cfgP || (cfgP = fetch('/api/mp/public/mama-box/config', { cache: 'no-store' }).then(function (r) { return r.json(); })); }
|
||||
if (!pvSite) cfg()
|
||||
.then(function (j) {
|
||||
var g = !(j && j.result && j.result.giftEnabled === false);
|
||||
de.classList.toggle('gift-off', !g);
|
||||
@@ -47,8 +49,7 @@
|
||||
}
|
||||
window.__mbUgcReady = new Promise(function (res) {
|
||||
var t = setTimeout(function () { res(null); }, 4000);
|
||||
fetch('/api/mp/public/mama-box/config', { cache: 'no-store' })
|
||||
.then(function (r) { return r.json(); })
|
||||
cfg()
|
||||
.then(function (j) { clearTimeout(t); res(!!(j && j.result && j.result.ugcEnabled)); })
|
||||
.catch(function () { clearTimeout(t); res(null); });
|
||||
}).then(function (v) {
|
||||
|
||||
Reference in New Issue
Block a user