uxs20260774
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "uxs20260774" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-1636567ce80bc7185547ba2517d38d7681eeefe7ed0423c727bc31d9a4533dd6. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/uxs20260774 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Use html5-qrcode in the browser to scan QR codes or barcodes for document verification. Use when the user needs camera scanning, html5-qrcode, or scan-based verification.
Introduction source: third_party · user_f1b049da · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: uxs20260774
slug: uxs20260774
displayName: 摄像头扫码
version: 1.0.0
summary: 用 html5-qrcode 调起浏览器摄像头扫描单据二维码/条码。
license: MIT
description: 用 html5-qrcode 在浏览器内扫二维码或条码,核验单据。当用户要摄像头扫码、html5-qrcode、扫二维码核验时使用。摄像头扫码(html5-qrcode)
灵感:能力工具箱 html5-qrcode(pkg: html5-qrcode)。
小四原创:HTTPS/localhost 下申请摄像头,扫到即回调文本;扫完可停相机省电。
何时使用
- 现场核验合同/单据二维码
- 仓库或前台扫码录入单号
- 不装原生 App,浏览器内完成
硬约束
- 使用
html5-qrcode;需用户手势触发启动相机。 - 仅 HTTPS 或 localhost 可用摄像头(明文提示)。
- 成功一次后默认
stop,避免一直开着相机。 - 权限拒绝时给中文引导(设置里允许摄像头)。
- 实现要点注释标 小四原创。
- 不扫描用户相册整库;可选「选图识别」需单独按钮。
推荐实现
import { Html5Qrcode } from 'html5-qrcode'
// 小四原创:扫码会话
export function createScanner(elementId: string) {
const scanner = new Html5Qrcode(elementId)
return {
async start(onHit: (text: string) => void) {
await scanner.start(
{ facingMode: 'environment' },
{ fps: 8, qrbox: { width: 240, height: 240 } },
async (decoded) => {
onHit(decoded)
try {
await scanner.stop()
} catch {
/* ignore */
}
},
() => {},
)
},
async stop() {
if (scanner.isScanning) await scanner.stop()
},
}
}
Agent 步骤
- 页面放扫码容器 div;按钮「开始扫码」。
- 扫中填充单号/打开详情;失败展示权限错误。
- 离开路由务必
stop。 - 自测:后置摄像头二维码;无相机设备的降级文案。
不要做
- 未经提示持续后台录像。
- 把扫码结果默认发到不明外网。
附加
Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决现场合同核验、仓库扫码录入等明确业务场景
- 浏览器内完成扫码,无需安装原生 App,实用性强
Highlights
- 触发词精准完整,覆盖'摄像头扫码'、'html5-qrcode'、'扫二维码核验'等多种表达
Highlights
- 文档结构清晰,包含何时使用、硬约束、推荐实现、Agent 步骤等完整章节
- 提供 TypeScript 代码示例和具体实现要点
Highlights
- 使用标准 html5-qrcode 库,参数配置合理
- 包含权限处理、扫码成功后自动停止相机、路由离开清理等可靠性机制
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.