From 122766c91128ca0d69105a682582baeead79b556 Mon Sep 17 00:00:00 2001 From: guke Date: Mon, 29 Jun 2026 13:05:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(h5):=20SGBridge=20=E6=96=B0=E5=A2=9E=20clo?= =?UTF-8?q?sePage(=E8=BF=94=E5=9B=9E=E4=B8=8A=E4=B8=80=E9=A1=B5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- h5/shared/bridge.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/h5/shared/bridge.js b/h5/shared/bridge.js index ed70e0f..a61f187 100644 --- a/h5/shared/bridge.js +++ b/h5/shared/bridge.js @@ -118,6 +118,12 @@ else console.log('[SGBridge mock] launchApp →', json); } + /** 网页请求返回上一页(原生 popBackStack;无桥时浏览器仅 log)。 */ + function closePage() { + if (hasNative && native.closePage) native.closePage(); + else console.log('[SGBridge mock] closePage'); + } + // ====== 原生 → H5 事件总线 ====== var listeners = {}; // event → [fn] @@ -155,6 +161,7 @@ startCompare: startCompare, startCouponClaim: startCouponClaim, launchApp: launchApp, + closePage: closePage, // 事件 on: on, _emit: _emit,