Commit cbdbdd33 authored by 吴冠's avatar 吴冠

所有注册模块验证和功能

parent 10bae6a0
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
export default { export default {
data() { data() {
return { return {
message: '管理员登录' message: ''
} }
} }
} }
......
...@@ -168,7 +168,8 @@ ...@@ -168,7 +168,8 @@
" "
></el-input> ></el-input>
</el-form-item> </el-form-item>
<div class="phonecode" @click="getMessagecode">获取短信验证码</div> <div v-show="Verification" class="phonecode" @click="getMessagecode">获取短信验证码</div>
<div v-show="!Verification" class="phonecode"><span>{{timer}}</span>秒后重新获取</div>
</div> </div>
</el-form> </el-form>
</div> </div>
...@@ -649,13 +650,15 @@ ...@@ -649,13 +650,15 @@
<h5 style="color: #000000">拒绝原因:身份证信息作假</h5> <h5 style="color: #000000">拒绝原因:身份证信息作假</h5>
</div> </div>
</div> </div>
<button <div class="flex btn">
@click="next" <el-button type="primary" style="height:30px" class="t2 t10" v-if="active==1" @click="prev">上一步</el-button>
class="t2 nextButton" <button
v-if="active == 0 || active == 1" @click="next"
> class="t2 nextButton"
下一步 v-if="active == 0 || active == 1">
</button> 下一步
</button>
</div>
<button @click="back" class="t2 nextButton" v-if="active == 2"> <button @click="back" class="t2 nextButton" v-if="active == 2">
回到首页 回到首页
</button> </button>
...@@ -885,6 +888,8 @@ export default { ...@@ -885,6 +888,8 @@ export default {
this.flag = true; */ this.flag = true; */
return { return {
Verification:true,
timer:60,
centerDialogVisible: false, centerDialogVisible: false,
flag: true, flag: true,
companyNatures: [], companyNatures: [],
...@@ -1172,6 +1177,9 @@ export default { ...@@ -1172,6 +1177,9 @@ export default {
}; };
}, },
methods: { methods: {
prev(){
this.active ==0
},
back() { back() {
this.$router.push("/"); this.$router.push("/");
}, },
...@@ -1236,7 +1244,7 @@ export default { ...@@ -1236,7 +1244,7 @@ export default {
let message = {}; let message = {};
message.phone = this.adminform.phonenumber; message.phone = this.adminform.phonenumber;
message.verify = this.adminform.phonecode; message.verify = this.adminform.phonecode;
const { msg, code } = await verifyPhone(message); const { msg, code,data } = await verifyPhone(message);
if (code === 200) { if (code === 200) {
this.active++; this.active++;
} else { } else {
...@@ -1275,6 +1283,8 @@ export default { ...@@ -1275,6 +1283,8 @@ export default {
if (code === 200) { if (code === 200) {
this.$message.success(msg); this.$message.success(msg);
this.active++; this.active++;
}else{
this.$message.error(error)
} }
} }
} }
...@@ -1298,14 +1308,25 @@ export default { ...@@ -1298,14 +1308,25 @@ export default {
if (this.code.toLowerCase() !== this.adminform.code.toLowerCase()) { if (this.code.toLowerCase() !== this.adminform.code.toLowerCase()) {
this.$message.error("请输入正确的验证码"); this.$message.error("请输入正确的验证码");
return; return;
} }else{
let message = {}; let message = {};
message.phone = this.adminform.phonenumber; message.phone = this.adminform.phonenumber;
message.type = 1; message.type = 1;
const { msg, code } = await sendSms(message); const { msg, code } = await sendSms(message);
if (code === 200) { if (code === 200) {
this.$message.success("发送成功"); this.$message.success("发送成功");
this.refreshCode(); this.refreshCode();
this.Verification = false; //点击button改变v-show的状态
let auth_timer = setInterval(()=>{ //定时器设置每秒递减
this.timer--; //递减时间
if(this.timer<=0){
this.Verification = true; //60s时间结束还原v-show状态并清除定时器
clearInterval(auth_timer)
}
},1000)
}else{
this.$message.error(msg)
}
} }
}, },
}, },
...@@ -1354,6 +1375,7 @@ export default { ...@@ -1354,6 +1375,7 @@ export default {
margin-top: 0.45rem; margin-top: 0.45rem;
margin-bottom: 0.8rem; margin-bottom: 0.8rem;
color: #fff; color: #fff;
cursor: pointer;
} }
.item .el-form-item__label { .item .el-form-item__label {
...@@ -1459,4 +1481,14 @@ export default { ...@@ -1459,4 +1481,14 @@ export default {
.t1{ .t1{
margin-left:100px; margin-left:100px;
} }
.btn{
position: relative;
}
.t10{
position: absolute;
bottom:70px;
left:-120px;
cursor: pointer;
height:50px
}
</style> </style>
\ No newline at end of file
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
<el-form-item label="短信验证码" prop="verify" class="item"> <el-form-item label="短信验证码" prop="verify" class="item">
<el-input v-model="form.verify" placeholder="请输入短信验证码" style="width:2.4rem" maxlength="30"></el-input> <el-input v-model="form.verify" placeholder="请输入短信验证码" style="width:2.4rem" maxlength="30"></el-input>
</el-form-item> </el-form-item>
<div class="phonecode" @click = "getPhoneCode">获取短信验证码</div> <div v-show="Verification" class="phonecode" @click = "getPhoneCode">获取短信验证码</div>
<div v-show="!Verification" class="phonecode"><span>{{timer}}</span>秒后重新获取</div>
</div> </div>
</el-form> </el-form>
</div> </div>
...@@ -103,6 +104,8 @@ ...@@ -103,6 +104,8 @@
}; };
return { return {
/* dataMsg:0, */ /* dataMsg:0, */
Verification:true,
timer:60,
total: 3, total: 3,
active: 0, active: 0,
flag: true, //该值变化,就会触发刷新 flag: true, //该值变化,就会触发刷新
...@@ -177,14 +180,24 @@ ...@@ -177,14 +180,24 @@
let phonemes = {} let phonemes = {}
phonemes.phone = this.form.phone phonemes.phone = this.form.phone
phonemes.type = 2 phonemes.type = 2
const {data,code} = await sendSms(phonemes) const {data,code,msg} = await sendSms(phonemes)
//code返回为500时 友情提示账户未注册 //code返回为500时 友情提示账户未注册
if(code ==200){
this.Verification = false; //点击button改变v-show的状态
let auth_timer = setInterval(()=>{ //定时器设置每秒递减
this.timer--; //递减时间
if(this.timer<=0){
this.Verification = true; //60s时间结束还原v-show状态并清除定时器
clearInterval(auth_timer)
}
},1000)
}
if(code ==500){ if(code ==500){
this.$message.error('该手机号没有注册oVo'); this.$message.error(msg);
}
}else{
alert("验证码输入有误!请重新输入")
} }
}else{
alert("验证码输入有误!请重新输入")
}
}, },
countDown() { countDown() {
let clock = window.setInterval(() => { let clock = window.setInterval(() => {
...@@ -204,9 +217,10 @@ ...@@ -204,9 +217,10 @@
let dataform={} let dataform={}
dataform.phone=this.form.phone dataform.phone=this.form.phone
dataform.verify=this.form.verify dataform.verify=this.form.verify
const {data} = getVerifyPhone(dataform) const {data,code,msg} = getVerifyPhone(dataform)
this.active++ if(code ==200){
/* } */ this.active++
}
} else { } else {
this.$message.error('有未填写的选项或者错误选项'); this.$message.error('有未填写的选项或者错误选项');
console.log('error submit!!'); console.log('error submit!!');
......
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