更新记录
1.0.0(2025-02-24) 下载此版本
可拓展各类证件拍照
平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
× | × | - | - | × | √ | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
- | - | - | - | - | - | - | - | - | - | - |
使用说明
<template>
<view>
<zhqCamera @confirm="confirm"></zhqCamera>
</view>
</template>
<script>
import zhqCamera from "@/components/zhq-camera/index.nvue"
export default {
components:{
zhqCamera
},
data() {
return {
}
},
onLoad() {
},
methods: {
confirm(img){//图片路径
uni.showLoading({
title: '提交中...',
mask:true,
});
uni.uploadFile({
url: "xxxxxxx", //接口地址
filePath: img,
name: "file",
header: {
token: 'token123456789',
},
formData: {//附带传给后端的参数
folder: 'goods/img',
},
success: (e) => {
// 接口返回成功
uni.hideLoading();
},
fail: (e) => {
// 接口返回失败
uni.hideLoading();
}
})
}
}
}
</script>
<style>
</style>
需创建nvue页面引入插件,图片路径得自己修改