fix: bug
This commit is contained in:
+23
-22
@@ -305,28 +305,29 @@ export const previewFileFnc = ({
|
||||
}) => {
|
||||
let userInfo = getUserInfo()
|
||||
let userParams = '/' + (userInfo?.loginName ?? '')
|
||||
if (getPhoneEnvBool('AND')) {
|
||||
navigateTo('/pages/index/preview?fileId=' + fileId + '&fileApiSrc=' + getFileSrc);
|
||||
} else {
|
||||
if (isDownloading) return
|
||||
const base_url = get_base_url(getFileSrc);
|
||||
let fileUrl = base_url + getFileSrc + fileId + userParams;
|
||||
const localFilePath = '_doc/pdf_view/' + fileName + '.pdf';
|
||||
isDownloading = true
|
||||
downloadFileFnc(fileUrl, localFilePath).then((res) => {
|
||||
uni.openDocument({
|
||||
filePath: res,
|
||||
showMenu: true,
|
||||
success: function() {
|
||||
console.log('打开文档成功');
|
||||
}
|
||||
})
|
||||
}).finally(() => {
|
||||
setTimeout(() => {
|
||||
isDownloading = false
|
||||
}, 1000)
|
||||
});
|
||||
}
|
||||
navigateTo('/pages/index/preview?fileId=' + fileId + '&fileApiSrc=' + getFileSrc);
|
||||
// if (getPhoneEnvBool('AND')) {
|
||||
// navigateTo('/pages/index/preview?fileId=' + fileId + '&fileApiSrc=' + getFileSrc);
|
||||
// } else {
|
||||
// if (isDownloading) return
|
||||
// const base_url = get_base_url(getFileSrc);
|
||||
// let fileUrl = base_url + getFileSrc + fileId + userParams;
|
||||
// const localFilePath = '_doc/pdf_view/' + fileName + '.pdf';
|
||||
// isDownloading = true
|
||||
// downloadFileFnc(fileUrl, localFilePath).then((res) => {
|
||||
// uni.openDocument({
|
||||
// filePath: res,
|
||||
// showMenu: true,
|
||||
// success: function() {
|
||||
// console.log('打开文档成功');
|
||||
// }
|
||||
// })
|
||||
// }).finally(() => {
|
||||
// setTimeout(() => {
|
||||
// isDownloading = false
|
||||
// }, 1000)
|
||||
// });
|
||||
// }
|
||||
}
|
||||
const downloadFileFnc = async (fileUrl, localFilePath) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user