diff --git a/guangchang/ceshi/index.html b/guangchang/ceshi/index.html index 4071026..60371b1 100644 --- a/guangchang/ceshi/index.html +++ b/guangchang/ceshi/index.html @@ -320,8 +320,8 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
- - + + - - - + + + + + @@ -2559,17 +2559,17 @@ - + - - + + - + diff --git a/js/app.js b/js/app.js index 9265193..faf31f7 100644 --- a/js/app.js +++ b/js/app.js @@ -3,7 +3,7 @@ (function () { 'use strict'; /* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */ - var VER = '26110267'; + var VER = '26110268'; 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 6eac337..e2fc6ca 100644 --- a/js/gch/v4.js +++ b/js/gch/v4.js @@ -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=26110267'; fs.onload = fs.onerror = init; document.body.appendChild(fs); } + else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110268'; fs.onload = fs.onerror = init; document.body.appendChild(fs); } })(); diff --git a/js/gch/v6.css b/js/gch/v6.css index 92c3f77..7c659e0 100644 --- a/js/gch/v6.css +++ b/js/gch/v6.css @@ -86,3 +86,8 @@ html.night #gcHome.gv4.gv6 .g6-li{color:#F3E8F0;border-color:rgba(255,255,255,.1 #gcHome.gv4.gv6 .g6-all{display:flex;align-items:center;justify-content:center;gap:2px;width:auto;margin:2px auto 0;padding:6px 10px;border-radius:0;background:none;font-size:12.5px;font-weight:600;color:#B0948D} #gcHome.gv4.gv6 .g6-all.hide{display:none} html.night #gcHome.gv4.gv6 .g6-all{background:none;color:#B9A6B1} +/* 11-03 「大家都在关注」改放 6 篇笔记:标题两行、右侧封面小图、点赞数 + 孕周 */ +#gcHome.gv4.gv6 .g6-nt{align-items:center} +#gcHome.gv4.gv6 .g6-nt .ms-q{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:15px;line-height:1.45} +#gcHome.gv4.gv6 .g6-ph{flex:none;width:56px;height:56px;margin-left:10px;border-radius:12px;object-fit:cover;background:#F6EEEA} +#gcHome.gv4.gv6 .g6-st{margin-left:8px;font-style:normal;font-weight:600;color:#B19C96} diff --git a/js/gch/v6.js b/js/gch/v6.js index 6b96a5d..201fd4d 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=26110267'; + var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/gch/v4.css?v=26110268'; document.head.appendChild(l); - var s = document.createElement('script'); s.src = 'js/gch/v4.js?v=26110267'; + var s = document.createElement('script'); s.src = 'js/gch/v4.js?v=26110268'; s.onload = function () { if (sec.querySelector('.g4-foot')) merge(); else sec.addEventListener('gc4-ready', merge, { once: true }); }; /* v4 要先拉 feed.js 才渲染 */ document.body.appendChild(s); @@ -23,7 +23,7 @@ var box = document.createElement('div'); box.className = 'g6-ms'; box.innerHTML = - /* 11-03 用户:孕妈广场下面的「其他孕妈也在搜」改成广场里大家关注的 6 个话题,点了直接进该话题(问题库那份挪去「孕期百宝箱 → 孕期百问」) */ + /* 11-03 用户:孕妈广场下面的「其他孕妈也在搜」改成广场里大家关注的 6 条(同日再改:放笔记标题,不放话题,见 pick6);问题库那份挪去「孕期百宝箱 → 孕期百问」 */ '

大家都在关注

' + '' + '
' + @@ -73,23 +73,27 @@ if (/[?&]qzcard=1(?:&|$)/.test(location.search)) sec.insertBefore(qz, foot); var list = box.querySelector('.g6-list'), all = box.querySelector('.g6-all'); var tot = (window.__mbPulse && window.__mbPulse.total && +window.__mbPulse.total.value) || 1510000; - /* 6 个话题 = 广场「全部」页「热门话题」前 6(同 guangchang/index.html hotList:带 hot 的三块轮流排 —— 家庭婚姻 / 职场 / 经验) */ - function hot6() { - var T = window.GC_TOPICS || [], hot = T.filter(function (t) { return t.hot; }), by = ['family', 'work', 'baby'].map(function (c) { return hot.filter(function (t) { return t.cat === c; }); }), rr = []; - for (var r = 0; r < 10; r++) by.forEach(function (x) { if (x[r]) rr.push(x[r]); }); - return rr.concat(T.filter(function (t) { return !t.hot; })).slice(0, 6); + /* 11-03 用户:「这 6 条要放文章标题,不是话题;挑 6 篇吸引人的」→ 固定 6 篇笔记(点赞高、标题有画面,婚姻 / 经验 / 家庭 / 职场轮着来), + 点了直接打开那篇(guangchang/?n=id)。右边配笔记封面小图(图本身不露人头);feed 里找不到的按点赞高的补位。 */ + var PICK = ['m09-4', 'b07-1', 'f02-2', 'w10-1', 'b04-4', 'm09-6']; + function pick6() { + var F = window.GC_FEED || [], by = {}; + F.forEach(function (n) { by[n.id] = n; }); + var out = PICK.map(function (id) { return by[id]; }).filter(Boolean); + F.slice().sort(function (a, b) { return b.likes - a.likes; }).forEach(function (n) { if (out.length < 6 && out.indexOf(n) < 0) out.push(n); }); + return out.slice(0, 6); } function paintList() { - var l6 = hot6(); + var l6 = pick6(); if (!l6.length) { box.style.display = 'none'; return; } list.innerHTML = l6.map(function (x, i) { - var n = x.talk || 0, heat = '' + FIRE + '' + (n >= 1e4 ? Math.round(n / 1e3) / 10 + '万' : n) + ' 人在聊'; /* 在聊人数是 topics.js 的占位数,同广场页 */ - var b = window.__mbMsBadge ? window.__mbMsBadge(i) : { t: '', c: '' }; - var bd = b.t ? '' + (b.c === 'bao' ? FIRE_W : '') + esc(b.t) + '' : ''; - return '' + (i + 1) + '' + - '#' + esc(x.name) + '#' + heat + '' + bd + '›'; + var n = x.likes || 0, heat = '' + FIRE + '' + (n >= 1e4 ? Math.round(n / 1e3) / 10 + '万' : n) + ' 人点赞' + esc(x.stage || '') + ''; + var q = new URLSearchParams(location.search); q.set('n', x.id); + return '' + (i + 1) + '' + + '' + esc(x.title) + '' + heat + '' + + (x.photo ? '' : '›') + ''; }).join(''); - all.textContent = '查看全部话题 ›'; + all.textContent = '去广场看更多 ›'; all.classList.remove('hide'); } all.addEventListener('click', function () { location.href = 'guangchang/' + location.search + location.hash; }); diff --git a/js/kit.js b/js/kit.js index cd4cae3..5747a14 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 = '26110267'; + var V = '26110268'; 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/topic/_shared/tools.js b/topic/_shared/tools.js index 33c4073..dd62743 100644 --- a/topic/_shared/tools.js +++ b/topic/_shared/tools.js @@ -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=26110267').then(function (idx) { + getJSON('../_shared/idx.json?v=26110268').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=26110267').then(function (d) { L = d.c || []; paint(); }).catch(function () { paint(); }); + getJSON('../_shared/cm/' + SLUG + '.json?v=26110268').then(function (d) { L = d.c || []; paint(); }).catch(function () { paint(); }); } function extras(el) {