npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tj-ai-qrcode

v1.0.1

Published

qrcode

Readme

天鉴三维码小程序插件

1. 项目介绍

1.1 插件概述

天鉴三维码小程序插件(tj-ai-qrcode)是一款专为小程序开发的三维码识别与拍照工具,基于jsQR库进行优化,提供了高效、精准的三维码识别功能,支持实时视频流解析、自动相机控制和智能拍照等特性。

1.2 功能特点

  • 实时三维码识别:通过视频流实时解析三维码内容
  • 智能相机控制:根据识别结果自动调整相机放大倍数
  • 自动拍照功能:识别成功后自动拍摄大小两张图片
  • 多角度检测:支持三维码倾斜角度检测和提示
  • 自动缩放:根据三维码大小智能调整相机缩放比例
  • 超时自动拍照:支持设置超时时间,超时后自动拍照
  • 音频提示:可配置识别过程中的音频提示

1.3 应用场景

  • 商品防伪验证
  • 证件信息采集
  • 物流信息查询
  • 会员信息识别
  • 产品溯源管理
  • 特殊场景下的信息采集

2. 安装方法

2.1 npm安装

npm install tj-ai-qrcode

2.2 小程序引入

在小程序项目的app.json中配置插件:

{
  "plugins": {
    "tj-ai-qrcode": {
      "version": "1.0.0",
      "provider": "插件提供者appid"
    }
  }
}

2.3 页面使用

在需要使用插件的页面json文件中引入组件:

{
  "usingComponents": {
    "camera-take-photo": "tj-ai-qrcode/cameraTakePhoto"
  }
}

3. 使用说明

3.1 基本使用

在页面wxml中添加组件:

<camera-take-photo 
  isPlayAudio="{{false}}" 
  playAudioURL="" 
  bind:qrCodeFinish="onQRCodeFinish"
>
</camera-take-photo>

在页面js中处理识别结果:

Page({
  /**
   * 三维码识别完成回调
   * @param {Object} e - 事件对象
   */
  onQRCodeFinish: function(e) {
    const { photo_min, photo_max, code_data } = e.detail;
    console.log('识别结果:', code_data);
    console.log('小图路径:', photo_min.path);
    console.log('大图路径:', photo_max.path);
    
    // 处理识别结果,例如上传服务器进行验证
    this.uploadResult(photo_min, photo_max, code_data);
  },
  
  /**
   * 上传识别结果到服务器
   */
  uploadResult: function(photo_min, photo_max, code_data) {
    // 实现上传逻辑
  }
});

3.2 高级使用

3.2.1 配置音频提示

<camera-take-photo 
  isPlayAudio="{{true}}" 
  playAudioURL="https://ai.tj5.cc:35437/static/ai_audio/AI_Audio.mp3" 
  bind:qrCodeFinish="onQRCodeFinish"
>
</camera-take-photo>

3.2.2 自定义识别参数

在页面js中获取组件实例并配置参数:

4. API文档

4.1 组件属性

| 属性名 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | isPlayAudio | Boolean | false | 是否播放音频提示 | | playAudioURL | String | 内置URL | 音频播放地址 |

9. 技术支持

如有问题或建议,欢迎联系我们:


版权所有 © 2026 天鉴三维码