From fec95743b40ebb12e6ccc1e3d50fdc6147072f9e Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Thu, 3 Jul 2025 11:11:08 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/devicesSearch/qrSearch.vue | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/pages/devicesSearch/qrSearch.vue b/src/pages/devicesSearch/qrSearch.vue index c1ed2c3..019ffbe 100644 --- a/src/pages/devicesSearch/qrSearch.vue +++ b/src/pages/devicesSearch/qrSearch.vue @@ -3,7 +3,7 @@ 二维码扫描 - + 设备信息 @@ -138,17 +138,22 @@ onShow(() => { // } // 扫码识别按钮点击事件 const scanStart = () => { - // if (scanQrCodeRef.value) { - // scanQrCodeRef.value.scanQrCode() - // } - qrCodeScan.value = '202502-00027' - getMaInfoScan() + qrCodeScan.value = '' + if (scanQrCodeRef.value) { + scanQrCodeRef.value.scanQrCode() + } + // qrCodeScan.value = + // getMaInfoScan() } // 处理扫描成功事件 const handleScanSuccess = (result) => { - qrCodeScan.value = result - getMaInfoScan() + qrCodeScan.value = result?.text?.split('?qrcode=')[1] || result?.text + if (qrCodeScan.value === '') { + uni.showToast({ title: '扫码识别失败', icon: 'none' }) + } else { + getMaInfoScan() + } } // 处理扫描失败事件