登录页:滑动验证加载以及监听处理

This commit is contained in:
骆乐 2022-10-14 11:33:47 +08:00
parent 7746171721
commit 72ea9ab623
7 changed files with 39 additions and 26 deletions

BIN
dist.zip

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

View File

@ -92,7 +92,6 @@
<el-form-item style="margin-top: 25px" label="" prop="password"> <el-form-item style="margin-top: 25px" label="" prop="password">
<!-- @keyup.enter.native="loginFn" --> <!-- @keyup.enter.native="loginFn" -->
<el-input <el-input
@change="onChange2"
v-model="form.password" v-model="form.password"
style="height: 53px; font-size: 16px" style="height: 53px; font-size: 16px"
type="password" type="password"
@ -212,6 +211,7 @@
:r="10" :r="10"
:w="330" :w="330"
:h="175" :h="175"
:imgs="imageList"
slider-text="向右滑动滑块填充拼图" slider-text="向右滑动滑块填充拼图"
ref="slideverify" ref="slideverify"
@success="onSuccess" @success="onSuccess"
@ -260,10 +260,11 @@ export default {
data() { data() {
return { return {
msg: '', msg: '',
oldVal:'',
show: false, show: false,
showVerify:false, showVerify:false, //
verificateBtn:false,// verificateBtn:false, //
pass:true, pass:true, //
input: "", input: "",
radio: "", radio: "",
projectType: "", projectType: "",
@ -316,6 +317,13 @@ export default {
platformLogo: "", platformLogo: "",
platformName: "", platformName: "",
}, },
imageList:[
require('../../assets/images/login/Rectangle 381.jpg'),
require('../../assets/images/login/Rectangle 382.jpg'),
require('../../assets/images/login/Rectangle 383.jpg'),
require('../../assets/images/login/Rectangle 384.jpg'),
require('../../assets/images/login/Rectangle 385.jpg'),
]
}; };
}, },
watch: { watch: {
@ -327,7 +335,19 @@ export default {
} else { } else {
window._paq.push(["trackEvent", "点击", "登录", "使用账号登录"]); window._paq.push(["trackEvent", "点击", "登录", "使用账号登录"]);
} }
} },
// oldVal:{
// handler(n,o){
// console.log(n,o);
// if(n!= o){
// console.log('====')
// this.showVerify = true,
// this.pass = false
// }
// },
// deep:true,
// immediate:false
// }
}, },
created() { created() {
this.company = COMPANY; this.company = COMPANY;
@ -369,16 +389,12 @@ export default {
} }
}, },
methods: { methods: {
onChange1(e){ onChange1(val){
if(e!=this.form.account){ if(this.oldVal != ''){
// this.verificateBtn = false if(this.oldVal != this.form){
// this.showVerify = true this.verificateBtn = false,
this.pass = true
} }
},
onChange2(e){
if(e!=this.form.password){
// this.verificateBtn = false
// this.showVerify = true
} }
}, },
onReset() { onReset() {
@ -386,18 +402,15 @@ export default {
this.$refs.slideverify.reset(); this.$refs.slideverify.reset();
}, },
onSuccess(){ onSuccess(){
setTimeout(()=>{ this.oldVal = this.form.account
this.showVerify = false
this.verificateBtn = true this.verificateBtn = true
this.showVerify = false
this.pass = false this.pass = false
},100)
}, },
onFail(){ onFail(){
this.msg = '验证失败' this.msg = '验证失败'
}, },
onRefresh(){ onRefresh(){},
this.msg = ''
},
getData() { getData() {
getOneComputerAuthApi().then((res) => { getOneComputerAuthApi().then((res) => {
if (res.result) { if (res.result) {
@ -431,7 +444,7 @@ export default {
goSignIn() { goSignIn() {
this.$router.push({ path: "/sign" }); this.$router.push({ path: "/sign" });
}, },
// //
verificateFn(){ verificateFn(){
this.showVerify = true this.showVerify = true
// this.$bus.$emit('resetSlideVerify') // this.$bus.$emit('resetSlideVerify')