|
@@ -24,7 +24,7 @@
|
|
|
<image class="add" src="../../static/me/icon_add.png" mode="widthFix" />
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="tips">*最多上传6张图片</view>
|
|
|
+ <view class="tips">*最多上传{{maxImageCount}}张图片</view>
|
|
|
|
|
|
<view class="blankHeight"></view>
|
|
|
</view>
|
|
@@ -46,6 +46,7 @@
|
|
|
],
|
|
|
content: '',
|
|
|
list: [],
|
|
|
+ maxImageCount:6
|
|
|
}
|
|
|
},
|
|
|
onLoad() {},
|
|
@@ -131,15 +132,16 @@
|
|
|
upload() {
|
|
|
console.log("----upload");
|
|
|
var that = this;
|
|
|
- if (this.list.length >= 6) {
|
|
|
+ if (this.list.length >= this.maxImageCount) {
|
|
|
uni.showToast({
|
|
|
- title: "最多上传6张图片",
|
|
|
+ title: `最多上传${this.maxImageCount}张图片`,
|
|
|
icon: 'none'
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
+ let count = this.maxImageCount - this.list.length
|
|
|
uni.chooseImage({
|
|
|
- count: 6,
|
|
|
+ count,
|
|
|
sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
sourceType: ['album', 'camera'], //从相册、相机选择
|
|
|
extension: ['.png', '.jpeg', '.jpg'],
|