v26110235 全部问题页:去掉「正在看」和热度条,只留「N 人看过」;前 10 名挂热搜小标(爆/沸/热/新)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-11-02 14:14:26 +00:00
parent ef0f95d260
commit 2c136c2cf2
8 changed files with 27 additions and 32 deletions

View File

@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26110234';
var VER = '26110235';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -5579,9 +5579,10 @@
$('#qaHeroW').textContent = band ? '孕 ' + state.week + ' 周' : '大家都在问';
$('#qaHeroT').textContent = '妈妈们最常问的问题';
$('#qaHeroD').textContent = bank.length + ' 个问题 · 点开看答案';
/* 11-02 用户:列表每条要有热度、多少人正在看、多少人看过 —— 看过 = 「此刻」总人数 × heat(同首页);正在看 = 看过的约万分之六,按分钟轻微浮动(模拟数,AGENTS.md 12b) */
/* 11-02 用户二改:不要「正在看」和热度条,每条只显示「N 人看过」(= 「此刻」总人数 × heat,同首页;模拟数,AGENTS.md 12b);
前 10 名像微博热搜挂小标:第 1 爆、2~3 沸、4~7 热、8~10 新,其余不挂 */
const tot = (window.__mbPulse && window.__mbPulse.total && +window.__mbPulse.total.value) || 1510000;
const hMax = Math.max.apply(null, bank.map(x => +x.heat || 0)) || 1, mnt = Math.floor(Date.now() / 60000);
const QA_BD = i => i < 1 ? ['爆', 'bao'] : i < 3 ? ['沸', 'fei'] : i < 7 ? ['热', 're'] : i < 10 ? ['新', 'xin'] : null;
const wan = n => n >= 1e4 ? (Math.round(n / 1e3) / 10) + '万' : String(Math.round(n));
$('#qaTopic').classList.add('hide');
const inBand = x => !!(band && x.st && x.st.indexOf(band) >= 0);
@@ -5614,13 +5615,12 @@
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 seen = tot * +x.heat, now = Math.max(6, Math.round(seen * 0.0006 * (0.8 + 0.4 * Math.abs(Math.sin(mnt / 7 + i)))));
const st = document.createElement('span'); st.className = 'qa-st';
st.innerHTML = '<i class="qh">' + MS_FIRE + '热度<u><s style="width:' + Math.max(18, Math.round(Math.sqrt(+x.heat / hMax) * 100)) + '%"></s></u></i>' +
'<i class="qn">' + wan(now) + ' 人正在看</i><i>' + wan(seen) + ' 人看过</i>';
st.textContent = wan(tot * +x.heat) + ' 人看过';
t.appendChild(st);
}
const g = document.createElement('span'); g.className = 'qa-tag' + (x.badge ? ' hot' : ''); g.textContent = x.href ? '专题' : (x.tag || '');
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 = '›';
h.appendChild(no); h.appendChild(t); if (g.textContent) h.appendChild(g); h.appendChild(ch);
const a = document.createElement('div'); a.className = 'qa-a';