Commit 425de011 authored by yyh's avatar yyh

设置手机号验证码发送逻辑

parent 6d6b594c
......@@ -4,7 +4,7 @@
<div style="font-size: 20px;">已绑定手机号</div>
<div class="title" style="font-size:25px;margin-top:5px;margin-bottom:22px;">{{userInfo.phone || userInfo.email}}</div>
<div style="font-size:14px;color:#737582;">绑定手机号将作为您身份验证的重要方式,请谨慎操作!</div>
<van-button block style="margin-top: 60px;" type="info" @click="step = '2'">更改手机号</van-button>
<van-button block style="margin-top: 60px;" type="info" @click="step = '2';sendCode()();">更改手机号</van-button>
<div style="font-size:12px;color:#999999;margin-top:17px;">变更手机号后,将自动同步新手机号为登录账号</div>
</section>
<code-input
......@@ -16,7 +16,7 @@
<section v-if="step === '3'">
<div class="title">输入新手机号</div>
<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';sendCode(newPhone)();">确定</van-button>
</section>
<code-input
v-if="step === '4'"
......@@ -59,10 +59,10 @@ export default class SetPhone extends Vue {
return this.isPhone ? 0 : 1;
}
private sendSms(account: string = '') {
return this.$api.user.sendSms(account || this.userInfo.phone , 1); // 1 修改密码
return this.$api.user.sendSms(account || this.userInfo.phone , 3); // 1 修改密码
}
private sendEmail(account: string = '') {
return this.$api.user.sendEmail(account || this.userInfo.email, 1); // 1 修改密码
return this.$api.user.sendEmail(account || this.userInfo.email, 3); // 1 修改密码
}
private sendCode(account: string = '') {
return async () => {
......
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