|
|
@@ -1,8 +1,15 @@
|
|
|
<template>
|
|
|
<!-- 移动端上拉加载更多 -->
|
|
|
+ <!--<a @click="scrollToTop" v-show="!hideToTop"><i class="iconfont icon-arrow-up icon-xlg"></i></a>-->
|
|
|
</template>
|
|
|
<script>
|
|
|
+// import { scrollTo } from '~utils/scroll'
|
|
|
export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ hideToTop: true
|
|
|
+ }
|
|
|
+ },
|
|
|
props: {
|
|
|
searchMore: {
|
|
|
type: Boolean
|
|
|
@@ -47,6 +54,8 @@
|
|
|
height = document.body.scrollHeight
|
|
|
scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
|
|
|
}
|
|
|
+// this.hideToTop = scrolled <= window.screen.availHeight
|
|
|
+// console.log(this.hideToTop)
|
|
|
if (Math.ceil(scrolled + window.screen.availHeight) >= height && !this.searchMore && this.page < this.allPage) {
|
|
|
this.getMore()
|
|
|
}
|
|
|
@@ -55,18 +64,33 @@
|
|
|
if (!this.searchMore) {
|
|
|
this.$emit('pullUpAction')
|
|
|
}
|
|
|
+ },
|
|
|
+ scrollToTop () {
|
|
|
+// console.log(1)
|
|
|
+ let el = document.querySelector('.mobile-fix-content')
|
|
|
+ if (el) {
|
|
|
+ el.scrollTop = 0
|
|
|
+ }
|
|
|
+// console.log(el.scrollTop)
|
|
|
+// scrollTo(el ? '.mobile-fix-content' : 'body', 100, {offset: el ? el.scrollTop : null})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
- .loading {
|
|
|
+ a {
|
|
|
+ position: fixed;
|
|
|
+ right: .1rem;
|
|
|
+ bottom: 1.1rem;
|
|
|
+ background: rgba(0,0,0,.4);
|
|
|
+ color: #fff;
|
|
|
+ width: .88rem;
|
|
|
+ height: .88rem;
|
|
|
+ line-height: .88rem;
|
|
|
+ border-radius: 100%;
|
|
|
text-align: center;
|
|
|
- background: #fff;
|
|
|
- >img {
|
|
|
- width: .64rem;
|
|
|
- height: .64rem;
|
|
|
- margin: .2rem 0;
|
|
|
+ i {
|
|
|
+ font-size: .46rem;
|
|
|
}
|
|
|
}
|
|
|
</style>
|