更新记录

1.0.0(2026-03-06)

  • 新版发布

平台兼容性

uni-app(4.76)

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
× ×
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 小红书小程序 快应用-华为 快应用-联盟
× × × × × × × × × - × ×

uni-app x(4.76)

Chrome Safari Android iOS 鸿蒙 微信小程序
× × ×

dc-uts-scan

特别提醒

  • 购买本插件前,请先试用、请先试用、请先试用,并充分自测确认满足需求之后再行购买。虚拟物品一旦购买之后无法退款;
  • 如有使用上的疑问、bug,可以进交流群联系作者;
  • 作者可承接各种插件定制;
  • 请在合法范围内使用,若使用本插件做非法开发,本方概不负责;
  • 结合文档和示例demo集成使用;

插件使用文档

说明:支持13种码制式,可自定义选择支持的码制,扫码时不传默认全部。

参数 对应码制格式
Code128 Code 128
Code39 Code 39
Code93 Code 93
Codabar Codabar
EAN-13 EAN-13
EAN-8 EAN-8
ITF14 ITF14
UPC-A UPC-A
UPC-E UPC_E
QR QR code
PDF417 PDF417
Aztec Aztec
DataMatrix DataMatrix

uniapp完整示例

<template>
    <view>
        <image class="logo" src="/static/logo.png"></image>
        <text class="title" @click="scanAction">扫码测试/text>
        <text class="title" style="margin-top: 140rpx;">扫描结果:{{title}}</text>
    </view>
</template>

<script>
    import * as Scan from '@/uni_modules/dc-uts-scan'
    export default {

        data() {
            return {
                title: ""
            }
        },
        onLoad() {

        },
        methods: {
            scanAction() {
                Scan.openScan({
                    params: {
                        album: false,
                        scanTypes: ["EAN-13", 'QR', 'EAN-8', 'UPC-A', 'Aztec']
                    },
                    success: (res => {
                        console.log(res)
                        this.title = res.result
                    })
                })
            }
        }
    }
</script>

<style>
    .logo {
        height: 100px;
        width: 100px;
        margin: 100px auto 25px auto;
    }

    .title {
        font-size: 18px;
        color: #8f8f94;
        text-align: center;
    }
</style>

uniapp-x完整示例

<template>
    <view>
        <image class="logo" src="/static/logo.png"></image>
        <text class="title" @click="scanAction">扫码测试</text>
        <text class="title" style="margin-top: 140rpx;">扫描结果:{{title}}</text>
    </view>
</template>

<script>
    import * as Scan from '@/uni_modules/dc-uts-scan'
    export default {

        data() {
            return {
                title: ""
            }
        },
        onLoad() {

        },
        methods: {
            scanAction() {
                Scan.openScan({
                    params: {
                        album: false,
                        scanTypes: ["EAN-13", 'QR', 'EAN-8', 'UPC-A', 'Aztec']
                    } as Scan.ScanParams,
                    success: (res => {
                        console.log(res)
                        this.title = res.result ?? ''
                    })
                } as Scan.ScanApiOptions)
            }
        }
    }
</script>

<style>
    .logo {
        height: 100px;
        width: 100px;
        margin: 100px auto 25px auto;
    }

    .title {
        font-size: 18px;
        color: #8f8f94;
        text-align: center;
    }
</style>

隐私、权限声明

1. 本插件需要申请的系统权限列表:

相机、相册

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件不采集任何数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

暂无用户评论。