From 1eac768b76af5e987bef5e47798bd6dd1a9e8da0 Mon Sep 17 00:00:00 2001 From: linxi Date: Tue, 22 Oct 2024 09:26:21 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A2510=20=E3=80=90=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E3=80=91=E5=BA=97=E9=93=BA=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5-=E5=8F=91=E5=B8=83=E5=8A=A8=E6=80=81=EF=BC=8C?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E6=80=A7=E4=B8=8A=E4=BC=A0=E5=A4=9A=E5=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=97=B6=E6=9C=80=E5=90=8E=E5=87=A0=E5=BC=A0?= =?UTF-8?q?=E4=BC=9A=E6=98=BE=E7=A4=BA=E4=B8=8A=E4=BC=A0=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E4=B8=BA0%=EF=BC=8C=E4=BD=86=E7=82=B9=E5=87=BB=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E5=90=8E=E6=89=80=E6=9C=89=E5=9B=BE=E7=89=87=E9=83=BD?= =?UTF-8?q?=E8=83=BD=E6=AD=A3=E5=B8=B8=E5=9C=A8=E8=B5=84=E8=AE=AF=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/tm-upload/tm-upload.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/components/tm-upload/tm-upload.vue b/components/tm-upload/tm-upload.vue index 9c26e5f..1ef692d 100644 --- a/components/tm-upload/tm-upload.vue +++ b/components/tm-upload/tm-upload.vue @@ -7,11 +7,11 @@ class="sunui-uploader-file" /> - + x - {{item.upload_percent}}% + @@ -185,6 +185,7 @@ export default { if (Math.ceil(res.size / 1024) < this.upload_video_max * 1024) { await this.upload_img_size.push(Math.ceil(res.size / 1024)); await this.upload_before_list.push(res); + this.$forceUpdate() } else { this.upload_exceeded_list.push(1); @@ -219,6 +220,7 @@ export default { if (Math.ceil(res.tempFiles[i].size / 1024) < this.upload_max * 1024) { await this.upload_img_size.push(Math.ceil(res.tempFiles[i].size / 1024)); await this.upload_before_list.push(res.tempFiles[i]); + this.$forceUpdate() // TODO v3.1增加图片格式限制 } else { res.tempFilePaths.splice(i, 1); @@ -239,6 +241,7 @@ export default { } this.upload_cache = await res.tempFilePaths; this.upload(this.upload_auto); + this.$forceUpdate() }, fail: (err) => { console.log(err); @@ -338,7 +341,12 @@ export default { uploadTask.onProgressUpdate(async (res) => { // this.upload_before_list[this.upload_before_list.length-1].upload_percent = await res.progress; - for(let i in this.upload_before_list) { if(this.upload_before_list[i].upload_percent != 100) { this.upload_before_list[i].upload_percent = await res.progress; break; } }; + for (let i in this.upload_before_list) { + if (this.upload_before_list[i].upload_percent != 100) { + console.log(res.progress, '-----------res.progress-----------'); + this.upload_before_list[i].upload_percent = await res.progress + } + }; }); } }