Commit 21c6ef36 authored by zhangyanni's avatar zhangyanni

注册

parent 36fbc288
......@@ -28,7 +28,7 @@
<el-checkbox name="type" v-model.trim="checked">我已阅读并同意《</el-checkbox><span @click="handleToProtocol" class="protocol">Techbook服务协议</span>
</el-form-item>
<el-form-item>
<el-button type="primary" class="loginButton" @click="handleRegister('registerForm')">注册
<el-button type="primary" class="loginButton" :disabled="flag>0" @click="handleRegister('registerForm')">注册
</el-button>
</el-form-item>
<el-form-item class="registerButton">
......@@ -77,7 +77,8 @@
sliderSuccess:false,
timer:null,
showCount:true,
count:''
count:'',
flag:0
}
},
methods: {
......@@ -107,30 +108,54 @@
let that =this;
api.postEmailRegisterAxios(this.registerForm).then((res)=>{
if(res.code==0){
// that.$router.replace({path:"/completeInfoCmpt",query:{}});
setTimeout(function(){
that.flag=0;
return false;
})
that.$router.replace({path:"/completeInfoCmpt"});
}else{
that.$message.error(res.msg);
setTimeout(function(){
that.flag=0;
return false;
})
}
}).catch((err)=>{
that.$message.error(err);
setTimeout(function(){
that.flag=0;
return false;
})
})
},
//注册
handleRegister(formName) {
const that =this;
this.$refs[formName].validate((valid) => {
if (valid) {
if(this.checked){
that.submitRegisterFormFunc();
}else{
this.$message.warning("请先同意服务协议");
}
if(this.flag==0){
this.flag++;
this.$refs[formName].validate((valid) => {
if (valid) {
if(this.checked){
that.submitRegisterFormFunc();
}else{
this.$message.warning("请先同意服务协议");
setTimeout(function(){
that.flag=0;
return false;
})
}
} else {
} else {
return false;
}
});
}else{
setTimeout(function(){
that.flag=0;
return false;
}
});
})
}
},
......@@ -159,20 +184,8 @@
this.errorInfo = "请先输入邮箱";
this.bool = false;
}
if(this.flag==0){
this.flag++;
if(this.bool) this.isShowSlider = true;
else this.$message.error(that.errorInfo);
setTimeout(function(){
that.flag = 0;
return false;
},500)
}else{
setTimeout(function(){
that.flag = 0;
return false;
},500)
}
if(this.bool) this.isShowSlider = true;
else this.$message.error(that.errorInfo);
},
//获取验证码掉接口
......
......@@ -32,7 +32,7 @@
<el-checkbox name="type" v-model.trim="checked">我已阅读并同意《<span @click="handleToProtocol" class="protocol">Techbook服务协议</span></el-checkbox>
</el-form-item>
<el-form-item>
<el-button type="primary" class="loginButton" @click="handleRegister('registerForm')">注册
<el-button type="primary" class="loginButton" :disabled="flag>0" @click="handleRegister('registerForm')">注册
</el-button>
</el-form-item>
<el-form-item class="registerButton">
......@@ -116,29 +116,54 @@
api.postPhoneRegisterAxios(this.registerForm).then((res)=>{
if(res.code==0){
that.$router.replace("/completeInfoCmpt");
setTimeout(function(){
that.flag = 0;
return false;
},500)
}else{
that.$message.error(res.msg);
setTimeout(function(){
that.flag = 0;
return false;
},500)
}
}).catch((err)=>{
that.$message.error(err);
setTimeout(function(){
that.flag = 0;
return false;
},500)
})
},
//注册
handleRegister(formName) {
const that =this;
this.$refs[formName].validate((valid) => {
if (valid) {
if(this.checked){
that.submitRegisterFormFunc();
}else{
that.$message.warning("请先同意服务协议");
}
if(this.flag==0){
this.flag++;
this.$refs[formName].validate((valid) => {
if (valid) {
if(this.checked){
that.submitRegisterFormFunc();
}else{
that.$message.warning("请先同意服务协议");
setTimeout(function(){
that.flag = 0;
return false;
},500)
}
} else {
} else {
return false;
}
});
}else{
setTimeout(function(){
that.flag = 0;
return false;
}
});
},500)
}
},
//查看协议
......@@ -159,20 +184,8 @@
this.errorInfo = "请先输入手机号";
this.bool = false;
}
if(this.flag==0){
this.flag++;
if(this.bool) this.isShowSlider = true;
else this.$message.error(that.errorInfo);
setTimeout(function(){
that.flag = 0;
return false;
},500)
}else{
setTimeout(function(){
that.flag = 0;
return false;
},500)
}
if(this.bool) this.isShowSlider = true;
else this.$message.error(that.errorInfo);
},
//获取验证码掉接口
......
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