[baozhangchao] 3 years ago
parent
commit
7c50ca4351
3 changed files with 39 additions and 19 deletions
  1. BIN
      public/images/Loading1.png
  2. 27
    7
      public/index.html
  3. 12
    12
      src/utils/initial.js

BIN
public/images/Loading1.png View File


+ 27
- 7
public/index.html View File

@@ -25,15 +25,17 @@
25 25
     }
26 26
 
27 27
     .page-loading {
28
-      width: 100vw;
28
+      width: 0px;
29
+      position: relative;
30
+      animation: loadingrotate 3s ease-in-out 0s 1 alternate forwards;
31
+      overflow: hidden;
29 32
       /* height: 100vw; */
30 33
     }
31 34
 
32 35
     .page-loading .loading-image {
33
-      width: 15vw;
34
-      height: 15vw;
35
-      animation: loadingrotate 1.5s linear infinite;
36
-      margin: auto;
36
+      width: 40vw;
37
+      height: 40vw;
38
+      /* margin: auto; */
37 39
     }
38 40
 
39 41
     .page-loading .loading-tips {
@@ -42,8 +44,25 @@
42 44
     }
43 45
 
44 46
     @keyframes loadingrotate {
47
+      0% {
48
+        width: 0px;
49
+        left: -1vw;
50
+
51
+
52
+      }
53
+
54
+      50% {
55
+        width: 10vw;
56
+        left: -12vw;
57
+
58
+
59
+      }
60
+
45 61
       100% {
46
-        transform: rotate(360deg);
62
+        width: 31vw;
63
+        left: 0vw;
64
+
65
+
47 66
       }
48 67
     }
49 68
   </style>
@@ -52,8 +71,9 @@
52 71
 <body>
53 72
   <div class="page-loading-wrapper">
54 73
     <div class="page-loading">
74
+
55 75
       <div class="loading-image">
56
-        <img src="./images/Loading.png" width="100%" alt="">
76
+        <img src="./images/Loading1.png" width="100%" alt="">
57 77
       </div>
58 78
     </div>
59 79
   </div>

+ 12
- 12
src/utils/initial.js View File

@@ -16,16 +16,16 @@ const jsApiList = [
16 16
 
17 17
 function initSDK (url) {
18 18
   request(`/api/wx/jssdk?url=${encodeURIComponent(url)}`)
19
-  .then((res) => {
20
-    window.wx.config({
21
-      debug: process.env.NODE_ENV === 'development', // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
22
-      appId: res.appId, // 必填,公众号的唯一标识
23
-      timestamp: res.timestamp, // 必填,生成签名的时间戳
24
-      nonceStr: res.nonceStr, // 必填,生成签名的随机串
25
-      signature: res.signature, // 必填,签名
26
-      jsApiList // 必填,需要使用的JS接口列表
19
+    .then((res) => {
20
+      window.wx.config({
21
+        debug: process.env.NODE_ENV === 'development', // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
22
+        appId: res.appId, // 必填,公众号的唯一标识
23
+        timestamp: res.timestamp, // 必填,生成签名的时间戳
24
+        nonceStr: res.nonceStr, // 必填,生成签名的随机串
25
+        signature: res.signature, // 必填,签名
26
+        jsApiList // 必填,需要使用的JS接口列表
27
+      })
27 28
     })
28
-  })
29 29
 }
30 30
 // Vue.use(Vuex)
31 31
 
@@ -87,7 +87,7 @@ export function Login () {
87 87
       console.error(error)
88 88
     }
89 89
 
90
-    hideLoading()
90
+    // hideLoading()
91 91
 
92 92
     return;
93 93
   })
@@ -102,7 +102,7 @@ function hideLoading () {
102 102
  * 获取 code
103 103
  * @returns 
104 104
  */
105
- export function getCode () {
105
+export function getCode () {
106 106
   const matched = /[?&]*code=([^&]+)/.exec(location.search)
107 107
   if (matched) {
108 108
     return decodeURIComponent(matched[1])
@@ -118,7 +118,7 @@ export function redirect (force) {
118 118
   const originCode = localStorage.getItem('wxcode');
119 119
   const wxfirst = localStorage.getItem('wxfirst') === null;
120 120
   const queryCode = getCode();
121
- 
121
+
122 122
   localStorage.setItem('wxcode', queryCode)
123 123
   localStorage.setItem('wxfirst', 'not');
124 124