Commit d093ade7 by liangjianmin

xtf-scanqrcode

parent 709cb4de
## 1.1.5(2026-02-09)
优化
## 1.1.4(2026-02-06)
优化编译错误问题
## 1.1.3(2026-02-06)
Android 添加继续扫码
## 1.1.2(2026-02-03)
优化Android 不能动态控制相册显示与隐藏
## 1.1.1(2025-11-18)
优化
## 1.1.0(2025-11-17)
优化
## 1.0.9(2025-11-16)
优化
## 1.0.7(2025-11-16)
优化ios 扫码
## 1.0.6(2025-11-16)
增加iOS端
## 1.0.5(2025-08-18)
优化
## 1.0.4(2025-08-02)
优化
## 1.0.3(2025-06-08)
优化uniapp 报错
## 1.0.2(2025-03-14)
优化
## 1.0.1(2025-03-04)
优化
## 1.0.0(2025-02-14)
初始化
No preview for this file type
{
"id": "xtf-scanqrcode",
"displayName": "安卓ios 扫码,扫描二维码 扫码二维码 多码识别 扫码 扫描",
"version": "1.1.5",
"description": "扫码 扫描二维码扫码 基于google MlKit MLKitBarcodeScanning扫描二维码和条形码,等多种格式,支持设置扫码界面样式 扫码 扫描二维码 扫码",
"keywords": [
"扫码",
"扫描二维码",
"二维码",
"二维码识别",
"多码识别扫描"
],
"repository": "",
"engines": {
"uni-app": "^4.07",
"uni-app-x": "^4.07"
},
"dcloudext": {
"type": "uts",
"sale": {
"regular": {
"price": "9.99"
},
"sourcecode": {
"price": "299.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "<uses-permission android:name=\"android.permission.CAMERA\" />\n <uses-permission android:name=\"android.permission.VIBRATE\" />\n <uses-permission android:name=\"android.permission.FLASHLIGHT\" />"
},
"npmurl": "",
"darkmode": "x",
"i18n": "x",
"widescreen": "√"
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "√",
"aliyun": "√",
"alipay": "√"
},
"client": {
"uni-app": {
"vue": {
"vue2": "-",
"vue3": "-"
},
"web": {
"safari": "-",
"chrome": "-"
},
"app": {
"vue": "√",
"nvue": "√",
"android": {
"extVersion": "",
"minVersion": "21"
},
"ios": {
"extVersion": "",
"minVersion": "15"
},
"harmony": "-"
},
"mp": {
"weixin": "-",
"alipay": "-",
"toutiao": "-",
"baidu": "-",
"kuaishou": "-",
"jd": "-",
"harmony": "-",
"qq": "-",
"lark": "-"
},
"quickapp": {
"huawei": "-",
"union": "-"
}
},
"uni-app-x": {
"web": {
"safari": "-",
"chrome": "-"
},
"app": {
"android": {
"extVersion": "",
"minVersion": "21"
},
"ios": "-",
"harmony": "-"
},
"mp": {
"weixin": "-"
}
},
"App": {
"app-android": "u",
"app-harmony": "u",
"app-ios": "u"
}
}
}
}
}
\ No newline at end of file
# xtf-scanqrcode
### 二维码扫描
### 插件测试使用方法
1.选择试用,绑定要试用的项目appid,
2.选择后下载到对应的本地项目,
3.按照文档 -》把插件引入项目(即 import {openScan,ScanConfig} from "@/uni_modules/xtf-scanqrcode" 需要先引入),
4.发布-》云打包-》选择制作基座-》打包等基座制作完成
5.运行 -》 运行到手机或模拟器-》运行到Androidapp基座-》选择使用自定义基座运行-》选择手机-》运行
6.之前若安装过基座 ,请卸载之前的基座
#### 注意
插件使用谷歌扫码库,安卓和iOS功能有一些区别 界面样式和自定义功能,请注意先试用
ios 支持ios15.5版本
#### uniappx
~~~
import {openScan,ScanConfig} from "@/uni_modules/xtf-scanqrcode"
openScan({
scanHintText:"一维码/二维码",
fullScreenScan:false,
isShowBeep:true,
isShowLightController:true,
isShowPhotoAlbum:true,
success: (type:number,data:string) => {
if(type==0){
that.title=data;
}
}
} as ScanConfig)
~~~
#### uniapp
~~~
import {openScan} from "@/uni_modules/xtf-scanqrcode"
openScan({
scanHintText:"一维码/二维码",
fullScreenScan:false,
isShowBeep:true,
isShowLightController:true,
isShowPhotoAlbum:true,
success: (type,data) => {
if(type==0){
that.title=data;
}
}
} )
~~~
ScanConfig 参数介绍
~~~
export type ScanConfig={
continueScan?:boolean, 默认false 是否继续扫码
continueScanDelayTime?:number, 默认3000 继续扫码下次扫码间隔
isShowVibrate?:boolean,//设置完成震动
isShowBeep?:boolean,//扫描完成声音
isShowPhotoAlbum?:boolean,//显示相册功能
isShowLightController?:boolean,//显示闪光灯
scanHintText?:string,// 扫描提示文字
scanHintTextColor?:string,// 扫码提示文字颜色
scanHintTextSize?:number,// 扫码提示文字大小
scanColor?:string,//扫码颜色
supportZoom?:boolean// 是否支持缩放
laserStyle?:boolean,
bgColor?:string,// 背景颜色
// gridScanLineColumn:number,
fullScreenScan?:boolean,// 是否全屏,
statusBarColor?:string// 状态栏背景颜色
statusBarDark?:boolean,// 状态栏文字颜色
scanFrameSizeScale?:number,// 框大小 0-1
zhezhao?:boolean,// 是否有遮罩
success:(type:number,data:string)=>void// 成功回调
imageCallback?:(data:string)=>void// 扫描时相片地址回到 需要就写 可为空
}
~~~
### 开发文档
[UTS 语法](https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html)
[UTS API插件](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html)
[UTS uni-app兼容模式组件](https://uniapp.dcloud.net.cn/plugin/uts-component.html)
[UTS 标准模式组件](https://doc.dcloud.net.cn/uni-app-x/plugin/uts-vue-component.html)
[Hello UTS](https://gitcode.net/dcloud/hello-uts)
\ No newline at end of file
{
"minSdkVersion": "21",
"dependencies":[
"com.google.mlkit:barcode-scanning:17.0.2",
"androidx.camera:camera-core:1.0.2",
"androidx.camera:camera-camera2:1.0.2",
"androidx.camera:camera-lifecycle:1.0.2",
"androidx.camera:camera-view:1.0.0-alpha25"
]
}
\ No newline at end of file
{
"deploymentTarget": "15.5",
"dependencies-pods": [{
"name": "GoogleMLKit",
"version": "9.0.0"
},
{
"name": "MLKitBarcodeScanning",
"version": "8.0.0"
}
]
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSCameraUsageDescription</key>
<string>需要访问相机进行扫码</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>需要访问相册选择图片</string>
</dict>
</plist>
\ No newline at end of file
export type ScanConfig={
isShowVibrate?:boolean,//设置完成震动
isShowBeep?:boolean,//扫描完成声音
isShowPhotoAlbum?:boolean,//显示相册功能
isShowLightController?:boolean,//显示闪光灯
scanHintText?:string,// 扫描提示文字
scanHintTextColor?:string,// 扫码提示文字颜色
scanHintTextSize?:number,// 扫码提示文字大小
scanColor?:string,//扫码颜色
supportZoom?:boolean// 是否支持缩放
laserStyle?:boolean,
bgColor?:string,// 背景颜色
// gridScanLineColumn:number,
fullScreenScan?:boolean,// 是否全屏,
statusBarColor?:string
statusBarDark?:boolean,
scanFrameSizeScale?:number,// 框大小 0-1
zhezhao?:boolean,// 是否有遮罩
success:(type:number,data:string)=>void,
imageCallback?:(data:string)=>void
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment