sunshibo před 4 dny
rodič
revize
d5d44e2fc8
1 změnil soubory, kde provedl 1 přidání a 50 odebrání
  1. 1 50
      HBuilderProjects/shareAiConsult.html

+ 1 - 50
HBuilderProjects/shareAiConsult.html

@@ -717,9 +717,6 @@
 
 
         main.innerHTML = bodyHtml;
         main.innerHTML = bodyHtml;
         refreshWxLaunchTagAttrs();
         refreshWxLaunchTagAttrs();
-        if (weChatJssdkConfigured && isWeChatInAppBrowser()) {
-          scheduleWxLaunchTagUiSync();
-        }
       }
       }
 
 
       function buildAiConsultOpenParams() {
       function buildAiConsultOpenParams() {
@@ -997,34 +994,6 @@
           });
           });
       }
       }
 
 
-      function isWxLaunchTagRendered() {
-        var tag = document.getElementById("launch-btn");
-        if (!tag) return false;
-        try {
-          if (tag.shadowRoot) {
-            return !!tag.shadowRoot.querySelector("button, .wx-open-app-btn");
-          }
-        } catch (eShadow) {}
-        return false;
-      }
-
-      function syncWxLaunchTagUi() {
-        if (!isWeChatInAppBrowser()) return;
-        if (isWxLaunchTagRendered()) {
-          document.body.classList.add("wx-jssdk-ready");
-        } else {
-          document.body.classList.remove("wx-jssdk-ready");
-        }
-      }
-
-      function scheduleWxLaunchTagUiSync() {
-        if (!isWeChatInAppBrowser()) return;
-        syncWxLaunchTagUi();
-        [200, 500, 1000, 1800].forEach(function (ms) {
-          window.setTimeout(syncWxLaunchTagUi, ms);
-        });
-      }
-
       function applyWxConfigFromSign(sign, htmlUrl) {
       function applyWxConfigFromSign(sign, htmlUrl) {
         var wxConfigParams = {
         var wxConfigParams = {
           debug: isWxDebugOn(),
           debug: isWxDebugOn(),
@@ -1039,8 +1008,8 @@
           wx.config(wxConfigParams);
           wx.config(wxConfigParams);
           wx.ready(function () {
           wx.ready(function () {
             weChatJssdkConfigured = true;
             weChatJssdkConfigured = true;
+            document.body.classList.add("wx-jssdk-ready");
             refreshWxLaunchTagAttrs();
             refreshWxLaunchTagAttrs();
-            scheduleWxLaunchTagUiSync();
             console.log("[wx.config] ready, htmlUrl=", htmlUrl);
             console.log("[wx.config] ready, htmlUrl=", htmlUrl);
             resolve(true);
             resolve(true);
           });
           });
@@ -1338,18 +1307,7 @@
         }
         }
 
 
         document.addEventListener("WeixinOpenTagsError", function (e) {
         document.addEventListener("WeixinOpenTagsError", function (e) {
-          document.body.classList.remove("wx-jssdk-ready");
-          weChatJssdkConfigured = false;
-          wxJssdkInitPromise = null;
           console.warn("[WeixinOpenTagsError]", e && e.detail);
           console.warn("[WeixinOpenTagsError]", e && e.detail);
-          var d = e && e.detail;
-          var em =
-            d && d.errMsg
-              ? String(d.errMsg)
-              : d && d.errmsg
-                ? String(d.errmsg)
-                : "";
-          showFabToast(em || "微信开放标签不可用,请升级微信后重试");
         });
         });
 
 
         var openBtnWx = document.getElementById("openApp");
         var openBtnWx = document.getElementById("openApp");
@@ -1360,13 +1318,6 @@
                 showFabToast(
                 showFabToast(
                   wxInitLastError || "微信 SDK 初始化中,请稍候再点底部按钮"
                   wxInitLastError || "微信 SDK 初始化中,请稍候再点底部按钮"
                 );
                 );
-                initWeChatOpenLaunchApp(true);
-                return;
-              }
-              if (!document.body.classList.contains("wx-jssdk-ready")) {
-                refreshWxLaunchTagAttrs();
-                scheduleWxLaunchTagUiSync();
-                showFabToast("开放标签加载中,请稍候再点");
               }
               }
             });
             });
           } else {
           } else {