更新记录
1.0.0(2025-06-04)
下载此版本
初始化
平台兼容性
uni-app(4.21)
Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
uni-app x(4.21)
Chrome |
Safari |
Android |
iOS |
鸿蒙 |
微信小程序 |
- |
- |
- |
- |
- |
- |
使用方法:
const hpCarCode = uni.requireNativePlugin('Hp-CarCode');
let _this = this
//打开相机
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['camera'],
success: function(imgRes) {
uni.saveFile({
tempFilePath: imgRes.tempFilePaths[0]
});
hpCarCode.recognizeLicensePlate({
imagePath: "file://" + plus.io.convertLocalFileSystemURL(imgRes.tempFilePaths[0])
// base64: ImgBase64
}, (res) => {
_this.result = `${res.plateNumber}`
uni.showToast({
title: res.msg,
icon: 'none'
})
});
}
});