This commit is contained in:
zhaofang
2022-06-14 11:00:02 +08:00
parent a4d045f42e
commit 4fb5e32401

View File

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