首页此刻改2行轮播;新增孕妈广场(首页横滑话题卡+15话题瀑布流+详情点赞评论,占位内容)v26110109

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-11-01 06:16:52 +00:00
parent 225fb21bf3
commit 107e02a47e
5 changed files with 3118 additions and 4 deletions

View File

@@ -7,7 +7,7 @@
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>兜爸心选 · 孕育陪伴</title>
<!-- V:26110108 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<!-- V:26110109 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<link rel="stylesheet" href="mama-box.css">
<link rel="stylesheet" href="night.css">
<!-- 夜晚模式:首屏绘制前就按上次的选择加 class,避免先白后黑闪一下(开关在首页右上角 #nightBtn,逻辑见 app.js) -->
@@ -447,6 +447,10 @@
html.night .hts-row,html.night .hts-add{background:rgba(255,255,255,.07);box-shadow:none}
html.night .hts-mv,html.night .hts-reset{background:rgba(255,255,255,.1);color:#E2D2DC}
html.night .hts-foot{border-color:rgba(255,255,255,.08)}
/* 2026-11-01 用户:「把此刻下面三行轮播改成两行轮播」→ 可见 2 行(app.js FEED_N=2),高度 30×2;
mama-box.css 里「新进一行淡入」按第 4 个子元素写死,两行时新进的是第 3 个,这里补上 */
.pl-feed.pl-feed3{height:60px}
.pl-feed3 .pl-track>.pl-row:nth-child(3):last-child{animation:plIn .55s var(--ease) both}
</style>
<!-- 此刻(2026-10-01 需求文档 v1.0 第二节;同日两次改版)。数据 GET /api/mp/public/mama-box/pulse,渲染在 app.js pulseCard()。
⚠️ 模拟数据是产品负责人 2026-10-01 拍板的例外(AGENTS.md §4.12),只限这一条。
@@ -491,6 +495,57 @@
</div>
</section>
<!-- 孕妈广场(2026-11-01 第一版,占位内容)。用户原话:「在这个模块下边加一个广场,放一些话题,有跟家庭里的,也有宝妈经验的……
展示的时候不要像下面『其他妈妈也在搜』那种列表形式,两个列表就乱了。点进去之后变成小红书那种瀑布流」。
→ 首页只放一排横滑的话题封面卡(不是列表):渐变色块 + 大水印字 + 话题名 + 篇数/在聊,热门带角标;
点卡进 guangchang/?t=话题id,点「去逛逛」进广场全部。话题表在 guangchang/topics.js(与广场页共用),渲染在 app.js initPlaza()。
⚠️ 篇数 / 在聊人数是占位数字(topics.js 注释),广场页底部写着「示例占位」。topics.js 没加载到 → 整块保持 .hide。 -->
<section class="gc-home hide" id="gcHome">
<div class="gch-head">
<h2 class="gch-title"><span>孕妈广场</span></h2>
<span class="gch-cat" id="gchCat" role="tablist" aria-label="话题分类"><button type="button" class="on" data-cat="">全部</button><button type="button" data-cat="family">家庭</button><button type="button" data-cat="exp">经验</button></span>
<button type="button" class="gch-more" id="gchMore">去逛逛<i aria-hidden="true">›</i></button>
</div>
<div class="gch-who"><span class="gch-avs" id="gchAvs" aria-hidden="true"></span><span id="gchCnt"></span></div>
<div class="gch-row" id="gchRow"></div>
<style>
#homeBody>section.gc-home{--gt:255,120,150}
.gc-home{margin:16px -26px 0;padding:16px 26px 16px;border-radius:26px;position:relative;z-index:0;background-color:#fff}
.gc-home.hide{display:none}
.gch-head{display:flex;align-items:center;gap:8px}
.gch-title{flex:none;margin:0;font-size:21px;font-weight:900;letter-spacing:.5px;color:#2A1E1E}
.gch-title span{background:linear-gradient(transparent 58%,#FFD0DC 58%,#FFD0DC 92%,transparent 92%);padding:0 3px}
.gch-cat{display:flex;padding:2px;border-radius:99px;background:rgba(240,222,214,.7)}
.gch-cat button{height:22px;padding:0 8px;border:0;border-radius:99px;background:none;font:inherit;font-size:11.5px;font-weight:700;color:#9A7F78}
.gch-cat button.on{background:#fff;color:#D9466A;box-shadow:0 1px 4px rgba(190,110,120,.18)}
.gch-more{margin-left:auto;flex:none;display:inline-flex;align-items:center;gap:2px;height:26px;padding:0 4px 0 10px;border:0;border-radius:99px;background:linear-gradient(135deg,#FF8A9E,#F2627E);font:inherit;font-size:12px;font-weight:800;color:#fff;box-shadow:0 4px 10px rgba(242,98,126,.28)}
.gch-more i{font-style:normal;font-size:15px;line-height:1;padding:0 4px 1px 1px}
.gch-who{display:flex;align-items:center;gap:7px;margin:9px 0 0;font-size:12px;color:#8E7773}
.gch-who b{color:#D9466A;font-weight:800;font-variant-numeric:tabular-nums}
.gch-avs{display:flex}
.gch-avs img{width:20px;height:20px;border-radius:50%;object-fit:cover;border:1.5px solid #fff;margin-left:-6px;background:#FFE3D3}
.gch-avs img:first-child{margin-left:0}
.gch-row{display:flex;gap:10px;margin:12px -26px 0;padding:2px 26px 8px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;scroll-padding:0 26px;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.gch-row::-webkit-scrollbar{display:none}
.gch-row::after{content:"";flex:none;width:16px}
.gch-card{position:relative;flex:none;width:124px;height:152px;padding:12px 11px 10px;border:0;border-radius:18px;overflow:hidden;text-align:left;font:inherit;display:flex;flex-direction:column;scroll-snap-align:start;
background:linear-gradient(155deg,var(--c1),var(--c2));color:var(--ink);box-shadow:0 8px 16px -10px var(--ink),inset 0 1px 0 rgba(255,255,255,.7)}
.gch-card:active{transform:scale(.97)}
.gch-card .gk{align-self:flex-start;height:18px;padding:0 6px;border-radius:6px;background:rgba(255,255,255,.62);font-size:10px;font-weight:800;line-height:18px;letter-spacing:.5px}
.gch-card .gg{position:absolute;right:-8px;top:18px;font-size:72px;font-weight:900;line-height:1;color:#fff;opacity:.55;pointer-events:none;font-family:"STKaiti","KaiTi","Kaiti SC",serif}
.gch-card .gb{position:absolute;right:-26px;bottom:-30px;width:86px;height:86px;border-radius:50%;background:rgba(255,255,255,.28);pointer-events:none}
.gch-card .gn{position:relative;margin-top:auto;font-size:15px;font-weight:900;line-height:1.3;letter-spacing:.2px;color:#2F2424;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.gch-card .gm{position:relative;margin-top:5px;font-size:10.5px;font-weight:600;white-space:nowrap;opacity:.85}
.gch-card .gh{position:absolute;right:0;top:0;height:20px;padding:0 7px 0 8px;border-radius:0 18px 0 10px;background:linear-gradient(135deg,#FF7A45,#F4433C);color:#fff;font-size:10.5px;font-weight:800;line-height:20px;letter-spacing:.5px}
.gch-card.all{align-items:center;justify-content:center;gap:8px;text-align:center;--c1:#FFF6F2;--c2:#FFE9E1;--ink:#C9886F;border:1.5px dashed #F2C9BA;box-shadow:none}
.gch-card.all .ga{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:#fff;color:#E2553A;font-size:22px;font-weight:700;box-shadow:0 4px 10px rgba(226,85,58,.15)}
.gch-card.all b{font-size:13.5px;font-weight:800;color:#8A5A4C}
.gch-card.all small{font-size:11px;color:#B39184}
html.night .gch-title{color:#F1E6EE}
html.night .gch-cat{background:rgba(255,255,255,.08)}
</style>
</section>
<!-- 孕期小知识(2026-09-30)。用户原话:「按她填写的孕周,比如孕 20 周 5 天,给她列出几个小模块,
设计一定要漂亮、匹配母婴用户,最好是动态的;小知识匹配每周的每一天」。
内容:assets/data/preg-tips.json(孕 4–40 周,每周 宝宝/妈妈/饮食/注意 四句 + 每天一条小知识,共 7 条),
@@ -2338,6 +2393,7 @@
<script src="/_bridge/avatar-picker.js?v=26101105"></script>
<script src="/_bridge/hand-icons.js?v=26101202"></script>
<script src="js/zodiac-art.js"></script>
<script src="guangchang/topics.js?v=26110109"></script>
<script src="js/app.js"></script>
<!-- 2026-10-03 首页彩蛋:宝宝在肚皮底下动(独立文件,删掉这一行即整体下线;开关在「隐私权限」) -->
<script src="js/bump.js"></script>
@@ -2346,7 +2402,7 @@
<!-- 2026-10-05 首页头图:宝宝时不时动一动小手小脚(独立文件,删掉这一行即下线) -->
<script src="js/baby-limbs.js?v=26101201"></script>
<script src="js/coach.js?v=26101211"></script>
<script src="js/birth-flow.js?v=26110108"></script>
<script src="js/birth-flow.js?v=26110109"></script>
<!-- 禁止下拉回弹(2026-10-11 统一规则,与孕期体重同一段):竖向拖动时从手指下往上找还能朝该方向滚的容器,找不到才拦;横滑、双指、可滚列表不受影响 -->
<script>