diff --git a/h5/css/style.css b/h5/css/style.css index cfe6977..68e2975 100644 --- a/h5/css/style.css +++ b/h5/css/style.css @@ -21,6 +21,8 @@ * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; } html, body { height: 100%; } +/* 微信「字体大小」设置会放大网页文字(iOS 经 text-size-adjust);锁定 100% 使与 Safari 一致 */ +html { -webkit-text-size-adjust: 100% !important; text-size-adjust: 100% !important; } body { font-family: var(--font); color: var(--ink); diff --git a/h5/js/app.js b/h5/js/app.js index a4fd998..2acdc6f 100644 --- a/h5/js/app.js +++ b/h5/js/app.js @@ -1395,6 +1395,18 @@ if (e.persisted) handleCamVisible(); // bfcache 恢复(不一定伴随 visibilitychange) }); + /* ─── 微信安卓端:字体大小设置不走 text-size-adjust,需经 JSBridge 重置为标准并屏蔽后续调整 ─── */ + (function lockWeixinFontSize() { + function lock() { + var B = window.WeixinJSBridge; + if (!B) return; + B.invoke('setFontSizeCallback', { fontSize: 0 }); + B.on('menu:setfont', function () { B.invoke('setFontSizeCallback', { fontSize: 0 }); }); + } + if (window.WeixinJSBridge) lock(); + else document.addEventListener('WeixinJSBridgeReady', lock, false); + })(); + /* ─── 初始化 ─── */ history.replaceState({ screen: 's-splash' }, ''); // 刷新后从启动页开始,历史栈的屏标记与之对齐 renderCamStep();