Forráskód Böngészése

完成在线预览及从个人中心过来的方式

秦鹏 3 éve
szülő
commit
dfb4aa742a
1 módosított fájl, 28 hozzáadás és 25 törlés
  1. 28 25
      src/views/teacher-dev/Preview.vue

+ 28 - 25
src/views/teacher-dev/Preview.vue

@@ -339,18 +339,18 @@ export default {
             this.data.fileType = this.data.tag[this.data.tag.length - 1];
             this.attachment = JSON.parse(res.data.result.attachment);
             this.loading = false;
-            if (
-              this.attachment[0].fileType == "pdf" ||
-              this.attachment[0].fileType == "PDF"
-            ) {
-              // this.attachment[0].fileRelativePath =
-              //   process.env.VUE_APP_BASE_API + this.attachment[0].fileRelativePath;
-              this.attachment[0].fileRelativePath =
-                process.env.VUE_APP_BASE_API +
-                this.attachment[0].fileRelativePath;
-              console.log(this.attachment[0].fileRelativePath);
-              this.getNumPages();
-            }
+            // if (
+            //   this.attachment[0].fileType == "pdf" ||
+            //   this.attachment[0].fileType == "PDF"
+            // ) {
+            //   // this.attachment[0].fileRelativePath =
+            //   //   process.env.VUE_APP_BASE_API + this.attachment[0].fileRelativePath;
+            //   this.attachment[0].fileRelativePath =
+            //     process.env.VUE_APP_BASE_API +
+            //     this.attachment[0].fileRelativePath;
+            //   console.log(this.attachment[0].fileRelativePath);
+            //   this.getNumPages();
+            // }
             this.changePrice(this.data.price * 1, 24, 16);
             this.goods_detail_type = this.getimgurl(this.data);
             // 3000的
@@ -369,7 +369,6 @@ export default {
               `http://docpreview.utschool.cn/onlinePreview?url=` +
               Base64.encode(this.attachment[0].fileUrlHttps);
             this.attachment[0].newpath = path;
-            // window.open(this.attachment[0].newpath);
           }
         })
         .catch((res) => {
@@ -399,19 +398,23 @@ export default {
             });
             this.data.fileType = this.data.tag[this.data.tag.length - 1];
             this.attachment = JSON.parse(res.data.result.attachment);
+            let path =
+              `http://docpreview.utschool.cn/onlinePreview?url=` +
+              Base64.encode(this.attachment[0].fileUrlHttps);
+            this.attachment[0].newpath = path;
             this.loading = false;
-            if (
-              this.attachment[0].fileType == "pdf" ||
-              this.attachment[0].fileType == "PDF"
-            ) {
-              // this.attachment[0].fileRelativePath =
-              //   process.env.VUE_APP_BASE_API + this.attachment[0].fileRelativePath;
-              this.attachment[0].fileRelativePath =
-                process.env.VUE_APP_BASE_API +
-                this.attachment[0].fileRelativePath;
-              console.log(this.attachment[0].fileRelativePath);
-              this.getNumPages();
-            }
+            // if (
+            //   this.attachment[0].fileType == "pdf" ||
+            //   this.attachment[0].fileType == "PDF"
+            // ) {
+            //   // this.attachment[0].fileRelativePath =
+            //   //   process.env.VUE_APP_BASE_API + this.attachment[0].fileRelativePath;
+            //   this.attachment[0].fileRelativePath =
+            //     process.env.VUE_APP_BASE_API +
+            //     this.attachment[0].fileRelativePath;
+            //   console.log(this.attachment[0].fileRelativePath);
+            //   this.getNumPages();
+            // }
             this.changePrice(this.data.price * 1, 24, 16);
           }
         })