From e310f28869cdf8fb7f66cdfe54aeb68034debdff Mon Sep 17 00:00:00 2001 From: kuaileWu <1432334894@qq.com> Date: Tue, 7 May 2024 16:36:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9/=E5=88=A0=E9=99=A4=E5=B0=B1?= =?UTF-8?q?=E8=AF=8A=E4=BA=BA=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=9D=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=81=94=E8=B0=83=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/modify_visitor/modify_visitor.vue | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/pages/modify_visitor/modify_visitor.vue b/pages/modify_visitor/modify_visitor.vue index 7ced801..92c8e9d 100644 --- a/pages/modify_visitor/modify_visitor.vue +++ b/pages/modify_visitor/modify_visitor.vue @@ -41,22 +41,7 @@ if(option.vid) this.vid = option.vid }, onShow() { - if(this.vid){ - var visitor_info = uni.getStorageSync('visitor_info_'+this.vid) - if(!visitor_info) { - this.$func.toPage('/pages/index/index') - return - } - visitor_info = JSON.parse(visitor_info) - this.name = visitor_info.real_name - this.idcardExt = visitor_info.id_no - this.phone = visitor_info.mobile - this.nameRule = true - this.idcardExtRule = true - this.phoneRule = true - - this.checkSubmit() - } + if(this.vid) this.getVisitorInfo() }, methods: { add() { @@ -83,6 +68,22 @@ if(data == -1) return this.$func.toPage('/pages/visitors/visitors?type='+this.type) }); + }, + getVisitorInfo() { + this.$http.req('get_visitor_info', {id:this.vid}, 'GET', true).then(data=>{ + if(data == -1) { + this.$func.toPage('/pages/index/index') + return + } + + this.name = data.name + this.idcardExt = data.idcard_ext + this.phone = data.phone + this.nameRule = true + this.idcardExtRule = true + this.phoneRule = true + this.checkSubmit() + }); }, nameBlurEvent(value, res){ this.name = value