Ver Fonte

判断是否是选择图片刷新

zs há 2 anos atrás
pai
commit
dba7f8fffd

+ 3 - 0
pagesMessage/message/components/submit_1.vue

@@ -76,17 +76,20 @@
 			sendImg(e) {
 				const that = this;
 				let serverUrl = that.$config.serverUrl;
+				that.$emit('choseImg', true);
 				uni.chooseImage({
 					count: 1,
 					sizeType: ['original', 'compressed'],
 					sourceType: ['album', 'camera'],
 					success: async function(res) {
+						that.$emit('choseImg', true);
 						let tempFile = JSON.parse(JSON.stringify(res.tempFilePaths));
 						const arr = await that.$apifile(`/point/upload`, 'file', tempFile[0], 'file');
 						if (arr.errcode == '0') {
 							let filePaths = serverUrl + arr.uri
 							that.send(filePaths, '1')
 						} else {
+							that.$emit('choseImg', false);
 							uni.showToast({
 								title: arr.errmsg,
 								icon: 'none'

+ 16 - 5
pagesMessage/message/info.vue

@@ -149,7 +149,8 @@
 				</scroll-view>
 			</view>
 			<view class="two">
-				<submit_1 @inputs="inputs" @heights="heights" @sendGoods="sendGoods" @sendOrder="sendOrder"></submit_1>
+				<submit_1 @choseImg="choseImg" @inputs="inputs" @heights="heights" @sendGoods="sendGoods"
+					@sendOrder="sendOrder"></submit_1>
 			</view>
 		</view>
 		<!-- 规格 -->
@@ -216,15 +217,20 @@
 				scrollToView: '', //滑动最后一条信息
 				// 规格弹框
 				popupShow: '1',
+				// 判断是否是选择图片刷新
+				is_img: false
 			};
 		},
 		onShow: async function() {
 			const that = this;
-			if (that.id) {
-				await that.clearPage();
-				await that.search()
+			// 判断是否是选择图片刷新
+			if (!that.is_img) {
+				if (that.id) {
+					await that.clearPage();
+					await that.search()
+				}
+				await that.searchOther();
 			}
-			await that.searchOther();
 		},
 		onLoad: async function(e) {
 			const that = this;
@@ -505,6 +511,11 @@
 					}
 				});
 			},
+			// 判断是否是选择图片刷新
+			choseImg(e) {
+				const that = this;
+				that.$set(that, `is_img`, e)
+			},
 			//接受输入内容
 			async inputs(e) {
 				const that = this;