my-scroll-tap.js 471 Bytes
module.exports = {
    onPageScroll: function(event) {
        let { scrollTop } = event;
        var isTopShow = scrollTop > 1000 ? true : false;

        if (isTopShow !== this.data.isTop) {
            this.setData({isTop: isTopShow});
        }
    },
    onReachBottom: function() {
        this.tapLoadMore && this.tapLoadMore();
    },
    backToTop: function() {
        wx.pageScrollTo({
            scrollTop: 0,
            duration: 300
        });
    },
};