diff --git a/guangchang/ceshi/index.html b/guangchang/ceshi/index.html
index 1af9c3d..a2a3589 100644
--- a/guangchang/ceshi/index.html
+++ b/guangchang/ceshi/index.html
@@ -3,7 +3,7 @@
-
+
测一测 · 孕妈广场
@@ -322,9 +322,9 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
-
-
-
+
+
+
+
孕妈广场
@@ -294,6 +294,15 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
.ck.gs .ck-wash{background:linear-gradient(180deg,rgba(240,246,255,.86),rgba(230,240,254,.74) 62%,rgba(223,235,253,.35))}
.ck .cv .ck-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 50%}
.csr-i.has-bg{background-size:cover!important;background-position:70% 85%!important;box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.7)}
+/* 11-04 二改(用户:照片压在字后面抢字)→ 图文分开:照片只占卡片上方一条、往下渐隐成本组纯色,标题/题数/按钮全在纯色区,不再叠在照片上 */
+.ck.has-bg .cv{justify-content:flex-start;background:linear-gradient(180deg,var(--c1),var(--c2))}
+.ck.has-bg .cv .ck-wash{display:none}
+.ck.has-bg .cv .ck-bg{inset:0 0 auto 0;height:var(--ph,62px);-webkit-mask-image:linear-gradient(180deg,#000 55%,transparent);mask-image:linear-gradient(180deg,#000 55%,transparent)}
+.ck.has-bg .cv>b{margin-top:calc(var(--ph,62px) - 8px)}
+#more .ck.has-bg .cv{--ph:64px;height:auto;min-height:168px;padding:0 6px 12px}
+#more .c2 .ck.has-bg .cv{--ph:84px;min-height:212px}
+#more .c2 .ck.has-bg .cv:has(.ck-hl){padding-bottom:36px}
+.ck.has-bg .cv .ck-top,.ck.has-bg .cv .dn{z-index:2}
.ck .cv .ck-wm{position:absolute;right:-8px;bottom:-6px;width:62px;height:62px;opacity:.22;transform:rotate(-12deg);pointer-events:none}
.ck .cv .ck-wm svg{width:100%;height:100%}
.ck .cv .ck-wm svg,.ck .cv .ck-wm svg [fill="#fff"]{fill:var(--cb)}.ck .cv .ck-wm svg [stroke="#fff"]{stroke:var(--cb)}
@@ -869,11 +878,11 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
-
-
-
-
-
+
+
+
+
+
+
我的投稿
@@ -107,7 +107,7 @@ main{padding:6px 16px 0}
-
+
-
+
+
@@ -2593,9 +2593,9 @@
-
+
-
+
-
+
diff --git a/js/app.js b/js/app.js
index 231ae6e..c3a4439 100644
--- a/js/app.js
+++ b/js/app.js
@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
- var VER = '26110418';
+ var VER = '26110419';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
diff --git a/js/gch/v4.js b/js/gch/v4.js
index 66aeb9b..4ed27ad 100644
--- a/js/gch/v4.js
+++ b/js/gch/v4.js
@@ -244,5 +244,5 @@
}
/* feed.js 首页默认不加载(index.html 只引了 topics.js),这里按需拉一次 */
if (window.GC_FEED) init();
- else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110418'; fs.onload = fs.onerror = init; document.body.appendChild(fs); }
+ else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110419'; fs.onload = fs.onerror = init; document.body.appendChild(fs); }
})();
diff --git a/js/gch/v6.js b/js/gch/v6.js
index d960c10..ca8712f 100644
--- a/js/gch/v6.js
+++ b/js/gch/v6.js
@@ -6,9 +6,9 @@
(function () {
var sec = document.getElementById('gcHome');
if (!sec) return;
- var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/gch/v4.css?v=26110418';
+ var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/gch/v4.css?v=26110419';
document.head.appendChild(l);
- var s = document.createElement('script'); s.src = 'js/gch/v4.js?v=26110418';
+ var s = document.createElement('script'); s.src = 'js/gch/v4.js?v=26110419';
s.onload = function () { if (sec.querySelector('.g4-foot')) merge(); else sec.addEventListener('gc4-ready', merge, { once: true }); }; /* v4 要先拉 feed.js 才渲染 */
document.body.appendChild(s);
@@ -121,24 +121,28 @@
for (var k = 0; k < c; k++) h += avaEl(LIKE_AVA[avaAt++ % LIKE_AVA.length]);
return '' + h + '';
}
- var likeT = 0;
+ /* 11-04 用户:前 3 条的小头像各自 2~6 秒随机换一个(每条独立计时);原地换(缩小→换图→弹回),个数、点赞数都不动 */
+ var likeT = [];
+ function swapOne(r) {
+ var ims = r.querySelectorAll('.g6-avs img');
+ if (!ims.length) return;
+ var im = ims[Math.floor(Math.random() * ims.length)], on = {}, nx, t = 0;
+ list.querySelectorAll('.g6-avs img').forEach(function (m) { on[m.getAttribute('src')] = 1; });
+ do { nx = LIKE_AVA[avaAt++ % LIKE_AVA.length]; } while (on['assets/img/mom/' + nx + '.jpg'] && ++t < LIKE_AVA.length);
+ im.className = 'sw-o';
+ setTimeout(function () { im.src = 'assets/img/mom/' + nx + '.jpg'; im.className = 'sw-i'; }, 220);
+ }
function likeTick() {
- clearTimeout(likeT);
- likeT = setTimeout(function () {
- var rows = list.querySelectorAll('.g6-nt');
- if (!document.hidden && rows.length && list.offsetParent) {
- /* 11-03 用户:「头像在变,比如 3 个里突然有一个变了;后面点赞数不变」→ 原地换掉其中一个(缩小→换图→弹回),个数、点赞数都不动 */
- var r = rows[Math.floor(Math.random() * rows.length)], ims = r.querySelectorAll('.g6-avs img');
- if (ims.length) {
- var im = ims[Math.floor(Math.random() * ims.length)], on = {}, nx, t = 0;
- list.querySelectorAll('.g6-avs img').forEach(function (m) { on[m.getAttribute('src')] = 1; });
- do { nx = LIKE_AVA[avaAt++ % LIKE_AVA.length]; } while (on['assets/img/mom/' + nx + '.jpg'] && ++t < LIKE_AVA.length);
- im.className = 'sw-o';
- setTimeout(function () { im.src = 'assets/img/mom/' + nx + '.jpg'; im.className = 'sw-i'; }, 220);
- }
- }
- likeTick();
- }, 4000 + Math.random() * 3000);
+ likeT.forEach(clearTimeout); likeT = [];
+ [0, 1, 2].forEach(function (i) {
+ (function loop() {
+ likeT[i] = setTimeout(function () {
+ var r = list.querySelectorAll('.g6-nt')[i];
+ if (r && !document.hidden && list.offsetParent) swapOne(r);
+ loop();
+ }, 2000 + Math.random() * 4000);
+ })();
+ });
}
all.addEventListener('click', function () { location.href = 'guangchang/' + location.search + location.hash; });
paintList();
diff --git a/js/kit.css b/js/kit.css
index e0b19bc..9ce4e3e 100644
--- a/js/kit.css
+++ b/js/kit.css
@@ -102,8 +102,9 @@ html.night .lv-i em{color:#F1E6EE}
.kr.t-qa .lv-i{color:#2E9B78}
/* 生娃计算器固定第一条,图标块左上角小火苗 */
.kr-ic{position:relative}
-.kr-hot{position:absolute;right:-6px;top:-6px;display:grid;place-items:center;width:17px;height:17px;border-radius:50%;background:linear-gradient(135deg,#F0453A,#FF8A3D);border:1.5px solid #fff;box-sizing:content-box}
-.kr-hot svg{width:11px;height:11px;color:#fff}
+/* 11-04 用户:不要外面的圈,直接一个红色火苗 */
+.kr-hot{position:absolute;right:-7px;top:-9px;display:block;width:16px;height:16px;line-height:0;filter:drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1px #fff)}
+.kr-hot svg{width:16px;height:16px;color:#F0352A}
/* 11-04 用户:「我的孕期工具」标题和下面「孕期百宝箱」一样大、字下半截一样垫一条小色块(写在这里而不是 mama-box.css:本文件在首页一定加载,且晚于 mama-box.css) */
.dock-head .dock-title{flex:none;padding:0 3px;font-size:21px;font-weight:900;letter-spacing:.5px;color:#2A1E1E;background:linear-gradient(transparent 58%,#FFD6A0 58%,#FFD6A0 92%,transparent 92%)}
html.night .dock-head .dock-title{color:#F1E6EE}
diff --git a/js/kit.js b/js/kit.js
index 3122f15..8c4a605 100644
--- a/js/kit.js
+++ b/js/kit.js
@@ -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 = '26110418';
+ var V = '26110419';
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');
diff --git a/js/share-card.js b/js/share-card.js
index 9ddc7ac..0d5ea09 100644
--- a/js/share-card.js
+++ b/js/share-card.js
@@ -8,7 +8,7 @@
postMessage 不是实时投递,微信在分享那一刻才派发,所以每次换内容都要再报一次;子页面没引 jweixin,这里按需加载。 */
(function (g) {
'use strict';
- var V = '26110418';
+ var V = '26110419';
var isWx = /MicroMessenger/i.test(navigator.userAgent || '');
var waiting = [], loading = false;
function ready(cb) {
diff --git a/topic/_shared/tools.js b/topic/_shared/tools.js
index 74b1571..33430bc 100644
--- a/topic/_shared/tools.js
+++ b/topic/_shared/tools.js
@@ -57,7 +57,7 @@
'.tc-more{display:block;width:100%;margin-top:6px;height:40px;border:0;border-radius:99px;background:#F7F8FA;color:#4E5969;font-size:13px;font-weight:600}';
var SLUG = (location.pathname.match(/\/topic\/([^\/]+)\//) || [])[1] || '';
/* 11-04 微信转发图:每个专题一张 assets/share/t/.jpg(核心词大字 + logo),见 js/share-card.js */
- if (SLUG) (function () { var s = document.createElement('script'); s.src = '../../js/share-card.js?v=26110418'; s.onload = function () { window.mbShare('../../assets/share/t/' + SLUG + '.jpg'); }; document.head.appendChild(s); })();
+ if (SLUG) (function () { var s = document.createElement('script'); s.src = '../../js/share-card.js?v=26110419'; s.onload = function () { window.mbShare('../../assets/share/t/' + SLUG + '.jpg'); }; document.head.appendChild(s); })();
var SK = 'mmbox.tp.v1', UK = (function () { var m = ((location.hash || '') + '&' + (location.search || '')).match(/[#?&]openid=([^&]*)/); return m ? decodeURIComponent(m[1]) : '_guest'; })();
function loadMe() { try { var a = JSON.parse(localStorage.getItem(SK) || '{}') || {}; var m = a[UK] || {}; m.cm = m.cm || {}; m.lk = m.lk || {}; return { a: a, m: m }; } catch (e) { return { a: {}, m: { cm: {}, lk: {} } }; } }
function saveMe(st) { try { st.a[UK] = st.m; localStorage.setItem(SK, JSON.stringify(st.a)); } catch (e) {} }
@@ -70,7 +70,7 @@
function getJSON(u) { return fetch(u, { cache: 'no-cache' }).then(function (r) { if (!r.ok) throw r.status; return r.json(); }); }
function related(box) {
- getJSON('../_shared/idx.json?v=26110418').then(function (idx) {
+ getJSON('../_shared/idx.json?v=26110419').then(function (idx) {
var me = null; idx.forEach(function (x) { if (x[0] === SLUG) me = x; });
var tag = me ? me[2] : '', h = 0; for (var i = 0; i < SLUG.length; i++) h = (h * 31 + SLUG.charCodeAt(i)) >>> 0;
var rest = idx.filter(function (x) { return x[0] !== SLUG && (window.__mbUgc || ['ceshi', 'duiyou'].indexOf(x[0]) < 0); }); /* UGC 关着不推两个测试 */
@@ -177,13 +177,13 @@
}
fetch(API + '/comments?kind=topic&target=' + encodeURIComponent(SLUG) + (OID ? '&openid=' + encodeURIComponent(OID) : ''))
.then(function (r) { return r.json(); }).then(function (j) { if (j && j.code === 200) { RC = j.result; paint(); } }).catch(function () {});
- getJSON('../_shared/cm/' + SLUG + '.json?v=26110418').then(function (d) { L = d.c || []; paint(); }).catch(function () { paint(); });
+ getJSON('../_shared/cm/' + SLUG + '.json?v=26110419').then(function (d) { L = d.c || []; paint(); }).catch(function () { paint(); });
}
function ugcReady() {
if (window.__mbUgcReady) return window.__mbUgcReady;
return new Promise(function (res) {
- var u = document.createElement('script'); u.src = '../../js/ugc.js?v=26110418';
+ var u = document.createElement('script'); u.src = '../../js/ugc.js?v=26110419';
u.onload = function () { (window.__mbUgcReady || Promise.resolve(false)).then(res); };
u.onerror = function () { res(false); };
document.head.appendChild(u);
diff --git a/topic/_shared/wizard.css b/topic/_shared/wizard.css
new file mode 100644
index 0000000..cc2b179
--- /dev/null
+++ b/topic/_shared/wizard.css
@@ -0,0 +1,46 @@
+/* 计算器分步模式(配合 wizard.js,11-04)。用页面的 --c 主题色;--h 标题色、--m 弱文字色。 */
+.wz .wz-off,.wz-hold,html.wz-q #tx-rel,html.wz-q #tx-cm,html.wz-q .tc-in{display:none!important}
+.wz:not(.wz-res) .res,.wz:not(.wz-res) .wz-again,.wz.wz-res .wz-top,.wz.wz-res .wz-bot{display:none!important}
+.wz{min-height:300px}
+.wz-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:4px}
+.wz-n{font-size:12.5px;font-weight:800;color:var(--c);letter-spacing:.5px}
+.wz-dots{display:flex;gap:5px}
+.wz-dots i{width:7px;height:7px;border-radius:99px;background:#ECE6E8;transition:width .25s,background .25s}
+.wz-dots i.d{background:var(--c);opacity:.45}
+.wz-dots i.c{width:20px;background:var(--c)}
+/* 题目:标签放大成问题 */
+.wz .wz-in{animation:wzIn .32s ease both}
+.wz .fld.wz-in{margin-top:10px}
+.wz .fld.wz-in>.lb,.wz .fld.wz-in>label.lb,.wz .fld.wz-in>span.lb{display:block;margin-bottom:12px;font-size:20px;font-weight:900;line-height:1.4;color:var(--h)}
+.wz .fld.wz-in>.lb small,.wz .fld.wz-in>.lb small{display:block;margin-top:3px;font-size:13px;font-weight:500;color:var(--m)}
+.wz .fld.two.wz-in .lb{font-size:16px;font-weight:800;color:var(--h)}
+.wz .tabs.wz-in{margin-top:10px}
+.wz .tabs.wz-in::before{content:attr(data-wzq);display:block;margin-bottom:12px;font-size:20px;font-weight:900;line-height:1.4;color:var(--h)}
+.calc.wz .tabs.wz-in{display:flex;flex-direction:column;gap:10px;padding:0;border-radius:0;background:none}
+.calc.wz .tabs.wz-in button{flex:none;height:54px;border-radius:14px;border:1.5px solid #EDE7EA;background:#fff;box-shadow:none;font-size:16px;font-weight:700;color:var(--h)}
+.calc.wz .tabs.wz-in button.on{border-color:var(--c);background:var(--cbg);color:var(--c)}
+.wz .fld.wz-in .seg button{min-height:46px;font-size:15px}
+.wz .fld.wz-in .in,.wz .fld.wz-in .inp{min-height:50px;font-size:17px}
+/* 底部按钮 */
+.wz-bot{margin-top:22px}
+.wz-err{min-height:18px;margin-bottom:6px;font-size:13px;font-weight:700;color:#E5484D;text-align:center}
+.wz-err:empty{min-height:0;margin:0}
+.wz-act{display:flex;gap:10px}
+.wz-prev{flex:0 0 auto;height:48px;padding:0 16px;border-radius:99px;background:#F5F2F3;color:var(--m);font-size:14.5px;font-weight:700}
+.wz-next{flex:1;height:48px;border-radius:99px;background:var(--c);color:#fff;font-size:16px;font-weight:800;box-shadow:0 8px 18px -8px var(--c)}
+.wz-next.go{background:linear-gradient(135deg,var(--c2,var(--c)),var(--c))}
+.wz-prev[hidden]{display:none}
+.wz-tip{margin-top:8px;font-size:12px;color:var(--m);text-align:center}
+.wz-tip:empty{display:none}
+.wz-shake .wz-in{animation:wzShake .35s}
+/* 结果屏 */
+.wz.wz-res{min-height:0}
+.wz-pop{animation:wzPop .5s cubic-bezier(.3,1.4,.5,1) both}
+.wz-again{display:flex;flex-direction:column;align-items:center;gap:4px;margin-top:14px}
+.wz-re{height:42px;padding:0 22px;border-radius:99px;border:1.5px solid var(--c);color:var(--c);font-size:14.5px;font-weight:800;background:#fff}
+.wz-re{display:inline-flex;align-items:center;gap:5px}.wz-re svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
+.wz-again small{font-size:12px;color:var(--m)}
+@keyframes wzIn{from{opacity:0;transform:translateX(18px)}to{opacity:1;transform:none}}
+@keyframes wzPop{from{opacity:0;transform:scale(.92) translateY(10px)}to{opacity:1;transform:none}}
+@keyframes wzShake{0%,100%{transform:none}25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
+@media (prefers-reduced-motion:reduce){.wz .wz-in,.wz-pop,.wz-shake .wz-in{animation:none}}
diff --git a/topic/_shared/wizard.js b/topic/_shared/wizard.js
new file mode 100644
index 0000000..d8933d8
--- /dev/null
+++ b/topic/_shared/wizard.js
@@ -0,0 +1,144 @@
+/* 计算器分步模式(11-04 用户:「其他计算器都按生娃计算器那种模式:点进去一步一步填,最后出答案」)
+ 用法:页面原来的计算逻辑不动(照样实时往结果框里写),本脚本只管「显示哪一块」:
+ CKW.init({ root: '.calc', res: '#res', after: '#scroll > section.calc ~ *' })
+ · root 里每个 .fld 是一题;.tabs(算法切换)单独一题,题目取 data-q;包在 div 里的 .fld 会被拆开,带 .hide 的跳过;
+ .calc 直属的 .hint 跟着上一题。
+ · 必填:有 input/select/.seg 的题要先填;标签里写了「选填」或 .fld 带 data-opt 的不拦。
+ · 只有一组 .seg / .tabs 的题,点完自动下一题(同生娃计算器)。
+ · 最后一题按钮是「看结果」:结果框里还是 .empty(没填全 / 数不对)就不放行,把那句提示显示出来。
+ · 结果屏:只出结果框 + after 选中的内容(详细说明等)+「重新算」(回第 1 题,填过的都留着)。
+ · 记住停在哪一屏(AGENTS 规则:测试 / 计算器再进来回到最后停的屏),键 mmbox.wz.v1,按页面路径分。 */
+(function (g) {
+ 'use strict';
+ var KEY = 'mmbox.wz.v1';
+ function load() { try { return JSON.parse(localStorage.getItem(KEY) || '{}') || {}; } catch (e) { return {}; } }
+ function save(v) { try { var m = load(); m[location.pathname] = v; localStorage.setItem(KEY, JSON.stringify(m)); } catch (e) {} }
+ function hidden(el) { return el.classList.contains('hide') || el.hidden; }
+ function txt(el) { return el ? el.textContent.replace(/\s+/g, ' ').trim() : ''; }
+
+ function init(o) {
+ var root = typeof o.root === 'string' ? document.querySelector(o.root) : o.root;
+ var res = typeof o.res === 'string' ? document.querySelector(o.res) : o.res;
+ if (!root || !res || root.__wz) return;
+ root.__wz = 1;
+ var after = o.after ? [].slice.call(document.querySelectorAll(o.after)).filter(function (e) { return !/toast|mask/.test(e.className + ' ' + e.id); }) : [];
+ var sc = document.getElementById('scroll') || document.scrollingElement;
+ root.classList.add('wz');
+
+ /* 顶部进度 + 底部按钮 */
+ var top = document.createElement('div'); top.className = 'wz-top';
+ top.innerHTML = '';
+ var bot = document.createElement('div'); bot.className = 'wz-bot';
+ bot.innerHTML = '';
+ var again = document.createElement('div'); again.className = 'wz-again';
+ again.innerHTML = '填过的都还在,改哪项点哪项';
+ root.insertBefore(top, root.firstChild);
+ root.appendChild(bot);
+ res.parentNode.insertBefore(again, res.nextSibling);
+ var nEl = top.querySelector('.wz-n'), dEl = top.querySelector('.wz-dots'), err = bot.querySelector('.wz-err'),
+ prev = bot.querySelector('.wz-prev'), next = bot.querySelector('.wz-next'), tip = bot.querySelector('.wz-tip');
+
+ /* 题目单元:每次现算(页面切 tabs 会显示 / 隐藏不同的 .fld) */
+ function units() {
+ var out = [];
+ [].forEach.call(root.children, function (c) {
+ if (c === top || c === bot || c === res || c === again || hidden(c)) return;
+ if (c.classList.contains('fld') || c.classList.contains('tabs')) out.push([c]);
+ else if (c.querySelector('.fld')) [].forEach.call(c.querySelectorAll('.fld'), function (f) { if (!hidden(f)) out.push([f]); });
+ else if (out.length) out[out.length - 1].push(c); /* 跟在题后的 .hint / 「再加一个孩子」等 */
+ else out.push([c]);
+ });
+ return out;
+ }
+ /* 能被藏的块:root 的直属子元素(除进度 / 按钮 / 结果框)+ 壳里的 .fld;题里面的东西不碰 */
+ function all() {
+ var out = [];
+ [].forEach.call(root.children, function (c) {
+ if (c === top || c === bot || c === res || c === again) return;
+ out.push(c);
+ if (!c.classList.contains('fld') && !c.classList.contains('tabs')) [].push.apply(out, c.querySelectorAll('.fld'));
+ });
+ return out;
+ }
+ function single(u) { /* 只有一组按钮可选 → 选完自动下一题 */
+ var el = u[0];
+ if (el.classList.contains('tabs')) return true;
+ return el.querySelectorAll('.seg').length === 1 && !el.querySelector('input,select,.stp');
+ }
+ function missing(u) {
+ var el = u[0];
+ if (el.hasAttribute('data-opt') || /选填/.test(txt(el.querySelector('.lb')))) return '';
+ var bad = '';
+ [].forEach.call(el.querySelectorAll('input,select'), function (i) {
+ if (bad || i.type === 'hidden' || i.disabled) return;
+ var lb = i.closest('div') && i.closest('div').querySelector('.lb');
+ if (lb && /选填/.test(txt(lb))) return;
+ if (!String(i.value).trim()) bad = '先填一下「' + (txt(lb || el.querySelector('.lb')).replace(/选填.*$/, '') || '这一项') + '」';
+ });
+ if (!bad) [].forEach.call(el.querySelectorAll('.seg'), function (s) { if (!bad && !s.querySelector('.on')) bad = '先选一下' + (txt(el.querySelector('.lb')) ? '「' + txt(el.querySelector('.lb')).replace(/\s.*$/, '') + '」' : ''); });
+ return bad;
+ }
+
+ var i = 0, mode = 'q';
+ function show() {
+ var us = units();
+ if (i >= us.length) i = us.length - 1;
+ if (i < 0) i = 0;
+ all().forEach(function (e) { e.classList.add('wz-off'); });
+ [].forEach.call(root.querySelectorAll('.wz-in'), function (e) { e.classList.remove('wz-in'); });
+ root.classList.toggle('wz-res', mode === 'r');
+ document.documentElement.classList.toggle('wz-q', mode !== 'r'); /* 答题时页面底部后加的相关推荐 / 评论区也先不出 */
+ after.forEach(function (e) { e.classList.toggle('wz-hold', mode !== 'r'); });
+ err.textContent = '';
+ if (mode === 'r') {
+ res.classList.remove('wz-pop'); void res.offsetWidth; res.classList.add('wz-pop');
+ save('r'); sc.scrollTop = 0; return;
+ }
+ var u = us[i];
+ u.forEach(function (e) {
+ e.classList.remove('wz-off'); e.classList.add('wz-in');
+ if (e.parentNode !== root) e.parentNode.classList.remove('wz-off'); /* 包在 #fLmp 这类壳里的题 */
+ });
+ var q = u[0].classList.contains('tabs') ? (u[0].getAttribute('data-q') || '先选一种算法') : '';
+ u[0].setAttribute('data-wzq', q);
+ nEl.textContent = '第 ' + (i + 1) + ' / ' + us.length + ' 步';
+ dEl.innerHTML = us.map(function (_, k) { return ''; }).join('');
+ prev.hidden = !i;
+ var last = i === us.length - 1;
+ next.textContent = last ? '看结果 ›' : '下一步 ›';
+ next.classList.toggle('go', last);
+ tip.textContent = single(u) && !last ? '选完自动下一步' : '';
+ save(i); sc.scrollTop = 0;
+ }
+ function go(d) {
+ var us = units();
+ if (d > 0) {
+ var m = missing(us[i]);
+ if (m) { err.textContent = m; root.classList.remove('wz-shake'); void root.offsetWidth; root.classList.add('wz-shake'); return; }
+ if (i === us.length - 1) {
+ var e = res.querySelector('.empty');
+ if (e) { err.textContent = txt(e); return; }
+ mode = 'r'; return show();
+ }
+ }
+ i += d; show();
+ }
+ prev.addEventListener('click', function () { go(-1); });
+ next.addEventListener('click', function () { go(1); });
+ again.querySelector('.wz-re').addEventListener('click', function () { mode = 'q'; i = 0; show(); });
+ /* 单选题点完自动下一步(等页面自己的点击处理先跑完) */
+ root.addEventListener('click', function (e) {
+ if (mode !== 'q') return;
+ var b = e.target.closest('.seg button,.tabs button'); if (!b) return;
+ var us = units(), u = us[i];
+ if (!u || u.indexOf(b.closest('.fld,.tabs')) < 0 || !single(u) || i === us.length - 1) return;
+ setTimeout(function () { if (mode === 'q' && units()[i] && units()[i][0] === u[0]) go(1); }, 320);
+ });
+
+ var sv = load()[location.pathname];
+ if (sv === 'r' && !res.querySelector('.empty')) mode = 'r';
+ else if (typeof sv === 'number') i = sv;
+ show();
+ }
+ g.CKW = { init: init };
+})(window);
diff --git a/topic/butie-js/index.html b/topic/butie-js/index.html
index 0ddbb16..c26556d 100644
--- a/topic/butie-js/index.html
+++ b/topic/butie-js/index.html
@@ -11,7 +11,8 @@
月数按「自然月」数:从 max(出生月, 2025-01) 起,到满 3 周岁那个月之前为止(结果标「约」,以当地核定为准)。
最多填 3 个孩子;还没出生的填预产期先算。地方另有加码的(如部分城市每孩另发)不在这里算。
共用 ../_shared/calc.css + calc.js(返回 / 禁回弹 / 日期按北京时间 / 记住上次填的值);自成一页,不引 app.js。 -->
-
+
+
@@ -45,7 +46,7 @@
地方可能另有补贴:部分城市在国家 3600 元之外还另发生育补贴、育儿补贴,问一下当地卫健部门或看政务平台。
-
+
-
+
+
+
+