测一测:新增 5 个好物配置测试(t26-t30,12 种采购玩家类型);测一测列表按组换排法(考卷编号/心理双列/闯关横滑/好物图文);测一测分类标签独立样式;v26110220

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-11-02 11:55:39 +00:00
parent 96ca17261c
commit 4be3d20275
48 changed files with 133 additions and 6904 deletions

View File

@@ -187,5 +187,5 @@
}
/* feed.js 首页默认不加载(index.html 只引了 topics.js),这里按需拉一次 */
if (window.GC_FEED) init();
else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110219'; fs.onload = fs.onerror = init; document.body.appendChild(fs); }
else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110220'; fs.onload = fs.onerror = init; document.body.appendChild(fs); }
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
<meta name="format-detection" content="telephone=no">
<title>测一测 · 孕妈广场</title>
<!-- 孕妈广场 · 测一测(25 个测试共用这一页,?id=t01…t25)
<!-- 孕妈广场 · 测一测(30 个测试共用这一页,?id=t01…t30)
11-02 v1:列表 + 简版答题。
11-02 v2 用户:「每一个测一测页面都要有设计感,要做插图放进去,跟『你是什么样的妈妈』那个一样;『只在本机算,不上传』删掉」
→ 照 topic/ceshi(妈妈类型卡)重做三屏:
@@ -147,6 +147,7 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
.dims{position:relative;display:flex;align-items:center;gap:12px;margin-top:18px;padding:14px 14px 14px 8px;border-radius:20px;background:rgba(255,255,255,.85);text-align:left}
.dims>svg{flex:none;width:146px;height:128px}
.dl{flex:1;min-width:0;display:flex;flex-direction:column;gap:9px}
.dl.wide{padding-left:8px;display:grid;grid-template-columns:1fr 1fr;column-gap:16px;row-gap:10px}
.dr{display:grid;grid-template-columns:1fr auto;align-items:center;row-gap:3px;font-size:12.5px;color:var(--txt);line-height:1.3}
.dr span:first-child{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.dr .p{font-weight:700;color:var(--ink)}
@@ -206,7 +207,7 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
.rec b{display:block;font-size:15px;color:var(--ink);line-height:1.4}
.rec small{display:block;font-size:12.5px;color:var(--sub);line-height:1.5}
.rec em{flex:none;font-style:normal;height:28px;padding:0 12px;border-radius:99px;font-size:12.5px;font-weight:700;line-height:28px}
.rec.g-quiz em{background:#FFEEE8;color:#E8643F}.rec.g-psy em{background:#F1EDFF;color:#7C5CFC}.rec.g-game em{background:#E2F6F1;color:#13917C}
.rec.g-quiz em{background:#FFEEE8;color:#E8643F}.rec.g-psy em{background:#F1EDFF;color:#7C5CFC}.rec.g-game em{background:#E2F6F1;color:#13917C}.rec.g-shop em{background:#FFEEF3;color:#E9557F}
.again{margin-top:24px}
.foot{margin:28px 20px 0;font-size:12px;color:var(--sub);text-align:center}
.toast{position:fixed;left:50%;bottom:calc(80px + env(safe-area-inset-bottom));transform:translate(-50%,8px);max-width:300px;padding:10px 16px;border-radius:12px;background:rgba(31,35,41,.88);color:#fff;font-size:13.5px;line-height:1.6;text-align:center;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:60}
@@ -308,7 +309,7 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
<section class="blk fade"><div class="sh2"><i>01</i><b id="rReadT"></b></div><div class="read" id="rRead"></div></section>
<section class="blk fade" id="rTipsB"><div class="sh2"><i>02</i><b>给你的小建议</b></div><div class="tips" id="rTips"></div></section>
<section class="blk fade" id="rRvB"><div class="sh2"><i>03</i><b id="rRvT"></b></div><div id="rRv"></div></section>
<section class="blk fade"><div class="sh2"><i>04</i><b>再测一个</b><span>共 25 个测试</span></div><div class="recs" id="rRecs"></div></section>
<section class="blk fade"><div class="sh2"><i>04</i><b>再测一个</b><span>共 30 个测试</span></div><div class="recs" id="rRecs"></div></section>
<button class="btn sec again" id="againBtn"><svg class="ic"><use href="#i-refresh"/></svg>重新测试</button>
</main>
@@ -322,7 +323,7 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
</div>
<div class="toast" id="toast"></div>
<script src="tests.js?v=26110219"></script>
<script src="tests.js?v=26110220"></script>
<script>
(function () {
'use strict';
@@ -343,7 +344,8 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
var GROUP = {
quiz: { name: '知识考卷', en: 'QUIZ', c: '#F0714F', bg: '#FFEFE9', c2: '#FFD9CB', rgb: '240,113,79' },
psy: { name: '趣味心理测试', en: 'MIND TEST', c: '#7C5CFC', bg: '#F1EDFF', c2: '#E4DDFD', rgb: '124,92,252' },
game: { name: '趣味闯关', en: 'CHALLENGE', c: '#13A08A', bg: '#E4F6F1', c2: '#C4EBE1', rgb: '19,160,138' }
game: { name: '趣味闯关', en: 'CHALLENGE', c: '#13A08A', bg: '#E4F6F1', c2: '#C4EBE1', rgb: '19,160,138' },
shop: { name: '好物配置', en: 'SHOPPING TYPE', c: '#E9557F', bg: '#FFEEF3', c2: '#FFD3E0', rgb: '233,85,127' }
};
var G = GROUP[t.group] || GROUP.psy, R = t.results, N = t.questions.length, KS = 'ABCD';
var st = document.documentElement.style;
@@ -351,7 +353,7 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
st.setProperty('--c06', 'rgba(' + G.rgb + ',.06)'); st.setProperty('--c10', 'rgba(' + G.rgb + ',.10)'); st.setProperty('--c20', 'rgba(' + G.rgb + ',.22)');
document.title = t.title + ' · 测一测';
var IMG = function (k) { return 'img/' + t.id + '_' + k + '.webp'; }; /* k=0 主图;k=i+1 第 i 个结果 */
var rImg = function (r) { return IMG(R.indexOf(r) + 1); };
var rImg = function (r) { return r.img || IMG(R.indexOf(r) + 1); }; /* 好物配置组按类型共用插画:results[].img */
var optT = function (o) { return typeof o === 'string' ? o : o.t; };
var isQuiz = t.type === 'quiz', isType = t.type === 'type';
@@ -520,12 +522,12 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
$('#rImg').src = rImg(r); $('#rImg').alt = r.title;
$('#rYou').textContent = isType ? '你是' : isQuiz ? '你获得了称号' : '你的结果是';
$('#rName').textContent = r.title;
$('#rLine').textContent = t.title;
$('#rLine').textContent = r.line || t.title;
var tags = [r.tag, isQuiz ? '答对 ' + res.v + ' / ' + N : isType ? '占 ' + res.pc[r.k] + '%' : '指数 ' + res.v];
$('#rTags').innerHTML = tags.map(function (x) { return '<span>' + esc(x) + '</span>'; }).join('');
if (isType) {
var sorted = R.slice().sort(function (a, b) { return (b === r) - (a === r) || res.pc[b.k] - res.pc[a.k]; });
$('#rDims').innerHTML = radarSVG() + '<div class="dl">' + sorted.map(function (x) {
$('#rDims').innerHTML = (R.length <= 6 ? radarSVG() : '') + '<div class="dl' + (R.length > 6 ? ' wide' : '') + '">' + sorted.map(function (x) {
return '<div class="dr' + (x === r ? ' me' : '') + '"><span>' + esc(x.title) + '</span><span class="p num">' + res.pc[x.k] + '%</span><span class="tr"><i data-w="' + res.pc[x.k] + '"></i></span></div>';
}).join('') + '</div>';
} else {

View File

@@ -1,2 +1,2 @@
/* 测一测 25 个测试的轻量目录(广场列表 / 信息流穿插用),由 tests.js 生成,改题后重新生成。 */
window.GC_TESTS_META = [{"id":"t01","title":"孕妈孕期知识考卷","group":"quiz","type":"quiz","sub":"这些孕期常识,你真的懂吗","n":14,"min":4,"r":4},{"id":"t02","title":"准爸爸孕期助攻考卷","group":"quiz","type":"quiz","sub":"你是神助攻还是猪队友","n":14,"min":4,"r":4},{"id":"t03","title":"新手妈妈育儿摸底考卷","group":"quiz","type":"quiz","sub":"新手妈妈的第一张考卷","n":15,"min":5,"r":4},{"id":"t04","title":"新手爸爸带娃通关考卷","group":"quiz","type":"quiz","sub":"奶爸技能,你解锁了几项","n":14,"min":4,"r":4},{"id":"t05","title":"待产包认知考卷","group":"quiz","type":"quiz","sub":"待产包,你装对了吗","n":14,"min":4,"r":4},{"id":"t06","title":"新生儿护理小考卷","group":"quiz","type":"quiz","sub":"老人说的那些,到底对不对?","n":14,"min":4,"r":4},{"id":"t07","title":"产后恢复知识考卷","group":"quiz","type":"quiz","sub":"坐月子的老规矩,还灵吗?","n":15,"min":4,"r":4},{"id":"t08","title":"辅食添加知识考卷","group":"quiz","type":"quiz","sub":"第一口辅食,你喂对了吗?","n":15,"min":4,"r":4},{"id":"t09","title":"宝宝睡眠知识考卷","group":"quiz","type":"quiz","sub":"哄睡这件事,你懂多少?","n":15,"min":4,"r":4},{"id":"t10","title":"哺乳期饮食避坑考卷","group":"quiz","type":"quiz","sub":"喂奶期间到底该怎么吃?","n":15,"min":4,"r":4},{"id":"t11","title":"你是松弛型还是内卷型妈妈?","group":"psy","type":"type","sub":"带娃风格,一测就露馅","n":13,"min":3,"r":4},{"id":"t12","title":"你的带娃队友靠谱指数测试","group":"psy","type":"score","sub":"队友几颗星,测完就知道","n":13,"min":3,"r":4},{"id":"t13","title":"宝宝出生后你的角色适应力测试","group":"psy","type":"score","sub":"新手爸妈,你上手多快?","n":13,"min":3,"r":4},{"id":"t14","title":"你的产后情绪雷达测试","group":"psy","type":"score","sub":"给心情做个温柔小体检","n":13,"min":3,"r":4},{"id":"t15","title":"你属于哪种育儿观念?","group":"psy","type":"type","sub":"看看你心里的育儿理想","n":13,"min":3,"r":4},{"id":"t16","title":"你们夫妻育儿默契大测试","group":"psy","type":"score","sub":"带娃路上,你俩是神队友吗","n":13,"min":3,"r":4},{"id":"t17","title":"你的孕期焦虑等级小测试","group":"psy","type":"score","sub":"测测你现在是哪种心情天气","n":13,"min":3,"r":4},{"id":"t18","title":"你是精细养娃还是粗放养娃?","group":"psy","type":"type","sub":"测测你的带娃画风是哪一派","n":14,"min":3,"r":4},{"id":"t19","title":"二胎妈妈内心状态测试","group":"psy","type":"type","sub":"两个娃的妈,心里住着谁","n":13,"min":3,"r":4},{"id":"t20","title":"爷爷奶奶外公外婆育儿观念测试","group":"psy","type":"type","sub":"看看您是哪种宝藏长辈","n":13,"min":3,"r":4},{"id":"t21","title":"准爸爸胎教合格大挑战","group":"game","type":"quiz","sub":"准爸爸,这关你能闯几颗星?","n":13,"min":4,"r":4},{"id":"t22","title":"新手爸妈避坑能力测试","group":"game","type":"quiz","sub":"老话说的那些,你中招了吗?","n":14,"min":4,"r":4},{"id":"t23","title":"妈妈产后自我关怀指数测试","group":"game","type":"score","sub":"照顾宝宝之外,你照顾自己了吗?","n":13,"min":3,"r":4},{"id":"t24","title":"宝宝气质预判小测试","group":"game","type":"type","sub":"你家宝宝会是哪种小性格?","n":12,"min":3,"r":4},{"id":"t25","title":"你的孕期幸福感测试","group":"game","type":"score","sub":"测测你的孕期快乐值有多少","n":13,"min":3,"r":4}];
/* 测一测 30 个测试的轻量目录(广场列表 / 信息流穿插用),由 tests.js 生成,改题后重新生成。 */
window.GC_TESTS_META = [{"id":"t01","title":"孕妈孕期知识考卷","group":"quiz","type":"quiz","sub":"这些孕期常识,你真的懂吗","n":14,"min":4,"r":4},{"id":"t02","title":"准爸爸孕期助攻考卷","group":"quiz","type":"quiz","sub":"你是神助攻还是猪队友","n":14,"min":4,"r":4},{"id":"t03","title":"新手妈妈育儿摸底考卷","group":"quiz","type":"quiz","sub":"新手妈妈的第一张考卷","n":15,"min":5,"r":4},{"id":"t04","title":"新手爸爸带娃通关考卷","group":"quiz","type":"quiz","sub":"奶爸技能,你解锁了几项","n":14,"min":4,"r":4},{"id":"t05","title":"待产包认知考卷","group":"quiz","type":"quiz","sub":"待产包,你装对了吗","n":14,"min":4,"r":4},{"id":"t06","title":"新生儿护理小考卷","group":"quiz","type":"quiz","sub":"老人说的那些,到底对不对?","n":14,"min":4,"r":4},{"id":"t07","title":"产后恢复知识考卷","group":"quiz","type":"quiz","sub":"坐月子的老规矩,还灵吗?","n":15,"min":4,"r":4},{"id":"t08","title":"辅食添加知识考卷","group":"quiz","type":"quiz","sub":"第一口辅食,你喂对了吗?","n":15,"min":4,"r":4},{"id":"t09","title":"宝宝睡眠知识考卷","group":"quiz","type":"quiz","sub":"哄睡这件事,你懂多少?","n":15,"min":4,"r":4},{"id":"t10","title":"哺乳期饮食避坑考卷","group":"quiz","type":"quiz","sub":"喂奶期间到底该怎么吃?","n":15,"min":4,"r":4},{"id":"t11","title":"你是松弛型还是内卷型妈妈?","group":"psy","type":"type","sub":"带娃风格,一测就露馅","n":13,"min":3,"r":4},{"id":"t12","title":"你的带娃队友靠谱指数测试","group":"psy","type":"score","sub":"队友几颗星,测完就知道","n":13,"min":3,"r":4},{"id":"t13","title":"宝宝出生后你的角色适应力测试","group":"psy","type":"score","sub":"新手爸妈,你上手多快?","n":13,"min":3,"r":4},{"id":"t14","title":"你的产后情绪雷达测试","group":"psy","type":"score","sub":"给心情做个温柔小体检","n":13,"min":3,"r":4},{"id":"t15","title":"你属于哪种育儿观念?","group":"psy","type":"type","sub":"看看你心里的育儿理想","n":13,"min":3,"r":4},{"id":"t16","title":"你们夫妻育儿默契大测试","group":"psy","type":"score","sub":"带娃路上,你俩是神队友吗","n":13,"min":3,"r":4},{"id":"t17","title":"你的孕期焦虑等级小测试","group":"psy","type":"score","sub":"测测你现在是哪种心情天气","n":13,"min":3,"r":4},{"id":"t18","title":"你是精细养娃还是粗放养娃?","group":"psy","type":"type","sub":"测测你的带娃画风是哪一派","n":14,"min":3,"r":4},{"id":"t19","title":"二胎妈妈内心状态测试","group":"psy","type":"type","sub":"两个娃的妈,心里住着谁","n":13,"min":3,"r":4},{"id":"t20","title":"爷爷奶奶外公外婆育儿观念测试","group":"psy","type":"type","sub":"看看您是哪种宝藏长辈","n":13,"min":3,"r":4},{"id":"t21","title":"准爸爸胎教合格大挑战","group":"game","type":"quiz","sub":"准爸爸,这关你能闯几颗星?","n":13,"min":4,"r":4},{"id":"t22","title":"新手爸妈避坑能力测试","group":"game","type":"quiz","sub":"老话说的那些,你中招了吗?","n":14,"min":4,"r":4},{"id":"t23","title":"妈妈产后自我关怀指数测试","group":"game","type":"score","sub":"照顾宝宝之外,你照顾自己了吗?","n":13,"min":3,"r":4},{"id":"t24","title":"宝宝气质预判小测试","group":"game","type":"type","sub":"你家宝宝会是哪种小性格?","n":12,"min":3,"r":4},{"id":"t25","title":"你的孕期幸福感测试","group":"game","type":"score","sub":"测测你的孕期快乐值有多少","n":13,"min":3,"r":4},{"id":"t26","title":"你的母婴选品偏好,藏着你的育儿配置路线","group":"shop","type":"type","sub":"看看你挑东西最在意啥","n":15,"min":3,"r":6},{"id":"t27","title":"测一测|你的母婴采购是什么配置思路","group":"shop","type":"type","sub":"下单那一刻,暴露了你","n":15,"min":3,"r":6},{"id":"t28","title":"从母婴囤货选择,找到适合你的育儿好物方向","group":"shop","type":"type","sub":"囤货柜里藏着你的性格","n":15,"min":3,"r":6},{"id":"t29","title":"母婴消费配置测试:你属于哪一类育儿采购玩家","group":"shop","type":"type","sub":"8种玩家,你是哪一挂","n":15,"min":3,"r":8},{"id":"t30","title":"你的购物清单,决定你的育儿好物选择逻辑","group":"shop","type":"type","sub":"一张清单,看穿你的选法","n":15,"min":3,"r":6}];

File diff suppressed because one or more lines are too long

View File

@@ -130,9 +130,67 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
.hot::-webkit-scrollbar{display:none}
.hot::after{content:"";flex:none;width:2px}
/* 11-02 v2 测一测:广场第 5 个分类「测一测」(经验后面)+「大家在聊」信息流里穿插测试卡。卡片插画 ceshi/img/<id>_s.webp */
.cats .c-ceshi{--cf:#7C5CFC}
.cats .c-ceshi{--cf:#7C5CFC;align-self:center;display:inline-flex;align-items:center;gap:3px;margin-left:9px;height:30px;padding:0 12px 0 9px;border-radius:99px;font-size:14px;font-weight:800;color:#7C5CFC;
background:linear-gradient(120deg,#F1ECFF,#FFE8F1);box-shadow:inset 0 0 0 1px rgba(124,92,252,.18);line-height:30px}
.cats .c-ceshi::before{content:"";position:absolute;left:-9px;top:7px;bottom:7px;width:1px;background:#E6D7D0}
.cats .c-ceshi .ic{display:block;width:13px;height:13px;flex:none}
.cats .c-ceshi i{display:none}
.cats .c-ceshi.on{font-size:14px;font-weight:900;color:#fff;background:linear-gradient(120deg,#8E6BFF,#EE6A9C);box-shadow:0 6px 14px -6px rgba(200,90,180,.7)}
/* 测一测列表(11-02 v3 用户:「列表别跟帖子一个样,换个形式」)→ 分组专栏:组头 + 推荐横卡 + 条目行 */
.csl{padding:0 12px}
.csg{margin-top:18px}
.csg-h{display:flex;align-items:baseline;gap:8px;padding:0 4px}
.csg-h b{position:relative;font-size:17px;font-weight:900;color:#2A1E1E}
.csg-h b::after{content:"";position:absolute;left:-2px;right:-2px;bottom:1px;height:7px;border-radius:4px;background:var(--tg);opacity:.22;z-index:-1}
.csg-h b{z-index:0}
.csg-h small{font-size:12px;color:#A08B85}
.csg-h em{margin-left:auto;font-style:normal;font-size:12px;font-weight:800;color:var(--tg)}
.csf{position:relative;display:flex;align-items:center;gap:12px;width:100%;margin-top:10px;padding:14px 12px 14px 16px;border-radius:22px;overflow:hidden;text-align:left;background:linear-gradient(125deg,var(--tl),#fff 85%);box-shadow:0 8px 20px -14px var(--tg)}
.csf:active,.csr:active{transform:scale(.985)}
.csf .tx{flex:1;min-width:0;position:relative;z-index:1}
.csf .tx small{display:inline-block;height:20px;padding:0 8px;border-radius:99px;background:#fff;color:var(--tg);font-size:11px;font-weight:800;line-height:20px}
.csf .tx b{display:block;margin-top:7px;font-size:17px;font-weight:900;line-height:1.38;color:#2A1E1E}
.csf .tx p{margin-top:3px;font-size:12.5px;color:#7A6A66;line-height:1.5}
.csf .tx .go{display:inline-flex;align-items:center;gap:2px;margin-top:10px;height:30px;padding:0 14px;border-radius:99px;background:var(--tg);color:#fff;font-size:13px;font-weight:800;box-shadow:0 5px 12px -5px var(--tg)}
.csf .tx .go .ic{width:13px;height:13px;stroke-width:2.4}
.csf img{flex:none;width:118px;height:118px;border-radius:28px 28px 28px 8px;object-fit:cover;object-position:center 30%;border:3px solid #fff;box-shadow:0 8px 18px -10px var(--tg)}
.csq{margin-top:8px;border-radius:20px;background:#fff;box-shadow:0 3px 12px rgba(170,110,90,.07);overflow:hidden}
.csn{display:flex;align-items:center;gap:12px;width:100%;padding:12px 12px 12px 14px;text-align:left;border-top:1px dashed #F1E2DC}
.csn:first-child{border-top:0}
.csn .no{flex:none;width:40px;font-size:20px;font-weight:900;color:var(--tg);line-height:1;font-family:Georgia,serif;font-style:italic}
.csn .no small{display:block;font-size:9px;font-style:normal;letter-spacing:1px;opacity:.6;margin-bottom:2px;font-family:inherit}
.csn .tx{flex:1;min-width:0}
.csn b{display:block;font-size:14.5px;font-weight:800;line-height:1.4;color:#2A1E1E;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.csn small{display:block;font-size:12px;color:#A08B85;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.csn small em{font-style:normal;color:var(--tg);font-weight:700}
.csn .ar{flex:none;color:#D9C3BC}.csn .ar .ic{width:15px;height:15px;stroke-width:2.4}
.csp{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.cst{position:relative;display:block;padding:8px 8px 11px;border-radius:20px;background:linear-gradient(180deg,var(--tl),#fff 70%);text-align:left;box-shadow:0 6px 16px -12px var(--tg)}
.cst img{display:block;width:100%;aspect-ratio:4/3;border-radius:15px;object-fit:cover;object-position:center 28%}
.cst i{position:absolute;top:14px;left:14px;height:20px;padding:0 8px;border-radius:99px;background:var(--tg);color:#fff;font-size:11px;font-style:normal;font-weight:800;line-height:20px}
.cst b{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:8px 4px 0;font-size:14px;font-weight:800;line-height:1.4;color:#2A1E1E;min-height:39px}
.cst small{display:block;margin:2px 4px 0;font-size:11.5px;color:#A08B85;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.cst small em{font-style:normal;color:var(--tg);font-weight:700}
.cs-l{display:flex;gap:10px;margin:10px -16px 0;padding:0 16px 6px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.cs-l::-webkit-scrollbar{display:none}
.csx{position:relative;flex:none;width:236px;height:150px;border-radius:22px;overflow:hidden;text-align:left;background:var(--tl)}
.csx img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 30%}
.csx .tx{position:absolute;left:0;right:0;bottom:0;padding:30px 14px 12px;background:linear-gradient(180deg,rgba(10,60,52,0),rgba(10,60,52,.78));color:#fff}
.csx small{display:inline-block;height:18px;padding:0 7px;border-radius:6px;background:var(--tg);font-size:10.5px;font-weight:800;line-height:18px}
.csx b{display:block;margin-top:5px;font-size:15px;font-weight:900;line-height:1.35;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.csx .go{display:block;margin-top:2px;font-size:11.5px;opacity:.9;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.csn:active,.cst:active,.csx:active{transform:scale(.985)}
.csr{display:flex;align-items:center;gap:12px;width:100%;margin-top:8px;padding:9px 10px 9px 9px;border-radius:18px;background:#fff;text-align:left;box-shadow:0 3px 12px rgba(170,110,90,.07)}
.csr img{flex:none;width:58px;height:58px;border-radius:15px;object-fit:cover;object-position:center 28%;background:var(--tl)}
.csr .tx{flex:1;min-width:0}
.csr b{display:block;font-size:14.5px;font-weight:800;line-height:1.4;color:#2A1E1E;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.g-shop .csr b{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal}
.csr small{display:block;margin-top:1px;font-size:12px;color:#A08B85;line-height:1.45;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.csr small em{font-style:normal;color:var(--tg);font-weight:700}
.csr .ar{flex:none;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--tl);color:var(--tg)}
.csr .ar .ic{width:15px;height:15px;stroke-width:2.4}
.k-ceshi{--kf:#7C5CFC;--kt:#6346B0;--kl:#F1EDFF;--kl2:#E4DDFD}
.g-quiz{--tg:#F0714F;--tl:#FFEFE9}.g-psy{--tg:#7C5CFC;--tl:#F1EDFF}.g-game{--tg:#13A08A;--tl:#E4F6F1}
.g-quiz{--tg:#F0714F;--tl:#FFEFE9}.g-psy{--tg:#7C5CFC;--tl:#F1EDFF}.g-game{--tg:#13A08A;--tl:#E4F6F1}.g-shop{--tg:#E9557F;--tl:#FFEEF3}
.nc.tst .cvw{background:var(--tl)}
.nc.tst .cvw img{display:block;width:100%;height:calc(var(--cw) * 1.08);object-fit:cover;object-position:center 30%}
.nc.tst .tb{position:absolute;left:7px;top:7px;display:inline-flex;align-items:center;gap:3px;height:21px;padding:0 8px 0 6px;border-radius:7px;background:var(--tg);color:#fff;font-size:11px;font-weight:800;letter-spacing:.5px;box-shadow:0 3px 8px -3px var(--tg)}
@@ -518,10 +576,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=26110219"></script>
<script src="data.js?v=26110219"></script>
<script src="feed.js?v=26110219"></script>
<script src="ceshi/meta.js?v=26110219"></script>
<script src="topics.js?v=26110220"></script>
<script src="data.js?v=26110220"></script>
<script src="feed.js?v=26110220"></script>
<script src="ceshi/meta.js?v=26110220"></script>
<script>
(function () {
'use strict';
@@ -665,7 +723,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
}
$('#cats').innerHTML = CATS.map(function (x) {
return '<button type="button" role="tab" data-c="' + x[0] + '" class="c-' + (x[0] || 'all') + (catF === x[0] ? ' on' : '') + '" aria-selected="' + (catF === x[0]) + '">' +
x[1] + '<i>' + catCnt(x[0]) + '</i></button>';
(x[0] === 'ceshi' ? '<svg class="ic"><use href="#i-spark"/></svg>' : '') + x[1] + '<i>' + catCnt(x[0]) + '</i></button>';
}).join('') + '<span class="bar"></span>';
moveBar();
}
@@ -676,6 +734,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
var w = on.offsetWidth - 20, x = on.offsetLeft + (on.offsetWidth - w) / 2;
bar.style.width = w + 'px'; bar.style.transform = 'translateX(' + x + 'px)';
bar.style.background = getComputedStyle(on).getPropertyValue('--cf');
bar.style.opacity = on.dataset.c === 'ceshi' ? '0' : '';
}
window.addEventListener('resize', moveBar);
/* 11-02 用户:「孕妈广场做一张为宝宝祈福的 banner,点了直接进祈福树;要把祈福树调上来、有动效,像首页 3D 婴儿房,吸引点击;替换掉 30 现金 + 500 兜豆」
@@ -709,8 +768,8 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
测试目录只引轻量 ceshi/meta.js;题库在 ceshi/tests.js,只在测试页加载。 */
var TM = window.GC_TESTS_META || [], TMBY = {};
TM.forEach(function (x) { TMBY[x.id] = x; });
var TG = { quiz: '知识考卷', psy: '趣味心理', game: '趣味闯关' }, tGrp = '';
var CS_MIX = ['t11', 't01', 't24', 't16', 't03', 't14', 't21', 't18', 't05'], CS_AT = [3, 11, 20, 30, 41, 53, 66, 80, 95];
var TG = { quiz: '知识考卷', psy: '趣味心理', game: '趣味闯关', shop: '好物配置' }, tGrp = '';
var CS_MIX = ['t11', 't29', 't01', 't24', 't26', 't16', 't03', 't27', 't14', 't21', 't30', 't18'], CS_AT = [3, 10, 18, 27, 37, 48, 60, 73, 87, 102, 118, 135];
function csDone() { try { return (JSON.parse(localStorage.getItem('mmbox.gcts.v1') || '{}')[param('openid') || '_guest']) || {}; } catch (e) { return {}; } }
function ceshiURL(id, fromTab) {
var q = new URLSearchParams(location.search); ['t', 'n', 'c', 'id', 'mine'].forEach(function (k) { q.delete(k); });
@@ -725,15 +784,52 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
'<div class="nb"><h3>' + esc(x.title) + '</h3><div class="nf">' + (d ? '<span class="gs dn">已测 · ' + esc(d.title) + '</span>' : '<span class="gs">' + TG[x.group] + '</span>') +
'<span class="gt">' + (d ? '再测' : '去测') + ' ›</span></div></div></button>';
}
var TGD = { quiz: '有标准答案,答完看解析', psy: '没有对错,测测你是哪一型', game: '挑战一下,看能拿什么称号', shop: '看看你是哪一类育儿采购玩家' };
/* 每组换一种排法,避免整页一个样:考卷=编号卷宗,心理=双列卡,闯关=横滑大卡,好物=图文行 */
function rest(g, l, done) {
if (g === 'psy') return '<div class="csp">' + l.map(function (x) {
var d = done[x.id];
return '<button type="button" class="cst" data-test="' + x.id + '"><img src="ceshi/img/' + x.id + '_s.webp" alt="" loading="lazy">' + (d ? '<i>已测</i>' : '') +
'<b>' + esc(x.title) + '</b><small>' + (d ? '<em>' + esc(d.title) + '</em>' : esc(x.sub)) + '</small></button>';
}).join('') + '</div>';
if (g === 'game') return '<div class="cs-l">' + l.map(function (x) {
var d = done[x.id];
return '<button type="button" class="csx" data-test="' + x.id + '"><img src="ceshi/img/' + x.id + '_s.webp" alt="" loading="lazy"><span class="tx"><small>' + x.n + ' 关</small><b>' + esc(x.title) + '</b>' +
'<span class="go">' + (d ? '已拿「' + esc(d.title) + '」' : '去闯关') + '</span></span></button>';
}).join('') + '</div>';
if (g === 'quiz') return '<div class="csq">' + l.map(function (x, i) {
var d = done[x.id];
return '<button type="button" class="csn" data-test="' + x.id + '"><span class="no"><small>NO.</small>' + ('0' + (TM.filter(function (y) { return y.group === 'quiz'; }).indexOf(x) + 1)).slice(-2) + '</span><span class="tx"><b>' + esc(x.title) + '</b>' +
'<small>' + (d ? '<em>已测 · ' + esc(d.title) + '</em>' : x.n + ' 题 · ' + esc(x.sub)) + '</small></span><span class="ar"><svg class="ic"><use href="#i-right"/></svg></span></button>';
}).join('') + '</div>';
return l.map(function (x) {
var d = done[x.id];
return '<button type="button" class="csr" data-test="' + x.id + '"><img src="ceshi/img/' + x.id + '_s.webp" alt="" loading="lazy"><span class="tx"><b>' + esc(x.title) + '</b>' +
'<small>' + (d ? '<em>已测 · ' + esc(d.title) + '</em>' : x.n + ' 题 · 约 ' + x.min + ' 分钟 · ' + esc(x.sub)) + '</small></span><span class="ar"><svg class="ic"><use href="#i-right"/></svg></span></button>';
}).join('');
}
function ceshiListHTML() {
var done = csDone();
return '<div class="csl">' + ['quiz', 'psy', 'game', 'shop'].filter(function (g) { return !tGrp || tGrp === g; }).map(function (g) {
var l = TM.filter(function (x) { return x.group === g; }); if (!l.length) return '';
var nd = l.filter(function (x) { return done[x.id]; }).length;
var f = l.filter(function (x) { return !done[x.id]; })[0] || l[0]; /* 推荐位:本组第一个没测过的 */
if (g === 'psy' || g === 'game') return '<section class="csg g-' + g + '"><div class="csg-h"><b>' + TG[g] + '</b><small>' + l.length + ' 套 · ' + TGD[g] + '</small>' + (nd ? '<em>已测 ' + nd + '</em>' : '') + '</div>' + rest(g, l, done) + '</section>';
return '<section class="csg g-' + g + '"><div class="csg-h"><b>' + TG[g] + '</b><small>' + l.length + ' 套 · ' + TGD[g] + '</small>' + (nd ? '<em>已测 ' + nd + '</em>' : '') + '</div>' +
'<button type="button" class="csf" data-test="' + f.id + '"><span class="tx"><small>' + (done[f.id] ? '再测一次' : '本组推荐') + '</small><b>' + esc(f.title) + '</b><p>' + esc(f.sub) + ' · ' + f.n + ' 题</p>' +
'<span class="go">' + (done[f.id] ? '再测' : '开始测') + '<svg class="ic"><use href="#i-right"/></svg></span></span><img src="ceshi/img/' + f.id + '_s.webp" alt="" loading="lazy"></button>' +
rest(g, l.filter(function (x) { return x !== f; }), done) + '</section>';
}).join('') + '</div>';
}
function ceshiHead() {
var n = function (g) { return TM.filter(function (x) { return x.group === g; }).length; };
return '<div class="csh"><b>孕育测一测</b><p>知识考卷、趣味心理、闯关挑战,测完就有专属结果卡</p>' +
'<div class="gn"><span class="g-quiz">考卷 ' + n('quiz') + '</span><span class="g-psy">心理 ' + n('psy') + '</span><span class="g-game">闯关 ' + n('game') + '</span></div>' +
return '<div class="csh"><b>孕育测一测</b><p>知识考卷、趣味心理、闯关挑战、好物配置,测完就有专属结果卡</p>' +
'<div class="gn"><span class="g-quiz">考卷 ' + n('quiz') + '</span><span class="g-psy">心理 ' + n('psy') + '</span><span class="g-game">闯关 ' + n('game') + '</span><span class="g-shop">好物 ' + n('shop') + '</span></div>' +
'<img src="ceshi/img/t11_s.webp" alt=""></div>';
}
function ceshiFh(fh) {
fh.className = 'lvw k-ceshi';
var all = [['', '全部', TM.length]].concat(['quiz', 'psy', 'game'].map(function (g) { return [g, TG[g], TM.filter(function (x) { return x.group === g; }).length]; }));
var all = [['', '全部', TM.length]].concat(['quiz', 'psy', 'game', 'shop'].map(function (g) { return [g, TG[g], TM.filter(function (x) { return x.group === g; }).length]; }));
fh.innerHTML = '<div class="lv"><h2>测一测</h2><small>' + TM.length + ' 个测试 · 每个 12 题以上</small></div>' +
'<div class="tcs">' + all.map(function (x) { return '<button type="button" data-tg="' + x[0] + '"' + (tGrp === x[0] ? ' class="on"' : '') + '>' + x[1] + '<i>' + x[2] + '</i></button>'; }).join('') + '</div>';
}
@@ -802,13 +898,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
/* 真瀑布流:每张卡放进当前更矮的那一列(逐张量高,标题一行/两行也算进去) */
var hs = [0, 0], tmp = document.createElement('div'), STY = ['', 'ov', '', '', 'tg', '', '', 'ov', '', 'tg', '', ''];
if (catF === 'ceshi') {
var done = csDone();
TM.filter(function (x) { return !tGrp || x.group === tGrp; }).forEach(function (x, k) {
tmp.innerHTML = testCardHTML(x, done);
var el = tmp.firstChild; el.style.animationDelay = Math.min(k, 10) * 30 + 'ms';
var c = hs[0] <= hs[1] ? 0 : 1; cols[c].appendChild(el); hs[c] += el.offsetHeight + 8;
});
$('#more').innerHTML = ''; return;
$('#more').innerHTML = ceshiListHTML(); return;
}
/* 「全部」信息流:按 CS_AT 位置穿插测试卡 */
if (!cur && !catF && TM.length) {
@@ -999,6 +1089,10 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
if (on) { el.classList.remove('pop'); void el.offsetWidth; el.classList.add('pop'); }
});
}
$('#more').addEventListener('click', function (e) {
var ts = e.target.closest('[data-test]');
if (ts) { e.stopPropagation(); haptic(); location.href = ceshiURL(ts.dataset.test, true); }
}, true);
$('#wf').addEventListener('click', function (e) {
var ts = e.target.closest('[data-test]');
if (ts) { haptic(); location.href = ceshiURL(ts.dataset.test, catF === 'ceshi'); return; }

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:26110219 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<!-- V:26110220 缓存版本标记:改 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) -->
@@ -2498,7 +2498,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=26110219"></script>
<script src="guangchang/topics.js?v=26110220"></script>
<script src="js/app.js"></script>
<script>
/* 11-02 首页「孕妈广场」效果稿:地址带 ?gcv=1~6 时,把 #gcHome 换成 demo/gch/vN.css + vN.js 的版式并滚到这一块。
@@ -2506,7 +2506,7 @@
(function () {
var m = location.search.match(/[?&]gcv=([1-6])(?:&|$)/);
if (!m) window.__gcDefault = 1;
var n = m ? m[1] : '6', l = document.createElement('link'), s = document.createElement('script'), q = m ? Date.now() : 'v=26110219';
var n = m ? m[1] : '6', l = document.createElement('link'), s = document.createElement('script'), q = m ? Date.now() : 'v=26110220';
l.rel = 'stylesheet'; l.href = 'demo/gch/v' + n + '.css?' + q;
s.src = 'demo/gch/v' + n + '.js?' + q;
if (m) s.onload = function () { setTimeout(function () { var el = document.getElementById('gcHome'); if (el) el.scrollIntoView({ block: 'center' }); }, 900); };
@@ -2514,7 +2514,7 @@
/* 11-02 品牌露出(用户定 4 处都要):默认加载,?brand=0 可关掉对比;⚠️ 上正式前和 V6 一起并进正式代码,别依赖 demo/ */
if (!/[?&]brand=0/.test(location.search)) {
var bl = document.createElement('link'), bs = document.createElement('script');
bl.rel = 'stylesheet'; bl.href = 'demo/brand/brand.css?v=26110219'; bs.src = 'demo/brand/brand.js?v=26110219';
bl.rel = 'stylesheet'; bl.href = 'demo/brand/brand.css?v=26110220'; bs.src = 'demo/brand/brand.js?v=26110220';
document.head.appendChild(bl); document.body.appendChild(bs);
}
})();

View File

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