P***@outlook.com
P***@outlook.com
  • 发布:2021-09-29 00:06
  • 更新:2021-09-29 00:26
  • 阅读:789

mescroll-body + 自定义导航栏 详见视频

分类:uni-app

下拉正常

上拉之后起始位置就变了

https://youtu.be/m52lAP2xs4A

!

<template>  
    <view>  
        <!--@zenghao 2018-06-12-->  
        <head-view title="演出列表" :needBack="false"></head-view>  
        <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">  
             <PerformList :list="PerformList"></PerformList>  

        </mescroll-body>  
    </view>  
</template>  

<script>  
    import PerformList from '@/components/perform/list.vue';  
    export default {  
        components: {  
            PerformList  
        },  
        data() {  
            return {  
                mescroll: null,  
                page: 1,  
                limit: 10,  
                downOption: {  

                },  
                upOption: {  

                },  
                PerformList: []  
            }  
        },  
        onShow() {  
            console.log('xxx');  
            // this.mescroll.resetUpScroll()  
        },  
        methods: {  
            mescrollInit(mescroll) {  
                this.mescroll = mescroll;  
            },  
            downCallback(mescroll) {  
                this.downOption = true;  
                setTimeout(()=>{  
                    // 隐藏下拉加载状态  
                    mescroll.endErr()  
                }, 1000);  
            },  
            upCallback(page) {  
                var that = this;  
                var param = {  
                    page: that.page,  
                    limit: that.limit  
                };  
                that.$api.performList(param, res => {  
                    if (res.code == 200) {  
                        this.PerformList = res.data;  
                        console.log(res.data.length, res.count);  
                        this.mescroll.endBySize(res.data.length, res.count);   
                    }   

                }, false);  
            },  

            getPerformList() {  
                var that = this;  
                that.$api.performList({}, res => {  
                    this.PerformList = res.data;  
                }, false);  
            }  
        }  
    }  
</script>  

<style lang="scss" scoped>  
</style>
2021-09-29 00:06 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复