//获取地址
mui('#openFile')[0].addEventListener('tap',function(){
openFile("http://192.168.1.98/test.doc");
});
//文件下载及打开第三方软件预览
function openFile(url){
var wait = plus.nativeUI.showWaiting("正在打开文件...");
var dtask = plus.downloader.createDownload(url, {method: "GET"}, function(d, status) {
if (status == 200) {
plus.runtime.openFile(d.filename, {}, function(e){
wait.close();
mui.toast('无法打开文件!');
});
wait.close();
} else {
wait.close();
mui.toast('打开文件失败!');
}
});
dtask.start();
}