[baozhangchao] 3 lat temu
rodzic
commit
68d607627b
2 zmienionych plików z 23 dodań i 25 usunięć
  1. 22
    15
      public/index.html
  2. 1
    10
      src/utils/initial.js

+ 22
- 15
public/index.html Wyświetl plik

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html lang="">
2
 <html lang="">
3
-  <head>
4
-    <meta charset="utf-8">
5
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
-    <title><%= htmlWebpackPlugin.options.title %></title>
9
-  </head>
10
-  <body>
11
-    <noscript>
12
-      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13
-    </noscript>
14
-    <div id="app"></div>
15
-    <!-- built files will be auto injected -->
16
-  </body>
17
-</html>
3
+
4
+<head>
5
+  <meta charset="utf-8">
6
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
+  <meta name="viewport" content="width=device-width,initial-scale=1.0">
8
+  <link rel="icon" href="<%= BASE_URL %>favicon.ico">
9
+  <title>
10
+    <%= htmlWebpackPlugin.options.title %>
11
+  </title>
12
+  <script src="https://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
13
+</head>
14
+
15
+<body>
16
+  <noscript>
17
+    <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
18
+        Please enable it to continue.</strong>
19
+  </noscript>
20
+  <div id="app"></div>
21
+  <!-- built files will be auto injected -->
22
+</body>
23
+
24
+</html>

+ 1
- 10
src/utils/initial.js Wyświetl plik

41
   const imgUrl = opt.imgUrl || defaultImg
41
   const imgUrl = opt.imgUrl || defaultImg
42
 
42
 
43
   initSDK(link)
43
   initSDK(link)
44
+
44
   window.wx.ready(function () {
45
   window.wx.ready(function () {
45
     jsApiList.map((apiName) => {
46
     jsApiList.map((apiName) => {
46
       const fn = window.wx[apiName]
47
       const fn = window.wx[apiName]
73
     } catch (error) {
74
     } catch (error) {
74
       console.error(error)
75
       console.error(error)
75
     }
76
     }
76
-    if (isLoaded) {
77
-      console.log('hideLoading', isLoaded);
78
-      hideLoading()
79
-
80
-
81
-    } else {
82
-      isLoaded = true
83
 
77
 
84
-      console.log(4, isLoaded);
85
-
86
-    }
87
     return;
78
     return;
88
   })
79
   })
89
 }
80
 }