forked from floraachy/ImageKnife
修改onLoadCancel回调demo及其缓存中获取图片的格式大小信息
Signed-off-by: tyBrave <tianyong21@h-partners.com>
This commit is contained in:
parent
1027fc0304
commit
e31c592ee4
|
@ -79,7 +79,9 @@ struct LoadStatePage {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
.margin({ top: 20 })
|
.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)
|
ImageKnifeComponent({ imageKnifeOption: this.ImageKnifeOption }).height(this.currentHeight).width(this.currentWidth)
|
||||||
.margin({ top: 20 })
|
.margin({ top: 20 })
|
||||||
Button($r('app.string.Custom_download_failed')).onClick(()=>{
|
Button($r('app.string.Custom_download_failed')).onClick(()=>{
|
||||||
|
|
|
@ -38,10 +38,10 @@ struct TestLoadCancelListenerPage {
|
||||||
loadSrc: "https://q7.itc.cn/images01/20240223/ce80229bf9934dff97cdf2ad7be1dcb8.jpeg",
|
loadSrc: "https://q7.itc.cn/images01/20240223/ce80229bf9934dff97cdf2ad7be1dcb8.jpeg",
|
||||||
objectFit: ImageFit.Contain,
|
objectFit: ImageFit.Contain,
|
||||||
onLoadListener: {
|
onLoadListener: {
|
||||||
onLoadStart: (data) => {
|
onLoadStart: () => {
|
||||||
this.showChild = false;
|
this.showChild = false;
|
||||||
},
|
},
|
||||||
onLoadCancel: (res, data) => {
|
onLoadCancel: (res) => {
|
||||||
this.text = "onLoadCancel回调成功,网络nLoadCancel回调原因:" + res
|
this.text = "onLoadCancel回调成功,网络nLoadCancel回调原因:" + res
|
||||||
console.log("TestLoadCancelListenerPage----onLoadCancel> url:" + res)
|
console.log("TestLoadCancelListenerPage----onLoadCancel> url:" + res)
|
||||||
}
|
}
|
||||||
|
@ -66,10 +66,10 @@ struct TestLoadCancelListenerPage {
|
||||||
loadSrc: $r('app.media.loading'),
|
loadSrc: $r('app.media.loading'),
|
||||||
objectFit: ImageFit.Contain,
|
objectFit: ImageFit.Contain,
|
||||||
onLoadListener: {
|
onLoadListener: {
|
||||||
onLoadStart: (data) => {
|
onLoadStart: () => {
|
||||||
this.showChild = false;
|
this.showChild = false;
|
||||||
},
|
},
|
||||||
onLoadCancel: (res, data) => {
|
onLoadCancel: (res) => {
|
||||||
this.text = "onLoadCancel回调成功,本地onLoadCancel回调原因:" + res
|
this.text = "onLoadCancel回调成功,本地onLoadCancel回调原因:" + res
|
||||||
console.log("TestLoadCancelListenerPage----onLoadCancel> url:" + res)
|
console.log("TestLoadCancelListenerPage----onLoadCancel> url:" + res)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue