|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="shop">
|
|
|
+ <div class="shop" id="shop">
|
|
|
<div class="shop-top">
|
|
|
<p><i class="iconfont icon-dianpu1"></i><span>{{list.totalElements || 0}}</span>家店铺</p>
|
|
|
<span @click="onClick()">{{downName}} <i class="iconfont icon-arrow-down"></i></span>
|
|
|
@@ -98,15 +98,16 @@
|
|
|
mounted: function () {
|
|
|
let _this = this
|
|
|
_this.$nextTick(function () {
|
|
|
- window.addEventListener('scroll', function () {
|
|
|
+ document.getElementById('shop').addEventListener('scroll', function () {
|
|
|
_this.scroll()
|
|
|
}, false)
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
scroll: function () {
|
|
|
- let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
|
|
|
- if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && !this.isSearchingMore && this.page < this.allPage) {
|
|
|
+ let obj = document.getElementById('shop')
|
|
|
+ let scrolled = obj.scrollTop
|
|
|
+ if (Math.ceil(scrolled + obj.clientHeight) >= obj.scrollHeight && !this.isSearchingMore && this.page < this.allPage) {
|
|
|
this.getMoreStore()
|
|
|
}
|
|
|
},
|
|
|
@@ -188,7 +189,11 @@
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.shop{
|
|
|
- margin-bottom: .98rem;
|
|
|
+ position: fixed;
|
|
|
+ width: 100%;
|
|
|
+ top: .88rem;
|
|
|
+ bottom: .98rem;
|
|
|
+ overflow-y: auto;
|
|
|
min-height: 10rem;
|
|
|
background: #e2e4e6;
|
|
|
.shop-top{
|