previewImagesolo(list, curIndex=0) {
let that = this;
let arr = []
if (!Array.isArray(list)) {
arr = [list];
} else {
arr = list
}
let httpUrl = store.state.webserver+'/fileservice/filedownload.do?md5=';
let photoList = arr.map(item => {
return item.imageUrl;//||httpUrl+item.md5;
});
uni.previewImage({
current: arr.length>1?curIndex:0,
urls: photoList,
longPressActions: {
itemList: ['保存图片'],
success: function(data) {
// let url = ${store.state.webserver}/fileservice/filedownload.do?md5=${chatItem.fileMd5}
;
// let fileName = chatItem.fileMd5+'.png';
let curImg = photoList[data.index];
let curImgObj = arr.find(item=>{return item.imageUrl==curImg||httpUrl+item.md5==curImg})
let fileName = curImgObj.md5+'.png';
let fileUrl2 = httpUrl+curImgObj.md5;
that.saveImageToAlbum(fileUrl2,fileName);
},
fail: function(err) {
that.consoleLog('保存图片err',err.errMsg);
}
},
})
}
ujoin_wql
- 发布:2023-06-01 19:11
- 更新:2024-06-19 17:58
- 阅读:440
4 个回复
FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866
上传 可运行的demo,方便排查
l***@163.com
解决了吗 我也遇到这个问题了
套马杆的套子 - 没有解决不了的问题,只有解决不完的问题
刚用下面这测试了下,没发现问题
JiYis - JiYis
看看是不是路径里面有啥特殊字符,比如中文啥的,可以做一下urlencode编码,然后再传进去