feat(首页头图): 按预产期推算星座,孕囊右下角挂「xx宝宝」玻璃小牌 (v26100424)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-04 08:40:36 +00:00
parent 62d885ab72
commit d01a617ec5
4 changed files with 50 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26100423';
var VER = '26100424';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -1219,7 +1219,8 @@
syncPregnancy 有好几个提前 return 的分支,所以用微任务等它整个跑完再发,拿到的是最终状态。 */
function pubPreg() {
const d = { week: (state.postpartum || state.pregEmpty) ? null : state.week, day: state.day,
postpartum: !!state.postpartum, empty: !!state.pregEmpty };
postpartum: !!state.postpartum, empty: !!state.pregEmpty,
due: (state.due && !state.pregEmpty) ? [state.due.getFullYear(), state.due.getMonth() + 1, state.due.getDate()] : null }; // 2026-10-04 头图星座牌按预产期算
window.__mbPreg = d;
window.dispatchEvent(new CustomEvent('mb-preg', { detail: d }));
}