Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
fix(certificate): (#513) 未认证用户点击认证时页面报错
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Sep 19, 2018
1 parent 14aa4b2 commit e85720a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 60 deletions.
42 changes: 11 additions & 31 deletions src/page/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@
<use xlink:href="#profile-home"/>
</svg>
<span class="m-text-box m-flex-grow1">个人主页</span>
<v-icon
type="base-arrow-r"
class="m-entry-append"/>
<v-icon type="base-arrow-r" class="m-entry-append"/>
</router-link>
<router-link
to="/profile/news/released"
Expand All @@ -64,9 +62,7 @@
<use xlink:href="#profile-plane"/>
</svg>
<span class="m-text-box m-flex-grow1">我的投稿</span>
<v-icon
type="base-arrow-r"
class="m-entry-append"/>
<v-icon type="base-arrow-r" class="m-entry-append"/>
</router-link>
<!-- <router-link to="/upgrade" tag="li" class="m-entry">
<svg class='m-style-svg m-svg-def m-entry-prepend'>
Expand All @@ -92,27 +88,19 @@
to="/wallet"
class="m-entry"
tag="li">
<v-icon
type="profile-wallet"
class="m-entry-prepend"/>
<v-icon type="profile-wallet" class="m-entry-prepend"/>
<span class="m-text-box m-flex-grow1">钱包</span>
<span class="m-entry-extra">{{ new_balance }}</span>
<v-icon
type="base-arrow-r"
class="m-entry-append"/>
<v-icon type="base-arrow-r" class="m-entry-append"/>
</router-link>
<router-link
tag="li"
to="/currency"
class="m-entry">
<v-icon
type="profile-integral"
class="m-entry-prepend"/>
<v-icon type="profile-integral" class="m-entry-prepend"/>
<span class="m-text-box m-flex-grow1">{{ currency_name }}</span>
<span class="m-entry-extra">{{ sum }}</span>
<v-icon
class="m-entry-append"
type="base-arrow-r"/>
<v-icon class="m-entry-append" type="base-arrow-r"/>
</router-link>
<router-link
to="/profile/collection/feeds"
Expand All @@ -122,23 +110,17 @@
<use xlink:href="#profile-collect"/>
</svg>
<span class="m-text-box m-flex-grow1">收藏</span>
<v-icon
type="base-arrow-r"
class="m-entry-append"/>
<v-icon type="base-arrow-r" class="m-entry-append"/>
</router-link>
</ul>
<ul class="m-box-model m-entry-group">
<li
class="m-entry"
@click="selectCertType">
<li class="m-entry" @click="selectCertType">
<svg class="m-style-svg m-svg-def m-entry-prepend">
<use xlink:href="#profile-approve"/>
</svg>
<span class="m-text-box m-flex-grow1">认证</span>
<span class="m-entry-extra">{{ verifiedText }}</span>
<v-icon
type="base-arrow-r"
class="m-entry-append"/>
<v-icon type="base-arrow-r" class="m-entry-append"/>
</li>
<router-link
to="/setting"
Expand All @@ -148,9 +130,7 @@
<use xlink:href="#profile-setting"/>
</svg>
<span class="m-text-box m-flex-grow1">设置</span>
<v-icon
type="base-arrow-r"
class="m-entry-append"/>
<v-icon type="base-arrow-r" class="m-entry-append"/>
</router-link>
</ul>
</div>
Expand Down Expand Up @@ -202,7 +182,7 @@ export default {
},
watch: {
verified(to) {
if (to) to.status = Number(to.status);
if (to && to.status) to.status = Number(to.status);
if (to && to.status === 0) {
this.verifiedText = "待审核";
} else if (to && to.status === 1) {
Expand Down
28 changes: 12 additions & 16 deletions src/page/profile/Certificate.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
<template>
<div class="p-profile-certificate">
<header class="m-box m-pos-f m-main m-bb1 m-head-top">
<div
class="m-box m-aln-center m-flex-none"
@click="step > 1 ? step-- : goBack()">
<v-icon type="base-back" />
</div>
<div class="m-box m-aln-center m-flex-auto m-justify-center m-head-top-title">
<span>{{ step === 1 ? '基本信息' : '上传资料' }}</span>
</div>
<div class="m-box m-aln-center m-flex-none btn-submit">
<span
v-show="step === 2"
:class="['btn-submit', disabled]"
@click="validate(onSubmit)">提交</span>
</div>
</header>

<common-header :back="back">
{{ step === 1 ? '基本信息' : '上传资料' }}
<span
v-show="step === 2"
slot="right"
:class="['btn-submit', disabled]"
@click="validate(onSubmit)">提交</span>
</common-header>

<transition-group
:enter-active-class="animated.enter"
Expand Down Expand Up @@ -315,6 +308,9 @@ export default {
});
},
methods: {
back() {
this.step > 1 ? this.step-- : this.goBack();
},
onSubmit() {
const postData = Object.assign({ files: this.files }, this.formData);
if (this.status === 0) {
Expand Down
17 changes: 4 additions & 13 deletions src/page/profile/Certification.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
<template>
<div class="p-profile-certification">
<header class="m-box m-pos-f m-main m-bb1 m-head-top">
<div
class="m-box m-aln-center m-flex-none"
@click="goBack">
<v-icon type="base-back" />
</div>
<div class="m-box m-aln-center m-flex-auto m-justify-center m-head-top-title">
<span>{{ type === 'user' ? '个人' : '企业' }}认证</span>
</div>
<div class="m-box m-aln-center m-flex-none btn-submit"/>
</header>

<common-header>{{ type === 'user' ? '个人' : '企业' }}认证</common-header>

<main class="m-box-model main">
<div
v-if="verified.status === 0"
Expand Down Expand Up @@ -55,6 +47,7 @@
</div>
</div>
</main>

</div>
</template>

Expand Down Expand Up @@ -131,8 +124,6 @@ export default {
background-color: #fff;
main {
padding-top: 0.9rem;
.info-bar {
background-color: #4bb893;
color: #fff;
Expand Down

0 comments on commit e85720a

Please sign in to comment.