fix(手机端详情): 统一预览方式
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -2836,6 +2836,8 @@
|
||||
})
|
||||
},
|
||||
openFileInPdf(attId, oldFileName) {
|
||||
this.$preview(attId)
|
||||
/*
|
||||
// 判断是否是图片格式,图片格式不预览,直接下载
|
||||
let index1 = oldFileName.lastIndexOf('.')
|
||||
let index2 = oldFileName.length
|
||||
@@ -2878,6 +2880,7 @@
|
||||
} else {
|
||||
this.$message.warning('PDG文件,不支持手机端预览')
|
||||
}
|
||||
*/
|
||||
},
|
||||
getFileInfo(fileId) {
|
||||
Axios({
|
||||
|
||||
@@ -1269,6 +1269,8 @@
|
||||
})
|
||||
},
|
||||
openFileInPdf(attId, oldFileName) {
|
||||
this.$preview(attId)
|
||||
/*
|
||||
// 判断是否是图片格式,图片格式不预览,直接下载
|
||||
let index1 = oldFileName.lastIndexOf('.')
|
||||
let index2 = oldFileName.length
|
||||
@@ -1298,6 +1300,7 @@
|
||||
}else {
|
||||
this.$message.warning('PDG文件,不支持手机端预览')
|
||||
}
|
||||
*/
|
||||
},
|
||||
showItemsModel(attField) {
|
||||
if (attField) {
|
||||
|
||||
Reference in New Issue
Block a user