更新记录

1.0.0(2026-04-21) 下载此版本

{ "name": "legacy-camera", "id": "legacy-camera", "version": "1.0.0", "description": "基于 camera-sdk-release.aar 的 UniApp Android 原生相机插件", "_dp_nativeplugin": { "android": { "plugins": [ { "type": "module", "name": "LegacyCameraModule", "class": "com.xygala.uniplugin.LegacyCameraModule" } ], "integrateType": "aar", "dependencies": [ "com.alibaba:fastjson:1.2.83" ], "abis": [ "armeabi-v7a", "arm64-v8a" ], "useAndroidX": true } } }


平台兼容性

uni-app(5.07)

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
- - - -
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 小红书小程序 快应用-华为 快应用-联盟
- - - - - - - - - - - -
{ this.lastEvent = JSON.stringify(event) if (event.event === 'cameraError') { uni.showToast({ title: event.message || '相机异常', icon: 'none' }) } }) await camera.init({}) }, methods: { async start() { const res = await camera.startPreview({ facing: CameraFacing.BACK }) if (res.code !== 0) { uni.showToast({ title: res.msg, icon: 'none' }) } }, async switchCam() { await camera.switchCamera() }, async shoot() { const res = await camera.takePicture() if (res.code === 0) { this.filePath = res.data.filePath || '' } else { uni.showToast({ title: res.msg, icon: 'none' }) } }, async stop() { await camera.stopPreview() }, async destroy() { await camera.destroy() } }, onUnload() { camera.offEvent() camera.destroy() } } <style> .page { display: flex; flex-direction: column; gap: 16rpx; padding: 24rpx; } .path { font-size: 24rpx; } </style>

隐私、权限声明

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

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

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

许可协议

MIT协议

暂无用户评论。