|
|
|
@ -8,13 +8,16 @@ |
|
|
|
<div>忘记密码</div> |
|
|
|
<div>忘记密码</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="bottom_con"> |
|
|
|
<div class="bottom_con"> |
|
|
|
<el-form ref="form" :model="loginForm" :rules="loginRules" label-width="100px" style="width: 28%;margin: 0 auto;"> |
|
|
|
<el-form ref="form" :model="loginForm" :rules="loginRules" label-width="100px" |
|
|
|
|
|
|
|
style="width: 28%;margin: 0 auto;"> |
|
|
|
<el-form-item label="手机号" prop="phoneNumber"> |
|
|
|
<el-form-item label="手机号" prop="phoneNumber"> |
|
|
|
<el-input v-model="loginForm.phoneNumber"></el-input> |
|
|
|
<el-input v-model="loginForm.phoneNumber"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="手机验证码" prop="valiNum"> |
|
|
|
<el-form-item label="手机验证码" prop="valiNum"> |
|
|
|
<el-input v-model="loginForm.valiNum" style="width:60%" :disabled="!isShowValite"></el-input> |
|
|
|
<el-input v-model="loginForm.valiNum" style="width:60%" :disabled="!isShowValite"></el-input> |
|
|
|
<el-button style="width:38%;margin-left:2%;" :disabled="!/^1[3-9][0-9]{9}$|^15[0-9]{2}[0-9]{8}$|^17[0-9]{2}[0-9]{7}$|^18[0-9]{3}[0-9]{6}$/.test(loginForm.phoneNumber)" @click="getVerfyCode">获取验证码</el-button> |
|
|
|
<el-button style="width:38%;margin-left:2%;" |
|
|
|
|
|
|
|
:disabled="!/^1[3-9][0-9]{9}$|^15[0-9]{2}[0-9]{8}$|^17[0-9]{2}[0-9]{7}$|^18[0-9]{3}[0-9]{6}$/.test(loginForm.phoneNumber)" |
|
|
|
|
|
|
|
@click="getVerfyCode">获取验证码</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="设置密码" prop="password"> |
|
|
|
<el-form-item label="设置密码" prop="password"> |
|
|
|
<el-input v-model="loginForm.password"></el-input> |
|
|
|
<el-input v-model="loginForm.password"></el-input> |
|
|
|
@ -22,21 +25,22 @@ |
|
|
|
<el-form-item label="确认密码" prop="comfirmPassword"> |
|
|
|
<el-form-item label="确认密码" prop="comfirmPassword"> |
|
|
|
<el-input v-model="loginForm.comfirmPassword"></el-input> |
|
|
|
<el-input v-model="loginForm.comfirmPassword"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-button class="next_box" @click="handleRegsiter">下一步</el-button> |
|
|
|
<el-button class="next_box" @click="handleRegsiter">确定</el-button> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
export default { |
|
|
|
import {resetPwd} from "@/api/user"; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
var validatePass2 = (rule, value, callback) => { |
|
|
|
var validatePass2 = (rule, value, callback) => { |
|
|
|
console.log('value============>',value) |
|
|
|
console.log('value============>', value) |
|
|
|
if(!value){ |
|
|
|
if (!value) { |
|
|
|
callback(new Error('请确认密码')); |
|
|
|
callback(new Error('请确认密码')); |
|
|
|
}else if (value && value == '') { |
|
|
|
} else if (value && value == '') { |
|
|
|
callback(new Error('请确认密码')); |
|
|
|
callback(new Error('请确认密码')); |
|
|
|
} else if (value !== this.loginForm.password) { |
|
|
|
} else if (value !== this.loginForm.password) { |
|
|
|
callback(new Error('两次输入密码不一致!')); |
|
|
|
callback(new Error('两次输入密码不一致!')); |
|
|
|
@ -45,73 +49,83 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
return { |
|
|
|
return { |
|
|
|
loginForm:{}, |
|
|
|
loginForm: {}, |
|
|
|
options:[], |
|
|
|
options: [], |
|
|
|
dialogVisible:false, |
|
|
|
dialogVisible: false, |
|
|
|
keyword:'', |
|
|
|
keyword: '', |
|
|
|
positionList:[], |
|
|
|
positionList: [], |
|
|
|
showPositionList:false, |
|
|
|
showPositionList: false, |
|
|
|
center:{ lng: 116.404, lat: 39.915}, |
|
|
|
center: { lng: 116.404, lat: 39.915 }, |
|
|
|
BMap:null, |
|
|
|
BMap: null, |
|
|
|
points:[], |
|
|
|
points: [], |
|
|
|
showInfowindow:false, |
|
|
|
showInfowindow: false, |
|
|
|
infoPosition:{lng:'',lat:''}, |
|
|
|
infoPosition: { lng: '', lat: '' }, |
|
|
|
infoName:'', |
|
|
|
infoName: '', |
|
|
|
infoAddress:'', |
|
|
|
infoAddress: '', |
|
|
|
address:'', |
|
|
|
address: '', |
|
|
|
province:'', |
|
|
|
province: '', |
|
|
|
city:'', |
|
|
|
city: '', |
|
|
|
district:'', |
|
|
|
district: '', |
|
|
|
isMarker:false, |
|
|
|
isMarker: false, |
|
|
|
loginRules:{ |
|
|
|
loginRules: { |
|
|
|
phoneNumber:[ |
|
|
|
phoneNumber: [ |
|
|
|
{required:true,message:'请输入手机号',trigger:'blur'}, |
|
|
|
{ required: true, message: '请输入手机号', trigger: 'blur' }, |
|
|
|
{pattern:/^1[3-9][0-9]{9}$|^15[0-9]{2}[0-9]{8}$|^17[0-9]{2}[0-9]{7}$|^18[0-9]{3}[0-9]{6}$/,message:'请输入正确的手机号格式'} |
|
|
|
{ pattern: /^1[3-9][0-9]{9}$|^15[0-9]{2}[0-9]{8}$|^17[0-9]{2}[0-9]{7}$|^18[0-9]{3}[0-9]{6}$/, message: '请输入正确的手机号格式' } |
|
|
|
], |
|
|
|
], |
|
|
|
password:{required:true,message:'请设置密码',trigger:'blur'}, |
|
|
|
password: { required: true, message: '请设置密码', trigger: 'blur' }, |
|
|
|
comfirmPassword:{ validator: validatePass2, trigger: 'blur' }, |
|
|
|
comfirmPassword: { validator: validatePass2, trigger: 'blur' }, |
|
|
|
valiNum:{required:true,message:'请输入手机验证码',trigger:'blur'}, |
|
|
|
valiNum: { required: true, message: '请输入手机验证码', trigger: 'blur' }, |
|
|
|
}, |
|
|
|
}, |
|
|
|
isShowValite:false |
|
|
|
isShowValite: false |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() {}, |
|
|
|
mounted() { }, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 跳转到登录页面 |
|
|
|
// 跳转到登录页面 |
|
|
|
trunLogin(){ |
|
|
|
trunLogin() { |
|
|
|
this.$router.push({path: "/login"}); |
|
|
|
this.$router.push({ path: "/login" }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取验证码 |
|
|
|
// 获取验证码 |
|
|
|
getVerfyCode(){ |
|
|
|
getVerfyCode() { |
|
|
|
verifycode({phone:this.loginForm.phoneNumber}).then(res =>{ |
|
|
|
verifycode({ phone: this.loginForm.phoneNumber }).then(res => { |
|
|
|
console.log('res===========>',res) |
|
|
|
console.log('res===========>', res) |
|
|
|
if(res.data.code == 200){ |
|
|
|
if (res.data.code == 200) { |
|
|
|
this.$message.success('验证码已发送,请填写验证码') |
|
|
|
this.$message.success('验证码已发送,请填写验证码') |
|
|
|
this.isShowValite = true |
|
|
|
this.isShowValite = true |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 注册 |
|
|
|
// 注册 |
|
|
|
handleRegsiter(){ |
|
|
|
handleRegsiter() { |
|
|
|
this.$refs.form.validate((valid) =>{ |
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
if(valid){ |
|
|
|
if (valid) { |
|
|
|
|
|
|
|
let query = { |
|
|
|
|
|
|
|
phone: this.loginForm.phoneNumber, |
|
|
|
|
|
|
|
password: this.loginForm.password, |
|
|
|
|
|
|
|
verifyCode: this.loginForm.valiNum, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
resetPwd(query).then(res => { |
|
|
|
|
|
|
|
this.$message.success('修改成功,请登录') |
|
|
|
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
|
|
|
this.$router.push({ path: "/login" }); |
|
|
|
|
|
|
|
},500) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.container{ |
|
|
|
.container { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
height: 100%; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
top: 0; |
|
|
|
top: 0; |
|
|
|
background: rgb(207, 207, 207); |
|
|
|
background: rgb(207, 207, 207); |
|
|
|
|
|
|
|
|
|
|
|
.top_box{ |
|
|
|
.top_box { |
|
|
|
width: 98%; |
|
|
|
width: 98%; |
|
|
|
height: 15%; |
|
|
|
height: 15%; |
|
|
|
font-size: 40px; |
|
|
|
font-size: 40px; |
|
|
|
@ -122,13 +136,13 @@ |
|
|
|
background: #fff; |
|
|
|
background: #fff; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.bottom_box{ |
|
|
|
.bottom_box { |
|
|
|
width: 85%; |
|
|
|
width: 85%; |
|
|
|
height:80%; |
|
|
|
height: 80%; |
|
|
|
background: #fff; |
|
|
|
background: #fff; |
|
|
|
margin: 1% auto; |
|
|
|
margin: 1% auto; |
|
|
|
|
|
|
|
|
|
|
|
.bottom_tit{ |
|
|
|
.bottom_tit { |
|
|
|
height: 8%; |
|
|
|
height: 8%; |
|
|
|
width: 95%; |
|
|
|
width: 95%; |
|
|
|
padding: 1% 2.5%; |
|
|
|
padding: 1% 2.5%; |
|
|
|
@ -137,14 +151,14 @@ |
|
|
|
justify-content: space-between; |
|
|
|
justify-content: space-between; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.bottom_con{ |
|
|
|
.bottom_con { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: 85%; |
|
|
|
height: 85%; |
|
|
|
// background: red; |
|
|
|
// background: red; |
|
|
|
margin: 0 auto; |
|
|
|
margin: 0 auto; |
|
|
|
overflow-y: auto; |
|
|
|
overflow-y: auto; |
|
|
|
|
|
|
|
|
|
|
|
.next_box{ |
|
|
|
.next_box { |
|
|
|
width: 80%; |
|
|
|
width: 80%; |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
|
@ -154,6 +168,5 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|
</style> |
|
|
|
|
|
|
|
|