提交 7022f610 编写于 作者: Q qiang

fix(App): openDocument callback

上级 2e64d756
import {
getRealPath
getRealPath,
warpPlusSuccessCallback,
warpPlusErrorCallback
} from '../util'
import {
invoke
} from '../../bridge'
export function openDocument ({
filePath,
fileType
} = {}, callbackId) {
plus.io.resolveLocalFileSystemURL(getRealPath(filePath), entry => {
plus.runtime.openFile(getRealPath(filePath))
invoke(callbackId, {
errMsg: 'openDocument:ok'
})
}, err => {
invoke(callbackId, {
errMsg: 'openDocument:fail ' + err.message
})
})
const successCallback = warpPlusSuccessCallback(callbackId, 'saveFile')
const errorCallback = warpPlusErrorCallback(callbackId, 'saveFile')
plus.runtime.openFile(getRealPath(filePath), undefined, errorCallback, successCallback)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册