!21 ImageKnife新增本地沙盒图片文件加载能力
Merge pull request !21 from zhoulisheng1/master
This commit is contained in:
commit
01c960daba
|
@ -60,7 +60,7 @@ struct Index {
|
||||||
build() {
|
build() {
|
||||||
Scroll() {
|
Scroll() {
|
||||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||||
ImageKnifeComponent({ imageKnifeOption: $imageKnifeOption1 })
|
ImageKnifeComponent({ imageKnifeOption: this.imageKnifeOption1 })
|
||||||
.width(300) // 自定义组件支持通用属性链式调用,可以直接设置宽高
|
.width(300) // 自定义组件支持通用属性链式调用,可以直接设置宽高
|
||||||
.height(300)
|
.height(300)
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ struct IndexFunctionDemo {
|
||||||
Scroll() {
|
Scroll() {
|
||||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||||
Text("简单示例:加载一张gif图片").fontSize(15)
|
Text("简单示例:加载一张gif图片").fontSize(15)
|
||||||
ImageKnifeComponent({ imageKnifeOption: $imageKnifeOption })
|
ImageKnifeComponent({ imageKnifeOption: this.imageKnifeOption })
|
||||||
.width(300) // 自定义组件支持通用属性链式调用,可以直接设置宽高
|
.width(300) // 自定义组件支持通用属性链式调用,可以直接设置宽高
|
||||||
.height(300)
|
.height(300)
|
||||||
}
|
}
|
||||||
|
@ -254,7 +254,7 @@ struct Index {
|
||||||
build() {
|
build() {
|
||||||
Scroll() {
|
Scroll() {
|
||||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||||
ImageKnifeComponent({ imageKnifeOption: $imageKnifeOption1 })
|
ImageKnifeComponent({ imageKnifeOption: this.imageKnifeOption1 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.width('100%')
|
.width('100%')
|
||||||
|
|
|
@ -61,7 +61,7 @@ struct IndexFunctionDemo {
|
||||||
Button("加载GIF")
|
Button("加载GIF")
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.imageKnifeOption2 = {
|
this.imageKnifeOption2 = {
|
||||||
loadSrc: 'https://pic.ibaotu.com/gif/18/17/16/51u888piCtqj.gif!fwpaa70/fw/700',
|
loadSrc: 'https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658',
|
||||||
|
|
||||||
placeholderSrc: $r('app.media.icon_loading'),
|
placeholderSrc: $r('app.media.icon_loading'),
|
||||||
errorholderSrc: $r('app.media.icon_failed'),
|
errorholderSrc: $r('app.media.icon_failed'),
|
||||||
|
|
|
@ -58,7 +58,7 @@ struct TestGifDontAnimatePage {
|
||||||
Button('网络资源gif')
|
Button('网络资源gif')
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
this.imageKnifeOption1 = {
|
this.imageKnifeOption1 = {
|
||||||
loadSrc: 'https://pic.ibaotu.com/gif/18/17/16/51u888piCtqj.gif!fwpaa70/fw/700',
|
loadSrc: 'https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658',
|
||||||
placeholderSrc: $r('app.media.icon_loading'),
|
placeholderSrc: $r('app.media.icon_loading'),
|
||||||
errorholderSrc: $r('app.media.icon_failed'),
|
errorholderSrc: $r('app.media.icon_failed'),
|
||||||
};
|
};
|
||||||
|
@ -66,7 +66,7 @@ struct TestGifDontAnimatePage {
|
||||||
Button('网络资源gif静态')
|
Button('网络资源gif静态')
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
this.imageKnifeOption1 = {
|
this.imageKnifeOption1 = {
|
||||||
loadSrc: 'https://pic.ibaotu.com/gif/18/17/16/51u888piCtqj.gif!fwpaa70/fw/700',
|
loadSrc: 'https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658',
|
||||||
placeholderSrc: $r('app.media.icon_loading'),
|
placeholderSrc: $r('app.media.icon_loading'),
|
||||||
errorholderSrc: $r('app.media.icon_failed'),
|
errorholderSrc: $r('app.media.icon_failed'),
|
||||||
dontAnimateFlag:true
|
dontAnimateFlag:true
|
||||||
|
|
|
@ -150,7 +150,7 @@ struct TestImageKnifeOptionChangedPage {
|
||||||
Button('gif')
|
Button('gif')
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
this.imageKnifeOption1 = {
|
this.imageKnifeOption1 = {
|
||||||
loadSrc: 'https://pic.ibaotu.com/gif/18/17/16/51u888piCtqj.gif!fwpaa70/fw/700',
|
loadSrc: 'https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658',
|
||||||
|
|
||||||
placeholderSrc: $r('app.media.icon_loading'),
|
placeholderSrc: $r('app.media.icon_loading'),
|
||||||
errorholderSrc: $r('app.media.icon_failed')
|
errorholderSrc: $r('app.media.icon_failed')
|
||||||
|
|
|
@ -148,7 +148,7 @@ struct TestPreloadPage {
|
||||||
Button('预加载网络资源gif')
|
Button('预加载网络资源gif')
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
let request = new RequestOption();
|
let request = new RequestOption();
|
||||||
request.load('https://pic.ibaotu.com/gif/18/17/16/51u888piCtqj.gif!fwpaa70/fw/700')
|
request.load('https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658')
|
||||||
.setImageViewSize({ width: 300, height: 300 })
|
.setImageViewSize({ width: 300, height: 300 })
|
||||||
.addListener((err, data) => {
|
.addListener((err, data) => {
|
||||||
if (err && err.length > 0) {
|
if (err && err.length > 0) {
|
||||||
|
@ -166,7 +166,7 @@ struct TestPreloadPage {
|
||||||
Button('网络资源gif')
|
Button('网络资源gif')
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.imageKnifeOption1 = {
|
this.imageKnifeOption1 = {
|
||||||
loadSrc: 'https://pic.ibaotu.com/gif/18/17/16/51u888piCtqj.gif!fwpaa70/fw/700',
|
loadSrc: 'https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658',
|
||||||
|
|
||||||
placeholderSrc: $r('app.media.icon_loading'),
|
placeholderSrc: $r('app.media.icon_loading'),
|
||||||
errorholderSrc: $r('app.media.icon_failed'),
|
errorholderSrc: $r('app.media.icon_failed'),
|
||||||
|
@ -179,7 +179,7 @@ struct TestPreloadPage {
|
||||||
Button('预加载网络资源gif静态')
|
Button('预加载网络资源gif静态')
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
let request = new RequestOption();
|
let request = new RequestOption();
|
||||||
request.load('https://pic.ibaotu.com/gif/18/17/16/51u888piCtqj.gif!fwpaa70/fw/700')
|
request.load('https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658')
|
||||||
.setImageViewSize({ width: 300, height: 300 })
|
.setImageViewSize({ width: 300, height: 300 })
|
||||||
.dontAnimate()
|
.dontAnimate()
|
||||||
.addListener((err, data) => {
|
.addListener((err, data) => {
|
||||||
|
@ -198,7 +198,7 @@ struct TestPreloadPage {
|
||||||
Button('网络资源gif静态')
|
Button('网络资源gif静态')
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.imageKnifeOption1 = {
|
this.imageKnifeOption1 = {
|
||||||
loadSrc: 'https://pic.ibaotu.com/gif/18/17/16/51u888piCtqj.gif!fwpaa70/fw/700',
|
loadSrc: 'https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658',
|
||||||
|
|
||||||
placeholderSrc: $r('app.media.icon_loading'),
|
placeholderSrc: $r('app.media.icon_loading'),
|
||||||
errorholderSrc: $r('app.media.icon_failed'),
|
errorholderSrc: $r('app.media.icon_failed'),
|
||||||
|
|
|
@ -13,110 +13,29 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IDataFetch } from "../networkmanage/IDataFetch"
|
import { IDataFetch } from '../networkmanage/IDataFetch'
|
||||||
import { RequestOption } from "../RequestOption"
|
import { RequestOption } from '../RequestOption'
|
||||||
import { Md5 } from "../../cache/Md5"
|
import { Md5 } from '../../cache/Md5'
|
||||||
import { FileUtils } from "../../cache/FileUtils"
|
import { FileUtils } from '../../cache/FileUtils'
|
||||||
|
import { NetworkDownloadClient } from './NetworkDownloadClient'
|
||||||
|
import { LoadLocalFileClient } from './LoadLocalFileClient'
|
||||||
import loadRequest from '@ohos.request';
|
import loadRequest from '@ohos.request';
|
||||||
|
|
||||||
|
// 数据加载器
|
||||||
export class DownloadClient implements IDataFetch {
|
export class DownloadClient implements IDataFetch {
|
||||||
|
private networkClient = new NetworkDownloadClient();
|
||||||
|
private localFileClient = new LoadLocalFileClient();
|
||||||
|
|
||||||
loadData(request: RequestOption, onCompleteFunction, onErrorFunction) {
|
loadData(request: RequestOption, onCompleteFunction, onErrorFunction) {
|
||||||
|
if (typeof request.loadSrc == 'string') {
|
||||||
let filename = Md5.hashStr(request.generateDataKey);
|
if (request.loadSrc.startsWith(globalThis.ImageKnife.getImageKnifeContext()
|
||||||
let downloadFolder = request.getFilesPath() + "/" + request.networkCacheFolder;
|
.filesDir) || request.loadSrc.startsWith(globalThis.ImageKnife.getImageKnifeContext().cacheDir)) {
|
||||||
let allpath = request.getFilesPath() + "/" + request.networkCacheFolder + "/" + filename + ".img";
|
// 本地沙盒
|
||||||
|
this.localFileClient.loadData(request, onCompleteFunction, onErrorFunction)
|
||||||
if (!FileUtils.getInstance().existFolder(downloadFolder)) {
|
|
||||||
FileUtils.getInstance().createFolder(downloadFolder)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FileUtils.getInstance().exist(allpath)) {
|
|
||||||
FileUtils.getInstance().deleteFile(allpath)
|
|
||||||
}
|
|
||||||
|
|
||||||
let desc = filename + ".img";
|
|
||||||
var downloadConfig = {
|
|
||||||
url: (request.loadSrc as string),
|
|
||||||
filePath: allpath,
|
|
||||||
};
|
|
||||||
|
|
||||||
let loadTask = null;
|
|
||||||
loadRequest.download(globalThis.ImageKnife.getImageKnifeContext(), downloadConfig).then(downloadTask => {
|
|
||||||
if (downloadTask) {
|
|
||||||
loadTask = downloadTask;
|
|
||||||
|
|
||||||
loadTask.on('progress', (receivedSize, totalSize) => {
|
|
||||||
if(totalSize > 0) {
|
|
||||||
// 并不是所有服务器都会返回totalSize 当没有文件大小的时候,下载进度没有百分比回调,只能知道目前下载了多少数据量
|
|
||||||
let percent = Math.round(((receivedSize * 1.0) / (totalSize * 1.0)) * 100)
|
|
||||||
if (request.progressFunc) {
|
|
||||||
request.progressFunc(percent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
loadTask.on('complete', () => {
|
|
||||||
let downloadPath = allpath;
|
|
||||||
request.downloadFilePath = downloadPath;
|
|
||||||
let arraybuffer = FileUtils.getInstance().readFilePic(downloadPath)
|
|
||||||
onCompleteFunction(arraybuffer);
|
|
||||||
FileUtils.getInstance().deleteFile(downloadPath);
|
|
||||||
|
|
||||||
loadTask.off('complete', () => {
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
loadTask.off('pause', () => {
|
|
||||||
})
|
|
||||||
|
|
||||||
loadTask.off('remove', () => {
|
|
||||||
})
|
|
||||||
|
|
||||||
loadTask.off('progress', () => {
|
|
||||||
})
|
|
||||||
|
|
||||||
loadTask.off('fail', () => {
|
|
||||||
})
|
|
||||||
loadTask = null;
|
|
||||||
})
|
|
||||||
|
|
||||||
loadTask.on('pause', () => {
|
|
||||||
})
|
|
||||||
|
|
||||||
loadTask.on('remove', () => {
|
|
||||||
})
|
|
||||||
|
|
||||||
loadTask.on('fail', (err) => {
|
|
||||||
onErrorFunction('DownloadClient Download task fail err =' + err)
|
|
||||||
if (loadTask) {
|
|
||||||
loadTask.remove().then(result => {
|
|
||||||
loadTask.off('complete', () => {
|
|
||||||
})
|
|
||||||
|
|
||||||
loadTask.off('pause', () => {
|
|
||||||
})
|
|
||||||
|
|
||||||
loadTask.off('remove', () => {
|
|
||||||
})
|
|
||||||
|
|
||||||
loadTask.off('progress', () => {
|
|
||||||
})
|
|
||||||
|
|
||||||
loadTask.off('fail', () => {
|
|
||||||
})
|
|
||||||
loadTask = null
|
|
||||||
}).catch(err => {
|
|
||||||
loadTask = null;
|
|
||||||
console.log('DownloadClient Download task fail err =' + err);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
onErrorFunction('DownloadClient downloadTask dismiss!')
|
// 网络下载
|
||||||
|
this.networkClient.loadData(request, onCompleteFunction, onErrorFunction)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).catch((err) => {
|
|
||||||
onErrorFunction(err)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -13,9 +13,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {RequestOption} from "../RequestOption"
|
import { RequestOption } from '../RequestOption'
|
||||||
|
|
||||||
// 网络接口
|
// 资源加载接口
|
||||||
export interface IDataFetch {
|
export interface IDataFetch {
|
||||||
loadData(request: RequestOption, onCompleteFunction, onErrorFunction);
|
loadData(request: RequestOption, onComplete: (img: ArrayBuffer) => void, onError: (err: string) => void);
|
||||||
}
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 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 { IDataFetch } from '../networkmanage/IDataFetch'
|
||||||
|
import { RequestOption } from '../RequestOption'
|
||||||
|
import { Md5 } from '../../cache/Md5'
|
||||||
|
import { FileUtils } from '../../cache/FileUtils'
|
||||||
|
import loadRequest from '@ohos.request';
|
||||||
|
|
||||||
|
export class LoadLocalFileClient {
|
||||||
|
loadData(request: RequestOption, onComplete: (img: ArrayBuffer) => void, onError: (err: string) => void) {
|
||||||
|
if (typeof request.loadSrc == 'string') {
|
||||||
|
let fileBuffer = FileUtils.getInstance().readFilePic(request.loadSrc)
|
||||||
|
if (fileBuffer == null || fileBuffer.byteLength <= 0) {
|
||||||
|
onError('LoadLocalFileClient loadLocalFileData The File Does Not Exist!Check The File!')
|
||||||
|
} else {
|
||||||
|
onComplete(fileBuffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,118 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 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 { IDataFetch } from '../networkmanage/IDataFetch'
|
||||||
|
import { RequestOption } from '../RequestOption'
|
||||||
|
import { Md5 } from '../../cache/Md5'
|
||||||
|
import { FileUtils } from '../../cache/FileUtils'
|
||||||
|
import loadRequest from '@ohos.request';
|
||||||
|
|
||||||
|
// 数据加载器
|
||||||
|
export class NetworkDownloadClient {
|
||||||
|
loadData(request: RequestOption, onComplete: (img: ArrayBuffer) => void, onError: (err: string) => void) {
|
||||||
|
let filename = Md5.hashStr(request.generateDataKey);
|
||||||
|
let downloadFolder = request.getFilesPath() + "/" + request.networkCacheFolder;
|
||||||
|
let allpath = request.getFilesPath() + "/" + request.networkCacheFolder + "/" + filename + ".img";
|
||||||
|
if (!FileUtils.getInstance().existFolder(downloadFolder)) {
|
||||||
|
FileUtils.getInstance().createFolder(downloadFolder)
|
||||||
|
}
|
||||||
|
if (FileUtils.getInstance().exist(allpath)) {
|
||||||
|
FileUtils.getInstance().deleteFile(allpath)
|
||||||
|
}
|
||||||
|
var downloadConfig = {
|
||||||
|
url: (request.loadSrc as string),
|
||||||
|
filePath: allpath,
|
||||||
|
};
|
||||||
|
let loadTask = null;
|
||||||
|
loadRequest.download(globalThis.ImageKnife.getImageKnifeContext(), downloadConfig).then(downloadTask => {
|
||||||
|
if (downloadTask) {
|
||||||
|
loadTask = downloadTask;
|
||||||
|
|
||||||
|
loadTask.on('progress', (receivedSize, totalSize) => {
|
||||||
|
if (totalSize > 0) {
|
||||||
|
// 并不是所有服务器都会返回totalSize 当没有文件大小的时候,下载进度没有百分比回调,只能知道目前下载了多少数据量
|
||||||
|
let percent = Math.round(((receivedSize * 1.0) / (totalSize * 1.0)) * 100)
|
||||||
|
if (request.progressFunc) {
|
||||||
|
request.progressFunc(percent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
loadTask.on('complete', () => {
|
||||||
|
let downloadPath = allpath;
|
||||||
|
request.downloadFilePath = downloadPath;
|
||||||
|
let arraybuffer = FileUtils.getInstance().readFilePic(downloadPath)
|
||||||
|
onComplete(arraybuffer);
|
||||||
|
FileUtils.getInstance().deleteFile(downloadPath);
|
||||||
|
|
||||||
|
loadTask.off('complete', () => {
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
loadTask.off('pause', () => {
|
||||||
|
})
|
||||||
|
|
||||||
|
loadTask.off('remove', () => {
|
||||||
|
})
|
||||||
|
|
||||||
|
loadTask.off('progress', () => {
|
||||||
|
})
|
||||||
|
|
||||||
|
loadTask.off('fail', () => {
|
||||||
|
})
|
||||||
|
loadTask = null;
|
||||||
|
})
|
||||||
|
|
||||||
|
loadTask.on('pause', () => {
|
||||||
|
})
|
||||||
|
|
||||||
|
loadTask.on('remove', () => {
|
||||||
|
})
|
||||||
|
|
||||||
|
loadTask.on('fail', (err) => {
|
||||||
|
onError('NetworkDownloadClient Download task fail err =' + err)
|
||||||
|
if (loadTask) {
|
||||||
|
loadTask.remove().then(result => {
|
||||||
|
loadTask.off('complete', () => {
|
||||||
|
})
|
||||||
|
|
||||||
|
loadTask.off('pause', () => {
|
||||||
|
})
|
||||||
|
|
||||||
|
loadTask.off('remove', () => {
|
||||||
|
})
|
||||||
|
|
||||||
|
loadTask.off('progress', () => {
|
||||||
|
})
|
||||||
|
|
||||||
|
loadTask.off('fail', () => {
|
||||||
|
})
|
||||||
|
loadTask = null
|
||||||
|
}).catch(err => {
|
||||||
|
loadTask = null;
|
||||||
|
console.log('NetworkDownloadClient Download task fail err =' + err);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
} else {
|
||||||
|
onError('NetworkDownloadClient downloadTask dismiss!')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
onError("下载子系统download错误捕获,error="+err.message);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
|
@ -190,7 +190,10 @@ export class RequestManager {
|
||||||
let success = (arraybuffer) => {
|
let success = (arraybuffer) => {
|
||||||
this.downloadSuccess(arraybuffer, onComplete, onError)
|
this.downloadSuccess(arraybuffer, onComplete, onError)
|
||||||
}
|
}
|
||||||
this.mIDataFetch.loadData(request, success, onError);
|
let error = (errorMsg:string) =>{
|
||||||
|
onError(errorMsg)
|
||||||
|
}
|
||||||
|
this.mIDataFetch.loadData(request, success, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载本地资源
|
// 加载本地资源
|
||||||
|
|
Loading…
Reference in New Issue