api.download({
url :url,
report : true,
cache : true
}, function(ret, err) {
if (ret && ret.state == 0) {
api.showProgress({
style: 'default',
animationType: 'fade',
title: '下载中...',
text: ret.percent + "%",
modal: true
});
}
if (ret && ret.state == 1) {
api.hideProgress();
// 下载完成
var savePath = ret.savePath;
api.installApp({
appUri : savePath
});
}
});
url :url,
report : true,
cache : true
}, function(ret, err) {
if (ret && ret.state == 0) {
api.showProgress({
style: 'default',
animationType: 'fade',
title: '下载中...',
text: ret.percent + "%",
modal: true
});
}
if (ret && ret.state == 1) {
api.hideProgress();
// 下载完成
var savePath = ret.savePath;
api.installApp({
appUri : savePath
});
}
});