Commit 2c9e6edd authored by Damon's avatar Damon

拍照组件文档补充

parent 02a38e38
...@@ -17,7 +17,7 @@ uni.hideTabBar() ...@@ -17,7 +17,7 @@ uni.hideTabBar()
### Props ### Props
| 属性名 | 类型 | 默认值 | 可选值 | 说明 | | 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :-: | :-: | :-: | :-: | :-: | | :-: | :-: | :-: | :-: | :-: |
| update | Boolean | true | true/false | 是否默认上传 true:会自动上传好图片并返回绝对路径 false: 只返回临时路径,需要在父组件做上传动作 | | upload | Boolean | true | true/false | 是否默认上传 true:会自动上传好图片并返回绝对路径 false: 只返回临时路径,需要在父组件做上传动作 |
| num | Number | 10 | 1-10 | 拍照数量,只能传1-10的正整数 | | num | Number | 10 | 1-10 | 拍照数量,只能传1-10的正整数 |
| currentItem | Object | - | - | 对应的规范数据,用于获取示意图和水印,以及保存图片所需的ID **格式见下文** | | currentItem | Object | - | - | 对应的规范数据,用于获取示意图和水印,以及保存图片所需的ID **格式见下文** |
...@@ -67,10 +67,12 @@ uni.hideTabBar() ...@@ -67,10 +67,12 @@ uni.hideTabBar()
```javascript ```javascript
import takePhoto from '@/components/take/index.vue' import takePhoto from '@/components/take/index.vue'
import baseFile from '@/components/upload/index' // upload为false时需加上
export default { export default {
components: { components: {
'take-photo': takePhoto 'take-photo': takePhoto
}, },
mixins: [baseFile], // upload为false时需加上
data() { data() {
return { return {
takeStatus: false, takeStatus: false,
...@@ -86,6 +88,11 @@ export default { ...@@ -86,6 +88,11 @@ export default {
// 拍照完成或关闭相机 // 拍照完成或关闭相机
closeTake(images) { closeTake(images) {
this.takeStatus = false this.takeStatus = false
// upload为false时处理
const files = images.map(v => v.path)
const value = await this.saveToTask(files)
console.log("value", value)
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment