更新记录
1.1.1(2024-09-26)
修复扫描文件持续触发不生效问题(1.1.1)
1.1.0(2024-05-20)
数据返回uri地址信息。
1.0.9(2024-05-17)
新增获取所有相册和视频接口
查看更多平台兼容性
Vue2 | Vue3 |
---|---|
√ | √ |
App | 快应用 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节小程序 | QQ小程序 |
---|---|---|---|---|---|---|
HBuilderX 3.6.8,Android:4.4,iOS:不支持,HarmonyNext:不确定 | × | × | × | × | × | × |
钉钉小程序 | 快手小程序 | 飞书小程序 | 京东小程序 | 鸿蒙元服务 |
---|---|---|---|---|
× | × | × | × | × |
H5-Safari | Android Browser | 微信浏览器(Android) | QQ浏览器(Android) | Chrome | IE | Edge | Firefox | PC-Safari |
---|---|---|---|---|---|---|---|---|
× | × | × | × | × | × | × | × | × |
概述
XF-fileScanUTS实现了安卓平台扫描指定文件类型功能。
模块使用攻略
- 执行扫描前请申请动态申请存储权限
插件接口
startScan
开始扫描
uni-app项目中(nvue)调用示例:
import { startScan } from "@/uni_modules/XF-fileScanUTS"
startScan({
fileType: ["pdf", "m3u8"],
scanning: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { startScan } from "@/uni_modules/XF-fileScanUTS";
import { FileResult, CompleteResult, ScanOptions } from "@/uni_modules/XF-fileScanUTS/utssdk/interface.uts";
let options = {
fileType: ["pdf", "m3u8"],
scanning: (res : FileResult) => {
console.log(res)
},
complete: (res : CompleteResult) => {
console.log(res)
}
} as ScanOptions;
startScan(options);
可用性
Android系统
可提供的1.0.0及更高版本
stopScan
停止扫描
uni-app项目中(nvue)调用示例:
import { stopScan } from "@/uni_modules/XF-fileScanUTS"
stopScan();
uni-app x项目(uvue)中调用示例:
import { stopScan } from "@/uni_modules/XF-fileScanUTS";
stopScan();
可用性
Android系统
可提供的1.0.0及更高版本
getVideoThumbnail
获取视频封面
uni-app项目中(nvue)调用示例:
import { getVideoThumbnail } from "@/uni_modules/XF-fileScanUTS"
getVideoThumbnail({
path: "",
scanning: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { getVideoThumbnail } from "@/uni_modules/XF-fileScanUTS";
import { ThumbnailOptions } from "@/uni_modules/XF-fileScanUTS/utssdk/interface.uts";
let options = {
path: "",
scanning: (res : any) => {
console.log(res)
}
} as ThumbnailOptions;
getVideoThumbnail(options);
可用性
Android系统
可提供的1.0.2及更高版本
getAllPictrue
获取所有相册
uni-app项目中(nvue)调用示例:
import { getAllPictrue } from "@/uni_modules/XF-fileScanUTS"
getAllPictrue({
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { getAllPictrue } from "@/uni_modules/XF-fileScanUTS";
import { PictrueOptions } from "@/uni_modules/XF-fileScanUTS/utssdk/interface.uts";
let options = {
complete: (res : any) => {
console.log(res)
}
} as PictrueOptions;
getAllPictrue(options);
可用性
Android系统
可提供的1.0.9及更高版本
getAllVideo
获取所有视频
uni-app项目中(nvue)调用示例:
import { getAllVideo } from "@/uni_modules/XF-fileScanUTS"
getAllVideo({
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { getAllVideo } from "@/uni_modules/XF-fileScanUTS";
import { VideoOptions } from "@/uni_modules/XF-fileScanUTS/utssdk/interface.uts";
let options = {
complete: (res : any) => {
console.log(res)
}
} as VideoOptions;
getAllVideo(options);
可用性
Android系统
可提供的1.0.9及更高版本