Compare commits
1 Commits
42ae7e0ccd
...
e9f43fe770
Author | SHA1 | Date |
---|---|---|
|
e9f43fe770 |
|
@ -1,93 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the 'License');
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an 'AS IS' BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ImageKnifeComponent } from '@ohos/libraryimageknife'
|
|
||||||
@Entry
|
|
||||||
@Component
|
|
||||||
struct ErrorMessageDownload {
|
|
||||||
@State httpCode: string = ''
|
|
||||||
@State httpError: string = ''
|
|
||||||
@State storageError: string = ''
|
|
||||||
@State fileError: string = ''
|
|
||||||
@State notPic: string = ''
|
|
||||||
build() {
|
|
||||||
Column() {
|
|
||||||
Text(this.httpCode)
|
|
||||||
ImageKnifeComponent({
|
|
||||||
imageKnifeOption:{
|
|
||||||
loadSrc:'https://gitee.com/openharmony-tpc/ImageKnife/issues/1111111',
|
|
||||||
errorholderSrc:$r('app.media.failed'),
|
|
||||||
onLoadListener:{
|
|
||||||
onLoadFailed:(err)=>{
|
|
||||||
this.httpCode = err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).width(100).height(100).margin({bottom:10})
|
|
||||||
|
|
||||||
Text(this.httpError)
|
|
||||||
ImageKnifeComponent({
|
|
||||||
imageKnifeOption:{
|
|
||||||
loadSrc:'https://xx.xx.xx',
|
|
||||||
errorholderSrc:$r('app.media.failed'),
|
|
||||||
onLoadListener:{
|
|
||||||
onLoadFailed:(err)=>{
|
|
||||||
this.httpError = err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).width(100).height(100).margin({bottom:10})
|
|
||||||
|
|
||||||
Text(this.storageError)
|
|
||||||
ImageKnifeComponent({
|
|
||||||
imageKnifeOption:{
|
|
||||||
loadSrc:'/data/storage/el2/base/haps/entry/cache/a/b',
|
|
||||||
errorholderSrc:$r('app.media.failed'),
|
|
||||||
onLoadListener:{
|
|
||||||
onLoadFailed:(err)=>{
|
|
||||||
this.storageError = err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).width(100).height(100).margin({bottom:10})
|
|
||||||
|
|
||||||
Text(this.fileError)
|
|
||||||
ImageKnifeComponent({
|
|
||||||
imageKnifeOption:{
|
|
||||||
loadSrc:'file://xx.xx.xx',
|
|
||||||
errorholderSrc:$r('app.media.failed'),
|
|
||||||
onLoadListener:{
|
|
||||||
onLoadFailed:(err)=>{
|
|
||||||
this.fileError = err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).width(100).height(100).margin({bottom:10})
|
|
||||||
|
|
||||||
Text(this.notPic)
|
|
||||||
ImageKnifeComponent({
|
|
||||||
imageKnifeOption:{
|
|
||||||
loadSrc:'xx.xx.xx',
|
|
||||||
errorholderSrc:$r('app.media.failed'),
|
|
||||||
onLoadListener:{
|
|
||||||
onLoadFailed:(err)=>{
|
|
||||||
this.notPic = err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).width(100).height(100).margin({bottom:10})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -88,11 +88,6 @@ struct Index {
|
||||||
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
Button($r('app.string.Error_Message')).margin({top:10}).onClick(()=>{
|
|
||||||
router.push({
|
|
||||||
uri: 'pages/ErrorMessageDownload',
|
|
||||||
});
|
|
||||||
})
|
|
||||||
Button($r('app.string.Test_custom_download')).margin({top:10}).onClick(()=>{
|
Button($r('app.string.Test_custom_download')).margin({top:10}).onClick(()=>{
|
||||||
router.push({
|
router.push({
|
||||||
uri: 'pages/TestSetCustomImagePage',
|
uri: 'pages/TestSetCustomImagePage',
|
||||||
|
|
|
@ -683,10 +683,6 @@
|
||||||
{
|
{
|
||||||
"name": "Multiple_CallBack",
|
"name": "Multiple_CallBack",
|
||||||
"value": "Multiple image callback"
|
"value": "Multiple image callback"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Error_Message",
|
|
||||||
"value": "error message"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -41,7 +41,6 @@
|
||||||
"pages/AutoImageFit",
|
"pages/AutoImageFit",
|
||||||
"pages/SingleImageCallBack",
|
"pages/SingleImageCallBack",
|
||||||
"pages/MultipleImageCallBack",
|
"pages/MultipleImageCallBack",
|
||||||
"pages/LocalImage",
|
"pages/LocalImage"
|
||||||
"pages/ErrorMessageDownload"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -675,10 +675,6 @@
|
||||||
{
|
{
|
||||||
"name": "Multiple_CallBack",
|
"name": "Multiple_CallBack",
|
||||||
"value": "多张图片回调"
|
"value": "多张图片回调"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Error_Message",
|
|
||||||
"value": "错误信息"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
Loading…
Reference in New Issue