Commit cbdbdd33 authored by 吴冠's avatar 吴冠

所有注册模块验证和功能

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