ソースを参照

Merge branch 'master' of http://150.158.33.144:3000/lalalashen/MeetMateApp

ck110 2 週間 前
コミット
976d9f7393
2 ファイル変更7 行追加3 行削除
  1. 1 0
      pages/article/article.vue
  2. 6 3
      pages/my/managePhoto.vue

+ 1 - 0
pages/article/article.vue

@@ -137,6 +137,7 @@
 						'sign': getApp().globalData.headerSign
 					},
 					success: (res) => {
+						console.log('请求了qqqqqqqqq');
 						if (res.data.list == undefined || res.data.list == null) {
 							res.data.list = []
 						}

+ 6 - 3
pages/my/managePhoto.vue

@@ -11,7 +11,7 @@
 					<image class="add" src="../../static/me/icon_add.png" mode="widthFix" />
 				</view>
 			</view>
-			<view class="tips">*最多上传5张图片</view>
+			<view class="tips">*最多上传{{maxImageCount}}张图片</view>
 
 			<view class="blankHeight"></view>
 		</view>
@@ -25,6 +25,7 @@
 </template>
 
 <script>
+import { isArray } from '../../uni_modules/cl-uni/utils';
 	export default {
 		components: {},
 		data() {
@@ -35,6 +36,7 @@
 					'xx', 'ff', 'vv'
 				],
 				list: [],
+				maxImageCount:5
 			}
 		},
 		onLoad() {
@@ -134,15 +136,16 @@
 			upload() {
 				console.log("----upload");
 				var that = this;
-				if (this.list.length >= 5) {
+				if (this.list.length >= this.maxImageCount) {
 					uni.showToast({
 						title: "最多上传5张图片",
 						icon: 'none'
 					});
 					return;
 				}
+				let count = this.maxImageCount - this.list.length
 				uni.chooseImage({
-					count: 5,
+					count,
 					sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
 					sourceType: ['album', 'camera'], //从相册、相机选择
 					extension: ['.png', '.jpeg', '.jpg'],