|
|
@@ -192,6 +192,7 @@
|
|
|
}
|
|
|
|
|
|
.fab-dock__slot {
|
|
|
+ position: relative;
|
|
|
width: 100%;
|
|
|
max-width: 198px;
|
|
|
height: 48px;
|
|
|
@@ -229,6 +230,10 @@
|
|
|
|
|
|
#launch-btn {
|
|
|
display: none;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ z-index: 2;
|
|
|
width: 100%;
|
|
|
height: 48px;
|
|
|
min-height: 48px;
|
|
|
@@ -237,12 +242,14 @@
|
|
|
opacity: 1;
|
|
|
}
|
|
|
|
|
|
+ /* 开放标签叠在 openApp 上;保留 openApp 作视觉兜底,避免标签未渲染时按钮消失 */
|
|
|
body.is-wechat.wx-jssdk-ready #launch-btn {
|
|
|
display: block;
|
|
|
+ pointer-events: auto;
|
|
|
}
|
|
|
|
|
|
body.is-wechat.wx-jssdk-ready #openApp {
|
|
|
- display: none !important;
|
|
|
+ pointer-events: none;
|
|
|
}
|
|
|
|
|
|
.fab-wrap .fab {
|
|
|
@@ -716,6 +723,9 @@
|
|
|
|
|
|
main.innerHTML = bodyHtml;
|
|
|
refreshWxLaunchTagAttrs();
|
|
|
+ if (weChatJssdkConfigured && isWeChatInAppBrowser()) {
|
|
|
+ activateWxLaunchTagUi();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function buildAiConsultOpenParams() {
|
|
|
@@ -989,6 +999,29 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ function isWxLaunchTagRendered() {
|
|
|
+ var tag = document.getElementById("launch-btn");
|
|
|
+ if (!tag) return false;
|
|
|
+ try {
|
|
|
+ if (tag.shadowRoot) {
|
|
|
+ var innerBtn = tag.shadowRoot.querySelector("button, .wx-open-app-btn");
|
|
|
+ if (innerBtn) return true;
|
|
|
+ }
|
|
|
+ } catch (eShadow) {}
|
|
|
+ var rect = tag.getBoundingClientRect();
|
|
|
+ return rect.height >= 40 && rect.width >= 40;
|
|
|
+ }
|
|
|
+
|
|
|
+ function activateWxLaunchTagUi() {
|
|
|
+ document.body.classList.add("wx-jssdk-ready");
|
|
|
+ if (!isWeChatInAppBrowser()) return;
|
|
|
+ window.setTimeout(function () {
|
|
|
+ if (isWxLaunchTagRendered()) return;
|
|
|
+ document.body.classList.remove("wx-jssdk-ready");
|
|
|
+ console.warn("[wx] launch tag not rendered, fallback to #openApp");
|
|
|
+ }, 500);
|
|
|
+ }
|
|
|
+
|
|
|
function applyWxConfigFromSign(sign, htmlUrl) {
|
|
|
var wxConfigParams = {
|
|
|
debug: isWxDebugOn(),
|
|
|
@@ -1003,8 +1036,8 @@
|
|
|
wx.config(wxConfigParams);
|
|
|
wx.ready(function () {
|
|
|
weChatJssdkConfigured = true;
|
|
|
- document.body.classList.add("wx-jssdk-ready");
|
|
|
refreshWxLaunchTagAttrs();
|
|
|
+ activateWxLaunchTagUi();
|
|
|
console.log("[wx.config] ready, htmlUrl=", htmlUrl);
|
|
|
resolve(true);
|
|
|
});
|
|
|
@@ -1269,10 +1302,16 @@
|
|
|
}
|
|
|
|
|
|
if (shouldInitWeChatJssdkOnLoad()) {
|
|
|
+ if (isWxPcBrowser() && (isWxForceDebug() || isWxPcAutoDebugHost())) {
|
|
|
+ document.body.classList.add("wx-pc-debug");
|
|
|
+ }
|
|
|
scheduleWeChatJssdkBootstrap();
|
|
|
}
|
|
|
|
|
|
document.addEventListener("WeixinOpenTagsError", function (e) {
|
|
|
+ document.body.classList.remove("wx-jssdk-ready");
|
|
|
+ weChatJssdkConfigured = false;
|
|
|
+ wxJssdkInitPromise = null;
|
|
|
console.warn("[WeixinOpenTagsError]", e && e.detail);
|
|
|
});
|
|
|
|