8***@qq.com
8***@qq.com
  • 发布:2018-09-18 20:59
  • 更新:2018-09-27 12:27
  • 阅读:1458

hbuilder分享网络图片到微信棘手问题:ios的hubilder包正常,线上不能分享【vue】;安卓一切正常

分类:HTML5+
   /**  
         * 网络图片转换成本地图片分享  
         */  
        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 = this

            self.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("认证授权失败");  
                });  
            }  
        }  
2018-09-18 20:59 负责人:无 分享
已邀请:
ant8oo

ant8oo

你的ios版本是多少?我也发现这个问题了,我的ios12上遇到问题。

8***@qq.com

8***@qq.com (作者) - 阿萨德发顺丰

解决了我写成了绝对地址 file:/// 就ok了 安卓 ios都正常了

该问题目前已经被锁定, 无法添加新回复