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) {
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: "暂不支持预览该文件",