v26110254 孕妈广场分类小 banner:家庭婚姻/职场/经验/测一测各一张,祈福树只留在全部

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-11-03 06:55:00 +00:00
parent 0f79ddcffb
commit ab799bcebb
12 changed files with 57 additions and 20 deletions

View File

@@ -560,6 +560,24 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
.rec-app.off img,.rec-app.off .rl{opacity:.45;filter:grayscale(.4)}
.rec-app.off i{position:absolute;top:-8px;left:calc(50% + 4px);font-style:normal;font-size:9px;font-weight:700;line-height:1;padding:3px 5px;border-radius:99px;background:#B9A9A2;color:#fff;white-space:nowrap}
.rec-empty{padding:30px 0;text-align:center;font-size:13px;color:#9C8F88}
/* ---------- 分类小 banner(11-03 用户:家庭婚姻 / 职场 / 经验 / 测一测各做一张小 banner 替换祈福树,祈福树只留在「全部」)
图 guangchang/bn/*.webp(AI 生成 3D 黏土风,纯色底),卡片底色取图的底色,图贴右边、左侧文字 ---------- */
.cbn{position:relative;display:flex;align-items:stretch;width:calc(100% - 24px);height:112px;margin:2px 12px 0;border:0;padding:0;border-radius:18px;overflow:hidden;text-align:left;font-family:inherit;cursor:pointer;background:var(--bb);box-shadow:0 6px 16px rgba(160,90,70,.1);transition:transform .16s;-webkit-tap-highlight-color:transparent}
.cbn:active{transform:scale(.985)}
.cbn img{position:absolute;right:-6px;top:50%;height:132px;width:auto;transform:translateY(-50%);pointer-events:none;animation:cbnF 5s ease-in-out infinite}
@keyframes cbnF{0%,100%{transform:translateY(-50%)}50%{transform:translateY(calc(-50% - 3px))}}
.cbn::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,var(--bb) 38%,transparent 66%)}
.cbn-tx{position:relative;z-index:1;display:flex;flex-direction:column;align-items:flex-start;padding:14px 0 12px 16px;max-width:64%}
.cbn-tx small{font-size:11px;font-weight:700;color:var(--bc);opacity:.85;letter-spacing:.3px}
.cbn-tx b{margin-top:4px;font-size:17.5px;font-weight:900;color:#2A1E1E;line-height:1.25;white-space:nowrap}
.cbn-tx em{margin-top:3px;font-style:normal;font-size:11.5px;color:#7C6E68;white-space:nowrap}
.cbn-go{margin-top:auto;display:inline-flex;align-items:center;gap:1px;height:26px;padding:0 9px 0 12px;border-radius:99px;background:var(--bc);color:#fff;font-size:12px;font-weight:800;box-shadow:0 3px 8px rgba(0,0,0,.12)}
.cbn-go .ic{width:12px;height:12px}
.cbn.b-family{--bb:#FCDEE3;--bc:#E25C7A}
.cbn.b-work{--bb:#D2E0F7;--bc:#4A7BD0}
.cbn.b-baby{--bb:#D6EFE7;--bc:#2E9B78}
.cbn.b-ceshi{--bb:#E8E0FC;--bc:#7A5BD6}
</style>
</head>
<body>
@@ -648,10 +666,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=26110253"></script>
<script src="data.js?v=26110253"></script>
<script src="feed.js?v=26110253"></script>
<script src="ceshi/meta.js?v=26110253"></script>
<script src="topics.js?v=26110254"></script>
<script src="data.js?v=26110254"></script>
<script src="feed.js?v=26110254"></script>
<script src="ceshi/meta.js?v=26110254"></script>
<script>
(function () {
'use strict';
@@ -717,7 +735,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=26110253').then(function (r) { return r.json(); }).then(function (j) {
fetch('cm.json?v=26110254').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) {
@@ -859,6 +877,24 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
'<span class="qf-tx"><small><i></i>宝宝祈福树</small><b><i>#</i>为宝宝挂一张福牌<i>#</i></b><em>集齐五福,愿宝宝平平安安</em>' +
'<span class="qf-go">去祈福<svg class="ic"><use href="#i-right"/></svg></span></span></button>';
}
/* 分类小 banner:家庭婚姻 / 职场 / 经验 点了 = 参与本类最热话题(投稿规则弹层);测一测 点了 = 进最热的那个测试 */
var CBN = {
family: ['家庭婚姻', '孕期的家,也需要用心经营', '和老公、婆婆、爸妈的那些事', '我也来聊聊'],
work: ['职场', '怀孕了,工作也要安心', '产检请假、孕期上班、休产假', '我也来聊聊'],
baby: ['经验', '过来人的孕育笔记', '踩过的坑、买对的好物都在这', '分享我的经验'],
ceshi: ['孕育测一测', '', '', '测最热的一个']
};
function cbnHTML(c) {
var x = CBN[c]; if (!x) return '';
var tgt;
if (c === 'ceshi') {
var top = byHot(TM)[0];
x = x.slice(); x[1] = '测测你是哪种孕妈'; x[2] = '累计 ' + Math.round(TM.reduce(function (a, y) { return a + gcTested(y.id); }, 0) / 1e4) + ' 万人次参与 · ' + TM.length + ' 个测试';
tgt = top ? ' data-test="' + top.id + '"' : '';
} else { var h = hotList()[0]; tgt = ' data-join="' + (h ? h.id : '') + '"'; }
return '<button type="button" class="cbn b-' + c + '"' + tgt + '><img src="bn/' + c + '.webp" alt="" decoding="async">' +
'<span class="cbn-tx"><small>' + x[0] + '</small><b>' + x[1] + '</b><em>' + x[2] + '</em><span class="cbn-go">' + x[3] + '<svg class="ic"><use href="#i-right"/></svg></span></span></button>';
}
/* 跳祈福树:同首页 jumpApp(QIFU_URL) —— 相对路径、身份走 query、上报 last_app 与分享位置(AGENTS 硬约定 3/6/7/13) */
function goQifu() { goApp('/qifu-shu/'); }
/* 跳站内其他 H5(祈福树 / 记一下宫格共用):只走相对路径(AGENTS 13),后台给的完整地址也剥成 /slug/… */
@@ -950,10 +986,10 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
}
function renderHead() {
var t = TBY[cur], el = $('#head'), fh = $('#fh');
if (catF === 'ceshi') { el.innerHTML = ceshiHead(); ceshiFh(fh); return; }
if (catF === 'ceshi') { el.innerHTML = cbnHTML('ceshi'); ceshiFh(fh); return; } /* 原一行介绍 ceshiHead 并进 banner */
if (!t) {
var hl = hotList();
el.innerHTML = qifuHTML() +
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>' +
/* 11-02 用户:「热门话题不要一块一块的,改成井号、偏列表的形式」→ 排行列表:名次 + #话题# + 一行简介 + 篇数/热,右侧「参与」
投稿奖励从顶部大横幅挪到这里当列表头一行(用户:「30 现金 + 500 兜豆看放哪」→ 跟「参与」放一起,点了看规则) */
@@ -1154,6 +1190,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
$('#more').addEventListener('click', function (e) { if (e.target.closest('[data-t]')) { haptic(); selectTopic(''); } });
$('#head').addEventListener('click', function (e) {
if (e.target.closest('#qfBanner')) { goQifu(); return; }
var cb = e.target.closest('.cbn[data-test]'); if (cb) { haptic(); location.href = ceshiURL(cb.dataset.test, true); return; }
var j = e.target.closest('[data-join]'); if (j) { haptic(); openRule(j.dataset.join); return; }
if (e.target.closest('[data-rule]')) { openRule(''); return; }
if (e.target.closest('[data-all]')) { openTopics(); return; }