CTLTC地毯 小程序,点击首页产品展示 印花满铺地毯 ,再点击餐厅包房
,进入后点击详情图片 H7401
,跳出放大的图片不显示
,相关代码如下
var that = this;
var nowImgUrl = e.target.dataset.src;
var tagFrom = e.target.dataset.from;
var disable_save_img = that.data.disable_save_img || false;
let systemInfo = wx.getSystemInfoSync();
if (systemInfo.platform === 'windows' || systemInfo.platform === 'mac') {
wx.downloadFile({
url: nowImgUrl, // 你清洗过的 URL
success: (res) => {
if (res.statusCode === 200) {
// 4. 拿临时文件路径去预览
wx.previewImage({
urls: [res.tempFilePath],
current: res.tempFilePath,
});
} else {
wx.showToast({ title: '图片下载失败', icon: 'none' });
}
},
fail: (err) => {
console.error('downloadFile fail', err);
wx.showToast({ title: '网络异常,无法预览', icon: 'none' });
}
});
}
if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0 && !disable_save_img) {
var binddata = getBindData(that, tagFrom);
wx.previewImage({
current: nowImgUrl, // 当前显示图片的http链接
urls: binddata.imageUrls // 需要预览的图片http链接列表
})
}
请问要如何调整

电脑端为什么要downloadFile呢?
直接 预览不行吗?
previewImage 看看 fail 报什么错误