Commit 8c10dcc5 authored by yyh's avatar yyh

功能

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