lxr пре 1 недеља
родитељ
комит
b8277e3c0f
1 измењених фајлова са 20 додато и 6 уклоњено
  1. 20 6
      HBuilderProjects/shareAiConsult.html

+ 20 - 6
HBuilderProjects/shareAiConsult.html

@@ -182,6 +182,8 @@
       box-shadow: 0 4px 16px rgba(255, 107, 62, 0.32);
       touch-action: manipulation;
       -webkit-tap-highlight-color: transparent;
+      position: relative;
+      z-index: 1;
     }
 
     .continue-btn__label {
@@ -195,22 +197,23 @@
 
     #launch-btn {
       display: none;
+      position: absolute;
+      left: 0;
+      top: 0;
       width: 100%;
-      height: 48px;
+      height: 100%;
       min-height: 48px;
       border-radius: 999px;
       overflow: hidden;
+      z-index: 2;
     }
 
+    /* 底层 continue 按钮始终可见;微信就绪后开放标签叠在上面接收点击 */
     body.is-wechat.wx-jssdk-ready #launch-btn {
       display: block;
       pointer-events: auto;
     }
 
-    body.is-wechat.wx-jssdk-ready #btnContinue {
-      display: none !important;
-    }
-
     #openAppToast {
       display: none;
       position: fixed;
@@ -749,6 +752,10 @@
         });
       }
 
+      function hideWxLaunchOverlay() {
+        document.body.classList.remove("wx-jssdk-ready");
+      }
+
       function refreshWxLaunchTagAttrs() {
         var tag = document.getElementById("launch-btn");
         if (!tag) return;
@@ -776,6 +783,7 @@
                 : "";
           console.warn("[wx-open-launch-app]", detail, "extinfo=", tag.getAttribute("extinfo"));
           if (/launch:fail/i.test(errMsg)) {
+            hideWxLaunchOverlay();
             showAppOpenFailTip("未能打开 App,请确认已安装最新版「U店在哪」");
             return;
           }
@@ -942,6 +950,12 @@
 
       function tryOpenApp() {
         if (isWeChatInAppBrowser()) {
+          if (weChatJssdkConfigured && !document.body.classList.contains("wx-jssdk-ready")) {
+            document.body.classList.add("wx-jssdk-ready");
+            refreshWxLaunchTagAttrs();
+            showFabToast("请再次点击底部按钮");
+            return;
+          }
           if (!weChatJssdkConfigured) {
             showFabToast("微信 SDK 初始化中,请稍候再点");
             initWeChatOpenLaunchApp(true).then(function (ok) {
@@ -961,7 +975,7 @@
 
       document.addEventListener("WeixinOpenTagsError", function (e) {
         console.warn("[WeixinOpenTagsError]", e && e.detail);
-        document.body.classList.remove("wx-jssdk-ready");
+        hideWxLaunchOverlay();
         showFabToast("微信开放标签加载失败,请稍候再试");
       });