v26110266 预览:广场去掉篇数/话题数;孕期百问列表改版(热问大卡+分类彩签+答案摘要,人数×3.6);测一测列表按参考图改宫格卡
Co-Authored-By: AI 助手
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user