Commit 4bf3746d authored by Damon's avatar Damon

拍照组件-增加拍照数量参数

parent 513d2c35
...@@ -71,6 +71,12 @@ ...@@ -71,6 +71,12 @@
default () { default () {
return true return true
} }
},
num: {
type: Number,
default () {
return 10
}
} }
}, },
components: { components: {
...@@ -116,7 +122,9 @@ ...@@ -116,7 +122,9 @@
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
getApp().trackPage('拍照页') getApp().trackPage('拍照页')
photo.allImages = [] photo.allImages = []
photo.currentItemLength = 0
const length = (this.num > 10 || this.num < 0 || typeof this.num !== 'number') ? 0 : 10 - this.num
photo.currentItemLength = length
// this.ctx = uni.createCameraContext(); // this.ctx = uni.createCameraContext();
this.updateTime() this.updateTime()
......
...@@ -18,6 +18,7 @@ uni.hideTabBar() ...@@ -18,6 +18,7 @@ uni.hideTabBar()
| 属性名 | 类型 | 默认值 | 可选值 | 说明 | | 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :-: | :-: | :-: | :-: | :-: | | :-: | :-: | :-: | :-: | :-: |
| update | Boolean | true | true/false | 是否默认上传 true:会自动上传好图片并返回绝对路径 false: 只返回临时路径,需要在父组件做上传动作 | | update | Boolean | true | true/false | 是否默认上传 true:会自动上传好图片并返回绝对路径 false: 只返回临时路径,需要在父组件做上传动作 |
| num | Number | 10 | 1-10 | 拍照数量,只能传1-10的正整数 |
| currentItem | Object | - | - | 对应的规范数据,用于获取示意图和水印,以及保存图片所需的ID **格式见下文** | | currentItem | Object | - | - | 对应的规范数据,用于获取示意图和水印,以及保存图片所需的ID **格式见下文** |
### currentItem 格式 ### currentItem 格式
......
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