From 0e3baa12cf331f754752aab614bf6c54c6c86473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Fri, 28 Nov 2025 15:27:51 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +-- src/common/common.js | 45 +++++++++++++------------ src/pages/example/dialog.vue | 33 +++++++++--------- src/pages/index/dialog.vue | 65 +++++++++++++----------------------- src/pages/index/preview.vue | 4 +-- src/pages/sparring/talk.vue | 3 -- 6 files changed, 68 insertions(+), 86 deletions(-) diff --git a/.env.development b/.env.development index c476aba5..8a47007d 100644 --- a/.env.development +++ b/.env.development @@ -8,13 +8,13 @@ ENV = 'development' # VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' -# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' + VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' # VITE_APP_BASE_API_Url = 'http://192.168.247.200' # VITE_APP_BASE_API_Url = 'http://aitscdn.jlbank.com.cn:7001' # VITE_APP_BASE_API_Url = 'http://192.168.108.129' # dev -VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' +# VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' # sit # VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786' # UAT diff --git a/src/common/common.js b/src/common/common.js index c51b1ee9..15175f2e 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -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 { diff --git a/src/pages/example/dialog.vue b/src/pages/example/dialog.vue index f24852b9..f23d5a30 100644 --- a/src/pages/example/dialog.vue +++ b/src/pages/example/dialog.vue @@ -465,22 +465,23 @@ }); break; case 'preview': - if (getPhoneEnvBool('AND')) { - common.navigateTo('/pages/index/preview?fileId=' + info.docId); - } else { - const base_url = get_base_url('/traask/traFilePreview/'); - let fileUrl = base_url + '/traask/traFilePreview/' + info.docId + userParams; - const localFilePath = '_doc/pdf_view/' + info.docName + '.pdf'; - downloadAndSaveAvatar(fileUrl, localFilePath).then((res) => { - uni.openDocument({ - filePath: res, - showMenu: true, - success: function() { - console.log('打开文档成功'); - } - }); - }); - } + common.navigateTo('/pages/index/preview?fileId=' + info.docId); + // if (getPhoneEnvBool('AND')) { + // common.navigateTo('/pages/index/preview?fileId=' + info.docId); + // } else { + // const base_url = get_base_url('/traask/traFilePreview/'); + // let fileUrl = base_url + '/traask/traFilePreview/' + info.docId + userParams; + // const localFilePath = '_doc/pdf_view/' + info.docName + '.pdf'; + // downloadAndSaveAvatar(fileUrl, localFilePath).then((res) => { + // uni.openDocument({ + // filePath: res, + // showMenu: true, + // success: function() { + // console.log('打开文档成功'); + // } + // }); + // }); + // } break; case 'toCourse': console.log(type, data, id); diff --git a/src/pages/index/dialog.vue b/src/pages/index/dialog.vue index a59d0c5c..4d0f6bc4 100644 --- a/src/pages/index/dialog.vue +++ b/src/pages/index/dialog.vue @@ -492,47 +492,30 @@ }); break; case 'preview': - if (getPhoneEnvBool('AND')) { - common.navigateTo('/pages/index/preview?fileId=' + info.docId); - } else { - if(isDownloading.value) return - const base_url = get_base_url('/traask/traFilePreview/'); - let fileUrl = base_url + '/traask/traFilePreview/' + info.docId + userParams; - const localFilePath = '_doc/pdf_view/' + info.docName + '.pdf'; - isDownloading.value = true - downloadAndSaveAvatar(fileUrl, localFilePath).then((res) => { - uni.openDocument({ - filePath: res, - showMenu: true, - success: function () { - console.log('打开文档成功'); - } - }) - }).finally(()=>{ - setTimeout(()=>{ - isDownloading.value = false - },1000) - }); - // uni.downloadFile({ - // url: fileUrl, - // success: function (res) { - - // uni.saveFile({ - // tempFilePath: res.tempFilePath, - // success: function (resS) { - // var filePath = resS.savedFilePath - // uni.openDocument({ - // filePath: filePath, - // showMenu: true, - // success: function () { - // console.log('打开文档成功') - // } - // }) - // } - // }) - // } - // }) - } + common.navigateTo('/pages/index/preview?fileId=' + info.docId); + // if (getPhoneEnvBool('AND')) { + // common.navigateTo('/pages/index/preview?fileId=' + info.docId); + // } else { + // common.navigateTo('/pages/index/preview?fileId=' + info.docId); return + // if(isDownloading.value) return + // const base_url = get_base_url('/traask/traFilePreview/'); + // let fileUrl = base_url + '/traask/traFilePreview/' + info.docId + userParams; + // const localFilePath = '_doc/pdf_view/' + info.docName + '.pdf'; + // isDownloading.value = true + // downloadAndSaveAvatar(fileUrl, localFilePath).then((res) => { + // uni.openDocument({ + // filePath: res, + // showMenu: true, + // success: function () { + // console.log('打开文档成功'); + // } + // }) + // }).finally(()=>{ + // setTimeout(()=>{ + // isDownloading.value = false + // },1000) + // }); + // } break; case 'toCourse': console.log(type, data, id); diff --git a/src/pages/index/preview.vue b/src/pages/index/preview.vue index e6470716..036bdfdf 100644 --- a/src/pages/index/preview.vue +++ b/src/pages/index/preview.vue @@ -30,7 +30,7 @@ export default { showUrl: '', // viewerUrl: '/static/pdf-view/web/viewer.html', viewerUrl: '/static/view-pdf/pdf.html', - showView: false, + showView: true, wv: null, userParams: '' } @@ -64,7 +64,7 @@ export default { wv.setStyle({ top: 80 }) - uni.onKeyboardHeightChange(setHeight) + uni.onKeyboardHeightChange(this.setHeight) }, 1000) // #endif }, diff --git a/src/pages/sparring/talk.vue b/src/pages/sparring/talk.vue index e01bbd05..86dc3554 100644 --- a/src/pages/sparring/talk.vue +++ b/src/pages/sparring/talk.vue @@ -67,9 +67,6 @@ traId: traId.value, talkingType: isPreview.value? 'preview' : 'practice' }).then(res=>{ - watchFlag.value = 1; - socketStore?.closeSocket(); - changePlayItemId('') common.navigateTo('/pages/sparring/result?isOver=1&traId=' + traId.value + '&execId='