Jelajahi Sumber

商品资料库修改

喻文俊 3 tahun lalu
induk
melakukan
89da16b1af

+ 11 - 8
src/main/resources/static/js/document/beautyArchiveDetailMixin.js

@@ -95,17 +95,12 @@ var beautyArchiveDetailMixin = {
             var suffix = file.fileName.substring(index);
             if (suffix === '.doc' || suffix === '.ppt' || suffix === '.pptx' || suffix === '.docx') {
                 // 如果是 doc 或 ppt 直接打开链接预览
-                // window.open(file.htmlUrl, '_blank'); // 预览
-                window.open(file.fileUrl, '_black') // 下载
+                // window.open(file.fileUrl, '_black') // 下载
+                window.open('https://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(file.fileUrl), '_black') // 下载
+                // https://view.officeapps.live.com/op/view.aspx?src=
             } else if (suffix === '.pdf') {
                 // 如果是 pdf 需要跳转到预览页面并设置type为1,src为pdf预览链接
                 window.open(file.fileUrl, '_blank');
-                //                 // if (isPC) {
-                //     window.open(file.fileUrl, '_blank');
-                // } else {
-                //     // var url = '/document/pdfdetails.html?type=1&src=' + file.fileUrl;
-                //     window.open(file.fileUrl, '_blank');
-                // }
             } else {
                 CAIMEI.Popup({
                     content: suffix + '类型文件暂时无法预览',
@@ -116,6 +111,14 @@ var beautyArchiveDetailMixin = {
                 });
             }
         },
+        openFile: function(url){
+            var a = document.createElement('a');
+            a.href = url + '&random=' + Math.random();
+            a.setAttribute('target', '_blank');
+            document.body.appendChild(a);
+            a.click();
+            document.removeChild(a);
+        },
         /*
         * 下一步操作 链接跳转 支付支付采美豆
         * redirect: