秦鹏 пре 3 година
родитељ
комит
773beabe02
2 измењених фајлова са 16 додато и 7 уклоњено
  1. 1 1
      src/views/TextbookDetail.vue
  2. 15 6
      src/views/textbook-detail/TextbookDetailPdf.vue

+ 1 - 1
src/views/TextbookDetail.vue

@@ -619,7 +619,7 @@ export default {
         "/TextbookDetailPdf?id=" +
           this.TextBookId +
           "&url=" +
-          Base64.encodeURL(this.fileListDoc[index].file_url) +
+          Base64.encode(this.fileListDoc[index].file_url) +
           "&invok_module=" +
           this.$route.query.invok_module +
           "&fileId=" +

+ 15 - 6
src/views/textbook-detail/TextbookDetailPdf.vue

@@ -26,7 +26,13 @@
         </div>
       </div>
       <div v-if="attachment" class="pdf-box">
-        <pdf
+        <iframe
+          :src="attachment"
+          width="100%"
+          height="1000px"
+          id="ifm"
+        ></iframe>
+        <!-- <pdf
           ref="pdf"
           :src="attachment"
           v-for="i in numPages"
@@ -34,7 +40,7 @@
           :page="i"
         >
           {{ i / numPages }}
-        </pdf>
+        </pdf> -->
       </div>
     </div>
   </div>
@@ -128,10 +134,13 @@ export default {
           this.data = res;
           this.loading = false;
           this.attachment =
-            process.env.VUE_APP_PDF_API +
-            Base64.decode(this.$route.query.relativePath);
-          this.getNumPages();
-          console.log(this.attachment);
+            `http://docpreview.utschool.cn/onlinePreview?url=` +
+            this.$route.query.url;
+          // this.attachment =
+          //   process.env.VUE_APP_PDF_API +
+          //   Base64.decode(this.$route.query.relativePath);
+          // this.getNumPages();
+          // console.log(this.attachment);
         })
         .catch((res) => {
           this.loading = false;