|
本帖最后由 WangPiao 于 2016-11-21 10:36 编辑
iOS 路径怎么写?
var ft = new FileTransfer();
ft.download($("#imgBox").find("img").attr("src"), “路径”, function(entry) {
alert(entry.nativeURL);
image.httpToAlbum({
serverId :entry.nativeURL, //在app中通常是一个串行化的JSON对象,
success : function(res) {
alert(JSON.stringify(res));
zk.doToast('您的专属邀请海报已保存至相册!');
//cordova-plugin-file.Entry.remove
cordova.plugins.fileOpener2.open(res.localId, "image/", {
error : function() {
//justep.Util.hint("打开应用失败!");
},
success : function() {
//justep.Util.hint("打开应用成功!");
}
});
},
fail : function(res) {
zk.doToast('保存失败,请截图进行分享!1');
}
});
/* cordova.plugins.fileOpener2.open(entry.nativeURL, "image/", {
error : function() {
//justep.Util.hint("打开应用失败!");
},
success : function() {
//justep.Util.hint("打开应用成功!");
}
});*/
}, function(err) {
alert(JSON.stringify(err));
zk.doToast('保存失败,请截图进行分享!2');
}); |
|