首页百宝箱计算器轮换加入新 10 个(按孕周段);头图创意效果图放 demo/hero-ideas(v26110402)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-11-04 04:30:13 +00:00
parent 2d779f1b4a
commit 0eeb70a4f3
29 changed files with 106 additions and 67 deletions

View File

@@ -9,7 +9,7 @@
if (/[?&]kit=0(?:&|$)/.test(location.search)) return;
var box = document.getElementById('kit'), sec = document.getElementById('kitHome');
if (!box || !sec) return;
var V = '26110401';
var V = '26110402';
var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/kit.css?v=' + V; document.head.appendChild(l);
document.documentElement.classList.add('has-kit');
@@ -43,7 +43,7 @@
sec.classList.remove('hide');
function setCnt(k, t) { var e = box.querySelector('.e-' + k + ' em'); if (e) e.firstChild.nodeValue = t; }
function setNum(k, n) { var e = box.querySelector('.e-' + k + ' .kit-n i'); if (e && n) e.textContent = wanX(n); }
/* 人数口径(11-03 改):测过 = 30 个测试 gcTested 之和 × .456;看过 = 「此刻」总人数 × .574;算过 = 4 个计算器 heat 之和 × 总人数(同 topic/jisuan) */
/* 人数口径(11-03 改):测过 = 30 个测试 gcTested 之和 × .456;看过 = 「此刻」总人数 × .574;算过 = CALC 全部计算器 heat 之和 × 总人数(同 topic/jisuan) */
function nums() {
/* 11-03 用户:「三个入口的人数太大,几十万就行,要有零有整」→ 系数压到几十万(测过 ≈68 万 / 看过 ≈87 万 / 算过 ≈50 万),且一律带一位小数(wanX)。
仍不小于下面列表里单条的最大值(单个测试 ≤12 万、单条百问 ≤64 万、单个计算器 ≤18 万),口径不打架。模拟数,12-31 复核 */
@@ -67,9 +67,20 @@
/* 计算器(同 topic/jisuan 列表;heat 也同那页) */
var CALC = [
{ q: '生娃到底要花多少钱?一键算清', h: 'topic/huafei/', heat: .118 },
{ q: '预产期是哪天?还有几天见面', h: 'topic/yuchanqi-js/', heat: .083 }, /* 11-04 用户:孕期增重是记录工具不是计算器 → 换成新做的预产期计算器 */
{ q: '胎儿现在多重?填 B 超数估一估', h: '/taier-guzhong/', heat: .071, gate: 15 },
{ q: '产假能休多少天?哪天回去上班', h: 'topic/zhichang/', heat: .062, cm: 1 } /* cm:带 calc=1,进去第一屏就是计算器(11-03) */
{ q: '预产期是哪天?还有几天见面', h: 'topic/yuchanqi-js/', heat: .083, b: [1, 2, 0] }, /* 11-04 用户:孕期增重是记录工具不是计算器 → 换成新做的预产期计算器 */
{ q: '胎儿现在多重?填 B 超数估一估', h: '/taier-guzhong/', heat: .071, gate: 15, b: [4, 5] },
{ q: '产假能休多少天?哪天回去上班', h: 'topic/zhichang/', heat: .062, cm: 1, b: [4, 5, 6] }, /* cm:带 calc=1,进去第一屏就是计算器(11-03) */
/* 11-04 用户:「首页这 6 条也加上新的计算器」→ b = 适合的孕周段(同上 QZ_POOL 段号),第二条计算器从本段可用的里按天轮换 */
{ q: '今天孕几周几天?宝宝像什么', h: 'topic/yunzhou-js/', heat: .076, b: [1, 2, 3] },
{ q: '每次产检哪天去、查什么?', h: 'topic/chanjian-js/', heat: .069, b: [1, 2, 3, 4] },
{ q: '孕期胖多少才合适?', h: 'topic/zengzhong-js/', heat: .058, b: [2, 3, 4] },
{ q: '宝宝会是什么血型?', h: 'topic/xuexing-js/', heat: .066, b: [2, 3, 4] },
{ q: '宝宝长大能有多高?', h: 'topic/shengao-js/', heat: .079, b: [3, 4, 5] },
{ q: '坐月子要花多少钱?', h: 'topic/yuezi-js/', heat: .064, b: [4, 5, 6] },
{ q: '产假期间能领多少生育津贴?', h: 'topic/jintie-js/', heat: .072, b: [5, 6] },
{ q: '育儿补贴你家能领多少?', h: 'topic/butie-js/', heat: .081, b: [6, 0] },
{ q: '有宝宝一年能少交多少税?', h: 'topic/geshui-js/', heat: .047, b: [6, 0] },
{ q: '出生后哪些手续要在哪天前办?', h: 'topic/shouxu-js/', heat: .043, b: [6, 0] }
];
var QA = null, day = Math.floor((Date.now() + 288e5) / 864e5);
function band() { var p = window.__mbPreg || {}; return p.postpartum || !p.week ? 0 : (window.__mbQaBand ? window.__mbQaBand(p.week) : 0); }
@@ -87,10 +98,11 @@
out.qa.push({ q: x.q, href: x.href + location.search + location.hash, n: window.__mbQaViews ? window.__mbQaViews(+x.heat || .03) : total() * (+x.heat || .03), u: '人看过' /* 11-03 同百问列表页口径 */ });
});
}
var cl = CALC.filter(function (x) { return !(x.gate && wk && wk < x.gate); });
if (b >= 5) cl = [cl[cl.length - 1]].concat(cl.slice(0, -1)); /* 孕 29 周起产假排前 */
/* 11-04 用户:「生娃计算器放第一个,标个火」→ 计算器两条里 huafei 必在,排到 6 条最前(hot) */
var hf = CALC[0]; cl = [hf].concat(cl.filter(function (x) { return x !== hf; }));
/* 11-04 用户:「生娃计算器放第一个,标个火」→ 计算器两条里 huafei 必在,排到 6 条最前(hot);
第二条从适合本孕周段(x.b)的计算器里按天轮换(11-04 加了 10 个新计算器) */
var hf = CALC[0], cp = CALC.filter(function (x) { return x !== hf && x.b && x.b.indexOf(b) >= 0 && !(x.gate && wk && wk < x.gate); });
if (!cp.length) cp = CALC.filter(function (x) { return x !== hf && !x.gate; });
var cl = [hf, cp[day % cp.length]];
cl.slice(0, 2).forEach(function (x) { out.js.push({ q: x.q, href: x.h + (x.cm ? (location.search ? location.search + '&' : '?') + 'calc=1' : location.search) + location.hash, n: total() * x.heat, u: '人算过' }); });
var r = [];
if (out.js[0]) r.push(Object.assign({ c: 'js', hot: 1 }, out.js[0]));
@@ -153,6 +165,16 @@
'topic/huafei/': ['算出养到 18 岁约 <b>62.8 万</b>', '算出头一年约 <b>9.6 万</b>', '算出养到 3 岁约 <b>21.4 万</b>', '算出养到 18 岁约 <b>48.5 万</b>'],
'topic/yuchanqi-js/': ['算出还有 <b>96 天</b>见面', '算出现在孕 <b>23 周 + 4 天</b>', '算出预产期在 <b>3 月 12 日</b>', '算出预产期在 <b>4 月 20 日</b>'],
'/taier-guzhong/': ['估出宝宝约 <b>1.6 斤</b>', '估出宝宝约 <b>2.3 斤</b>', '估出宝宝约 <b>3.1 斤</b>'],
'topic/yunzhou-js/': ['算出今天孕 <b>18 周 + 2 天</b>', '算出现在 <b>孕 5 月</b>', '算出宝宝像 <b>一个芒果</b>'],
'topic/chanjian-js/': ['排出下次产检在 <b>12 月 3 日</b>', '排出糖耐在 <b>1 月 8 日</b>前做'],
'topic/zengzhong-js/': ['算出孕期胖 <b>8~14 公斤</b>合适', '算出现在胖得 <b>刚好</b>'],
'topic/xuexing-js/': ['算出宝宝 <b>59%</b> 是 A 型', '算出宝宝可能是 <b>O 型或 B 型</b>'],
'topic/shengao-js/': ['算出宝宝约 <b>175 cm</b>', '算出女儿约 <b>162 cm</b>'],
'topic/yuezi-js/': ['算出月子中心约 <b>4 万</b>', '算出请月嫂约 <b>1.6 万</b>'],
'topic/jintie-js/': ['算出生育津贴约 <b>4.7 万</b>', '算出津贴约 <b>3.2 万</b>'],
'topic/butie-js/': ['算出能领 <b>10800 元</b>', '算出两个孩子领 <b>1.6 万</b>'],
'topic/geshui-js/': ['算出一年少交 <b>2400 元</b>税', '算出一年少交 <b>4800 元</b>税'],
'topic/shouxu-js/': ['排好 <b>11 件</b>出生手续', '查到上户口还剩 <b>6 天</b>'],
'topic/zhichang/': ['算出产假能休 <b>178 天</b>(广东)', '算出产假能休 <b>158 天</b>(上海)', '算出产假能休 <b>188 天</b>(河南)', '算出产假能休 <b>180 天</b>(吉林)']
};
var lvT = 0;