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) {
|
} 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: "暂不支持预览该文件",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue