From 02566e20dbc50cad750a6a5320e2f8d57fb5f59a Mon Sep 17 00:00:00 2001 From: biss Date: Sun, 29 Mar 2026 12:26:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=AB=E6=8F=8F=E6=9D=A1?= =?UTF-8?q?=E5=BD=A2=E7=A0=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- certs/img/1405816120001.svg | 205 ++++++++++ certs/img/1405816120005.svg | 176 +++++++++ certs/img/1405816120006.svg | 181 +++++++++ certs/img/ZS20260002.svg | 746 ++++++++++++++++++++++++++++++++++++ certs/img/ZS20260003.svg | 743 +++++++++++++++++++++++++++++++++++ certs/index.html | 149 +++++-- 6 files changed, 2170 insertions(+), 30 deletions(-) create mode 100644 certs/img/1405816120001.svg create mode 100644 certs/img/1405816120005.svg create mode 100644 certs/img/1405816120006.svg create mode 100644 certs/img/ZS20260002.svg create mode 100644 certs/img/ZS20260003.svg diff --git a/certs/img/1405816120001.svg b/certs/img/1405816120001.svg new file mode 100644 index 0000000..c6eec75 --- /dev/null +++ b/certs/img/1405816120001.svg @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/certs/img/1405816120005.svg b/certs/img/1405816120005.svg new file mode 100644 index 0000000..06786e7 --- /dev/null +++ b/certs/img/1405816120005.svg @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/certs/img/1405816120006.svg b/certs/img/1405816120006.svg new file mode 100644 index 0000000..b51353b --- /dev/null +++ b/certs/img/1405816120006.svg @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/certs/img/ZS20260002.svg b/certs/img/ZS20260002.svg new file mode 100644 index 0000000..c64aa02 --- /dev/null +++ b/certs/img/ZS20260002.svg @@ -0,0 +1,746 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/certs/img/ZS20260003.svg b/certs/img/ZS20260003.svg new file mode 100644 index 0000000..2f183f0 --- /dev/null +++ b/certs/img/ZS20260003.svg @@ -0,0 +1,743 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/certs/index.html b/certs/index.html index b849ad8..4a4de3d 100644 --- a/certs/index.html +++ b/certs/index.html @@ -3,8 +3,10 @@ - Surpass 荣誉证书查询系统 + 荣誉证书查询系统 - 集成扫码 + + @@ -132,22 +170,34 @@
- +
+ +
+ +
+
- +
- +
- +
-
请输入信息开始检索
+
请输入信息或点击右侧图标扫码
+
+ + +
+
+
+
@@ -157,6 +207,49 @@ const SUPABASE_ANON_KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNoaXhzc3JwaGZneHZxcWlna3pvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzQ2OTE0OTEsImV4cCI6MjA5MDI2NzQ5MX0.Az_Ew2J2zdOMcSV0UNAjBS-LPqGpqhsaN4IyZ5R7iqU'; const sbClient = supabase.createClient(SUPABASE_URL, SUPABASE_ANON_KEY); + // 初始化扫码器 + const html5QrCode = new Html5Qrcode("reader"); + const scannerOverlay = document.getElementById('scanner-overlay'); + + // --- 扫码逻辑 --- + document.getElementById('startScanBtn').addEventListener('click', async () => { + scannerOverlay.style.display = 'flex'; + + // 扫码配置:qrbox 设为长方形有助于识别条形码 + const config = { + fps: 15, + qrbox: { width: 300, height: 180 }, + aspectRatio: 1.0 + }; + + try { + await html5QrCode.start( + { facingMode: "environment" }, // 使用后置摄像头 + config, + (decodedText) => { + // 识别成功 + document.getElementById('searchTerm').value = decodedText; + closeScanner(); + handleSearch(); // 自动执行查询 + }, + (errorMessage) => { /* 扫描中不抛出错误 */ } + ); + } catch (err) { + alert("无法启动摄像头,请检查 HTTPS 权限或设备连接"); + scannerOverlay.style.display = 'none'; + } + }); + + async function closeScanner() { + if (html5QrCode.isScanning) { + await html5QrCode.stop(); + } + scannerOverlay.style.display = 'none'; + } + + document.getElementById('stopScanBtn').addEventListener('click', closeScanner); + + // --- 查询逻辑 --- async function handleSearch() { const term = document.getElementById('searchTerm').value.trim(); const start = document.getElementById('dateStart').value; @@ -171,13 +264,9 @@ display.innerHTML = '
正在检索数据库...
'; try { - // 构造查询:筛选编号/姓名 let query = sbClient.from('certificates').select('*'); - - // 模糊匹配编号或姓名 query = query.or(`cert_number.ilike.%${term}%,holder_name.ilike.%${term}%`); - // 增加可选的时间起止限定 if (start) query = query.gte('issue_date', start); if (end) query = query.lte('issue_date', end);