Commit c277405f authored by Hello's avatar Hello

content

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