...
|
...
|
@@ -37,11 +37,12 @@ Page({ |
|
|
query.select('.container .top-search').boundingClientRect();
|
|
|
query.selectViewport().scrollOffset();
|
|
|
query.exec(res => {
|
|
|
this.filterInitialTop = res[0].top;
|
|
|
this.topSearchHeight = res[1].bottom - res[1].top;
|
|
|
this.resetListScrollPos = res[0].top - (res[1].bottom - res[1].top);
|
|
|
const [filter, search, scroll] = res;
|
|
|
|
|
|
this.onPageScroll({scrollTop: res[2].scrollTop});
|
|
|
this.maxScrollTop = filter.top + scroll.scrollTop - search.bottom + search.top;
|
|
|
this.resetListScrollPos = this.maxScrollTop;
|
|
|
|
|
|
this.onPageScroll({scrollTop: scroll.scrollTop});
|
|
|
})
|
|
|
}, 1000);
|
|
|
},
|
...
|
...
|
@@ -75,19 +76,22 @@ Page({ |
|
|
},
|
|
|
onPageScroll: function(e) {
|
|
|
const { scrollTop } = e;
|
|
|
|
|
|
const floatFilter = scrollTop > this.filterInitialTop - this.topSearchHeight;
|
|
|
const floatFilter = scrollTop > this.maxScrollTop;
|
|
|
const show = scrollTop > windowHeight * 2;
|
|
|
|
|
|
let data;
|
|
|
|
|
|
if (floatFilter !== this.data.floatFilter) {
|
|
|
this.setData({floatFilter});
|
|
|
data = data || {};
|
|
|
data.floatFilter = floatFilter;
|
|
|
}
|
|
|
|
|
|
if (show !== this.data.showBackTop) {
|
|
|
this.setData({
|
|
|
showBackTop: show
|
|
|
});
|
|
|
data = data || {};
|
|
|
data.showBackTop = show;
|
|
|
}
|
|
|
|
|
|
data && this.setData(data);
|
|
|
},
|
|
|
sortChange: function (e) {
|
|
|
let params;
|
...
|
...
|
|