悄悄话留言区:「被赞 6 次变星星」并进最热/最新/同孕周那一行 (v26110638)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-11-07 05:45:52 +00:00
parent 5ff0d5e898
commit 4f2c13b20c
5 changed files with 17 additions and 9 deletions

View File

@@ -1059,7 +1059,7 @@ html.night .gtg button.on{background:#F2725B;border-color:#F2725B;color:#fff}
var CMD = null, CMERR = false; var CMD = null, CMERR = false;
/* 头像编码:数字 = av/NNNN.webp(旧代码头像);'av:c012' = av/c012.webp(卡通/可爱卡通);'/…' = 站内绝对路径(内置头像库 /_bridge/avatars/);其余 = assets/img/mom/xxx.jpg */ /* 头像编码:数字 = 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'; }; 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=26110637').then(function (r) { return r.json(); }).then(function (j) { fetch('cm.json?v=26110638').then(function (r) { return r.json(); }).then(function (j) {
CMD = j; if (openId && NBY[openId]) { renderComments(NBY[openId]); syncBar(NBY[openId]); } CMD = j; if (openId && NBY[openId]) { renderComments(NBY[openId]); syncBar(NBY[openId]); }
}).catch(function () { CMERR = true; if (openId && NBY[openId]) renderComments(NBY[openId]); }); }).catch(function () { CMERR = true; if (openId && NBY[openId]) renderComments(NBY[openId]); });
function commentsOf(n) { function commentsOf(n) {

View File

@@ -9,10 +9,10 @@
<title>兜爸心选 · 孕育陪伴</title> <title>兜爸心选 · 孕育陪伴</title>
<!-- 11-04 UGC 总开关(孕妈广场 + 测一测,后台 /box_bm/plaza 顶部切换),见 js/ugc.js --> <!-- 11-04 UGC 总开关(孕妈广场 + 测一测,后台 /box_bm/plaza 顶部切换),见 js/ugc.js -->
<script src="js/ugc.js?v=26110487"></script> <script src="js/ugc.js?v=26110487"></script>
<!-- V:26110637 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 --> <!-- V:26110638 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<link rel="stylesheet" href="mama-box.css"> <link rel="stylesheet" href="mama-box.css">
<link rel="stylesheet" href="night.css?v=26110608"> <link rel="stylesheet" href="night.css?v=26110608">
<link rel="stylesheet" href="js/wh-cm.css?v=26110637"> <link rel="stylesheet" href="js/wh-cm.css?v=26110638">
<!-- 11-04 用户:「顶部图片上的倒计时先删除掉」→ 不加载 hero-cd.css / hero-cd.js(文件留着,加回这两行即恢复),头图回到原样式 --> <!-- 11-04 用户:「顶部图片上的倒计时先删除掉」→ 不加载 hero-cd.css / hero-cd.js(文件留着,加回这两行即恢复),头图回到原样式 -->
<!-- 夜晚模式:首屏绘制前就按上次的选择加 class,避免先白后黑闪一下(开关在首页右上角 #nightBtn,逻辑见 app.js) --> <!-- 夜晚模式:首屏绘制前就按上次的选择加 class,避免先白后黑闪一下(开关在首页右上角 #nightBtn,逻辑见 app.js) -->
<script>try{if(localStorage.getItem('mmbox.night.v1')==='1'){document.documentElement.classList.add('night');document.querySelector('meta[name=theme-color]').content='#2A2340'}}catch(e){}</script> <script>try{if(localStorage.getItem('mmbox.night.v1')==='1'){document.documentElement.classList.add('night');document.querySelector('meta[name=theme-color]').content='#2A2340'}}catch(e){}</script>
@@ -2680,7 +2680,7 @@ html.night .rs-pan .rp-card{background:rgba(255,255,255,.06);border-color:rgba(2
<script src="guangchang/topics.js?v=26110487"></script> <script src="guangchang/topics.js?v=26110487"></script>
<script src="js/ava-pool.js?v=26110487"></script> <!-- 11-05 装饰头像分配表(各模块互不重复) --> <script src="js/ava-pool.js?v=26110487"></script> <!-- 11-05 装饰头像分配表(各模块互不重复) -->
<script src="js/wh-themes.js?v=26110609"></script> <script src="js/wh-themes.js?v=26110609"></script>
<script src="js/wh-cm.js?v=26110637" defer></script> <script src="js/wh-cm.js?v=26110638" defer></script>
<script src="js/app.js"></script> <script src="js/app.js"></script>
<script src="js/kit.js?v=26110605"></script> <script src="js/kit.js?v=26110605"></script>
<!-- 11-05 用户:孕期百问加上跟趣味小测试一样的底部 Tab(孕期百问 / 记一下 / 返回首页)。挂在 #detailQA 里,面板关着时跟着滑出屏外; <!-- 11-05 用户:孕期百问加上跟趣味小测试一样的底部 Tab(孕期百问 / 记一下 / 返回首页)。挂在 #detailQA 里,面板关着时跟着滑出屏外;

View File

@@ -3,7 +3,7 @@
(function () { (function () {
'use strict'; 'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */ /* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26110637'; var VER = '26110638';
const $ = (s, c) => (c || document).querySelector(s); const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s)); const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));

View File

@@ -25,7 +25,8 @@
.wcs:not(.show) .wcs-rule,.wcs:not(.show) .wcm-tb{opacity:0} .wcs:not(.show) .wcs-rule,.wcs:not(.show) .wcm-tb{opacity:0}
.wcs-x{display:none!important} .wcs-x{display:none!important}
.wcs.show .wcs-x{display:grid!important;margin-left:auto;align-self:center;display:grid;place-items:center;width:28px;height:28px;border:0;border-radius:50%;background:rgba(255,255,255,.1);color:#fff} .wcs.show .wcs-x{display:grid!important;margin-left:auto;align-self:center;display:grid;place-items:center;width:28px;height:28px;border:0;border-radius:50%;background:rgba(255,255,255,.1);color:#fff}
.wcm-tb{display:flex;align-items:center;gap:6px;margin:10px 18px 2px} .wcm-tb{display:flex;align-items:center;gap:6px;margin:10px 14px 2px 18px}
.wcm-tb button{flex:none}
.wcm-tb button{height:26px;padding:0 12px;border-radius:99px;border:0;background:rgba(255,255,255,.07);color:rgba(232,222,255,.62);font:inherit;font-size:12.5px} .wcm-tb button{height:26px;padding:0 12px;border-radius:99px;border:0;background:rgba(255,255,255,.07);color:rgba(232,222,255,.62);font:inherit;font-size:12.5px}
.wcm-tb button.on{background:linear-gradient(135deg,rgba(255,214,170,.92),rgba(255,170,160,.92));color:#3A2312;font-weight:800} .wcm-tb button.on{background:linear-gradient(135deg,rgba(255,214,170,.92),rgba(255,170,160,.92));color:#3A2312;font-weight:800}
/* 重点:被赞 N 次就变成星星 */ /* 重点:被赞 N 次就变成星星 */
@@ -170,3 +171,9 @@ p.wcm-mf{display:block;color:#FFC07A}
.wcs-avs img+img{margin-left:-7px} .wcs-avs img+img{margin-left:-7px}
.wcs-avs img{transition:transform .26s ease,opacity .26s ease}.wcs-avs img.out{transform:scale(.4);opacity:0}.wcs-avs img.nw{animation:wavIn .45s cubic-bezier(.3,1.6,.5,1)} .wcs-avs img{transition:transform .26s ease,opacity .26s ease}.wcs-avs img.out{transform:scale(.4);opacity:0}.wcs-avs img.nw{animation:wavIn .45s cubic-bezier(.3,1.6,.5,1)}
@keyframes wavIn{from{transform:scale(.3);opacity:0}} @keyframes wavIn{from{transform:scale(.3);opacity:0}}
/* 11-07 规则横幅并进排序那一行 → 右边小胶囊 */
.wcm-tb .wcs-rule{flex:0 1 auto;min-width:0;margin:0 0 0 auto;padding:0 10px 0 8px;height:26px;gap:4px;border-radius:99px;font-size:11.5px;white-space:nowrap}
.wcm-tb .wcs-rule span{overflow:hidden;text-overflow:ellipsis}
.wcm-tb .wcs-rule svg{width:13px;height:13px}
.wcm-tb .wcs-rule b{font-size:13px}

View File

@@ -37,8 +37,9 @@
sh.innerHTML = '<div class="wcs-p" role="dialog" aria-label="妈妈们的留言">' + sh.innerHTML = '<div class="wcs-p" role="dialog" aria-label="妈妈们的留言">' +
'<div class="wcs-hd"><i class="wcs-grab" aria-hidden="true"></i><div class="wcs-tt"><b>妈妈们的留言</b><span class="wcs-avs" id="wcmAv" aria-hidden="true"></span><span id="wcmN"></span><i class="wcs-up">上滑看看</i>' + '<div class="wcs-hd"><i class="wcs-grab" aria-hidden="true"></i><div class="wcs-tt"><b>妈妈们的留言</b><span class="wcs-avs" id="wcmAv" aria-hidden="true"></span><span id="wcmN"></span><i class="wcs-up">上滑看看</i>' +
'<button type="button" class="wcs-x" aria-label="收起"><svg viewBox="0 0 24 24" width="14" height="14"><path d="M6 6l12 12M18 6L6 18" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/></svg></button></div>' + '<button type="button" class="wcs-x" aria-label="收起"><svg viewBox="0 0 24 24" width="14" height="14"><path d="M6 6l12 12M18 6L6 18" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/></svg></button></div>' +
'<div class="wcs-rule"><svg viewBox="0 0 20 20"><path d="M10 .5C10.9 7.4 12.6 9.1 19.5 10 12.6 10.9 10.9 12.6 10 19.5 9.1 12.6 7.4 10.9.5 10 7.4 9.1 9.1 7.4 10 .5Z"/></svg><span>留言被赞 <b id="wcmRuleN">6</b> 次,就会变成一颗星星挂上去</span></div>' + /* 11-07 用户:「被赞 6 次变星星」放到 最热/最新/同孕周 同一行后边 */
'<div class="wcm-tb" role="tablist"><button type="button" class="on" data-wso="hot">最热</button><button type="button" data-wso="new">最新</button><button type="button" data-wso="wk">同孕周</button></div></div>' + '<div class="wcm-tb" role="tablist"><button type="button" class="on" data-wso="hot">最热</button><button type="button" data-wso="new">最新</button><button type="button" data-wso="wk">同孕周</button>' +
'<div class="wcs-rule"><svg viewBox="0 0 20 20"><path d="M10 .5C10.9 7.4 12.6 9.1 19.5 10 12.6 10.9 10.9 12.6 10 19.5 9.1 12.6 7.4 10.9.5 10 7.4 9.1 9.1 7.4 10 .5Z"/></svg><span>被赞 <b id="wcmRuleN">6</b> 次,就变成一颗星星</span></div></div></div>' +
'<div class="wcs-ls" id="wcsLs"><div id="wcmLs"><p class="wcm-e">留言加载中…</p></div><button type="button" class="wcm-more" id="wcmMore" hidden>再看看</button></div>' + '<div class="wcs-ls" id="wcsLs"><div id="wcmLs"><p class="wcm-e">留言加载中…</p></div><button type="button" class="wcm-more" id="wcmMore" hidden>再看看</button></div>' +
'<div class="wcs-in"><span class="wcs-to" id="wcsTo" hidden></span><input id="wcsIn" type="text" maxlength="200" enterkeyhint="send" placeholder="说点什么…"><button type="button" id="wcsSend">发送</button></div>' + '<div class="wcs-in"><span class="wcs-to" id="wcsTo" hidden></span><input id="wcsIn" type="text" maxlength="200" enterkeyhint="send" placeholder="说点什么…"><button type="button" id="wcsSend">发送</button></div>' +
'</div>'; '</div>';
@@ -69,7 +70,7 @@
function repOf(c, me) { return { p: c.parent, n: me ? '我' : (c.nickname || '孕妈'), me: me, to: c.parentName, t: c.text, ts: c.at, st: me ? c.status : '' }; } function repOf(c, me) { return { p: c.parent, n: me ? '我' : (c.nickname || '孕妈'), me: me, to: c.parentName, t: c.text, ts: c.at, st: me ? c.status : '' }; }
function load() { function load() {
if (loading || SIM) return; loading = true; if (loading || SIM) return; loading = true;
fetch('guangchang/cm.json?v=26110637').then(function (r) { return r.json(); }).then(function (j) { fetch('guangchang/cm.json?v=26110638').then(function (r) { return r.json(); }).then(function (j) {
var PP = j.p; var PP = j.p;
SIM = (j.c[PID] || []).map(function (c, k) { SIM = (j.c[PID] || []).map(function (c, k) {
var p = PP[c[0]]; var p = PP[c[0]];