diff --git a/components/xtUpload.vue b/components/xtUpload.vue index 5fcf5ce..162e483 100644 --- a/components/xtUpload.vue +++ b/components/xtUpload.vue @@ -204,26 +204,27 @@ const preview = (item) => { } }) } else if (item.type == 10) { - uni.downloadFile({ - url: item.url, - success: function (res) { - var filePath = res.tempFilePath; - uni.openDocument({ - filePath: filePath, - showMenu: true, - success: function (res) { - console.log('打开文档成功'); - } - }); - }, - fail: function (err) { - console.log("下载失败:", err) - uni.showToast({ - title: "下载失败", - icon: "none" - }) - } - }); + window.open(item.url, '_blank'); + // uni.downloadFile({ + // url: item.url, + // success: function (res) { + // var filePath = res.tempFilePath; + // uni.openDocument({ + // filePath: filePath, + // showMenu: true, + // success: function (res) { + // console.log('打开文档成功'); + // } + // }); + // }, + // fail: function (err) { + // console.log("下载失败:", err) + // uni.showToast({ + // title: "下载失败", + // icon: "none" + // }) + // } + // }); } else if (item.type == 20) { uni.showToast({ title: "暂不支持预览该文件",