更新记录
1.0.2(2025-03-14)
优化
1.0.1(2025-03-04)
优化
1.0.0(2025-02-14)
初始化
查看更多平台兼容性
Vue2 | Vue3 |
---|---|
√ | √ |
App | 快应用 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节小程序 | QQ小程序 |
---|---|---|---|---|---|---|
Android:4.4,iOS:不支持,HarmonyNext:不支持 | × | × | × | × | × | × |
钉钉小程序 | 快手小程序 | 飞书小程序 | 京东小程序 | 鸿蒙元服务 |
---|---|---|---|---|
× | × | × | × | × |
H5-Safari | Android Browser | 微信浏览器(Android) | QQ浏览器(Android) | Chrome | IE | Edge | Firefox | PC-Safari |
---|---|---|---|---|---|---|---|---|
× | × | × | × | × | × | × | × | × |
xtf-scanqrcode
二维码扫描
uniappx
import {openScan,ScanConfig} from "@/uni_modules/xtf-scanqrcode"
openScan({
scanHintText:"一维码/二维码",
fullScreenScan:false,
success: (type:number,data:string) => {
if(type==0){
that.title=data;
}
},imageCallback(res:string){
}
} as ScanConfig)
ScanConfig 参数介绍
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// 扫描时相片地址回到 需要就写 可为空
}
uniappx
import {openScan} from "@/uni_modules/xtf-scanqrcode"
openScan({
scanHintText:"一维码/二维码",
fullScreenScan:false,
success: (type,data) => {
if(type==0){
that.title=data;
}
},
imageCallback(res){
}
} )