v26110233 广场普通卡去话题;图上文字 30% 放顶部/中间;回复里「作者」拉开间距;自己的评论带孕周;我的收藏(首页「我的」入口 + 广场收藏层)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-11-02 13:29:18 +00:00
parent 0a74cfc83f
commit 1e9b88896b
7 changed files with 127 additions and 30 deletions

View File

@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26110232';
var VER = '26110233';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -6471,6 +6471,20 @@
toast('请在小程序中完成授权登录');
}
}
/* 11-02 「我的」→ 我的收藏:进孕妈广场的收藏层(guangchang/?fav=1),条数读本机 mmbox.gc.v1[openid].fav */
(function () {
const card = $('#meFavCard'); if (!card) return;
const cnt = () => {
try { const a = JSON.parse(localStorage.getItem('mmbox.gc.v1') || '{}'), me = a[hashParam('openid') || '_guest'] || {}; const k = Object.keys(me.fav || {}).length; $('#meFavN').textContent = k ? '已收藏 ' + k + ' 篇' : '孕妈广场里收藏的帖子'; } catch (e) {}
};
cnt(); window.addEventListener('pageshow', cnt);
card.addEventListener('click', () => {
haptic();
const url = 'guangchang/?fav=1' + location.hash;
reportHostLocation(new URL(url, location.href).href);
location.href = url;
});
})();
var meAuth = $('#meAuthCard');
if (meAuth) meAuth.addEventListener('click', goAuth);
/* 方案A:未授权时点「我的」页顶部资料卡 → 直接去授权,不打开资料弹窗(捕获阶段拦在 data-modal 之前) */