Procházet zdrojové kódy

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

Baozhangchao před 3 roky
rodič
revize
992294c9ef

binární
public/favicon.ico Zobrazit soubor


binární
public/images/share.jpg Zobrazit soubor


binární
src/assets/indexImg/indexBgctop.jpg Zobrazit soubor


+ 1
- 1
src/components/MyWinning.vue Zobrazit soubor

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

+ 1
- 1
src/components/imgbox.vue Zobrazit soubor

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

+ 4
- 14
src/pages/Honghe.vue Zobrazit soubor

@@ -256,10 +256,8 @@ export default {
256 256
   flex-direction: column;
257 257
 }
258 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 261
   height: 100vh;
264 262
   position: relative;
265 263
   top: 0;
@@ -271,20 +269,12 @@ export default {
271 269
     z-index: 2;
272 270
   }
273 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 274
   .outer6-wrapper {
285 275
     width: 92vw;
286 276
     border: 1px solid #d0b69a;
287
-    margin: 16px auto 0;
277
+    margin: 0 auto;
288 278
     margin-bottom: 2em;
289 279
 
290 280
     .outer6 {

+ 1
- 1
src/pages/SaveShare.vue Zobrazit soubor

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

+ 2
- 2
src/router/index.js Zobrazit soubor

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

+ 3
- 3
src/utils/request.js Zobrazit soubor

@@ -16,6 +16,6 @@ export default function request (url, options = {}) {
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 Zobrazit soubor

@@ -64,9 +64,9 @@ export function redirect () {
64 64
   const queryCode = getCode();
65 65
   localStorage.setItem('wxcode', queryCode)
66 66
 
67
-  if (!queryCode || queryCode === originCode) {
67
+  if (!queryCode || queryCode !== originCode) {
68 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 70
     window.location.href = url
71 71
   }
72 72
 }
@@ -85,3 +85,18 @@ export function getOpenId () {
85 85
 
86 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
+}