瀏覽代碼

Merge branch 'master' of http://git.ycjcjy.com/honghe/h5-draw-lots

Baozhangchao 3 年之前
父節點
當前提交
992294c9ef
共有 10 個檔案被更改,包括 29 行新增24 行删除
  1. 二進制
      public/favicon.ico
  2. 二進制
      public/images/share.jpg
  3. 二進制
      src/assets/indexImg/indexBgctop.jpg
  4. 1
    1
      src/components/MyWinning.vue
  5. 1
    1
      src/components/imgbox.vue
  6. 4
    14
      src/pages/Honghe.vue
  7. 1
    1
      src/pages/SaveShare.vue
  8. 2
    2
      src/router/index.js
  9. 3
    3
      src/utils/request.js
  10. 17
    2
      src/utils/wx.js

二進制
public/favicon.ico 查看文件


二進制
public/images/share.jpg 查看文件


二進制
src/assets/indexImg/indexBgctop.jpg 查看文件


+ 1
- 1
src/components/MyWinning.vue 查看文件

293
         border-radius: 8px;
293
         border-radius: 8px;
294
         margin-top: 11px;
294
         margin-top: 11px;
295
         width: 343px;
295
         width: 343px;
296
-        background-color: #c1172d;
296
+        background-color: #b12b32;
297
         border: 0;
297
         border: 0;
298
         position: fixed;
298
         position: fixed;
299
         z-index: 15;
299
         z-index: 15;

+ 1
- 1
src/components/imgbox.vue 查看文件

45
     height: 49.5vw;
45
     height: 49.5vw;
46
     transform-style: preserve-3d;
46
     transform-style: preserve-3d;
47
     transition: all 0.6s ease;
47
     transition: all 0.6s ease;
48
-    transform: rotateY(-180deg) scale(1);
48
+    transform: rotateY(-180deg) scale(2);
49
     .back {
49
     .back {
50
       transform: rotateY(-180deg);
50
       transform: rotateY(-180deg);
51
     }
51
     }

+ 4
- 14
src/pages/Honghe.vue 查看文件

256
   flex-direction: column;
256
   flex-direction: column;
257
 }
257
 }
258
 .index-box {
258
 .index-box {
259
-  // background: url('../assets/indexImg/indexBgc.jpg') no-repeat;
260
-  background-color: #c1172d;
261
-  background-size: 100% 100%;
262
-  width: 100%;
259
+  background-color: #b12b32;
260
+  width: 100vw;
263
   height: 100vh;
261
   height: 100vh;
264
   position: relative;
262
   position: relative;
265
   top: 0;
263
   top: 0;
271
     z-index: 2;
269
     z-index: 2;
272
   }
270
   }
273
   .topImage {
271
   .topImage {
274
-    width: 90%;
275
-    z-index: 8;
276
-    overflow-wrap: break-word;
277
-    text-align: center;
278
-    white-space: nowrap;
279
-    align-self: center;
280
-    margin-top: 20px;
281
-    background-size: 100% auto;
282
-    background-repeat: no-repeat;
272
+    width: 100vw;
283
   }
273
   }
284
   .outer6-wrapper {
274
   .outer6-wrapper {
285
     width: 92vw;
275
     width: 92vw;
286
     border: 1px solid #d0b69a;
276
     border: 1px solid #d0b69a;
287
-    margin: 16px auto 0;
277
+    margin: 0 auto;
288
     margin-bottom: 2em;
278
     margin-bottom: 2em;
289
 
279
 
290
     .outer6 {
280
     .outer6 {

+ 1
- 1
src/pages/SaveShare.vue 查看文件

214
       border-radius: 8px;
214
       border-radius: 8px;
215
       margin-top: 11px;
215
       margin-top: 11px;
216
       width: 343px;
216
       width: 343px;
217
-      background-color: #c1172d;
217
+      background-color: #b12b32;
218
       border: 0;
218
       border: 0;
219
       position: fixed;
219
       position: fixed;
220
       z-index: 15;
220
       z-index: 15;

+ 2
- 2
src/router/index.js 查看文件

5
 import Honghe from '../pages/Honghe.vue'
5
 import Honghe from '../pages/Honghe.vue'
6
 import SaveShare from '../pages/SaveShare.vue'
6
 import SaveShare from '../pages/SaveShare.vue'
7
 import { useModel } from '../store'
7
 import { useModel } from '../store'
8
-import { getOpenId } from '../utils/wx'
8
+import { getUserInfo } from '../utils/wx'
9
 import { login } from '../services/person'
9
 import { login } from '../services/person'
10
 import { setToken } from '../utils/token'
10
 import { setToken } from '../utils/token'
11
 
11
 
36
 
36
 
37
   // 未登录
37
   // 未登录
38
   if (!person.personId) {
38
   if (!person.personId) {
39
-    getOpenId().then(openid => {
39
+    getUserInfo().then(openid => {
40
       login(openid).then(res => {
40
       login(openid).then(res => {
41
         const { user, token } = res;
41
         const { user, token } = res;
42
         setPerson(user)
42
         setPerson(user)

+ 3
- 3
src/utils/request.js 查看文件

16
     })
16
     })
17
 }
17
 }
18
 
18
 
19
-export const baseURL = process.env.NODE_ENV === 'development' ?
20
-  '/api/wx' :
21
-  '/api/wx'
19
+export const domain = process.env.NODE_ENV === 'development' ? '' : 'https://h5.njyunzhi.com'
20
+
21
+export const baseURL = `${domain}/api/wx`

+ 17
- 2
src/utils/wx.js 查看文件

64
   const queryCode = getCode();
64
   const queryCode = getCode();
65
   localStorage.setItem('wxcode', queryCode)
65
   localStorage.setItem('wxcode', queryCode)
66
 
66
 
67
-  if (!queryCode || queryCode === originCode) {
67
+  if (!queryCode || queryCode !== originCode) {
68
     const local = encodeURIComponent(location.origin + location.pathname)
68
     const local = encodeURIComponent(location.origin + location.pathname)
69
-    const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxd3bab568bc42d1de&redirect_uri=${local}&response_type=code&scope=snsapi_base&state=123#wechat_redirect`
69
+    const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxd3bab568bc42d1de&redirect_uri=${local}&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect`
70
     window.location.href = url
70
     window.location.href = url
71
   }
71
   }
72
 }
72
 }
85
 
85
 
86
   return request(`https://api.h5.njyunzhi.com/mp/openid?code=${encodeURIComponent(code)}`)
86
   return request(`https://api.h5.njyunzhi.com/mp/openid?code=${encodeURIComponent(code)}`)
87
 }
87
 }
88
+
89
+/**
90
+ * 获取 openid
91
+ * @returns 
92
+ */
93
+export function getUserInfo () {
94
+  if (process.env.NODE_ENV === 'development') return Promise.resolve({ openid: '123' });
95
+
96
+  const code = getCode()
97
+  if (!code) {
98
+    return Promise.reject("获取用户信息失败, 请刷新重试")
99
+  }
100
+
101
+  return request(`https://api.h5.njyunzhi.com/mp/userinfo?code=${encodeURIComponent(code)}`)
102
+}