wangxl@jiinfo.cn 3 hete
szülő
commit
17537106ec

+ 3 - 2
src/langs/cn/DownloadList.js

@@ -2,10 +2,11 @@ export default {
   syList: [
     {
       title: "Sanyou Bispecific Reference Antibody Catalog",
-      url: '/static/img/profile/en.jpg',
+      url: '/static/img/profile/5.png',
       img: '/static/img/download/en.png',
       contentImg: '/static/img/download/en_10.png',
-      link: 'https://sanyou-offical-website.oss-cn-shanghai.aliyuncs.com/20250401/Sanyou%20Bispecific%20Reference%20Antibody%20Catalog-EN-250328.pdf'
+      link: '/static/pdf/1.pdf'
+      // link: 'https://sanyou-offical-website.oss-cn-shanghai.aliyuncs.com/20250401/Sanyou%20Bispecific%20Reference%20Antibody%20Catalog-EN-250328.pdf'
     }
   ],
     list: [

+ 2 - 1
src/langs/en/DownloadList.js

@@ -6,7 +6,8 @@ export default {
       url: '/static/img/profile/en.jpg',
       img: '/static/img/download/en.png',
       contentImg: '/static/img/download/en_10.png',
-      link: 'https://sanyou-offical-website.oss-cn-shanghai.aliyuncs.com/20250401/Sanyou%20Bispecific%20Reference%20Antibody%20Catalog-EN-250328.pdf'
+      link: '/static/pdf/1.pdf'
+      // link: 'https://sanyou-offical-website.oss-cn-shanghai.aliyuncs.com/20250401/Sanyou%20Bispecific%20Reference%20Antibody%20Catalog-EN-250328.pdf'
     }
   ],
   list: [

+ 17 - 0
src/view/profile/index.vue

@@ -48,6 +48,7 @@
   </div>
 </template>
 <script>
+import axios from 'axios';
 import banner from "@/components/banner";
 export default {
   name: "profile",
@@ -63,6 +64,19 @@ export default {
     };
   },
   methods: {
+    downloadPdfone(pdfUrl, title) {
+      axios(pdfUrl, {
+        responseType: "blob" // 重要代码
+      }).then(res => {
+        const url = window.URL.createObjectURL(new Blob([res.data]));
+        const link = document.createElement("a");
+        link.href = url;
+        let fileName = title + ".pdf";
+        link.setAttribute("download", fileName);
+        document.body.appendChild(link);
+        link.click();
+      })
+    },
     tapProfile(item) {
       this.popShow = true;
       this.profile = item;
@@ -74,6 +88,9 @@ export default {
         text: this.$t('Download.loading') + '...',
         background: 'rgba(0, 0, 0, 0.7)'
       });
+      if (title == 'Sanyou Bispecific Reference Antibody Catalog') {
+        this.downloadPdfone(pdfUrl, title)
+      }
       const xhr = new XMLHttpRequest();
       xhr.open('GET', pdfUrl, true);
       xhr.responseType = 'blob';

BIN
static/img/profile/5.png


BIN
static/pdf/1.pdf