mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-14 21:36:42 +08:00
pdf预览地址加密处理
This commit is contained in:
@@ -114,33 +114,33 @@ export default {
|
||||
this.showPages++;
|
||||
}
|
||||
this.isscroll = true;
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
//加载页面
|
||||
loadInitPdf(url) {
|
||||
|
||||
|
||||
if(url && url.indexOf('.pdf')>-1){
|
||||
let loadingTask = pdf.createLoadingTask(url);
|
||||
this.src=loadingTask;
|
||||
|
||||
|
||||
loadingTask.promise.then((pdf) =>{
|
||||
console.log(pdf)
|
||||
this.totalPages=pdf.numPages;
|
||||
|
||||
|
||||
|
||||
if(pdf.numPages>this.initNum){
|
||||
this.showPages = this.initNum;
|
||||
|
||||
|
||||
} else{
|
||||
this.showPages =pdf.numPages;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}).catch((err) =>{
|
||||
this.$message.error("加载内容失败,请联系管理员");
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@@ -149,11 +149,11 @@ export default {
|
||||
let innerHeight = document.querySelector('#pdf-perView').clientHeight
|
||||
let outerHeight = document.documentElement.clientHeight
|
||||
let scrollTop = document.documentElement.scrollTop
|
||||
|
||||
|
||||
if(this.isscroll){
|
||||
this.showPages++;
|
||||
this.debounce(this.loadInitPdf(),5000);
|
||||
|
||||
|
||||
}
|
||||
// console.log(this.pdfpage,'000')
|
||||
// console.log(this.totalPages,this.pdfpage)
|
||||
@@ -168,8 +168,8 @@ export default {
|
||||
// document.querySelector('#articleAnking').style.cssText = "position: static";
|
||||
// }
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
debounce(func, wait) {// 非立即执行
|
||||
let timeout;
|
||||
return function () {
|
||||
@@ -229,6 +229,7 @@ export default {
|
||||
min-height: 300px;
|
||||
width: 100%;
|
||||
//border: 1px solid #dfdfdf;
|
||||
background-color: #e9e9e9;
|
||||
overflow-y: hidden;
|
||||
overflow-x: hidden;
|
||||
>span{
|
||||
|
||||
Reference in New Issue
Block a user