Commit a100d81e by zhangzhen

文件预览优化

parent cf0e9287
......@@ -162,7 +162,7 @@
},
islmage(filename) {
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);
},
onNavToPreview() {
......@@ -170,6 +170,11 @@
if (res.data.__sys__.status === 1) {
if(this.islmage(this.orderInfo.docName)){
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{
let urlStr = this.assetsPath + '/hggp/file/download/' + this.orderInfo.docId;
uni.downloadFile({
......
......@@ -5,9 +5,9 @@ module.exports = {
open: true,
proxy: {
'/prod-api': {
// target: `http://10.24.4.81:8099/hggp`,
target: `http://129.211.46.84:8085/hggp`,
// target: `https://www.eis-paas.com/hggp`,
// target: `http://10.24.4.66:8082/hggp_war_exploded`,
// target: `http://129.211.46.84:8085/hggp`,
target: `https://www.eis-paas.com/hggp`,
changeOrigin: true,
pathRewrite: {
'/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