fix(手机端详情): 统一预览方式

This commit is contained in:
zyn
2023-12-20 10:34:15 +08:00
parent 456875cc34
commit 172f013ce9
3 changed files with 12 additions and 1 deletions
+6 -1
View File
@@ -7,6 +7,7 @@ const Base64 = require('js-base64').Base64;
import store from '@/store'
import { Loading } from 'element-ui';
import axios from '@/common/axiosV2'
import isMobile from '@/store/isMobile'
// 获取转换为pdf的文件
function queryConvertAtt (data) {
@@ -27,7 +28,11 @@ async function preview (attId) {
if (res.ok && res.data) {
const file = res.data
if (file.fileSuffix.toLowerCase() === 'pdg') {
window.open('book://ssreader/e0?url=' + file.downLoadUrl)
if (isMobile()) {
this.$message.warning('pdg文件,不支持手机端预览')
} else {
window.open('book://ssreader/e0?url=' + file.downLoadUrl)
}
} else if (file.fileSuffix.toLowerCase() === 'pdf') {
window.open('./static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.id))
} else {