/**
* 网络图片转换成本地图片分享
*/
local_img_share(callback) {
var that = this
plus.nativeUI.showWaiting("分享中....")
var downloadUrl = that.imgUrl;
var downLoader = plus.downloader.createDownload(downloadUrl, {}, function (download, status) {
if (status == 200) {
plus.io.resolveLocalFileSystemURL(download.filename, function(entry) {
entry.file(callback);
// function(file) {
// console.log('file:')
// app.outSet(file)
//// videoMedia.src = sd_path;
//// videoMedia.autoplay = true;
//// videoMedia.controls = false;
//// videoMedia.load();
// }
}, function (e) {
plus.gallery.save(download.filename, callback, function (e) {
console.log("error:" + imgUrl + JSON.stringify(e));
});
});
plus.nativeUI.closeWaiting()
}
});
downLoader.start();
},
/**
-
分享操作
*/
shareImgAction(id, ex) {
var self = this
self.shareId = id
self.shareType = ex
self.updateSerivces()
self.local_img_share(self.shareImgHandle)
},
shareImgHandle(res) {
var self = thisself.local_img_url = res.fullPath console.log( self.local_img_url) var id = self.shareId var ex = self.shareType
// console.log('res')
// for (var x in res) {
// console.log(x + "=" + res[x]);
// }var s = null; if (!id || !(s = this.shares[id])) { return; } if (s.authenticated) { console.log("---已授权---"); self.shareURlMessage(s, ex); } else { console.log("---未授权---"); s.authorize(function () { self.shareURlMessage(s, ex); }, function (e) { console.log("认证授权失败"); }); } }
2 个回复
ant8oo
你的ios版本是多少?我也发现这个问题了,我的ios12上遇到问题。
8***@qq.com (作者) - 阿萨德发顺丰
解决了我写成了绝对地址 file:/// 就ok了 安卓 ios都正常了