Commit a100d81e by zhangzhen

文件预览优化

parent cf0e9287
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
}, },
islmage(filename) { islmage(filename) {
const extension = filename.split('.').pop().toLowerCase(); const extension = filename.split('.').pop().toLowerCase();
const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg','mp4','3gp','avi'] const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg','mp4','3gp','avi','docx','pdf']
return imageExtensions.includes(extension); return imageExtensions.includes(extension);
}, },
onNavToPreview() { onNavToPreview() {
...@@ -170,6 +170,11 @@ ...@@ -170,6 +170,11 @@
if (res.data.__sys__.status === 1) { if (res.data.__sys__.status === 1) {
if(this.islmage(this.orderInfo.docName)){ if(this.islmage(this.orderInfo.docName)){
this.previewStatus = true; this.previewStatus = true;
if(['docx','pdf'].includes(this.orderInfo.fileSuffix) ){
let urlStr=`${this.hostUrl}/?docId=${this.orderInfo.docId}&fileSuffix=${this.orderInfo.fileSuffix}`
window.open(urlStr)
}
}else{ }else{
let urlStr = this.assetsPath + '/hggp/file/download/' + this.orderInfo.docId; let urlStr = this.assetsPath + '/hggp/file/download/' + this.orderInfo.docId;
uni.downloadFile({ uni.downloadFile({
......
...@@ -5,9 +5,9 @@ module.exports = { ...@@ -5,9 +5,9 @@ module.exports = {
open: true, open: true,
proxy: { proxy: {
'/prod-api': { '/prod-api': {
// target: `http://10.24.4.81:8099/hggp`, // target: `http://10.24.4.66:8082/hggp_war_exploded`,
target: `http://129.211.46.84:8085/hggp`, // target: `http://129.211.46.84:8085/hggp`,
// target: `https://www.eis-paas.com/hggp`, target: `https://www.eis-paas.com/hggp`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'/prod-api': '' '/prod-api': ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment