|
|
@@ -8,7 +8,10 @@
|
|
|
<div>
|
|
|
<el-form :model="passwordRest" :rules="rules" ref="passwordRest" label-width="100px" class="demo-ruleForm">
|
|
|
<el-form-item prop="mobile">
|
|
|
- <el-input v-model="passwordRest.mobile" placeholder="新手机号码"></el-input>
|
|
|
+ <el-input v-model="passwordRest.mobile"
|
|
|
+ v-bind:class="{active: mobileExit}"
|
|
|
+ placeholder="新手机号码"></el-input>
|
|
|
+ <span class="tip tip-mobile" v-show="mobileExit">该手机已被注册</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="code">
|
|
|
<el-input type="text" v-model="passwordRest.code"
|
|
|
@@ -90,6 +93,7 @@
|
|
|
callback(new Error('请填写正确的手机号'))
|
|
|
this.getCodeBtnIsDisabled = true
|
|
|
this.mobileChecked = false
|
|
|
+ this.mobileExit = false
|
|
|
} else {
|
|
|
if (this.passwordRest.mobile !== '') {
|
|
|
var reg = /^1[0-9]{10}$/
|
|
|
@@ -97,9 +101,20 @@
|
|
|
callback(new Error('请填写正确的手机号'))
|
|
|
this.getCodeBtnIsDisabled = true
|
|
|
this.mobileChecked = false
|
|
|
+ this.mobileExit = false
|
|
|
} else {
|
|
|
- this.getCodeBtnIsDisabled = false
|
|
|
- this.mobileChecked = true
|
|
|
+ this.$http.get(`/update/user/mobile/hasRegister`, {params: {mobile: this.passwordRest.mobile}})
|
|
|
+ .then(response => {
|
|
|
+ if (response.data.content.hasRegister) {
|
|
|
+ this.getCodeBtnIsDisabled = true
|
|
|
+ this.mobileChecked = false
|
|
|
+ this.mobileExit = true
|
|
|
+ } else {
|
|
|
+ this.getCodeBtnIsDisabled = false
|
|
|
+ this.mobileChecked = true
|
|
|
+ this.mobileExit = false
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
callback()
|
|
|
@@ -113,7 +128,7 @@
|
|
|
} else {
|
|
|
if (this.passwordRest.code !== '') {
|
|
|
if (this.passwordRest.mobile === '') {
|
|
|
- callback(new Error('请先填写正确的手机号'))
|
|
|
+ callback(new Error('请先填写正确的验证码'))
|
|
|
} else {
|
|
|
if (this.token) {
|
|
|
let param = new FormData()
|
|
|
@@ -338,6 +353,7 @@
|
|
|
contactNameChecked: false,
|
|
|
contactTelChecked: false,
|
|
|
contactEmailChecked: false,
|
|
|
+ mobileExit: false,
|
|
|
rules: {
|
|
|
mobile: [
|
|
|
{validator: validateMobile, trigger: 'blur'}
|
|
|
@@ -574,6 +590,12 @@
|
|
|
color: #0076ad;
|
|
|
}
|
|
|
}
|
|
|
+ span.tip.tip-mobile{
|
|
|
+ top: 3px;
|
|
|
+ right: -105px;
|
|
|
+ color: #ff4949;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
span.tip.description {
|
|
|
top: 10px;
|
|
|
right: -266px;
|