Browse Source

bug修改

1004749546@qq.com 4 years ago
parent
commit
72f97a5822
1 changed files with 12 additions and 0 deletions
  1. 12 0
      pages/index/addData.vue

+ 12 - 0
pages/index/addData.vue

@@ -31,6 +31,9 @@
 						<view >
 							(最多3张)
 						</view>
+						<view >
+							(每张最大不超过10M)
+						</view>
 					</view>
 					<view v-show="photograph.length" v-for="(item,index) in photograph" :key="index" class="photograph-con">
 						<u-icon v-show="!isView" name="close-circle-fill" color="#fa3534" size="50" class="close-circle-icon" @click="cancelPhotograph(index)"></u-icon>
@@ -119,8 +122,16 @@
 				    sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
 				    sourceType: ['album','camera'], //从相册选择
 				    success:  (res) =>{
+						console.log(res,'rrrrrrrrrrr')
 				        console.log(JSON.stringify(res.tempFilePaths));
 						console.log(this.photograph.length,'this.photograph')
+						if(res.tempFiles[0].size>10485760){
+							uni.showToast({
+								title: '图片过大无法上传!',
+								icon: 'none'
+							})
+							return
+						}
 						uni.showLoading({
 							title:'正在保存图片...',
 							mask: true
@@ -278,6 +289,7 @@
 				flex-direction: column;
 				align-items: center;
 				color: #999999;
+				font-size: 24upx;
 			}
 			.photograph-con {
 				margin: 0 20upx;