|
|
|
@ -82,7 +82,7 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm" size="medium" v-if="ruleForm.showtwo"> |
|
|
|
|
<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm" size="medium" v-if="ruleForm.showtwo" v-loading="loading"> |
|
|
|
|
<p style="text-align: center;margin-bottom: 30px">短信验证码已发送,请提交短信验证码</p> |
|
|
|
|
<el-form-item prop="ruleForm.smsCode" style="height: 50px"> |
|
|
|
|
<el-input v-model="ruleForm.smsCode" style="height: 30px;width: 60%;margin-left: 20%"></el-input> |
|
|
|
@ -90,7 +90,7 @@ |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button type="success" @click="submitFormWithMsgCode()" size="medium" style="width: 70%;height: 50px;display:block;margin:0 auto">确认提交</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
<span @click="changeShow()" style="color: #787be8;text-decoration-line: underline;margin-left: 50%">返回授权</span> |
|
|
|
|
<span @click="changeShow()" style="color: #787be8;text-decoration-line: underline;margin-left: 50%">重新授权</span> |
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm" size="medium" v-if="ruleForm.showthree"> |
|
|
|
@ -101,13 +101,13 @@ |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
<p style="text-align: center;margin-bottom: 30px">授权成功,任务可能需要5-10分钟,请耐心等待...</p> |
|
|
|
|
<span @click="changeShow()" style="color: #787be8;text-decoration-line: underline;margin-left: 50%">返回授权</span> |
|
|
|
|
<span @click="changeShow()" style="color: #787be8;text-decoration-line: underline;margin-left: 50%">重新授权</span> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import {login,submitNote} from "@/api/freedom/login"; |
|
|
|
|
import {login,submitNote,submitNoteResult} from "@/api/freedom/login"; |
|
|
|
|
export default { |
|
|
|
|
name: "Login", |
|
|
|
|
data() { |
|
|
|
@ -121,8 +121,8 @@ export default { |
|
|
|
|
return { |
|
|
|
|
ruleForm: { |
|
|
|
|
smsCode : "", |
|
|
|
|
showone : true, |
|
|
|
|
showtwo : false, |
|
|
|
|
showone : false, |
|
|
|
|
showtwo : true, |
|
|
|
|
showthree : false, |
|
|
|
|
nsrsbh: '', |
|
|
|
|
nsrdq: '', |
|
|
|
@ -165,7 +165,8 @@ export default { |
|
|
|
|
{ validator: checkedFn, trigger: "change" } |
|
|
|
|
// { type: 'array', required: true, message: '请勾选同意协议', trigger: 'change' } |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
loading : false |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
@ -194,17 +195,56 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
submitFormWithMsgCode(){ |
|
|
|
|
this.loading = true; |
|
|
|
|
submitNote(this.ruleForm.traceno,this.ruleForm.nsrsbh,this.ruleForm.smsCode,this.ruleForm.nsrInfo.zjh) |
|
|
|
|
.then(res=>{ |
|
|
|
|
if (res.code == "200"){ |
|
|
|
|
this.ruleForm.showone = false; |
|
|
|
|
this.ruleForm.showtwo = false; |
|
|
|
|
this.ruleForm.showthree = true; |
|
|
|
|
|
|
|
|
|
let timer = setInterval(() => { |
|
|
|
|
this.fun(timer) |
|
|
|
|
}, 5000) |
|
|
|
|
}else { |
|
|
|
|
alter("请求失败请重试") |
|
|
|
|
this.loading = false; |
|
|
|
|
this.ruleForm.showone = false; |
|
|
|
|
this.ruleForm.showtwo = true; |
|
|
|
|
this.ruleForm.showthree = false; |
|
|
|
|
console.log("进入方法") |
|
|
|
|
console.log(this.loading) |
|
|
|
|
} |
|
|
|
|
}).catch(()=>{ |
|
|
|
|
this.loading = false; |
|
|
|
|
this.ruleForm.showone = false; |
|
|
|
|
this.ruleForm.showtwo = true; |
|
|
|
|
this.ruleForm.showthree = false; |
|
|
|
|
console.log("进入catch方法") |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
fun (timer) { |
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
// 这里ajax 请求的代码片段和判断是否停止定时器 |
|
|
|
|
submitNoteResult(this.ruleForm.traceno,this.ruleForm.nsrsbh,this.ruleForm.smsCode,this.ruleForm.nsrInfo.zjh) |
|
|
|
|
.then(res=>{ |
|
|
|
|
if (res.msg == "10011"){ |
|
|
|
|
this.ruleForm.showone = false; |
|
|
|
|
this.ruleForm.showtwo = false; |
|
|
|
|
this.ruleForm.showthree = true; |
|
|
|
|
this.loading = false; |
|
|
|
|
clearInterval(timer) |
|
|
|
|
}else if(res.msg == "10012"){ |
|
|
|
|
this.ruleForm.showone = false; |
|
|
|
|
this.ruleForm.showtwo = true; |
|
|
|
|
this.ruleForm.showthree = false; |
|
|
|
|
this.loading = false; |
|
|
|
|
clearInterval(timer) |
|
|
|
|
} |
|
|
|
|
}).catch(()=>{ |
|
|
|
|
this.ruleForm.showone = false; |
|
|
|
|
this.ruleForm.showtwo = true; |
|
|
|
|
this.ruleForm.showthree = false; |
|
|
|
|
this.loading = false; |
|
|
|
|
clearInterval(timer) |
|
|
|
|
}); |
|
|
|
|
}, 0) |
|
|
|
|
}, |
|
|
|
|
resetForm(formName) { |
|
|
|
|
this.$refs[formName].resetFields(); |
|
|
|
|