|
|
@ -60,7 +60,7 @@ |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="btns"> |
|
|
|
<div class="btns"> |
|
|
|
<el-button size="small" @click="$emit('back')">取消</el-button> |
|
|
|
<el-button size="small" @click="$router.back()">取消</el-button> |
|
|
|
<el-button type="primary" size="small" @click="submit">更新</el-button> |
|
|
|
<el-button type="primary" size="small" @click="submit">更新</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -84,10 +84,14 @@ |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog :title="form.phone ? '更换手机号' : '绑定手机号'" :visible.sync="phoneVisible" :close-on-click-modal="false" |
|
|
|
<el-dialog :title="form.phone ? '更换手机号' : '绑定手机号'" :visible.sync="phoneVisible" :close-on-click-modal="false" |
|
|
|
@close="closePhone" width="30%"> |
|
|
|
@close="closePhone" width="400px"> |
|
|
|
<el-form ref="form" :model="form" label-width="60px"> |
|
|
|
<el-form ref="form" :model="form" label-width="60px"> |
|
|
|
<el-form-item label="手机号"> |
|
|
|
<el-form-item label="手机号" ref="diaPhoneItem"> |
|
|
|
<el-input style="width: 404px;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input> |
|
|
|
<el-input placeholder="请输入新手机号" v-model="phone" maxlength="11" @input="checkAccountByPhone"> |
|
|
|
|
|
|
|
<img v-if="diaClientExist" slot="suffix" class="correct-icon" src="@/assets/images/login/correct.svg" |
|
|
|
|
|
|
|
alt=""> |
|
|
|
|
|
|
|
</el-input> |
|
|
|
|
|
|
|
<p v-if="diaClientMsg" class="el-form-item__error">{{ diaClientMsg }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="验证码"> |
|
|
|
<el-form-item label="验证码"> |
|
|
|
<div class="flex-between"> |
|
|
|
<div class="flex-between"> |
|
|
@ -150,6 +154,7 @@ export default { |
|
|
|
editUsername: '', |
|
|
|
editUsername: '', |
|
|
|
accountVisible: false, |
|
|
|
accountVisible: false, |
|
|
|
updateTime: 0, |
|
|
|
updateTime: 0, |
|
|
|
|
|
|
|
phoneReg: /^1[3456789]\d{9}$/, |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
accountId: '', |
|
|
|
accountId: '', |
|
|
|
userName: '', |
|
|
|
userName: '', |
|
|
@ -225,6 +230,8 @@ export default { |
|
|
|
phoneCode: "", |
|
|
|
phoneCode: "", |
|
|
|
phoneDisabled: false, |
|
|
|
phoneDisabled: false, |
|
|
|
phoneTimer: null, |
|
|
|
phoneTimer: null, |
|
|
|
|
|
|
|
diaClientExist: false, |
|
|
|
|
|
|
|
diaClientMsg: '', |
|
|
|
emailOpener: "", |
|
|
|
emailOpener: "", |
|
|
|
phoneOpener: "", |
|
|
|
phoneOpener: "", |
|
|
|
originAccount: "", |
|
|
|
originAccount: "", |
|
|
@ -397,8 +404,24 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
closePhone () { |
|
|
|
closePhone () { |
|
|
|
if (!this.emailDisabled) { |
|
|
|
if (!this.emailDisabled) { |
|
|
|
this.emailCode = ""; |
|
|
|
this.emailCode = '' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 手机号输入完回调。有账号才能继续操作。type:0手机验证码登录,1重置密码 |
|
|
|
|
|
|
|
async checkAccountByPhone (val) { |
|
|
|
|
|
|
|
if (!this.phoneReg.test(val)) { |
|
|
|
|
|
|
|
this.$refs.diaPhoneItem.clearValidate() |
|
|
|
|
|
|
|
this.diaClientMsg = '请输入正确的手机号' |
|
|
|
|
|
|
|
this.diaClientExist = false |
|
|
|
|
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
const { message } = await this.$get(`${this.api.forgotPreVerification}?phoneOrEmail=${val}&platform=4`) |
|
|
|
|
|
|
|
const exist = message !== 'success' // 用户已存在 |
|
|
|
|
|
|
|
this.diaClientExist = exist |
|
|
|
|
|
|
|
this.diaClientMsg = exist ? '' : '该手机号已注册!' |
|
|
|
|
|
|
|
} catch (e) { } |
|
|
|
}, |
|
|
|
}, |
|
|
|
sendPhoneCode () { |
|
|
|
sendPhoneCode () { |
|
|
|
if (!this.phone) return Util.warningMsg("请输入手机号"); |
|
|
|
if (!this.phone) return Util.warningMsg("请输入手机号"); |
|
|
@ -475,4 +498,9 @@ export default { |
|
|
|
width: 80px; |
|
|
|
width: 80px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.correct-icon { |
|
|
|
|
|
|
|
width: 30px; |
|
|
|
|
|
|
|
margin-top: -5px; |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |