v26110266 预览:广场去掉篇数/话题数;孕期百问列表改版(热问大卡+分类彩签+答案摘要,人数×3.6);测一测列表按参考图改宫格卡
Co-Authored-By: AI 助手
This commit is contained in:
@@ -367,8 +367,8 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
|
||||
</div>
|
||||
<div class="toast" id="toast"></div>
|
||||
|
||||
<script src="meta.js?v=26110265"></script>
|
||||
<script src="tests.js?v=26110265"></script>
|
||||
<script src="meta.js?v=26110266"></script>
|
||||
<script src="tests.js?v=26110266"></script>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
@@ -137,34 +137,44 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
.cats .c-ceshi i{display:none}
|
||||
.cats .c-ceshi.on{font-size:14px;font-weight:900;color:#fff;background:linear-gradient(120deg,#8E6BFF,#EE6A9C);box-shadow:0 6px 14px -6px rgba(200,90,180,.7)}
|
||||
/* 测一测列表(11-02 v3 用户:「列表别跟帖子一个样,换个形式」)→ 分组专栏:组头 + 推荐横卡 + 条目行 */
|
||||
.csl{padding:0 12px}
|
||||
.csg{margin-top:18px}
|
||||
.csg-h{display:flex;align-items:baseline;gap:8px;padding:0 4px}
|
||||
.csg-h b{position:relative;font-size:17px;font-weight:900;color:#2A1E1E}
|
||||
.csg-h b::after{content:"";position:absolute;left:-2px;right:-2px;bottom:1px;height:7px;border-radius:4px;background:var(--tg);opacity:.22;z-index:-1}
|
||||
.csg-h b{z-index:0}
|
||||
.csg-h small{font-size:12px;color:#A08B85}
|
||||
.csg-h em{margin-left:auto;font-style:normal;font-size:12px;font-weight:800;color:var(--tg)}
|
||||
/* 11-02 v4 用户:「测一测页面太乱,整洁一些,多少人测过要明显」→ 所有分组统一一种列表行:缩略图 + 标题/说明 + 右侧大号人数 */
|
||||
.cpl{margin-top:8px;border-radius:20px;background:#fff;box-shadow:0 3px 12px rgba(170,110,90,.07);overflow:hidden}
|
||||
.cr{display:flex;align-items:center;gap:12px;width:100%;padding:12px;text-align:left;border-top:1px solid #F7EFEB}
|
||||
.cr:first-child{border-top:0}
|
||||
.cr:active{background:#FCF8F6}
|
||||
.cr .cth{position:relative;flex:none;width:58px;height:58px}
|
||||
.cr .cth img{display:block;width:100%;height:100%;border-radius:14px;object-fit:cover;object-position:center 28%;background:var(--tl)}
|
||||
.cr .crk{position:absolute;left:-5px;top:-5px;min-width:20px;height:20px;padding:0 5px;border-radius:7px;background:#B9A7A1;color:#fff;font-size:11.5px;font-weight:900;line-height:20px;text-align:center;border:2px solid #fff;font-style:normal}
|
||||
.cr .crk.r1{background:#F0453A}.cr .crk.r2{background:#F28A1E}.cr .crk.r3{background:#F2B21E}
|
||||
.cr .tx{flex:1;min-width:0}
|
||||
.cr b{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:14.5px;font-weight:800;line-height:1.4;color:#2A1E1E}
|
||||
.cr small{display:block;margin-top:3px;font-size:12px;color:#A99590;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
|
||||
.cr small em{font-style:normal;font-weight:800;color:var(--tg)}
|
||||
.cr .cn{flex:none;min-width:66px;padding:7px 8px 6px;border-radius:14px;background:linear-gradient(160deg,#FFF3EE,#FFE4DA);text-align:center} /* 11-02 用户:「N万人测过」要更明显 */
|
||||
.cr .cn b{display:flex;align-items:baseline;justify-content:center;font-size:22px;font-weight:900;line-height:1.05;color:#EE4B2B;font-family:-apple-system,"DIN Alternate","Helvetica Neue",sans-serif;letter-spacing:-.5px}
|
||||
.cr .cn b i{font-size:12.5px;font-style:normal;font-weight:900;margin-left:1px}
|
||||
.cr .cn small{display:flex;align-items:center;justify-content:center;gap:2px;margin-top:3px;font-size:11px;font-weight:800;color:#F0704F}
|
||||
.cr .cn small svg{width:11px;height:11px}
|
||||
.cr .cn.dn b{font-size:13px;color:var(--tg)}
|
||||
.ckm{display:block;width:100%;height:42px;border-top:1px solid #F7EFEB;color:#8A7470;font-size:12.5px;font-weight:800;background:#fff}
|
||||
.csl{padding:0 14px}
|
||||
/* 11-03 测试列表 · 参考图排版(分组标题 + 宫格卡) */
|
||||
.cst{display:grid;grid-template-columns:repeat(5,1fr);gap:7px;padding:12px 14px 0}
|
||||
.cst button{height:34px;border-radius:10px;background:#fff;border:1px solid #F0E6EE;box-shadow:0 2px 6px rgba(150,110,140,.06);font-size:13px;font-weight:700;color:#5A4C58;white-space:nowrap}
|
||||
.cst button.on{background:linear-gradient(135deg,#EFEAFF,#E6F0FF);border-color:#D9D0FA;color:#4F45B5;font-weight:900}
|
||||
.csg{margin-top:22px}
|
||||
.csg-h{display:flex;flex-direction:column;gap:5px;padding:0 2px}
|
||||
.csg-h b{display:flex;align-items:center;gap:6px;padding-left:10px;border-left:3px solid #B9B3D6;font-size:19px;font-weight:900;line-height:1.1;color:#2B2433}
|
||||
.csg-h b i{font-style:normal;font-size:18px}
|
||||
.csg-h small{padding-left:13px;font-size:13px;color:#8F8494}
|
||||
.ckg{display:grid;gap:12px 10px;margin-top:12px}
|
||||
.ckg.c3{grid-template-columns:repeat(3,1fr)}
|
||||
.ckg.c2{grid-template-columns:repeat(2,1fr)}
|
||||
.ck{display:flex;flex-direction:column;min-width:0;border-radius:16px;background:#fff;box-shadow:0 4px 14px -4px rgba(120,90,130,.16);overflow:hidden;text-align:center}
|
||||
.ck:active{transform:scale(.97)}
|
||||
.ck .cv{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;height:128px;padding:0 6px;background:linear-gradient(160deg,var(--c1),var(--c2));overflow:hidden}
|
||||
.c2 .ck .cv{height:150px;gap:7px}
|
||||
.ck .cbl{position:absolute;inset:0;width:100%;height:100%}
|
||||
.ck .cbl .b1{fill:var(--c3);opacity:.75}.ck .cbl .b2{fill:var(--c4);opacity:.6}.ck .cbl .b3{fill:#fff;opacity:.35}
|
||||
.ck .cv b,.ck .cv small,.ck .cv em{position:relative}
|
||||
.ck .cv b{font-size:16.5px;font-weight:900;line-height:1.2;color:#2B2433;letter-spacing:.5px}
|
||||
.c2 .ck .cv b{font-size:20px;padding:0 8px}
|
||||
.ck .cv small{font-size:10.5px;color:#8D8091;white-space:nowrap}
|
||||
.ck .cv em{margin-top:2px;height:22px;padding:0 10px;border-radius:6px;background:var(--cb);color:#fff;font-size:11px;font-style:normal;font-weight:800;line-height:22px;box-shadow:0 3px 8px -3px var(--cb)}
|
||||
.c2 .ck .cv em{height:25px;line-height:25px;padding:0 13px;font-size:12px}
|
||||
.ck .cv .dn{position:absolute;right:6px;top:6px;height:17px;padding:0 6px;border-radius:99px;background:rgba(255,255,255,.88);color:var(--cb);font-size:10px;font-style:normal;font-weight:800;line-height:17px}
|
||||
.ck .ct{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:8px 8px 0;min-height:2.8em;font-size:12.5px;font-weight:700;line-height:1.4;color:#3A3040}
|
||||
.c2 .ck .ct{font-size:13.5px}
|
||||
.ck .cnn{display:inline-flex;align-items:center;justify-content:center;gap:2px;margin:4px 0 9px;font-size:11px;font-weight:800;color:#F0704F}
|
||||
.ck .cnn svg{width:11px;height:11px}
|
||||
.ck.pa{--c1:#FFF4EA;--c2:#FFE4D6;--c3:#FFC9AE;--c4:#FFB08F;--cb:#FF8A65}
|
||||
.ck.pb{--c1:#F4F0FA;--c2:#E9E4F4;--c3:#B9AEDB;--c4:#E8D9EE;--cb:#8D84BE}
|
||||
.ck.pc{--c1:#FFF9EC;--c2:#F0F2F6;--c3:#C9DCF0;--c4:#DDE6D2;--cb:#7F8EC9}
|
||||
.ck.pd{--c1:#F6EEFA;--c2:#FBEFE6;--c3:#D9C6EE;--c4:#FBD9BF;--cb:#9A86C4}
|
||||
.ck.pe{--c1:#F1FAEF;--c2:#EEF6F5;--c3:#CDE9D5;--c4:#BFDDEB;--cb:#7C8FCB}
|
||||
.ck.pf{--c1:#FFF1E6;--c2:#FDE6DD;--c3:#FFC5A6;--c4:#F8D7C4;--cb:#E58A64}
|
||||
.csd{display:flex;align-items:center;gap:10px;margin:20px 0 -4px;color:#A69CA8;font-size:12.5px}
|
||||
.csd::before,.csd::after{content:"";flex:1;height:1px;background:#E6DEE6}
|
||||
.k-ceshi{--kf:#7C5CFC;--kt:#6346B0;--kl:#F1EDFF;--kl2:#E4DDFD}
|
||||
.g-quiz{--tg:#F0714F;--tl:#FFEFE9}.g-psy{--tg:#7C5CFC;--tl:#F1EDFF}.g-game{--tg:#13A08A;--tl:#E4F6F1}.g-shop{--tg:#E9557F;--tl:#FFEEF3}
|
||||
.nc.tst .cvw{background:var(--tl)}
|
||||
@@ -672,10 +682,10 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
<div id="sheet" role="dialog" aria-modal="true"><i class="sg"></i><div class="sbd" id="sbd"></div></div>
|
||||
<div class="toast" id="toast"></div>
|
||||
|
||||
<script src="topics.js?v=26110265"></script>
|
||||
<script src="data.js?v=26110265"></script>
|
||||
<script src="feed.js?v=26110265"></script>
|
||||
<script src="ceshi/meta.js?v=26110265"></script>
|
||||
<script src="topics.js?v=26110266"></script>
|
||||
<script src="data.js?v=26110266"></script>
|
||||
<script src="feed.js?v=26110266"></script>
|
||||
<script src="ceshi/meta.js?v=26110266"></script>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -741,7 +751,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
var CMD = null, CMERR = false;
|
||||
/* 头像编码:数字 = av/NNNN.webp(旧代码头像);'av:c012' = av/c012.webp(卡通/可爱卡通);'/…' = 站内绝对路径(内置头像库 /_bridge/avatars/);其余 = assets/img/mom/xxx.jpg */
|
||||
var avP = function (a) { return typeof a === 'number' ? 'av/' + ('000' + a).slice(-4) + '.webp' : a.indexOf('av:') === 0 ? 'av/' + a.slice(3) + '.webp' : a.charAt(0) === '/' ? a : '../assets/img/mom/' + a + '.jpg'; };
|
||||
fetch('cm.json?v=26110265').then(function (r) { return r.json(); }).then(function (j) {
|
||||
fetch('cm.json?v=26110266').then(function (r) { return r.json(); }).then(function (j) {
|
||||
CMD = j; if (openId && NBY[openId]) { renderComments(NBY[openId]); syncBar(NBY[openId]); }
|
||||
}).catch(function () { CMERR = true; if (openId && NBY[openId]) renderComments(NBY[openId]); });
|
||||
function commentsOf(n) {
|
||||
@@ -950,29 +960,32 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
'<span class="gt">' + (d ? '再测' : '去测') + ' ›</span></div></div></button>';
|
||||
}
|
||||
/* 热度排序:按「N人测过」(ceshi/meta.js gcTested,模拟数,见 AGENTS.md 12b)从高到低 */
|
||||
var byHot = function (l) { return l.slice().sort(function (a, b) { return gcTested(b.id) - gcTested(a.id); }); }, hotOpen = false;
|
||||
var byHot = function (l) { return l.slice().sort(function (a, b) { return gcTested(b.id) - gcTested(a.id); }); };
|
||||
var TGD = { quiz: '有标准答案,答完看解析', psy: '没有对错,测测你是哪一型', game: '挑战一下,看能拿什么称号', shop: '看看你是哪一类育儿采购玩家' };
|
||||
/* 统一列表行:缩略图(热度榜带名次)+ 标题 / 说明 + 右侧大号人数;测过的右侧换成「已测」 */
|
||||
function rowHTML(x, done, rank) {
|
||||
var d = done[x.id], num = gcTestedText(x.id).replace('人测过', '').replace('万', '<i>万</i>');
|
||||
return '<button type="button" class="cr g-' + x.group + '" data-test="' + x.id + '"><span class="cth"><img src="ceshi/img/' + x.id + '_s.webp" alt="" loading="lazy">' +
|
||||
(rank ? '<i class="crk' + (rank <= 3 ? ' r' + rank : '') + '">' + rank + '</i>' : '') + '</span>' +
|
||||
'<span class="tx"><b>' + esc(x.title) + '</b><small>' + (d ? '<em>' + (x.group === 'quiz' || x.group === 'game' ? '已拿「' : '我是「') + esc(d.title) + '」</em>' : (rank ? '<em>' + TG[x.group] + '</em> · ' : '') + esc(x.sub)) + '</small></span>' +
|
||||
'<span class="cn"><b>' + num + '</b><small><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12.6 2.5c.4 3-1.6 4.6-3 6.2C8 10.4 7 12 7 14.3A5 5 0 0012 19.5a5 5 0 005-5.2c0-2-1-3.6-1.9-4.6-.2 1.3-.9 2.2-1.9 2.6.6-3.4-.2-7-.6-9.8z" fill="currentColor"/></svg>人测过</small></span></button>';
|
||||
}
|
||||
function hotHTML(done) {
|
||||
var l = byHot(TM);
|
||||
return '<section class="csg csk"><div class="csg-h"><b>热度榜</b><small>按测过的人数排名</small></div><div class="cpl">' +
|
||||
l.slice(0, hotOpen ? l.length : 5).map(function (x, i) { return rowHTML(x, done, i + 1); }).join('') +
|
||||
'<button type="button" class="ckm" data-hot="1">' + (hotOpen ? '收起' : '查看完整榜单(' + l.length + ' 个)') + '</button></div></section>';
|
||||
/* 11-03 用户发参考图:「测试列表按图里的排版」→ 分组标题(色条 + 图标 + 名称 + 一句话)+ 宫格卡:
|
||||
彩色渐变封面(两团柔和色块)上写大字短名 + 小字「谁来测 · N 题」+「开始测试」胶囊,封面下一行完整标题 + 人数;
|
||||
常识小测 / 趣味闯关 3 列,趣味心理 / 好物配置 2 列(大卡)。原热度榜不再单列,组内仍按人数从高到低排。 */
|
||||
var CS_SHORT = { t01: '孕期常识', t02: '准爸爸考卷', t03: '带娃常识', t04: '新手爸爸考', t05: '待产包自查', t06: '新生儿护理', t07: '月子常识', t08: '辅食常识', t09: '宝宝睡眠', t10: '哺乳饮食',
|
||||
t11: '你的带娃风格', t12: '给队友打个分', t13: '当爸妈适应度', t14: '产后心情自查', t15: '你信哪种育儿', t16: '夫妻带娃默契', t17: '孕期焦虑自查', t18: '讲究还是随意', t19: '二胎状态测试', t20: '你是哪种长辈',
|
||||
t21: '准爸爸闯关', t22: '育儿误区', t23: '自我关爱', t24: '宝宝小性格', t25: '孕期幸福感',
|
||||
t26: '你的选品偏好', t27: '母婴采购思路', t28: '囤货找方向', t29: '育儿采购玩家', t30: '购物清单逻辑' };
|
||||
var CS_SEC = { quiz: ['📝', '查漏补缺,温和掌握孕产育儿知识', 3], psy: ['💛', '看见情绪,也看见关系', 2], game: ['🎯', '挑战一下,看能拿什么称号', 3], shop: ['🛍️', '看看你是哪一类育儿采购玩家', 2] };
|
||||
var CS_PAL = ['pa', 'pb', 'pc', 'pd', 'pe', 'pf']; /* 6 套封面配色轮流:蜜桃 / 薰衣草 / 奶油蓝 / 浅紫 / 薄荷 / 杏橙 */
|
||||
var CS_BLOB = '<svg class="cbl" viewBox="0 0 100 100" preserveAspectRatio="none" aria-hidden="true"><path class="b1" d="M58 0C66 14 80 18 100 14V0z"/><path class="b2" d="M0 72C18 60 30 78 46 86S80 84 100 70V100H0z"/><path class="b3" d="M0 0H28C20 12 8 16 0 30z"/></svg>';
|
||||
function csCardHTML(x, done, i) {
|
||||
var d = done[x.id], who = (x.sub || '').split('·')[0].trim();
|
||||
return '<button type="button" class="ck ' + CS_PAL[i % CS_PAL.length] + '" data-test="' + x.id + '"><span class="cv">' + CS_BLOB +
|
||||
'<b>' + esc(CS_SHORT[x.id] || x.title) + '</b><small>' + esc(who) + ' · ' + x.n + ' 题</small><em>' + (d ? '再测一次' : '开始测试') + '</em>' + (d ? '<i class="dn">已测</i>' : '') + '</span>' +
|
||||
'<span class="ct">' + esc(x.title) + '</span><span class="cnn"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12.6 2.5c.4 3-1.6 4.6-3 6.2C8 10.4 7 12 7 14.3A5 5 0 0012 19.5a5 5 0 005-5.2c0-2-1-3.6-1.9-4.6-.2 1.3-.9 2.2-1.9 2.6.6-3.4-.2-7-.6-9.8z" fill="currentColor"/></svg>' + gcTestedText(x.id) + '</span></button>';
|
||||
}
|
||||
function ceshiListHTML() {
|
||||
var done = csDone();
|
||||
return '<div class="csl">' + (tGrp ? '' : hotHTML(done)) + ['quiz', 'psy', 'game', 'shop'].filter(function (g) { return !tGrp || tGrp === g; }).map(function (g) {
|
||||
var done = csDone(), gs = ['quiz', 'psy', 'game', 'shop'].filter(function (g) { return !tGrp || tGrp === g; }), k = 0;
|
||||
return '<div class="csl">' + gs.map(function (g, gi) {
|
||||
var l = byHot(TM.filter(function (x) { return x.group === g; })); if (!l.length) return '';
|
||||
var nd = l.filter(function (x) { return done[x.id]; }).length;
|
||||
return '<section class="csg g-' + g + '"><div class="csg-h"><b>' + TG[g] + '</b><small>' + l.length + ' 套 · ' + TGD[g] + '</small>' + (nd ? '<em>已测 ' + nd + '</em>' : '') + '</div>' +
|
||||
'<div class="cpl">' + l.map(function (x) { return rowHTML(x, done); }).join('') + '</div></section>';
|
||||
var c = CS_SEC[g];
|
||||
return (gi ? '<div class="csd"><span>' + (gi === 1 && !tGrp ? '点上方标签,可以只看某一类' : '继续往下看') + '</span></div>' : '') +
|
||||
'<section class="csg g-' + g + '"><div class="csg-h"><b><i>' + c[0] + '</i>' + TG[g] + '</b><small>' + c[1] + '</small></div>' +
|
||||
'<div class="ckg c' + c[2] + '">' + l.map(function (x) { return csCardHTML(x, done, k++); }).join('') + '</div></section>';
|
||||
}).join('') + '</div>';
|
||||
}
|
||||
function ceshiHead() { /* 11-02 用户同意:介绍卡压成一行,让热度榜进第一屏 */
|
||||
@@ -981,8 +994,8 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
function ceshiFh(fh) {
|
||||
fh.className = 'lvw k-ceshi';
|
||||
var all = [['', '全部', TM.length]].concat(['quiz', 'psy', 'game', 'shop'].map(function (g) { return [g, TG[g], TM.filter(function (x) { return x.group === g; }).length]; }));
|
||||
fh.innerHTML = '<div class="lv"><h2>全部测试</h2><small>' + TM.length + ' 个测试 · 每个 12 题以上</small></div>' +
|
||||
'<div class="tcs">' + all.map(function (x) { return '<button type="button" data-tg="' + x[0] + '"' + (tGrp === x[0] ? ' class="on"' : '') + '>' + x[1] + '<i>' + x[2] + '</i></button>'; }).join('') + '</div>';
|
||||
/* 11-03 参考图:顶部一排分类小方签(不写数量),选中的高亮 */
|
||||
fh.innerHTML = '<div class="cst">' + all.map(function (x) { return '<button type="button" data-tg="' + x[0] + '"' + (tGrp === x[0] ? ' class="on"' : '') + '>' + x[1] + '</button>'; }).join('') + '</div>';
|
||||
}
|
||||
function rewardHTML(sm) {
|
||||
return '<button type="button" class="rw' + (sm ? ' sm' : '') + '" data-rule="1"><span class="gf"><svg class="ic"><use href="#i-gift"/></svg></span>' +
|
||||
@@ -1004,27 +1017,28 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
if (!t) {
|
||||
var hl = hotList();
|
||||
el.innerHTML = (catF ? cbnHTML(catF) : qifuHTML()) + /* 祈福树只在「全部」 */
|
||||
'<div class="sh"><svg class="fire"><use href="#i-fire"/></svg><h2>热门话题</h2><button type="button" class="more" data-all="1">全部 ' + hl.length + ' 个<svg class="ic" style="width:13px;height:13px"><use href="#i-right"/></svg></button></div>' +
|
||||
'<div class="sh"><svg class="fire"><use href="#i-fire"/></svg><h2>热门话题</h2><button type="button" class="more" data-all="1">全部<svg class="ic" style="width:13px;height:13px"><use href="#i-right"/></svg></button></div>' +
|
||||
/* 11-02 用户:「热门话题不要一块一块的,改成井号、偏列表的形式」→ 排行列表:名次 + #话题# + 一行简介 + 篇数/热,右侧「参与」
|
||||
投稿奖励从顶部大横幅挪到这里当列表头一行(用户:「30 现金 + 500 兜豆看放哪」→ 跟「参与」放一起,点了看规则) */
|
||||
'<div class="htl"><button type="button" class="rwl" data-rule="1"><svg class="ic"><use href="#i-gift"/></svg><span>投稿被选中得 ' + REWARD + '</span><b>怎么参与 ›</b></button>' + hl.slice(0, 4).map(function (x, i) { /* 11-02 用户:热门话题 6 → 4 个,去掉下面浅色小字 */
|
||||
return '<div class="hr k-' + x.cat + '" data-t="' + x.id + '" role="button"><i class="no' + (i < 3 ? ' t' + i : '') + '">' + (i + 1) + '</i>' +
|
||||
'<span class="hm"><b><em>#</em>' + esc(x.name) + '<em>#</em></b></span>' +
|
||||
'<button type="button" class="jn" data-join="' + x.id + '">参与</button></div>';
|
||||
}).join('') + '<button type="button" class="hall" data-all="1">查看全部 ' + hl.length + ' 个话题 ›</button></div>';
|
||||
}).join('') + '<button type="button" class="hall" data-all="1">查看全部话题 ›</button></div>';
|
||||
if (catF) { fhLevels(fh); return; }
|
||||
fh.className = 'sh';
|
||||
fh.innerHTML = '<h2>大家在聊</h2><small>' + T.filter(function (x) { return cntT(x.id); }).length + ' 个话题 · 共 ' + NOTES.length + ' 篇</small>';
|
||||
/* 11-03 用户:广场里不显示具体有多少篇、多少个话题 → 篇数 / 话题数一律不露 */
|
||||
fh.innerHTML = '<h2>大家在聊</h2><small>孕妈们的真实分享</small>';
|
||||
return;
|
||||
}
|
||||
var d = D[t.id] || {};
|
||||
el.innerHTML = '<div class="th k-' + t.cat + '"><i class="wm" aria-hidden="true">' + esc(t.g) + '</i><button type="button" class="x" data-t="" aria-label="看全部"><svg class="ic"><use href="#i-x"/></svg></button>' +
|
||||
'<div class="bc"><button type="button" data-t="">' + kbHTML(t.cat).replace('</span>', ' ›</span>') + '</button><span>话题 · ' + cntT(t.id) + ' 篇</span></div>' +
|
||||
'<div class="bc"><button type="button" data-t="">' + kbHTML(t.cat).replace('</span>', ' ›</span>') + '</button><span>话题</span></div>' +
|
||||
'<h2><em>#</em>' + esc(t.name) + '<em>#</em></h2><p>' + esc(d.desc || '') + '</p>' +
|
||||
'<div class="tf"><button type="button" class="join" data-join="' + t.id + '"><svg class="ic"><use href="#i-plus"/></svg>参与话题</button><button type="button" class="sw" data-all="1">换个话题</button></div></div>';
|
||||
/* 11-02 用户:「话题页比较乱」→ 去掉投稿奖励横幅和同分类话题胶囊,只留一行标题 */
|
||||
fh.className = 'sh';
|
||||
fh.innerHTML = '<h2>这个话题下的分享</h2><small>共 ' + cntT(t.id) + ' 篇</small>';
|
||||
fh.innerHTML = '<h2>这个话题下的分享</h2>';
|
||||
}
|
||||
/* 11-02 用户:「选了家庭婚姻下一个话题,看着像这块就这几篇,层次感没出来」→ 选了分类 / 话题时,列表上方固定一行「分类 · N 个话题 · 共 M 篇」+ 该分类全部话题胶囊(带篇数),当前话题高亮,「全部」回分类 */
|
||||
var cntT = function (id) { return NOTES.filter(function (n) { return n.t === id; }).length; };
|
||||
@@ -1032,10 +1046,10 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
var tl = hotList().filter(function (x) { return cntT(x.id); }), all = 0;
|
||||
tl.forEach(function (x) { all += cntT(x.id); });
|
||||
fh.className = 'lvw k-' + catF;
|
||||
fh.innerHTML = '<div class="lv"><h2>' + CATS.filter(function (c) { return c[0] === catF; })[0][1] + '</h2><small>' + tl.length + ' 个话题 · 共 ' + all + ' 篇</small>' +
|
||||
fh.innerHTML = '<div class="lv"><h2>' + CATS.filter(function (c) { return c[0] === catF; })[0][1] + '</h2>' +
|
||||
(cur ? '<button type="button" class="ba" data-t="">看这块全部 ›</button>' : '') + '</div>' +
|
||||
'<div class="tcs"><button type="button" data-t=""' + (cur ? '' : ' class="on"') + '>全部<i>' + all + '</i></button>' +
|
||||
tl.map(function (x) { return '<button type="button" data-t="' + x.id + '"' + (cur === x.id ? ' class="on"' : '') + '>#' + esc(x.name) + '#<i>' + cntT(x.id) + '</i></button>'; }).join('') + '</div>';
|
||||
'<div class="tcs"><button type="button" data-t=""' + (cur ? '' : ' class="on"') + '>全部</button>' +
|
||||
tl.map(function (x) { return '<button type="button" data-t="' + x.id + '"' + (cur === x.id ? ' class="on"' : '') + '>#' + esc(x.name) + '#</button>'; }).join('') + '</div>';
|
||||
var on = fh.querySelector('.tcs .on'); if (on && cur) fh.querySelector('.tcs').scrollLeft = Math.max(0, on.offsetLeft - 60);
|
||||
}
|
||||
function renderFeed() {
|
||||
@@ -1100,8 +1114,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
/* 话题下帖子看完,接着引到同分类其他话题,避免以为这块只有这几篇 */
|
||||
var mo = $('#more'), tc = cur && TBY[cur];
|
||||
if (tc) {
|
||||
var rest = NOTES.filter(function (n) { return n.t !== cur; }).length; /* 11-03 分类取消 → 引回「全部」 */
|
||||
mo.innerHTML = '<button type="button" class="mo k-' + tc.cat + '" data-t=""><small>这个话题就这些啦</small><b>广场里还有 ' + rest + ' 篇,去看看 ›</b></button>';
|
||||
mo.innerHTML = '<button type="button" class="mo k-' + tc.cat + '" data-t=""><small>这个话题就这些啦</small><b>广场里还有更多分享,去看看 ›</b></button>';
|
||||
} else mo.innerHTML = '';
|
||||
}
|
||||
function setQuery(t, n) {
|
||||
@@ -1235,11 +1248,11 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
function openTopics() {
|
||||
var grp = function (cat) {
|
||||
var tl = T.filter(function (t) { return t.cat === cat; });
|
||||
return '<div class="tl-h">' + kbHTML(cat) + '<small>' + tl.length + ' 个话题</small></div><div class="tl k-' + cat + '">' + tl.map(function (t) {
|
||||
return '<button type="button" data-pick="' + t.id + '" class="' + (cur === t.id ? 'on' : '') + '"><span><em>#</em>' + esc(t.name) + '<em>#</em><small>' + cntT(t.id) + ' 篇分享</small></span>' + (t.hot ? '<i>热</i>' : '') + '</button>';
|
||||
return '<div class="tl-h">' + kbHTML(cat) + '</div><div class="tl k-' + cat + '">' + tl.map(function (t) {
|
||||
return '<button type="button" data-pick="' + t.id + '" class="' + (cur === t.id ? 'on' : '') + '"><span><em>#</em>' + esc(t.name) + '<em>#</em></span>' + (t.hot ? '<i>热</i>' : '') + '</button>';
|
||||
}).join('') + '</div>';
|
||||
};
|
||||
openSheet('topics', '<h3>全部 ' + T.length + ' 个话题</h3>' + (catF ? [catF] : []).concat(CAT_ORDER.filter(function (c) { return c !== catF; })).map(grp).join('') +
|
||||
openSheet('topics', '<h3>全部话题</h3>' + (catF ? [catF] : []).concat(CAT_ORDER.filter(function (c) { return c !== catF; })).map(grp).join('') +
|
||||
'<button type="button" class="tl-all" data-pick="">看全部分享</button>');
|
||||
}
|
||||
$('#mask').addEventListener('click', closeSheet);
|
||||
@@ -1267,7 +1280,6 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
});
|
||||
}
|
||||
$('#more').addEventListener('click', function (e) {
|
||||
if (e.target.closest('[data-hot]')) { e.stopPropagation(); haptic(); hotOpen = !hotOpen; var k = $('#more .csk'); if (k) k.outerHTML = hotHTML(csDone()); return; }
|
||||
var ts = e.target.closest('[data-test]');
|
||||
if (ts) { e.stopPropagation(); haptic(); location.href = ceshiURL(ts.dataset.test, true); }
|
||||
}, true);
|
||||
|
||||
@@ -105,7 +105,7 @@ main{padding:6px 16px 0}
|
||||
</div>
|
||||
<div class="wb"><button type="button" id="write"><svg class="ic" viewBox="0 0 24 24"><path d="M12 20h9M16.5 3.5a2.1 2.1 0 013 3L7 19l-4 1 1-4z"/></svg>写新的故事</button></div>
|
||||
|
||||
<script src="../topics.js?v=26110265"></script>
|
||||
<script src="../topics.js?v=26110266"></script>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
85
index.html
85
index.html
@@ -7,7 +7,7 @@
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>兜爸心选 · 孕育陪伴</title>
|
||||
<!-- V:26110265 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
|
||||
<!-- V:26110266 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
|
||||
<link rel="stylesheet" href="mama-box.css">
|
||||
<link rel="stylesheet" href="night.css">
|
||||
<!-- 夜晚模式:首屏绘制前就按上次的选择加 class,避免先白后黑闪一下(开关在首页右上角 #nightBtn,逻辑见 app.js) -->
|
||||
@@ -1649,20 +1649,17 @@
|
||||
.qa-bn-t em{height:22px;padding:0 9px;border-radius:99px;background:rgba(255,255,255,.95);color:#F2533A;font-size:12px;font-style:normal;font-weight:900;line-height:22px}
|
||||
.qa-bn-t b{font-size:19px;font-weight:900;line-height:1.3;color:#fff;letter-spacing:.3px;text-shadow:0 1px 6px rgba(200,60,30,.25)}
|
||||
.qa-bn-t span{font-size:12px;font-weight:700;color:rgba(255,255,255,.92)}
|
||||
.qa-bn img{position:absolute;right:-6px;bottom:-10px;width:128px;height:128px;object-fit:cover;object-position:center 25%;border-radius:50%;border:4px solid rgba(255,255,255,.55)}
|
||||
.qa-bn>img{position:absolute;right:-6px;bottom:-10px;width:128px;height:128px;object-fit:cover;object-position:center 25%;border-radius:50%;border:4px solid rgba(255,255,255,.55)}
|
||||
.qa-bn-o1,.qa-bn-o2{position:absolute;border-radius:50%;background:rgba(255,255,255,.16);pointer-events:none}
|
||||
.qa-bn-o1{left:-30px;top:-40px;width:110px;height:110px}.qa-bn-o2{right:110px;bottom:-30px;width:70px;height:70px}
|
||||
.qa-m{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}
|
||||
.qa-st{font-size:11.5px;color:#A8938F}
|
||||
/* 前 10 名热搜小标(微博式方块字) */
|
||||
.qa-bd{flex:none;width:20px;height:20px;border-radius:5px;color:#fff;font-size:12px;font-weight:900;line-height:20px;text-align:center}
|
||||
.qa-bd.bao{background:#D9232D}.qa-bd.fei{background:#F2533A}.qa-bd.re{background:#FF9A2E}.qa-bd.xin{background:#3E9BF5}
|
||||
.qa-cats{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 10px;margin:0 -16px;padding-left:18px;padding-right:18px;scrollbar-width:none}
|
||||
/* 11-03 百问列表改版:Banner 头像叠 + 本周热问 3 大卡 + 卡片行(分类彩签 / 火苗人数 / 一行答案摘要) */
|
||||
.qa-bn-t>span{display:flex;align-items:center;gap:6px}
|
||||
.qa-avs{display:inline-flex;padding-left:6px}
|
||||
.qa-avs img{width:20px;height:20px;margin-left:-6px;border-radius:50%;border:1.5px solid #FFB089;object-fit:cover;background:#fff}
|
||||
.qa-cats{display:flex;gap:7px;overflow-x:auto;padding:2px 2px 4px;margin:0 -16px;padding-left:16px;padding-right:16px;scrollbar-width:none}
|
||||
.qa-cats::-webkit-scrollbar{display:none}
|
||||
.qa-cat{flex:none;padding:5px 12px;border-radius:99px;border:1px solid #F1DDD6;background:#fff;font:inherit;font-size:13px;color:#5E4B48}
|
||||
.qa-cat small{margin-left:3px;font-size:11px;color:#A8938F}
|
||||
.qa-cat.on{background:#F4593C;border-color:#F4593C;color:#fff;font-weight:700}
|
||||
.qa-cat.on small{color:rgba(255,255,255,.8)}
|
||||
.qa-cat{flex:none;height:32px;padding:0 13px;border-radius:11px;border:1px solid #F3E3DD;background:#fff;font:inherit;font-size:13px;font-weight:600;color:#5E4B48;box-shadow:0 2px 6px rgba(190,120,100,.06)}
|
||||
.qa-cat.on{background:linear-gradient(135deg,#FF7A59,#FF9F6E);border-color:transparent;color:#fff;font-weight:800;box-shadow:0 6px 12px -6px #F2533A}
|
||||
.qa-topic{display:flex;align-items:center;gap:12px;margin:4px 0 10px;padding:8px 12px 8px 8px;border-radius:16px;background:linear-gradient(110deg,#FFEDE6,#FFF8F4);text-decoration:none;color:inherit}
|
||||
.qa-topic.hide{display:none}
|
||||
.qa-topic img{flex:none;width:54px;height:54px;border-radius:12px;object-fit:cover}
|
||||
@@ -1670,23 +1667,53 @@
|
||||
.qa-topic em{font-style:normal;font-size:11px;color:#F4593C;font-weight:700}
|
||||
.qa-topic b{font-size:14.5px;color:#2F2424}
|
||||
.qa-topic i{font-style:normal;font-size:20px;color:#E4A595}
|
||||
.qa-list{display:flex;flex-direction:column;gap:8px}
|
||||
.qa-it{border-radius:16px;background:#fff;box-shadow:0 2px 8px rgba(190,120,100,.07);overflow:hidden}
|
||||
.qa-list{display:flex;flex-direction:column;gap:10px}
|
||||
.qa-sec{display:flex;align-items:baseline;gap:8px;margin:14px 2px 0}
|
||||
.qa-sec b{padding-left:9px;border-left:3px solid #FF8A65;font-size:17px;font-weight:900;line-height:1.1;color:#2F2424}
|
||||
.qa-sec small{font-size:12px;color:#A8938F}
|
||||
.qa-list.flt .qa-sec{display:none}
|
||||
.qa-it{position:relative;border-radius:18px;background:#fff;box-shadow:0 3px 12px -2px rgba(190,120,100,.10);overflow:hidden}
|
||||
.qa-it.hide{display:none}
|
||||
.qa-q{display:flex;align-items:center;gap:10px;width:100%;padding:13px 12px;border:0;background:none;font:inherit;color:inherit;text-align:left}
|
||||
.qa-no{flex:none;width:20px;font-size:15px;font-weight:900;font-style:italic;color:#C9B4AF;text-align:center}
|
||||
.qa-it.top .qa-no{color:#F2533A}
|
||||
.qa-tx{font-size:15px;line-height:1.45;font-weight:600;color:#2F2424}
|
||||
.qa-tag{flex:none;padding:0 6px;border-radius:6px;font-size:10.5px;line-height:17px;font-weight:700;background:#F6EEEB;color:#8A7471}
|
||||
.qa-tag.hot{background:#FFE4DE;color:#E8492F}
|
||||
.qa-ch{flex:none;font-style:normal;font-size:16px;color:#D9C2BC;transition:transform .2s}
|
||||
.qa-q{display:flex;align-items:flex-start;gap:10px;width:100%;padding:14px 12px 13px;border:0;background:none;font:inherit;color:inherit;text-align:left}
|
||||
.qa-no{flex:none;width:24px;margin-top:1px;font-size:15px;font-weight:900;font-style:italic;color:#D3C2BD;text-align:center;font-family:-apple-system,"DIN Alternate","Helvetica Neue",sans-serif}
|
||||
.qa-m{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
|
||||
.qa-tx{font-size:15px;line-height:1.45;font-weight:700;color:#2F2424}
|
||||
.qa-mt{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
|
||||
.qa-tg{height:19px;padding:0 7px;border-radius:6px;font-size:11px;font-style:normal;font-weight:800;line-height:19px}
|
||||
.qa-tg.c1{background:#FFE9EF;color:#E0507A}.qa-tg.c2{background:#EEEBFF;color:#6E5BD6}.qa-tg.c3{background:#E3F4FF;color:#2F86C9}
|
||||
.qa-tg.c4{background:#FFF1DA;color:#D5871C}.qa-tg.c5{background:#E6F6EE;color:#2E9C6A}.qa-tg.c6{background:#FFEDE5;color:#E5683F}
|
||||
.qa-st{display:inline-flex;align-items:center;gap:2px;font-size:11.5px;font-weight:600;color:#A8938F}
|
||||
.qa-st svg{width:12px;height:12px;color:#FF6A3D}
|
||||
.qa-st b{font-size:12.5px;font-weight:900;color:#F2533A;font-variant-numeric:tabular-nums}
|
||||
.qa-sn{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;font-size:12.5px;line-height:1.55;color:#9A8885}
|
||||
.qa-sn.go{color:#E5683F;font-weight:700}
|
||||
.qa-it.open .qa-sn{display:none}
|
||||
/* 本周热问前 3:渐变底 + 大号渐变名次 + 摘要两行 */
|
||||
.qa-it.t3{background:linear-gradient(135deg,#FFF4EE 0%,#FFFFFF 62%)}
|
||||
.qa-it.t3.r2{background:linear-gradient(135deg,#FFF7E8 0%,#FFFFFF 62%)}
|
||||
.qa-it.t3.r3{background:linear-gradient(135deg,#F3F0FF 0%,#FFFFFF 62%)}
|
||||
.qa-it.t3::after{content:"";position:absolute;right:-28px;top:-28px;width:96px;height:96px;border-radius:50%;background:radial-gradient(circle,rgba(255,138,101,.16),transparent 70%);pointer-events:none}
|
||||
.qa-it.t3 .qa-q{padding:16px 12px 15px}
|
||||
.qa-it.t3 .qa-no{width:34px;font-size:26px;line-height:1;margin-top:-1px;background:linear-gradient(180deg,#FF5A3C,#FFAA6E);-webkit-background-clip:text;background-clip:text;color:transparent}
|
||||
.qa-it.r2 .qa-no{background-image:linear-gradient(180deg,#FF8A2E,#FFC86E)}
|
||||
.qa-it.r3 .qa-no{background-image:linear-gradient(180deg,#8D6BFF,#C3AEFF)}
|
||||
.qa-it.t3 .qa-tx{font-size:16px;font-weight:900}
|
||||
.qa-it.t3 .qa-sn{-webkit-line-clamp:2}
|
||||
.qa-list.flt .qa-it.t3{background:#fff}
|
||||
.qa-list.flt .qa-it.t3::after{display:none}
|
||||
/* 热搜小标(微博式方块字) */
|
||||
.qa-bd{flex:none;width:20px;height:20px;margin-top:1px;border-radius:6px;color:#fff;font-size:12px;font-weight:900;line-height:20px;text-align:center}
|
||||
.qa-bd.bao{background:linear-gradient(135deg,#F0453A,#FF7A3D)}.qa-bd.re{background:#FF9A2E}.qa-bd.xin{background:#3E9BF5}
|
||||
.qa-ch{flex:none;margin-top:1px;font-style:normal;font-size:16px;color:#D9C2BC;transition:transform .2s}
|
||||
.qa-it.open .qa-ch{transform:rotate(90deg)}
|
||||
.qa-a{display:none;margin:0 12px 13px 42px;padding:10px 12px;border-radius:12px;background:#FFF6F2;font-size:14px;line-height:1.75;color:#4A3B39}
|
||||
.qa-a{display:none;margin:-4px 12px 14px 46px;padding:11px 13px;border-radius:12px;background:#FFF6F2;font-size:14px;line-height:1.75;color:#4A3B39}
|
||||
.qa-it.t3 .qa-a{margin-left:56px}
|
||||
.qa-it.open .qa-a{display:block}
|
||||
.qa-it.hit{animation:qaHit 1.2s ease}
|
||||
@keyframes qaHit{0%,40%{box-shadow:0 0 0 2px #F4593C}100%{box-shadow:0 2px 8px rgba(190,120,100,.07)}}
|
||||
@keyframes qaHit{0%,40%{box-shadow:0 0 0 2px #F4593C}100%{box-shadow:0 3px 12px -2px rgba(190,120,100,.10)}}
|
||||
.qa-more{display:block;margin:16px auto 4px;padding:8px 16px;border-radius:99px;border:1px solid #F1DDD6;background:#fff;font:inherit;font-size:13px;color:#E0573A}
|
||||
html.night .qa-hero b,html.night .qa-tx,html.night .qa-topic b{color:#F1E6EE}
|
||||
html.night .qa-hero b,html.night .qa-tx,html.night .qa-topic b,html.night .qa-sec b{color:#F1E6EE}
|
||||
html.night .qa-it.t3{background:#2F2737}
|
||||
html.night .qa-it,html.night .qa-cat,html.night .qa-more{background:#2F2737;border-color:rgba(255,255,255,.1);box-shadow:none}
|
||||
html.night .qa-a{background:rgba(255,255,255,.06);color:#E3D6DE}
|
||||
html.night .qa-topic{background:linear-gradient(110deg,#3a2a2a,#2c2222)}
|
||||
@@ -2529,16 +2556,16 @@
|
||||
<script src="/_bridge/avatar-picker.js?v=26101105"></script>
|
||||
<script src="/_bridge/hand-icons.js?v=26101202"></script>
|
||||
<script src="js/zodiac-art.js"></script>
|
||||
<script src="guangchang/topics.js?v=26110265"></script>
|
||||
<script src="guangchang/topics.js?v=26110266"></script>
|
||||
<script src="js/app.js"></script>
|
||||
<script src="js/kit.js?v=26110265"></script>
|
||||
<script src="js/kit.js?v=26110266"></script>
|
||||
<script>
|
||||
/* 11-02 首页「孕妈广场」效果稿:地址带 ?gcv=1~6 时,把 #gcHome 换成 demo/gch/vN.css + vN.js 的版式并滚到这一块。
|
||||
11-02 用户:「用第一版,放到预览页面上」;后改定彩色卡 → 不带参数也默认用 V6 合并版(广场卡堆 + 其他妈妈也在搜 + 测一测第 4 版彩色卡),不滚动、不显示效果稿角标 */
|
||||
(function () {
|
||||
var m = location.search.match(/[?&]gcv=([1-6])(?:&|$)/);
|
||||
if (!m) window.__gcDefault = 1;
|
||||
var n = m ? m[1] : '6', l = document.createElement('link'), s = document.createElement('script'), q = m ? Date.now() : 'v=26110265';
|
||||
var n = m ? m[1] : '6', l = document.createElement('link'), s = document.createElement('script'), q = m ? Date.now() : 'v=26110266';
|
||||
var dir = n === '4' || n === '6' ? 'js/gch/' : 'demo/gch/'; /* 11-03 上正式:定稿 V6(含它套的 V4)并进 js/gch/,其余效果稿仍在 demo/ */
|
||||
l.rel = 'stylesheet'; l.href = dir + 'v' + n + '.css?' + q;
|
||||
s.src = dir + 'v' + n + '.js?' + q;
|
||||
@@ -2547,7 +2574,7 @@
|
||||
/* 11-02 品牌露出(用户定 4 处都要):默认加载,?brand=0 可关掉对比;11-03 已并进 js/gch/ */
|
||||
if (!/[?&]brand=0/.test(location.search)) {
|
||||
var bl = document.createElement('link'), bs = document.createElement('script');
|
||||
bl.rel = 'stylesheet'; bl.href = 'js/gch/brand.css?v=26110265'; bs.src = 'js/gch/brand.js?v=26110265';
|
||||
bl.rel = 'stylesheet'; bl.href = 'js/gch/brand.css?v=26110266'; bs.src = 'js/gch/brand.js?v=26110266';
|
||||
document.head.appendChild(bl); document.body.appendChild(bs);
|
||||
}
|
||||
})();
|
||||
@@ -2558,7 +2585,7 @@
|
||||
<script src="js/hero-fx.js"></script>
|
||||
<!-- 2026-10-05 首页头图:宝宝时不时动一动小手小脚(独立文件,删掉这一行即下线) -->
|
||||
<script src="js/baby-limbs.js?v=26101201"></script>
|
||||
<script src="js/coach.js?v=26110265"></script>
|
||||
<script src="js/coach.js?v=26110266"></script>
|
||||
<script src="js/birth-flow.js?v=26110201"></script>
|
||||
|
||||
<!-- 禁止下拉回弹(2026-10-11 统一规则,与孕期体重同一段):竖向拖动时从手指下往上找还能朝该方向滚的容器,找不到才拦;横滑、双指、可滚列表不受影响 -->
|
||||
|
||||
51
js/app.js
51
js/app.js
@@ -3,7 +3,7 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
|
||||
var VER = '26110265';
|
||||
var VER = '26110266';
|
||||
const $ = (s, c) => (c || document).querySelector(s);
|
||||
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
|
||||
|
||||
@@ -5509,6 +5509,10 @@
|
||||
return out.slice(0, n);
|
||||
}
|
||||
window.__mbQaPick = qaPick; window.__mbQaBand = qaBand;
|
||||
/* 11-03 用户:「孕期百问观看人数有点少」→ 单条「N 人看过」= 总人数 × heat × 3.6(约 12 万~64 万,仍低于百宝箱入口「孕期百问 93.6 万人看过」)。模拟数,AGENTS.md 12b,12-31 复核 */
|
||||
const QA_K = 3.6;
|
||||
const qaViews = h => ((window.__mbPulse && window.__mbPulse.total && +window.__mbPulse.total.value) || 1510000) * (+h || 0) * QA_K;
|
||||
window.__mbQaViews = qaViews;
|
||||
const MS_FIRE = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12.6 2.5c.4 3-1.6 4.6-3 6.2C8 10.4 7 12 7 14.3A5 5 0 0012 19.5a5 5 0 005-5.2c0-2-1-3.6-1.9-4.6-.2 1.3-.9 2.2-1.9 2.6.6-3.4-.2-7-.6-9.8z" fill="currentColor"/><path d="M12 19.5a2.6 2.6 0 01-2.6-2.6c0-1.6 1.3-2.5 2-3.6.3 1 .9 1.6 1.6 1.9.9.4 1.6 1.2 1.6 2.1A2.6 2.6 0 0112 19.5z" fill="#FFD36B"/></svg>';
|
||||
const MS_FIRE_W = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12.6 2.5c.4 3-1.6 4.6-3 6.2C8 10.4 7 12 7 14.3A5 5 0 0012 19.5a5 5 0 005-5.2c0-2-1-3.6-1.9-4.6-.2 1.3-.9 2.2-1.9 2.6.6-3.4-.2-7-.6-9.8z" fill="#FFE07A"/></svg>';
|
||||
function msHeat() {
|
||||
@@ -5579,14 +5583,17 @@
|
||||
⚠️ band 必须在用它的标题之前声明(11-02 曾写反 → const 暂时性死区报错,「查看全部」点了没反应) */
|
||||
const band = (state.postpartum || state.pregEmpty) ? 0 : qaBand(state.week);
|
||||
$('#qaTitle').textContent = '其他孕妈也在搜';
|
||||
$('#qaHeroW').textContent = band ? '孕 ' + state.week + ' 周' : '大家都在问';
|
||||
$('#qaHeroT').textContent = '妈妈们最常问的问题';
|
||||
$('#qaHeroD').textContent = bank.length + ' 个问题 · 点开看答案';
|
||||
/* 11-02 用户二改:不要「正在看」和热度条,每条只显示「N 人看过」(= 「此刻」总人数 × heat,同首页;模拟数,AGENTS.md 12b);
|
||||
前 10 名像微博热搜挂小标:第 1 爆、2~7 热、8~10 新,其余不挂(11-03 用户:不要「沸」,用「热」) */
|
||||
/* 11-03 用户:「孕期百问列表太素、看的人少,做得有设计感一点」→
|
||||
Banner 加头像叠 + 「N 万孕妈在这找答案」;前 3 条做成「本周热问」大卡(渐变名次 + 答案摘要);其余为卡片行:问题 + 分类彩签 + 火苗人数 + 一行答案摘要 */
|
||||
const tot = (window.__mbPulse && window.__mbPulse.total && +window.__mbPulse.total.value) || 1510000;
|
||||
const QA_BD = i => i < 1 ? ['爆', 'bao'] : i < 7 ? ['热', 're'] : i < 10 ? ['新', 'xin'] : null;
|
||||
const wan = n => n >= 1e4 ? (Math.round(n / 1e3) / 10) + '万' : String(Math.round(n));
|
||||
$('#qaHeroW').textContent = band ? '孕 ' + state.week + ' 周' : '大家都在问';
|
||||
$('#qaHeroT').textContent = '孕妈最常问的问题';
|
||||
const s0 = ((state.week || 1) * 5) % AVA_TOP.length;
|
||||
$('#qaHeroD').innerHTML = '<span class="qa-avs">' + [0, 1, 2, 3, 4].map(i => avaImg(AVA_TOP[(s0 + i * 2) % AVA_TOP.length])).join('') + '</span>' + wan(tot * 0.62) + ' 孕妈在这找答案';
|
||||
const QA_BD = i => i < 1 ? ['爆', 'bao'] : i < 7 ? ['热', 're'] : i < 10 ? ['新', 'xin'] : null;
|
||||
const QA_EM = { 身体: '🤰', 准备: '📋', 产检: '🩺', 宝宝: '👶', 生活: '🏠', 营养: '🥗', 职场: '💼', 花钱: '💰', 心情: '💗', 趣味: '🎈', 补剂: '💊', 专题: '📌' };
|
||||
const QA_TC = { 身体: 'c1', 准备: 'c2', 产检: 'c3', 宝宝: 'c4', 生活: 'c5', 营养: 'c6', 职场: 'c2', 花钱: 'c6', 心情: 'c1', 趣味: 'c4', 补剂: 'c3', 专题: 'c5' };
|
||||
$('#qaTopic').classList.add('hide');
|
||||
const inBand = x => !!(band && x.st && x.st.indexOf(band) >= 0);
|
||||
const order = bank.filter(x => x.href === QA_FIXED)
|
||||
@@ -5600,28 +5607,32 @@
|
||||
['全部'].concat(cats).forEach(c => {
|
||||
const b = document.createElement('button');
|
||||
b.type = 'button'; b.className = 'qa-cat'; b.dataset.cat = c;
|
||||
b.textContent = c === '__st' ? '孕 ' + state.week + ' 周' : c;
|
||||
const sm = document.createElement('small'); sm.textContent = c === '全部' ? bank.length : c === '__st' ? bank.filter(inBand).length : bank.filter(x => x.tag === c).length;
|
||||
b.appendChild(sm);
|
||||
b.textContent = c === '__st' ? '⏳ 孕 ' + state.week + ' 周' : c === '全部' ? '✨ 全部' : (QA_EM[c] ? QA_EM[c] + ' ' : '') + c;
|
||||
b.addEventListener('click', () => qaFilter(c));
|
||||
cb.appendChild(b);
|
||||
});
|
||||
const L = $('#qaList');
|
||||
L.textContent = '';
|
||||
const sec = (t, d) => { const h = document.createElement('div'); h.className = 'qa-sec'; h.innerHTML = '<b>' + t + '</b><small>' + d + '</small>'; L.appendChild(h); };
|
||||
const snip = a => (a || '').replace(/\s+/g, ' ').trim();
|
||||
order.forEach((x, i) => {
|
||||
if (i === 0) sec('🔥 本周热问', '看的人最多的 3 个问题');
|
||||
if (i === 3) sec('全部问题', '点开就有答案');
|
||||
const it = document.createElement('div');
|
||||
it.className = 'qa-it' + (i < 6 ? ' top' : '');
|
||||
it.className = 'qa-it' + (i < 3 ? ' t3 r' + (i + 1) : '');
|
||||
it.dataset.cat = x.tag || '';
|
||||
if (inBand(x)) it.dataset.st = '1';
|
||||
const h = document.createElement('button'); h.type = 'button'; h.className = 'qa-q';
|
||||
const no = document.createElement('i'); no.className = 'qa-no'; no.textContent = i + 1;
|
||||
const no = document.createElement('i'); no.className = 'qa-no'; no.textContent = i < 9 ? '0' + (i + 1) : i + 1;
|
||||
const t = document.createElement('span'); t.className = 'qa-m';
|
||||
const tq = document.createElement('span'); tq.className = 'qa-tx'; tq.textContent = x.q; t.appendChild(tq);
|
||||
if (+x.heat) {
|
||||
const st = document.createElement('span'); st.className = 'qa-st';
|
||||
st.textContent = wan(tot * +x.heat) + ' 人看过';
|
||||
t.appendChild(st);
|
||||
}
|
||||
const mt = document.createElement('span'); mt.className = 'qa-mt';
|
||||
if (x.tag) mt.insertAdjacentHTML('beforeend', '<em class="qa-tg ' + (QA_TC[x.tag] || 'c5') + '">' + x.tag + '</em>');
|
||||
if (+x.heat) mt.insertAdjacentHTML('beforeend', '<span class="qa-st">' + MS_FIRE + '<b>' + wan(qaViews(x.heat)) + '</b>人看过</span>');
|
||||
t.appendChild(mt);
|
||||
const sn = snip(x.a);
|
||||
if (sn) { const p = document.createElement('span'); p.className = 'qa-sn'; p.textContent = sn; t.appendChild(p); }
|
||||
else if (x.href) { const p = document.createElement('span'); p.className = 'qa-sn go'; p.textContent = '点开看专题,一次讲清楚 ›'; t.appendChild(p); }
|
||||
const bd = QA_BD(i), g = document.createElement('span');
|
||||
if (bd) { g.className = 'qa-bd ' + bd[1]; g.textContent = bd[0]; }
|
||||
const ch = document.createElement('i'); ch.className = 'qa-ch'; ch.textContent = '›';
|
||||
@@ -5638,8 +5649,9 @@
|
||||
const body = $('#detailQA .detail-body');
|
||||
body.scrollTop = 0;
|
||||
const fi = focus != null ? order.indexOf(bank[focus]) : -1;
|
||||
if (fi >= 0 && L.children[fi] && !bank[focus].href) {
|
||||
const c = L.children[fi];
|
||||
const its = L.querySelectorAll('.qa-it');
|
||||
if (fi >= 0 && its[fi] && !bank[focus].href) {
|
||||
const c = its[fi];
|
||||
c.classList.add('open');
|
||||
setTimeout(() => {
|
||||
body.scrollTo({ top: Math.max(0, c.getBoundingClientRect().top - body.getBoundingClientRect().top + body.scrollTop - 12), behavior: 'smooth' });
|
||||
@@ -5650,6 +5662,7 @@
|
||||
function qaFilter(c) {
|
||||
$$('#qaCats .qa-cat').forEach(b => b.classList.toggle('on', b.dataset.cat === c));
|
||||
$$('#qaList .qa-it').forEach(it => it.classList.toggle('hide', c === '__st' ? it.dataset.st !== '1' : c !== '全部' && it.dataset.cat !== c));
|
||||
const L = $('#qaList'); if (L) L.classList.toggle('flt', c !== '全部'); /* 筛选时不分「本周热问 / 全部问题」两段 */
|
||||
}
|
||||
(function () {
|
||||
const all = $('#msAll'); if (all) all.addEventListener('click', () => loadQA().then(() => openQA())); /* 11-02 合并版里原模块可能没渲染过,先确保问题库到手 */
|
||||
|
||||
@@ -231,5 +231,5 @@
|
||||
}
|
||||
/* feed.js 首页默认不加载(index.html 只引了 topics.js),这里按需拉一次 */
|
||||
if (window.GC_FEED) init();
|
||||
else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110265'; fs.onload = fs.onerror = init; document.body.appendChild(fs); }
|
||||
else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110266'; fs.onload = fs.onerror = init; document.body.appendChild(fs); }
|
||||
})();
|
||||
|
||||
@@ -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=26110265';
|
||||
var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/gch/v4.css?v=26110266';
|
||||
document.head.appendChild(l);
|
||||
var s = document.createElement('script'); s.src = 'js/gch/v4.js?v=26110265';
|
||||
var s = document.createElement('script'); s.src = 'js/gch/v4.js?v=26110266';
|
||||
s.onload = function () { if (sec.querySelector('.g4-foot')) merge(); else sec.addEventListener('gc4-ready', merge, { once: true }); }; /* v4 要先拉 feed.js 才渲染 */
|
||||
document.body.appendChild(s);
|
||||
|
||||
|
||||
@@ -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 = '26110265';
|
||||
var V = '26110266';
|
||||
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');
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
var skip = ['topic/huafei/', 'topic/ceshi/', 'topic/duiyou/', 'topic/zhichang/'];
|
||||
var all = window.__mbQaPick ? window.__mbQaPick(QA, wk, 40) : QA;
|
||||
all.filter(function (x) { return x.href && skip.indexOf(x.href) < 0; }).slice(0, 2).forEach(function (x) {
|
||||
out.qa.push({ q: x.q, href: x.href + location.search + location.hash, n: total() * (+x.heat || .03), u: '人看过' });
|
||||
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); });
|
||||
|
||||
@@ -68,7 +68,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=26110265').then(function (idx) {
|
||||
getJSON('../_shared/idx.json?v=26110266').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; });
|
||||
@@ -175,7 +175,7 @@
|
||||
}
|
||||
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=26110265').then(function (d) { L = d.c || []; paint(); }).catch(function () { paint(); });
|
||||
getJSON('../_shared/cm/' + SLUG + '.json?v=26110266').then(function (d) { L = d.c || []; paint(); }).catch(function () { paint(); });
|
||||
}
|
||||
|
||||
function extras(el) {
|
||||
|
||||
Reference in New Issue
Block a user