From a6cdbcfe28fcc40ebb4919f57d60fb20122e8e57 Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期二, 12 八月 2025 09:10:35 +0800 Subject: [PATCH] 1 --- pages/mine/index.vue | 68 +++++++++++++++++---------------- 1 files changed, 35 insertions(+), 33 deletions(-) diff --git a/pages/mine/index.vue b/pages/mine/index.vue index efbdad1..6ff401e 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -371,42 +371,44 @@ this.$tab.navigateTo('/pagesB/mine/myReservation/myReservation'); }, handleBuilding() { - const msg = uni.getStorageSync('msg'); - if (msg) { - let phone = msg; - getIdCardByPhone(phone).then(response => { - if (response.data) { - uni.setStorageSync('data', response.data); - const cusIdCard = uni.getStorageSync('data'); - uni.navigateTo({ - url: `/pages/tjrecord/tjrecord?cusIdCard=${cusIdCard}` - }); - } else { - uni.navigateTo({ - url: `/pagesA/Examiner/Examiner?id=2` - }); - } - }); - } else if (this.phone) { - let phone = this.phone; - getIdCardByPhone(phone).then(response => { - if (response.data) { - uni.setStorageSync('data', response.data); - const cusIdCard = uni.getStorageSync('data'); - uni.navigateTo({ - url: `/pages/tjrecord/tjrecord?cusIdCard=${cusIdCard}` - }); - } else { - uni.navigateTo({ - url: `/pagesA/Examiner/Examiner?id=2` - }); - } - }); - } else { + // 浼樺厛浠� uni.getStorageSync 鑾峰彇 phone锛岃嫢鏃犲垯浣跨敤 this.phone + const phone = uni.getStorageSync('msg') || this.phone; + + // 濡傛灉 phone 涓嶅瓨鍦紝鐩存帴璺宠浆鍒� Examiner 椤甸潰 + if (!phone) { uni.navigateTo({ - url: `/pagesA/Examiner/Examiner?id=2` + url: '/pagesA/Examiner/Examiner?id=2' }); + return; } + + // 璋冪敤 API 鑾峰彇韬唤璇佸彿 + getIdCardByPhone(phone) + .then(response => { + if (response.data) { + // 瀛樺偍韬唤璇佸彿骞惰烦杞埌 tjrecord 椤甸潰 + uni.setStorageSync('data', response.data); + uni.navigateTo({ + url: `/pages/tjrecord/tjrecord?cusIdCard=${response.data}` + }); + } else { + // 鏃犳暟鎹椂璺宠浆鍒� Examiner 椤甸潰 + uni.navigateTo({ + url: '/pagesA/Examiner/Examiner?id=2' + }); + } + }) + .catch(err => { + console.error('getIdCardByPhone 閿欒:', err); + uni.showToast({ + title: err.message || '缃戠粶閿欒锛岃绋嶅悗閲嶈瘯', + icon: 'none' + }); + // 鍙�夛細鏍规嵁闇�姹傚喅瀹氭槸鍚﹁烦杞� + uni.navigateTo({ + url: '/pagesA/Examiner/Examiner?id=2' + }); + }); }, personnel(canshu) { if (this.token) { -- Gitblit v1.8.0