wly 2 weken geleden
bovenliggende
commit
750468b48c
2 gewijzigde bestanden met toevoegingen van 7 en 4 verwijderingen
  1. 6 4
      pages/article/addArticle.vue
  2. 1 0
      pages/article/article.vue

+ 6 - 4
pages/article/addArticle.vue

@@ -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'],

+ 1 - 0
pages/article/article.vue

@@ -99,6 +99,7 @@
 
 		},
 		onShow() {
+			this.page = 1;
 			this.loadData();
 		},
 		methods: {