更新记录
1.0.3(2024-07-02)
更新相机权限日志
1.0.2(2024-07-02)
更新demo文档
1.0.1(2024-05-09)
更新说明文档
查看更多
平台兼容性
uni-app
app-vue |
app-nvue |
app-android |
app-ios |
? |
? |
? |
? |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
? |
? |
? |
? |
? |
? |
? |
? |
? |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
? |
? |
? |
? |
? |
? |
? |
? |
? |
uni-app x
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
? |
? |
? |
? |
? |
? |
? |
? |
? |
cf-takepic
开发文档
UTS 语法
UTS API插件
UTS 组件插件
Hello UTS
先打自定义基座,然后在自定义基座基础上运行到app
调用原生拍照函数
let that = this;
//调用uts插件函数
takepic({
paramA: false,
complete(res) {
that.img = "data:image/jpeg;base64," + res.replace(/\s+/g, '');
}
})
demo页代码
<template>
<view class="content">
<view class="text-area">
<button @click="take">拍照</button>
</view>
<view class="">
<image :src="img"></image>
</view>
</view>
</template>
<script>
//引入uts插件
import {
takepic
} from "../../uni_modules/cf-takepic"
export default {
data() {
return {
img: "",
}
},
onLoad() {
},
methods: {
take() {
let that = this;
//调用uts插件函数
takepic({
paramA: false,
complete(res) {
that.img = "data:image/jpeg;base64," + res.replace(/\s+/g, '');
}
})
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>