预览首页默认启用孕妈广场合并版(测一测第 1 版);测一测加第 4 版彩色卡(&qz=4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-11-02 04:34:40 +00:00
parent 60ee41bb9d
commit ecbb8db15a
5 changed files with 29 additions and 13 deletions

View File

@@ -17,7 +17,7 @@
function merge() {
sec.classList.add('gv6');
var mk = sec.querySelector('.g4-mark'); if (mk) mk.textContent = '效果稿 V6';
var mk = sec.querySelector('.g4-mark'); if (mk) { if (window.__gcDefault) mk.remove(); else mk.textContent = '效果稿 V6'; }
var old = document.getElementById('pregTips'); if (old) old.style.display = 'none';
var wk = document.getElementById('msWk'), wkT = wk && wk.textContent.trim();
var box = document.createElement('div');
@@ -35,11 +35,18 @@
{ href: 'topic/duiyou/', k: '队友类型', t: '准爸爸是哪种队友?', n: '8.3万', img: 'topic/duiyou/img/hero.webp', pos: '58% 24%', who: '测他', c: '#F07A2E', q1: '#FFF3E6', q2: '#FFE2C8', qs: 'rgba(240,122,46,.6)' }
];
/* 11-02 用户:「测一测出三版让我选」→ 地址 &qz=1/2/3 切换:1 插画白卡(默认)/ 2 小胶囊 / 3 你&他合体卡 */
var QV = (location.search.match(/[?&]qz=([1-3])/) || [])[1] || '1';
var QV = (location.search.match(/[?&]qz=([1-4])/) || [])[1] || '1';
var qz = document.createElement('div'), lk = function (q) { return esc(q.href + location.search + location.hash); };
qz.className = 'g6-qz qv' + QV;
var hd = '<div class="g6-qh">测一测<small>1 分钟,看看你和他</small></div>';
if (QV === '1') {
if (QV === '4') {
/* 第 4 版:用户说「测一测要明显一点,把之前那版(紫/橙底)拿来试试」→ 彩色底 + 类型小标签 + 实心按钮 + 右下圆形插画;标题用短的,避免单字掉行 */
qz.innerHTML = hd + '<div class="g6-qr">' + QZ.map(function (q) {
return '<a class="g6-k ripple" href="' + lk(q) + '" style="--qc:' + q.c + ';--q1:' + q.q1 + ';--q2:' + q.q2 + ';--qs:' + q.qs + '">' +
'<img src="' + esc(q.img) + '" alt="" loading="lazy">' +
'<span class="g6-kk">' + esc(q.k) + '</span><b class="g6-kt">' + esc(q.t) + '</b><span class="g6-kn">' + q.n + ' 人测过</span><span class="g6-kg">去测试 ›</span></a>';
}).join('') + '</div>';
} else if (QV === '1') {
qz.innerHTML = hd + '<div class="g6-qr">' + QZ.map(function (q) {
return '<a class="g6-q ripple" href="' + lk(q) + '">' +
'<img src="' + esc(q.img) + '" alt="" loading="lazy">' +