Commit a8fcd0ca authored by JingChao's avatar JingChao

scoll组建top自动计算距离修复

parent aab09c93
{ {
"name": "hls-easy-ui", "name": "hls-easy-ui",
"version": "0.0.5", "version": "0.0.6",
"description": "A Vue components project", "description": "A Vue components project",
"author": "JingChao <jingchao.wu@hand-china.com>", "author": "JingChao <jingchao.wu@hand-china.com>",
"private": false, "private": false,
......
.has-footer { .has-footer {
padding-bottom: 0.88rem; padding-bottom: 0.88rem;
.scrollContent{ .scrollContent{
padding-bottom: 1.76rem; // padding-bottom: 1.76rem;
} }
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
.has-footer { .has-footer {
// padding-bottom: 2.16rem; // padding-bottom: 2.16rem;
.scrollContent{ .scrollContent{
padding-bottom: 2.16rem; // padding-bottom: 2.16rem;
} }
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
.has-footer { .has-footer {
padding-bottom: 1.6rem; padding-bottom: 1.6rem;
.scrollContent{ .scrollContent{
padding-bottom: 2.84rem; // padding-bottom: 2.84rem;
} }
} }
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
.has-footer { .has-footer {
padding-bottom: 1.6rem; padding-bottom: 1.6rem;
.scrollContent{ .scrollContent{
padding-bottom: 2.84rem; // padding-bottom: 2.84rem;
} }
} }
......
...@@ -189,6 +189,8 @@ export default { ...@@ -189,6 +189,8 @@ export default {
isIos: false, isIos: false,
fullScreen: true, fullScreen: true,
fontSize: Number(window.document.documentElement.style.fontSize.replace('px', '')), fontSize: Number(window.document.documentElement.style.fontSize.replace('px', '')),
winHeight: window.innerHeight,
winWidth: window.innerWidth,
} }
}, },
computed: { computed: {
...@@ -289,9 +291,10 @@ export default { ...@@ -289,9 +291,10 @@ export default {
// 设置scrollContent的最小高,实现高度不足时也有回弹效果 // 设置scrollContent的最小高,实现高度不足时也有回弹效果
if (this.$refs.scrollContent) { if (this.$refs.scrollContent) {
// const headerHeight = vm.getHeaderHeight() const headerHeight = vm.getHeaderHeight()
// const nextHeight = vm.getNextElementHeight() // const nextHeight = vm.getNextElementHeight()
this.$refs.scrollContent.style.minHeight = `${this.$refs.scroll.getBoundingClientRect().height + 1}px` this.$refs.scrollContent.style.minHeight = `${this.$refs.scroll.getBoundingClientRect().height + 1}px`
this.$refs.scrollContent.style.paddingTop = `${headerHeight}px`
if (vm.hasFoot.footFlag) { if (vm.hasFoot.footFlag) {
let height = vm.hasFoot.height || 88 let height = vm.hasFoot.height || 88
// this.$refs.scrollContent.style.minHeight = `${this.$refs.scroll.getBoundingClientRect().height - height}px` // this.$refs.scrollContent.style.minHeight = `${this.$refs.scroll.getBoundingClientRect().height - height}px`
...@@ -460,7 +463,8 @@ export default { ...@@ -460,7 +463,8 @@ export default {
width 100% width 100%
overflow hidden !important overflow hidden !important
box-sizing border-box box-sizing border-box
position relative position absolute !important
top 0
height 100% height 100%
&__wrapper { &__wrapper {
...@@ -474,7 +478,7 @@ export default { ...@@ -474,7 +478,7 @@ export default {
text-size-adjust: none; text-size-adjust: none;
-webkit-transform-origin: left top; -webkit-transform-origin: left top;
transform-origin: left top; transform-origin: left top;
padding-bottom: 0.9rem; padding-bottom: 0.4rem;
} }
&__pullup { &__pullup {
...@@ -513,20 +517,24 @@ export default { ...@@ -513,20 +517,24 @@ export default {
} }
} }
} }
.has-footer {
.vue-better-scroll__wrapper {
padding-bottom: 1rem;
}
}
.platform-ios{ .platform-ios{
.vue-better-scroll { .has-footer {
&__wrapper { .vue-better-scroll__wrapper {
// padding-bottom: 2.16rem; padding-bottom: 1rem;
} }
} }
} }
// iPhoneX适配 // iPhoneX适配
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) { @media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
.platform-ios { .platform-ios {
.vue-better-scroll { .has-footer {
&__wrapper { .vue-better-scroll__wrapper {
// padding-bottom: 2.84rem; padding-bottom: 1.8rem;
} }
} }
} }
...@@ -535,9 +543,9 @@ export default { ...@@ -535,9 +543,9 @@ export default {
// iPhoneX Max适配 // iPhoneX Max适配
@media (device-width: 414px) and (device-height: 896px) { @media (device-width: 414px) and (device-height: 896px) {
.platform-ios { .platform-ios {
.vue-better-scroll { .has-footer {
&__wrapper { .vue-better-scroll__wrapper {
// padding-bottom: 2.84rem; padding-bottom: 1.8rem;
} }
} }
} }
......
...@@ -23,7 +23,9 @@ ...@@ -23,7 +23,9 @@
<tab-item>涉诉公告</tab-item> <tab-item>涉诉公告</tab-item>
<tab-item>司法协助</tab-item> <tab-item>司法协助</tab-item>
</s-tab> </s-tab>
<h-content :listen-scroll="true" class="has-footer" @scroll="scrollListen"> <scroll
ref="scrollList" :listen-scroll="true" :pullUp="true" class="has-footer"
@scroll="scrollListen">
<h-button class="button-class" type="primary" @click.native="showLoading">showLoading</h-button> <h-button class="button-class" type="primary" @click.native="showLoading">showLoading</h-button>
<h-button class="button-class" type="primary" @click.native="hideLoading">hideLoading</h-button> <h-button class="button-class" type="primary" @click.native="hideLoading">hideLoading</h-button>
<h-button class="button-class" type="primary" @click.native="showLongTop">showLongTop</h-button> <h-button class="button-class" type="primary" @click.native="showLongTop">showLongTop</h-button>
...@@ -239,7 +241,7 @@ ...@@ -239,7 +241,7 @@
</div> </div>
<h2 class="item-title">Modal</h2> <h2 class="item-title">Modal</h2>
<h-button class="button-class" type="primary" @click.native="showModal">Modal</h-button> <h-button class="button-class" type="primary" @click.native="showModal">Modal</h-button>
</h-content> </scroll>
<bottom-tab :show-divider="true"> <bottom-tab :show-divider="true">
<tab-button cusClass="button-exit" @click.native="showConfirm"><img <tab-button cusClass="button-exit" @click.native="showConfirm"><img
...@@ -324,10 +326,11 @@ export default { ...@@ -324,10 +326,11 @@ export default {
}).then((modal) => { }).then((modal) => {
this.modal = modal; this.modal = modal;
}) */ }) */
this.$refs.scrollList.update(true)
}, },
methods: { methods: {
scrollListen (e) { scrollListen (e) {
console.log('scroll listen:' + JSON.stringify(e,'',2)) console.log('scroll listen:' + JSON.stringify(e, '', 2))
}, },
stab () { stab () {
console.log('tab-click') console.log('tab-click')
......
...@@ -10,7 +10,7 @@ export default { ...@@ -10,7 +10,7 @@ export default {
window.localStorage.setItem('registrationID', data) window.localStorage.setItem('registrationID', data)
} }
if (data.length === 0) { if (data.length === 0) {
window.setTimeout(this.getRegistrationID, 1000) window.setTimeout(this.getRegistrationID.bind(this), 1000)
} }
} catch (exception) { } catch (exception) {
// alert(angular.toJson(exception)); // alert(angular.toJson(exception));
...@@ -18,7 +18,7 @@ export default { ...@@ -18,7 +18,7 @@ export default {
}, },
// 获取设备号 // 获取设备号
getRegistrationID: function () { getRegistrationID: function () {
window.plugins.jPushPlugin.getRegistrationID(this.onGetRegistrationID) window.plugins.jPushPlugin.getRegistrationID(this.onGetRegistrationID.bind(this))
}, },
onReceiveNotification: function (event) { onReceiveNotification: function (event) {
try { try {
......
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