Commit aabe0d5c authored by wangjiankun's avatar wangjiankun

ppt pdf word 页数显示不正确问题

parent 61b7a5d8
......@@ -12,14 +12,14 @@
:src="fullState ? exitFull : fullScreen"
>
<span style="font-weight: 400;">
<input
v-if="!blockJumpPage"
@keyup.enter="toPage"
@blur="toPage"
onkeypress="return event.keyCode>=48&&event.keyCode<=57"
ng-pattern="/[^a-zA-Z]/"
v-model="page"
>
<input
v-if="!blockJumpPage"
@keyup.enter="toPage"
@blur="toPage"
onkeypress="return event.keyCode>=48&&event.keyCode<=57"
ng-pattern="/[^a-zA-Z]/"
v-model="page"
>
<b v-else>{{ page }}</b> /&nbsp;{{ numPages }}</span>
<img
v-if="showLoading"
......@@ -85,7 +85,8 @@ export default {
fullState: false,
loading: false,
loadTask: '',
toolBarShow: false
toolBarShow: false,
saveMaxHeight: 0
}
},
watch: {
......@@ -186,8 +187,13 @@ export default {
$('.tool-bar').css('display', 'none')
this.toolBarShow = false
}
const itemHeight = $($('.pdfItem')[0]).outerHeight(true), // $('.pdfList').height()/this.numPages;
scrolled = $('.pdf')[0].scrollTop
let itemHeight = 0
$('.pdfItem').each(function() {
const h = $(this).outerHeight()
itemHeight = itemHeight < h ? h : itemHeight
})
// $('.pdfList').height()/this.numPages;
const scrolled = $('.pdf')[0].scrollTop
this.page = parseInt((scrolled + itemHeight) / (itemHeight)) + Math.ceil($('.pdf').height() / itemHeight) - 1
},
toFullScreen() {
......
......@@ -188,9 +188,13 @@ export default {
$('.tool-bar').css('display', 'none')
this.toolBarShow = false
}
const itemHeight = $('.pdfItem').height(), // $('.pdfList').height()/this.numPages;
scrolled = $('.pdf')[0].scrollTop
console.log($('.pdf')[0].scrollTop, $('.pdfItem').height())
let itemHeight = 0
$('.pdfItem').each(function() {
const h = $(this).outerHeight()
itemHeight = itemHeight < h ? h : itemHeight
})
// $('.pdfList').height()/this.numPages;
const scrolled = $('.pdf')[0].scrollTop
this.page = parseInt((scrolled + itemHeight) / (itemHeight)) + parseInt($('.pdf').height() / itemHeight) - 1
},
toFullScreen() {
......
......@@ -186,10 +186,14 @@ export default {
$('.tool-bar').css('display', 'none')
this.toolBarShow = false
}
const itemHeight = $('.pdfItem').outerHeight(true), // $('.pdfList').height()/this.numPages;
scrolled = $('.pdf')[0].scrollTop
let itemHeight = 0
$('.pdfItem').each(function() {
const h = $(this).outerHeight()
itemHeight = itemHeight < h ? h : itemHeight
})
// $('.pdfList').height()/this.numPages;
const scrolled = $('.pdf')[0].scrollTop
this.page = parseInt((scrolled + itemHeight) / (itemHeight)) + Math.ceil($('.pdf').height() / itemHeight) - 1
console.log((scrolled + itemHeight), itemHeight, Math.ceil($('.pdf').height() / itemHeight))
},
toFullScreen() {
const that = this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment