@zscreate/zhxy-app-component 1.0.228 → 1.0.230
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -166,13 +166,18 @@ import {downloadFile, getOpenId, toAwait} from "../../utils/util";
|
|
|
166
166
|
success: function(res) {
|
|
167
167
|
try {
|
|
168
168
|
res = JSON.parse(res.data)
|
|
169
|
-
if (!res.success)
|
|
169
|
+
if (!res.success) {
|
|
170
|
+
return uni.showToast({
|
|
171
|
+
title: res.message || '文件上传失败',
|
|
172
|
+
icon: 'none'
|
|
173
|
+
})
|
|
174
|
+
}
|
|
170
175
|
} catch (e) {
|
|
171
176
|
if (e.toString().includes('JSON')) e = undefined
|
|
172
177
|
that.show = false
|
|
173
178
|
that.percent = 0
|
|
174
179
|
return uni.showToast({
|
|
175
|
-
title:
|
|
180
|
+
title: '文件上传失败',
|
|
176
181
|
icon: 'none'
|
|
177
182
|
})
|
|
178
183
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view>
|
|
3
|
-
<u-upload
|
|
3
|
+
<u-upload ref="uUpload" :file-list="fileList" :action="action" :deletable="!disabled"
|
|
4
4
|
@afterRead="afterRead"
|
|
5
5
|
@delete="onRemove"
|
|
6
6
|
:header="header"
|
|
@@ -46,7 +46,6 @@ export default {
|
|
|
46
46
|
},
|
|
47
47
|
data() {
|
|
48
48
|
return {
|
|
49
|
-
refresh: false,
|
|
50
49
|
percent: 0,
|
|
51
50
|
upimg: '',
|
|
52
51
|
maxCount: 8,
|
|
@@ -285,13 +284,15 @@ export default {
|
|
|
285
284
|
this.$emit('filePost', imgObj)
|
|
286
285
|
},
|
|
287
286
|
async onRemove(index, lists, name) {
|
|
288
|
-
|
|
289
|
-
this.refresh = true
|
|
290
287
|
if (typeof (index) === 'object') index = index.index
|
|
291
288
|
this.emitList.splice(index, 1);
|
|
292
289
|
this.fileList.splice(index, 1);
|
|
293
290
|
this.$emit('fileDelete', index)
|
|
294
|
-
this
|
|
291
|
+
await this.$nextTick()
|
|
292
|
+
|
|
293
|
+
setTimeout(() => {
|
|
294
|
+
this.showImage()
|
|
295
|
+
}, 0)
|
|
295
296
|
}
|
|
296
297
|
}
|
|
297
298
|
}
|