diff --git a/src/components/PdfPreview/view.vue b/src/components/PdfPreview/view.vue index 8154484e..36b50e21 100644 --- a/src/components/PdfPreview/view.vue +++ b/src/components/PdfPreview/view.vue @@ -64,14 +64,9 @@ export default { type: Boolean, default: false, }, - boxShow:{ - type: Boolean, - default: true, - } }, data() { return { - likeBox:false, src: "", showPages: undefined, totalPages:0, @@ -103,13 +98,6 @@ export default { this.loadInitPdf(newVal); } }, - boxShow(newVal){ - if(newVal){ - this.likeBox = true; - } else { - this.likeBox = false; - } - }, loadedRatio(newVal){ // 直接使用loadedRatio控制进度条没有加载效果 if(newVal == 1){ @@ -123,7 +111,6 @@ export default { methods: { goTop() { document.documentElement.scrollTop = 0; - this.likeBox = false; }, loadProgress(e){ console.log(e,'loadProgress'); @@ -139,7 +126,6 @@ export default { this.showPages++; } this.isscroll = true; - this.likeBox = true; }, //加载页面 loadInitPdf(url) { @@ -164,16 +150,18 @@ export default { let scrollTop = document.documentElement.scrollTop let $this=this; if(this.isscroll){ - this.showPages++; - this.moreState = 2; - this.debounce(this.loadInitPdf($this.filePath),5000); + this.showPages++ + this.moreState = 2; + // this.debounce(this.loadInitPdf($this.filePath),5000); + // this.debounce(,200000); } if(this.pdfpage >= this.totalPages){ this.isscroll = false; this.moreState = 3; } - if(this.pdfpage < 4){ - this.likeBox = false; + if(this.showPages >= this.totalPages){ + this.isscroll = false; + this.moreState = 3; } // if(scrollTop > 400) { // document.querySelector('#articleAnking').style.cssText = "position: fixed;top: 0;width:242.5px"; @@ -181,8 +169,6 @@ export default { // document.querySelector('#articleAnking').style.cssText = "position: static"; // } }, - - debounce(func, wait) {// 非立即执行 let timeout; return function () {