From e31c592ee4d7388007c1ef38ec53fb8347c1629b Mon Sep 17 00:00:00 2001 From: tyBrave Date: Wed, 16 Oct 2024 15:56:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9onLoadCancel=E5=9B=9E?= =?UTF-8?q?=E8=B0=83demo=E5=8F=8A=E5=85=B6=E7=BC=93=E5=AD=98=E4=B8=AD?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=9B=BE=E7=89=87=E7=9A=84=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tyBrave --- entry/src/main/ets/pages/LoadStatePage.ets | 4 +++- entry/src/main/ets/pages/TestLoadCancelListenerPage.ets | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/entry/src/main/ets/pages/LoadStatePage.ets b/entry/src/main/ets/pages/LoadStatePage.ets index 2c0c4d8..a697c75 100644 --- a/entry/src/main/ets/pages/LoadStatePage.ets +++ b/entry/src/main/ets/pages/LoadStatePage.ets @@ -79,7 +79,9 @@ struct LoadStatePage { }) } .margin({ top: 20 }) - Text(this.typeValue) + Text("格式:"+this.typeValue) + Text("宽度:"+this.currentWidth) + Text("高度:"+this.currentHeight) ImageKnifeComponent({ imageKnifeOption: this.ImageKnifeOption }).height(this.currentHeight).width(this.currentWidth) .margin({ top: 20 }) Button($r('app.string.Custom_download_failed')).onClick(()=>{ diff --git a/entry/src/main/ets/pages/TestLoadCancelListenerPage.ets b/entry/src/main/ets/pages/TestLoadCancelListenerPage.ets index cc071b3..d6d1685 100644 --- a/entry/src/main/ets/pages/TestLoadCancelListenerPage.ets +++ b/entry/src/main/ets/pages/TestLoadCancelListenerPage.ets @@ -38,10 +38,10 @@ struct TestLoadCancelListenerPage { loadSrc: "https://q7.itc.cn/images01/20240223/ce80229bf9934dff97cdf2ad7be1dcb8.jpeg", objectFit: ImageFit.Contain, onLoadListener: { - onLoadStart: (data) => { + onLoadStart: () => { this.showChild = false; }, - onLoadCancel: (res, data) => { + onLoadCancel: (res) => { this.text = "onLoadCancel回调成功,网络nLoadCancel回调原因:" + res console.log("TestLoadCancelListenerPage----onLoadCancel> url:" + res) } @@ -66,10 +66,10 @@ struct TestLoadCancelListenerPage { loadSrc: $r('app.media.loading'), objectFit: ImageFit.Contain, onLoadListener: { - onLoadStart: (data) => { + onLoadStart: () => { this.showChild = false; }, - onLoadCancel: (res, data) => { + onLoadCancel: (res) => { this.text = "onLoadCancel回调成功,本地onLoadCancel回调原因:" + res console.log("TestLoadCancelListenerPage----onLoadCancel> url:" + res) }