feat: base xtUpload文件类直接window打开
This commit is contained in:
parent
cf280974c2
commit
e0a6416fae
|
|
@ -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: "暂不支持预览该文件",
|
||||
|
|
|
|||
Loading…
Reference in New Issue