|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="details-p" @scroll="showMorePage">
|
|
|
+ <div class="details-p" ref="sContent" @scroll="showMorePage">
|
|
|
<div class="top-title-group flex-r-c">
|
|
|
<van-icon :name="'diy-' + fileType(detailData.docFileType)"></van-icon>
|
|
|
<div class="flex">{{detailData.docName}}</div>
|
|
@@ -117,13 +117,16 @@ export default class extends Vue {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ showPageNum = 2
|
|
|
+ showPageNumT: any = ''
|
|
|
+
|
|
|
created () {
|
|
|
this.docIds = this.$route.params.id
|
|
|
this.onList()
|
|
|
}
|
|
|
|
|
|
get getPageNum () {
|
|
|
- return this.pdfPage.pageNum
|
|
|
+ return this.showPageNum
|
|
|
}
|
|
|
|
|
|
get Offset () {
|
|
@@ -135,8 +138,25 @@ export default class extends Vue {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- showMorePage (e: Event) {
|
|
|
- console.log(e, 'ss')
|
|
|
+ getMorePage () {
|
|
|
+ if (this.showPageNum < this.pdfPage.pageNum) {
|
|
|
+ if (this.showPageNum + 2 <= this.pdfPage.pageNum) {
|
|
|
+ this.showPageNum = this.showPageNum + 2
|
|
|
+ } else {
|
|
|
+ this.showPageNum = this.pdfPage.pageNum
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ showMorePage () {
|
|
|
+ const tDom = this.$refs.sContent as HTMLDivElement
|
|
|
+ const beBottom = tDom.scrollHeight - tDom.clientHeight - tDom.scrollTop
|
|
|
+ if (beBottom <= 200) {
|
|
|
+ clearTimeout(this.showPageNumT)
|
|
|
+ this.showPageNumT = setTimeout(() => {
|
|
|
+ this.getMorePage()
|
|
|
+ }, 300)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
getNumPages (url: string) {
|