Commit 8c10dcc5 authored by yyh's avatar yyh

功能

parent 3cf89fda
......@@ -70,7 +70,7 @@ export default class Index extends Vue {
};
get authIcon() {
const { auth_suc } = this.userInfo;
return auth_suc ? 'yirenzheng' : 'weirenzheng'
return auth_suc ? 'yirenzheng' : 'weirenzheng';
}
get datas() {
const { auth_type, auth_suc } = this.userInfo;
......
......@@ -19,12 +19,13 @@
<van-field v-model="newPhone" label="" placeholder="请输入新手机号" class="margin-top30"></van-field>
<van-button block type="info" class="margin-top30" @click="step='4'">确定</van-button>
</section>
<!-- :validateCode="() => {}"
-->
<code-input
v-if="step === '4'"
:code.sync="code"
:codeTo="newPhone"
:sendCode="sendCode(newPhone)"
:validateCode="() => {}"
:next="setPhone"></code-input>
<set-success
v-if="step === '5'"
......@@ -49,7 +50,7 @@ import CodeInput from './components/CodeInput.vue';
})
export default class SetPhone extends Vue {
@State('userInfo') private userInfo!: any;
@Action('getUserInfo') private getUserInfo!: () => void;
@Action('getUserInfo') private getUserInfo!: () => Promise<any>;
private code: string = '';
private randomToken: string = '';
private newPhone: string = '';
......@@ -73,7 +74,7 @@ export default class SetPhone extends Vue {
} else {
await this.sendEmail(account);
}
}
};
}
private async validateOldAccount() {
const { userInfo: { phone, email }, code, newPhone } = this;
......@@ -90,6 +91,7 @@ export default class SetPhone extends Vue {
private async setPhone() {
const {code, newPhone, randomToken } = this;
await this.$api.user.setPhone(code, newPhone, randomToken);
await this.getUserInfo();
this.step = '5';
}
}
......
......@@ -37,10 +37,14 @@ export default class CodeInput extends Vue {
})private codeTo!: string;
@Prop()private code!: string;
@Prop({
default: () => 0,
default: () => {
return () => {}
},
})private sendCode!: () => Promise<any>;
@Prop({
default: () => 0,
default: () => {
return () => {}
},
})private validateCode!: () => Promise<any>;
@Prop({
default: () => 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment