Browse Source

修复bug

1. 健康信息界面判断错误
2.极速登录参数错误问题
remotes/origin/HEAD
wally 5 years ago
parent
commit
9ab42b4fb5
  1. 4
      components/auth/auth.vue
  2. 2
      main.js
  3. 8
      pages/user-code/user-code.vue
  4. 3
      store/modules/user/actions.js
  5. 2
      store/modules/user/mutations.js

4
components/auth/auth.vue

@ -34,7 +34,11 @@ export default {
if (value) { if (value) {
if (!value.wxInfo || !value.wxInfo.nickname) { if (!value.wxInfo || !value.wxInfo.nickname) {
this.show = true; this.show = true;
} else {
this.show = false;
} }
} else {
this.show = false;
} }
}, },
}, },

2
main.js

@ -39,7 +39,7 @@ Vue.prototype.openPage = function(path, query = '') {
let url = query ? `${path}?${query}` : path; let url = query ? `${path}?${query}` : path;
store.commit('user/setPagePath', url); store.commit('user/setPagePath', url);
const isWhite = checkWhitePath(url); const isWhite = checkWhitePath(url);
if (!store.state.user.userInfo.id && !isWhite) { if ((!store.state.user.userInfo || !store.state.user.userInfo.id) && !isWhite) {
url = '/pages/basic-info/basic-info'; url = '/pages/basic-info/basic-info';
} }

8
pages/user-code/user-code.vue

@ -94,9 +94,9 @@ export default {
// //
level() { level() {
if (!this.userInfo || !this.userInfo.healthLevel) return '正常'; if (!this.userInfo || !this.userInfo.healthCodeList) return '正常';
let str = '正常'; let str = '正常';
switch (this.userInfo.healthLevel[0].healthLevel) { switch (this.userInfo.healthCodeList[0].healthLevel) {
case 0: case 0:
str = '正常'; str = '正常';
break; break;
@ -113,8 +113,8 @@ export default {
}, },
time() { time() {
if (!this.userInfo || !this.userInfo.healthLevel) return; if (!this.userInfo || !this.userInfo.healthCodeList) return;
return this.$moment(this.userInfo.healthLevel[0].time - 0).format('YYYY-MM-DD HH:mm'); return this.$moment(this.userInfo.healthCodeList[0].time - 0).format('YYYY-MM-DD HH:mm');
}, },
}, },

3
store/modules/user/actions.js

@ -52,7 +52,7 @@ const actions = {
.post(UPDATE_USER, params) .post(UPDATE_USER, params)
.then(res => { .then(res => {
const { data } = res.data; const { data } = res.data;
commit('updateUser', { type: 'wxInfo', params }); commit('updateUser', { type: 'wxInfo', value: params });
resolve(data); resolve(data);
}) })
.catch(data => { .catch(data => {
@ -75,6 +75,7 @@ const actions = {
.then(res => { .then(res => {
hideLoading(); hideLoading();
const { data } = res.data; const { data } = res.data;
console.log('getUserInfo data: ', data);
resolve(data); resolve(data);
// 获取自己的信息采取设置 // 获取自己的信息采取设置
// 扫别人健康码的时候不用设置 // 扫别人健康码的时候不用设置

2
store/modules/user/mutations.js

@ -69,7 +69,7 @@ const mutations = {
*/ */
setStatus(state, data) { setStatus(state, data) {
state.status = data || []; state.status = data || [];
} },
}; };
export default mutations; export default mutations;

Loading…
Cancel
Save