瀏覽代碼

Merge branch 'dev-z/v4.9.89' of qmx/jy into feature/v4.9.89

zhangyuhan 6 月之前
父節點
當前提交
f64a57e200
共有 1 個文件被更改,包括 25 次插入18 次删除
  1. 25 18
      src/web/staticres/common-module/public/head.js

+ 25 - 18
src/web/staticres/common-module/public/head.js

@@ -28,25 +28,7 @@
 })();
 
 ;(function () {
-  function setMiniAppInfo () {
-    try {
-      var title = document.title
-      var meta = document.querySelector('meta[name="mini-app-data"]');
-      if (meta) {
-        title = meta.getAttribute('content');
-      }
-      wx.miniProgram.postMessage({ data: {
-          post: 'share',
-          type: 'common',
-          desc: '默认标题',
-          title: title
-        }})
-    } catch (e) {
-      console.log(e)
-    }
-  }
 
-  setMiniAppInfo()
 
   function loadJS (url, success) {
     var scripts = document.getElementsByTagName('script')
@@ -70,6 +52,31 @@
     document.getElementsByTagName('head')[0].appendChild(domScript);
   }
 
+  function initMiniAppInfo () {
+    function setMiniAppInfo () {
+      try {
+        var title = document.title
+        var meta = document.querySelector('meta[name="mini-app-data"]');
+        if (meta) {
+          title = meta.getAttribute('content');
+        }
+        wx.miniProgram.postMessage({ data: {
+            post: 'share',
+            type: 'common',
+            desc: '默认标题',
+            title: title
+          }})
+      } catch (e) {
+        console.log(e)
+      }
+    }
+
+    loadJS('res2.wx.qq.com/open/js/jweixin-1.6.0.js', function () {
+      setMiniAppInfo()
+    })
+  }
+  initMiniAppInfo()
+
   try {
     // 初始化JTrack
     var sdkVersion = 142