scroll-view无法下拉刷新和上拉加载。
<scroll-view class="content" scroll-y="true" scroll-with-animation="true" @touchstart="handleScrollStart" @touchend="handleScrollEnd"></scroll-view>
handleScrollStart:function(e){
let _this = this;
let moveStartY = e.changedTouches[0].pageY;
_this.moveStartY = moveStartY;
},
handleScrollEnd:function(e){
let _this = this;
let moveEndY = e.changedTouches[0].pageY;
//下滑
if(moveEndY - _this.moveStartY > 200){
uni.startPullDownRefresh();
...
}
//上划
if( _this.moveStartY - moveEndY > 200 ){
...
}
}
但是这种方法,会导致用户正常地划动页面也触发事件,不太可取。