下拉正常
上拉之后起始位置就变了
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>
0 个回复