fix(手机端详情): 统一预览方式
This commit is contained in:
@@ -7,6 +7,7 @@ const Base64 = require('js-base64').Base64;
|
|||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { Loading } from 'element-ui';
|
import { Loading } from 'element-ui';
|
||||||
import axios from '@/common/axiosV2'
|
import axios from '@/common/axiosV2'
|
||||||
|
import isMobile from '@/store/isMobile'
|
||||||
|
|
||||||
// 获取转换为pdf的文件
|
// 获取转换为pdf的文件
|
||||||
function queryConvertAtt (data) {
|
function queryConvertAtt (data) {
|
||||||
@@ -27,7 +28,11 @@ async function preview (attId) {
|
|||||||
if (res.ok && res.data) {
|
if (res.ok && res.data) {
|
||||||
const file = res.data
|
const file = res.data
|
||||||
if (file.fileSuffix.toLowerCase() === 'pdg') {
|
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') {
|
} else if (file.fileSuffix.toLowerCase() === 'pdf') {
|
||||||
window.open('./static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.id))
|
window.open('./static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.id))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2836,6 +2836,8 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
openFileInPdf(attId, oldFileName) {
|
openFileInPdf(attId, oldFileName) {
|
||||||
|
this.$preview(attId)
|
||||||
|
/*
|
||||||
// 判断是否是图片格式,图片格式不预览,直接下载
|
// 判断是否是图片格式,图片格式不预览,直接下载
|
||||||
let index1 = oldFileName.lastIndexOf('.')
|
let index1 = oldFileName.lastIndexOf('.')
|
||||||
let index2 = oldFileName.length
|
let index2 = oldFileName.length
|
||||||
@@ -2878,6 +2880,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.$message.warning('PDG文件,不支持手机端预览')
|
this.$message.warning('PDG文件,不支持手机端预览')
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
},
|
},
|
||||||
getFileInfo(fileId) {
|
getFileInfo(fileId) {
|
||||||
Axios({
|
Axios({
|
||||||
|
|||||||
@@ -1269,6 +1269,8 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
openFileInPdf(attId, oldFileName) {
|
openFileInPdf(attId, oldFileName) {
|
||||||
|
this.$preview(attId)
|
||||||
|
/*
|
||||||
// 判断是否是图片格式,图片格式不预览,直接下载
|
// 判断是否是图片格式,图片格式不预览,直接下载
|
||||||
let index1 = oldFileName.lastIndexOf('.')
|
let index1 = oldFileName.lastIndexOf('.')
|
||||||
let index2 = oldFileName.length
|
let index2 = oldFileName.length
|
||||||
@@ -1298,6 +1300,7 @@
|
|||||||
}else {
|
}else {
|
||||||
this.$message.warning('PDG文件,不支持手机端预览')
|
this.$message.warning('PDG文件,不支持手机端预览')
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
},
|
},
|
||||||
showItemsModel(attField) {
|
showItemsModel(attField) {
|
||||||
if (attField) {
|
if (attField) {
|
||||||
|
|||||||
Reference in New Issue
Block a user