From 9bc0f8fb702fe365d27990d31c0d385d427e0e59 Mon Sep 17 00:00:00 2001 From: wangweidong <850489345@qq.com> Date: Thu, 5 Mar 2026 15:26:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/addjigou/name.vue | 35 ++++++++++++++++++++++++++++++----- pages/addoldman/oldIDcard.vue | 1 - pages/addstaff/IDcard.vue | 33 +++++++++++++++++++++++++++++---- 3 files changed, 59 insertions(+), 10 deletions(-) diff --git a/pages/addjigou/name.vue b/pages/addjigou/name.vue index 0500459..0e0f04a 100644 --- a/pages/addjigou/name.vue +++ b/pages/addjigou/name.vue @@ -261,11 +261,36 @@ { let father = JSON.parse(JSON.parse(uploadRes.data).result.data).data.back.data; - console.log(father) - textArray[6] = father.issueAuthority; - textArray[7] = father.validPeriod; - backImge.value = filePath; - savephoto(filePath, 1); + // console.log(father) + // textArray[6] = father.issueAuthority; + // textArray[7] = father.validPeriod; + // backImge.value = filePath; + // savephoto(filePath, 1); + let regex = /[\u4E00-\u9FA5\uF900-\uFA2D]{1,}/; + console.log(regex.test(father.validPeriod)) + if(!regex.test(father.validPeriod)){ + textArray[6] = father.issueAuthority; + textArray[7] = father.validPeriod; + backImge.value = filePath; + savephoto(filePath, 1); + }else{ + if(father.validPeriod.indexOf('长期')>-1){ + textArray[6] = father.issueAuthority; + textArray[7] = father.validPeriod; + backImge.value = filePath; + savephoto(filePath, 1); + }else{ + textArray[7] = ""; + uni.showToast({ + title: '识别失败', + icon: 'none', + duration: 2000 + }) + } + uping.value = true; + return + } + uni.hideLoading() } else { uni.hideLoading() uni.showToast({ diff --git a/pages/addoldman/oldIDcard.vue b/pages/addoldman/oldIDcard.vue index cc2efc4..3c98c39 100644 --- a/pages/addoldman/oldIDcard.vue +++ b/pages/addoldman/oldIDcard.vue @@ -375,7 +375,6 @@ } else if (JSON.parse(JSON.parse(uploadRes.data).result.data).data.back) { let father = JSON.parse(JSON.parse(uploadRes.data).result.data).data.back.data; let regex = /[\u4E00-\u9FA5\uF900-\uFA2D]{1,}/; - console.log(regex.test(father.validPeriod)) if(!regex.test(father.validPeriod)){ textArray[6] = father.issueAuthority; textArray[7] = father.validPeriod; diff --git a/pages/addstaff/IDcard.vue b/pages/addstaff/IDcard.vue index 34e4b96..ea103d1 100644 --- a/pages/addstaff/IDcard.vue +++ b/pages/addstaff/IDcard.vue @@ -252,10 +252,35 @@ savephoto(filePath, 0); } else if (JSON.parse(JSON.parse(uploadRes.data).result.data).data.back) { let father = JSON.parse(JSON.parse(uploadRes.data).result.data).data.back.data; - textArray[6] = father.issueAuthority; - textArray[7] = father.validPeriod; - backImge.value = filePath; - savephoto(filePath, 1); + // textArray[6] = father.issueAuthority; + // textArray[7] = father.validPeriod; + // backImge.value = filePath; + // savephoto(filePath, 1); + let regex = /[\u4E00-\u9FA5\uF900-\uFA2D]{1,}/; + if(!regex.test(father.validPeriod)){ + textArray[6] = father.issueAuthority; + textArray[7] = father.validPeriod; + backImge.value = filePath; + savephoto(filePath, 1); + }else{ + if(father.validPeriod.indexOf('长期')>-1){ + textArray[6] = father.issueAuthority; + textArray[7] = father.validPeriod; + backImge.value = filePath; + savephoto(filePath, 1); + }else{ + textArray[7] = ""; + uni.showToast({ + title: '识别失败', + icon: 'none', + duration: 2000 + }) + } + uping.value = true; + return + } + + uni.hideLoading() } else { uni.hideLoading() uni.showToast({