|
@@ -1,15 +1,16 @@
|
|
|
<template>
|
|
|
<!--使用 pdfvuer 实现 滑动浏览 单印章-->
|
|
|
<div class="pdf">
|
|
|
- <!-- <div class="loading" v-show="loading">
|
|
|
+ <div class="loading" v-show="loading">
|
|
|
<span>pdf可能会加载时间有点长,请耐心等待...</span>
|
|
|
</div>
|
|
|
- <div id="contentArea" class="show" v-if="!loading">
|
|
|
+ <!-- <div id="contentArea" class="show" v-if="!loading">
|
|
|
<pdf :scale.sync="scale" :resize="true" ref="wrapper" class="p-pdf" :src="pdfData" v-for="i in numPages" :key="i"
|
|
|
:id="i" :page="i" style="width: 100%">
|
|
|
</pdf>
|
|
|
</div> -->
|
|
|
- <iframe style="width: 100%; height: 99%; border: none" :src="'https://cloud.cocorobo.cn/pdf.js/web/viewer.html?file='+pdfUrl"></iframe>
|
|
|
+ <iframe ref="viframe" style="width: 100%; height: 99%; border: none"
|
|
|
+ :src="'https://cloud.cocorobo.cn/pdf.js/web/viewer.html?file=' + pdfUrl"></iframe>
|
|
|
<!-- <div class="rightArea">
|
|
|
<div class="toolGroup">
|
|
|
<div class="page">第 {{ page }} / {{ numPages }} 页</div>
|
|
@@ -61,6 +62,9 @@ export default {
|
|
|
// spinner: "",
|
|
|
// });
|
|
|
this.loading = true;
|
|
|
+ this.$refs.viframe.onload = function () {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
this.getPdf();
|
|
|
},
|
|
|
beforeDestroy() { },
|
|
@@ -73,6 +77,9 @@ export default {
|
|
|
// spinner: "",
|
|
|
// });
|
|
|
this.loading = true;
|
|
|
+ this.$refs.viframe.onload = function () {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
this.getPdf();
|
|
|
},
|
|
|
},
|
|
@@ -118,7 +125,8 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
- background-color: rgba(255, 255, 255, 0.7);
|
|
|
+ /* background-color: rgba(255, 255, 255, 0.7); */
|
|
|
+ background-color: rgba(255, 255, 255, 1);
|
|
|
z-index: 9;
|
|
|
font-size: 20px;
|
|
|
color: #007fff;
|