feat: base xtUpload文件类直接window打开

This commit is contained in:
caoqianming 2025-12-05 12:58:18 +08:00
parent cf280974c2
commit e0a6416fae
1 changed files with 21 additions and 20 deletions

View File

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