From ff234f6002204070e395d419854f27c8fa82e566 Mon Sep 17 00:00:00 2001 From: kuaileWu <1432334894@qq.com> Date: Fri, 29 Mar 2024 18:23:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=B1=E8=AF=8A=E4=BA=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 +- components/inputBox.vue | 9 ++++----- pages/add_visitor_form/add_visitor_form.vue | 16 +++++++++++----- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/App.vue b/App.vue index 86c8a33..5c5eb66 100644 --- a/App.vue +++ b/App.vue @@ -71,7 +71,7 @@ display: none; } .hover{ - opacity: 0.7; + opacity: 0.8; } .ft18{ diff --git a/components/inputBox.vue b/components/inputBox.vue index 3f58c35..a1c7aa1 100644 --- a/components/inputBox.vue +++ b/components/inputBox.vue @@ -53,20 +53,20 @@ export default { var value = e.detail.value var res = this.check(value); if(!res){ - this.$emit('blurEvent', '') + this.$emit('blurEvent', value, false) return } - this.$emit('blurEvent', value) + this.$emit('blurEvent', value, true) }, handleInput(e){ if(!this.errormsg) return; var value = e.detail.value var res = this.check(value); if(!res){ - this.$emit('blurEvent', '') + this.$emit('blurEvent', value, false) return } - this.$emit('blurEvent', value) + this.$emit('blurEvent', value, true) }, check(value){ var noEmptyVal = this.$trim.trim(value) @@ -124,7 +124,6 @@ export default { opacity: 0; } } - .right{ flex-grow: 1; color: #242833; diff --git a/pages/add_visitor_form/add_visitor_form.vue b/pages/add_visitor_form/add_visitor_form.vue index 18e2b8a..f8726ea 100644 --- a/pages/add_visitor_form/add_visitor_form.vue +++ b/pages/add_visitor_form/add_visitor_form.vue @@ -23,29 +23,35 @@ return { canSubmit:false, name:'', + nameRule:false, idcardExt:'', - phone:'' + idcardExtRule:false, + phone:'', + phoneRule:false, } }, components:{ inputBox }, methods: { - nameBlurEvent(value){ + nameBlurEvent(value, res){ this.name = value + this.nameRule = res this.checkSubmit() }, - idCardBlurEvent(value){ + idCardBlurEvent(value, res){ this.idcardExt = value + this.idcardExtRule = res this.checkSubmit() }, - phoneBlurEvent(value){ + phoneBlurEvent(value, res){ this.phone = value + this.phoneRule = res this.checkSubmit() }, checkSubmit() { this.canSubmit = false - if(!this.name || !this.idcardExt || !this.phone) return + if(!this.nameRule || !this.idcardExtRule || !this.phoneRule) return this.canSubmit = true }, submit(){