Commit aefc1529 by 高浩杰

修改协议 密码错误提示 注册页面

parent ea8362c2
......@@ -2,13 +2,13 @@
<div class="main-footer__container">
<button @click="handel">{{button}}</button>
<div class="main-footer">
<div class="input-box">
<input id="automatic" type="checkbox">
<div class="input-box" v-if="button !== '重置账号'">
<input id="automatic" type="checkbox" v-model="isSelect">
<label for="automatic"></label>
<p v-if="button === '登录'">下次自动登录</p>
<p v-if="button !== '登录'">我已阅读并同意<span>用户协议</span><span>隐私政策</span></p>
</div>
<div>
<div class="switch-box">
<span @click="handleReset">忘记密码</span>
<span> · </span>
<span v-if="button === '注册'" @click="handleLogin">登录</span>
......@@ -23,10 +23,15 @@ export default {
props: {
button: String
},
data() {
return {
isSelect: ''
}
},
methods: {
// 按钮点击
handel() {
this.$emit('handle');
this.$emit('handle', this.isSelect);
},
// 跳转忘记密码
handleReset() {
......@@ -61,17 +66,18 @@ export default {
.main-footer {
width: 100%;
margin: 16*$length auto;
@extend %flex-row-spb;
@extend %clearFix;
@extend %cursorPointer;
@include fontStyle(12, 17, 500, #999, left);
.input-box {
float: left;
text-align: left;
@extend %flex-row-spb;
/*label标签的大小、位置、背景颜色更改,在css选择时,“+”代表相邻元素,即当前元素的下一元素*/
#automatic + label {
display: block;
display: inline-block;
width: 12*$length;
height: 12*$length;
margin-top: 1*$length;
cursor: pointer;
background-color: #fff;
@include border-radius(2*$length);
......@@ -96,14 +102,17 @@ export default {
input[type=checkbox] {
display: none;
}
@extend %flex-row-spb;
> p {
display: inline-block;
padding-left: 8*$length;
> span {
color: #666;
}
}
}
.switch-box{
float: right;
}
}
}
</style>
......@@ -103,7 +103,11 @@ export default {
},
// 检测account 手机 邮箱
checkAccount() {
this.accountErrMsg = checkAccount(this.account);
if (this.isPassword) {
this.accountErrMsg = checkAccount(this.account) === '' ? '' : '账号格式错误';
} else {
this.accountErrMsg = checkPhone(this.account);
}
},
// 检测 密码
checkPassword() {
......
......@@ -150,7 +150,17 @@ export default {
});
}
},
async handleRegister() {
// 判断是否同意协议
checkAgreement(isAgreement) {
if (isAgreement) return true;
else {
this.$message({
type: 'info',
message: '请同意用户协议和隐私政策'
})
}
},
async handleRegister(isAgree) {
this.checkAccount();
this.checkPassword();
this.verifyErrMsg = checkVerification(this.verifyCode);
......@@ -158,16 +168,20 @@ export default {
let registerResponse;
if (!this.isEmail && this.passwordErrMsg === '' && this.accountErrMsg === '' && this.verifyErrMsg === '') {
if (this.checkAgreement(isAgree)) {
registerResponse = await this.$axios.$post(config.api.post.User.registerPhone, {
mobile: this.account,
password: this.password,
verifyCode: this.verifyCode
})
}
} else if (this.isEmail && this.passwordErrMsg === '' && this.accountErrMsg === '') {
if (this.checkAgreement(isAgree)) {
registerResponse = await this.$axios.$post(config.api.post.User.registerEmail, {
email: this.account,
password: this.password
})
}
// 邮箱注册
}
console.log(registerResponse);
......@@ -208,7 +222,7 @@ export default {
.register-container{
width: 514*$length;
margin: 0 auto;
padding: 136*$length 0;
padding: 40*$length 0;
}
.register-success{
width: 408*$length;
......
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