v26110903 补:12 个独立专题页、测一测页接 host-nav(容器页返回走 navigateBack),广场打开测试开容器页
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -235,6 +235,7 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
|
||||
@media (prefers-reduced-motion:reduce){.fade,.stage,.view.on,.mask.on{opacity:1;transform:none;transition:none;animation:none}}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../../topic/_shared/quiz-skin.css?v=26110643"><!-- 11-07 答题页底色 / 卡片 -->
|
||||
<script src="../../js/host-nav.js?v=26110903"></script>
|
||||
</head>
|
||||
<body>
|
||||
<svg class="hide" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">
|
||||
@@ -397,6 +398,7 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
|
||||
$('#back').addEventListener('click', function () {
|
||||
if (views.quiz.classList.contains('on') && cur > 0) { goPrev(); return; }
|
||||
if (!views.start.classList.contains('on')) { renderStart(); show('start'); return; }
|
||||
if (window.MBHost && MBHost.back(function () { location.href = plazaURL(); })) return; /* 11-09 容器页:回小程序上一页 */
|
||||
location.href = plazaURL();
|
||||
});
|
||||
sc.addEventListener('scroll', function () { $('#bar').classList.toggle('sh', sc.scrollTop > 4); }, { passive: true });
|
||||
|
||||
@@ -1324,6 +1324,7 @@ html.night .gtg button.on{background:#F2725B;border-color:#F2725B;color:#fff}
|
||||
var TG = { quiz: '常识小测', psy: '趣味心理', game: '趣味闯关', shop: '花钱风格' }, tGrp = '';
|
||||
var CS_MIX = ['t11', 't29', 't01', 't24', 't26', 't16', 't03', 't27', 't14', 't21', 't30', 't18'];
|
||||
function csDone() { try { return (JSON.parse(localStorage.getItem('mmbox.gcts.v1') || '{}')[param('openid') || '_guest']) || {}; } catch (e) { return {}; } }
|
||||
function goCeshi(u) { if (!(window.MBHost && MBHost.open(u))) location.href = u; } /* 11-09 小程序里开容器页,复制链接直达这个测试 */
|
||||
function ceshiURL(id, fromTab) {
|
||||
var q = new URLSearchParams(location.search); ['t', 'n', 'c', 'id', 'mine', 'write', 'fav'].forEach(function (k) { q.delete(k); });
|
||||
if (fromTab) q.set('c', 'ceshi');
|
||||
@@ -1570,7 +1571,7 @@ html.night .gtg button.on{background:#F2725B;border-color:#F2725B;color:#fff}
|
||||
}, 260);
|
||||
}
|
||||
ov.addEventListener('click', function (e) {
|
||||
if (e.target.closest('.lko-go')) { SFX.tap(); location.href = ceshiURL(pk.id, true); return; }
|
||||
if (e.target.closest('.lko-go')) { SFX.tap(); goCeshi(ceshiURL(pk.id, true)); return; }
|
||||
if (e.target.closest('.lko-re')) { if (!ov.classList.contains('done')) return; haptic(); roll(); return; }
|
||||
if (e.target.closest('.lko-x')) { close(); return; }
|
||||
var sb = e.target.closest('.lko-snd');
|
||||
@@ -1954,7 +1955,7 @@ html.night .gtg button.on{background:#F2725B;border-color:#F2725B;color:#fff}
|
||||
$('#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], .csv-i[data-test]'); if (cb) { haptic(); location.href = ceshiURL(cb.dataset.test, true); return; }
|
||||
var cb = e.target.closest('.cbn[data-test], .csv-i[data-test]'); if (cb) { haptic(); goCeshi(ceshiURL(cb.dataset.test, true)); return; }
|
||||
var dc = e.target.closest('#csvGo'); if (dc) { csdRoll(dc); return; }
|
||||
var j = e.target.closest('[data-join]'); if (j) { haptic(); openRule(j.dataset.join); return; }
|
||||
if (e.target.closest('[data-rule]')) { openRule(''); return; }
|
||||
@@ -2020,13 +2021,13 @@ html.night .gtg button.on{background:#F2725B;border-color:#F2725B;color:#fff}
|
||||
}
|
||||
$('#more').addEventListener('click', function (e) {
|
||||
var ts = e.target.closest('[data-test]');
|
||||
if (ts) { e.stopPropagation(); haptic(); location.href = ceshiURL(ts.dataset.test, true); }
|
||||
if (ts) { e.stopPropagation(); haptic(); goCeshi(ceshiURL(ts.dataset.test, true)); }
|
||||
}, true);
|
||||
$('#wf').addEventListener('click', function (e) {
|
||||
if (e.target.closest('[data-mine]')) { haptic(); location.href = mineURL(); return; }
|
||||
if (e.target.closest('[data-fav]')) { haptic(); openFav(false); return; }
|
||||
var ts = e.target.closest('[data-test]');
|
||||
if (ts) { haptic(); location.href = ceshiURL(ts.dataset.test, catF === 'ceshi'); return; }
|
||||
if (ts) { haptic(); goCeshi(ceshiURL(ts.dataset.test, catF === 'ceshi')); return; }
|
||||
var lk = e.target.closest('[data-like]');
|
||||
if (lk) { e.stopPropagation(); toggleLike(lk.dataset.like); syncCardLike(lk.dataset.like); return; }
|
||||
var c = e.target.closest('.nc');
|
||||
|
||||
Reference in New Issue
Block a user