Commit 89a319f6 by yanju

Merge branch 'yoona' into 'master'

Yoona

See merge request pigbigbig/beyond-clouds-front!56
parents 3151bc7a c4c01375
<template> <template>
<div> <div>
<card-container style="margin-top: 16px;padding-bottom: 32px" title="账号绑定" label="账号注册"> <card-container style="margin-top: 16px;padding-bottom: 32px" title="账号绑定" label="账号注册" @listenCardConLabel="() => {this.$router.push('/users/register')}">
<div class="bind-account-item__wrap"> <div class="bind-account-item__wrap">
<div class="bind-account-item"> <div class="bind-account-item">
<div class="item__left"> <div class="item__left">
...@@ -124,14 +124,14 @@ ...@@ -124,14 +124,14 @@
></login-input> ></login-input>
<login-input <login-input
:style="{pointerEvents: disabled, width: '334px'}" :style="{pointerEvents: disabled, width: '334px'}"
v-model="verifyCode" v-model="verifyCode2"
input-type="3" input-type="3"
placeholder="请输入验证码" placeholder="请输入验证码"
:error-message="verifyErrMsg" :error-message="verify2ErrMsg"
:is-count="isCount" :is-count="isCount"
@handleCheck="handleCheckVerifyCode" @handleCheck="handleCheckVerifyCode('password')"
@cancelCheck="verifyErrMsg = ''" @cancelCheck="verify2ErrMsg = ''"
@sendSms="sendVerifyCode" @sendSms="sendVerifyCode('password')"
@keyup.enter.native="savePassword" @keyup.enter.native="savePassword"
></login-input> ></login-input>
</div> </div>
...@@ -194,7 +194,6 @@ ...@@ -194,7 +194,6 @@
let local = infoResponse.data.local; let local = infoResponse.data.local;
let auths = {}; let auths = {};
for(let [key, item] of Object.entries(local)) { for(let [key, item] of Object.entries(local)) {
console.log(key);
auths[key] = item.account auths[key] = item.account
} }
console.log(auths); console.log(auths);
...@@ -212,6 +211,8 @@ ...@@ -212,6 +211,8 @@
isCount: false, isCount: false,
newPassword: '', newPassword: '',
newPasswordMsg: '', newPasswordMsg: '',
verifyCode2: '',
verify2ErrMsg: '',
disabled: 'none' disabled: 'none'
} }
}, },
...@@ -232,15 +233,36 @@ ...@@ -232,15 +233,36 @@
handleCheckPassword() { handleCheckPassword() {
this.newPasswordMsg = checkPassword(this.newPassword); this.newPasswordMsg = checkPassword(this.newPassword);
}, },
handleCheckVerifyCode() { handleCheckVerifyCode(type = '') {
if (type === 'password') {
this.verify2ErrMsg = checkVerification(this.verifyCode2);
} else {
this.verifyErrMsg = checkVerification(this.verifyCode); this.verifyErrMsg = checkVerification(this.verifyCode);
}
}, },
// 发送验证码 // 发送验证码
sendVerifyCode() { sendVerifyCode(type = '') {
if (type === 'password') {
if (!this.hasOwnProperty('mobile')) {
this.$message({
type: 'warning',
message: '请先绑定手机号'
});
return false
} else {
this.isCount = false;
this.getSms(type);
this.verify2ErrMsg = '';
this.isCount = true;
setTimeout(() => {
this.isCount = false;
}, 60000);
return false
}
}
if (this.title === '绑定手机号') { if (this.title === '绑定手机号') {
this.isCount = false; this.isCount = false;
let account = this.account !== '' ? this.account : this.mobile; this.accountErrMsg = checkPhone(this.account);
this.accountErrMsg = checkPhone(account);
if (this.accountErrMsg === '') { if (this.accountErrMsg === '') {
this.getSms(); this.getSms();
this.verifyErrMsg = ''; this.verifyErrMsg = '';
...@@ -262,7 +284,7 @@ ...@@ -262,7 +284,7 @@
} }
} }
}, },
async getSms() { async getSms(type = '') {
let account = this.account !== '' ? this.account : this.mobile; let account = this.account !== '' ? this.account : this.mobile;
let smsResponse = await this.$axios.$get(config.api.get.Sms.send, { let smsResponse = await this.$axios.$get(config.api.get.Sms.send, {
params: { params: {
...@@ -275,7 +297,11 @@ ...@@ -275,7 +297,11 @@
message: '短信发送成功!' message: '短信发送成功!'
}); });
} else { } else {
if (type === 'password') {
this.verify2ErrMsg = smsResponse.msg;
} else {
this.verifyErrMsg = smsResponse.msg; this.verifyErrMsg = smsResponse.msg;
}
this.$message({ this.$message({
type: 'info', type: 'info',
message: smsResponse.msg message: smsResponse.msg
...@@ -354,28 +380,22 @@ ...@@ -354,28 +380,22 @@
}, },
handleRevise() { handleRevise() {
this.disabled = this.disabled === 'auto' ? 'none' : 'auto'; this.disabled = this.disabled === 'auto' ? 'none' : 'auto';
// 取消时 清空输入框 错误提示
if (this.disabled === 'none') { if (this.disabled === 'none') {
Object.assign(this.$data, this.$options.data()); Object.assign(this.$data, this.$options.data());
} }
}, },
async savePassword() { async savePassword() {
this.handleCheckPassword(); this.handleCheckPassword();
this.handleCheckVerifyCode(); this.verify2ErrMsg = checkVerification(this.verifyCode2);
if (!this.hasOwnProperty('mobile')) { if (this.newPasswordMsg !== '' && this.verify2ErrMsg !== '') return false;
this.$message({
type: 'warning',
message: '请先绑定手机号'
});
return false
}
if (this.newPasswordMsg !== '' && this.verifyErrMsg !== '') return false;
let resetResponse; let resetResponse;
resetResponse = await this.$axios.$put(config.api.put.User.revisePassword, { resetResponse = await this.$axios.$put(config.api.put.User.revisePassword, {
mobile: this.mobile, mobile: this.mobile,
password: this.newPassword, password: this.newPassword,
verifyCode: this.verifyCode verifyCode: this.verifyCode2
}); });
console.log(resetResponse); console.log(resetResponse);
if (resetResponse.code === 0) { if (resetResponse.code === 0) {
...@@ -385,8 +405,9 @@ ...@@ -385,8 +405,9 @@
}); });
Object.assign(this.$data, this.$options.data()); Object.assign(this.$data, this.$options.data());
} else { } else {
this.verify2ErrMsg = resetResponse.msg;
this.$message({ this.$message({
type: 'info', type: 'error',
message: resetResponse.msg message: resetResponse.msg
}); });
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<p><span>性别:</span>{{genderInfo}}</p> <p><span>性别:</span>{{genderInfo}}</p>
</div> </div>
<div> <div>
<p><span>生日:</span>{{birthday || '暂无'}}</p> <p><span>生日:</span>暂无</p>
</div> </div>
<div> <div>
<p><span>签名:</span>{{signature || '暂无'}}</p> <p><span>签名:</span>{{signature || '暂无'}}</p>
...@@ -54,9 +54,9 @@ export default { ...@@ -54,9 +54,9 @@ export default {
}, },
computed: { computed: {
genderInfo: function () { genderInfo: function () {
if (this.gender === 0) { if (this.gender === 1) {
return '男' return '男'
} else if (this.gender === 1) { } else if (this.gender === 2) {
return '女' return '女'
} else { } else {
return '保密' return '保密'
......
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