Commit c277405f authored by Hello's avatar Hello

content

parent 63c1508e
......@@ -91,14 +91,13 @@ export default {
if (elHeight && part.test(elHeight)) {
headerHeight += Number(elHeight.replace('px', ''))
}
if ($el._prevClass && $el._prevClass.indexOf('h-header') === 0) {
if (detectOS() === 'ios' && vm.winWidth === 375 && vm.winHeight === 812) {
headerHeight += 0.8 * vm.fontSize
} else if (detectOS() === 'ios' && vm.winWidth === 414 && vm.winHeight === 896) {
headerHeight += 0.8 * vm.fontSize
} else if (detectOS() === 'ios') {
headerHeight += 0.4 * vm.fontSize
let paddingTopHeight = window.getComputedStyle($el).paddingTop
let paddingBottomHeight = window.getComputedStyle($el).paddingBottom
if (paddingTopHeight && part.test(paddingTopHeight)) {
headerHeight += Number(paddingTopHeight.replace('px', ''))
}
if (paddingBottomHeight && part.test(paddingBottomHeight)) {
headerHeight += Number(paddingBottomHeight.replace('px', ''))
}
$el = $el.previousElementSibling
}
......@@ -108,7 +107,7 @@ export default {
},
getNextElementHeight () {
let vm = this
let nextElement = this.$el.nextElementSibling
let nextElement = vm.$el.nextElementSibling
let nextHeight = 0
do {
if (nextElement) {
......@@ -117,30 +116,28 @@ export default {
if (elHeight && part.test(elHeight)) {
nextHeight += Number(elHeight.replace('px', ''))
}
if (nextElement._prevClass && nextElement._prevClass.indexOf('h-bottom-tab') === 0) {
let height = nextElement.clientHeight
if (detectOS() === 'ios' && height > Math.ceil(vm.fontSize * 0.88)) {
nextHeight += 0
} else {
if (detectOS() === 'ios' && vm.winWidth === 375 && vm.winHeight === 812) {
nextHeight += vm.fontSize * 0.68
} else if (detectOS() === 'ios' && vm.winWidth === 414 && vm.winHeight === 896) {
nextHeight += vm.fontSize * 0.68
let paddingTopHeight = window.getComputedStyle(nextElement).paddingTop
let paddingBottomHeight = window.getComputedStyle(nextElement).paddingBottom
if (paddingTopHeight && part.test(paddingTopHeight)) {
nextHeight += Number(paddingTopHeight.replace('px', ''))
}
if (paddingBottomHeight && part.test(paddingBottomHeight)) {
nextHeight += Number(paddingBottomHeight.replace('px', ''))
}
}
nextElement = nextElement.nextElementSibling
}
} while (nextElement)
return nextHeight
},
contentHeight () {
let vm = this
vm.$nextTick(() => {
const headerHeight = vm.getHeaderHeight()
const nextHeight = vm.getNextElementHeight()
let content = vm.$el
vm.height = (vm.winHeight - nextHeight - headerHeight)
content.style.height = (vm.winHeight - nextHeight - headerHeight) + 'px'
})
},
getKeyBoardHeight () {
let innerWidth = window.innerWidth
......
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