mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-06-12 21:29:31 +08:00
优化:重写友链列表,兼容微信小程序;
优化:解决分类功能滚动回弹问题;
This commit is contained in:
@@ -23,6 +23,10 @@
|
||||
@refresherrefresh="fnGetData(true)"
|
||||
@scrolltolower="fnGetData(false)"
|
||||
@scroll="fnOnScroll"
|
||||
@touchmove.stop
|
||||
@touchstart="fnOnTouchStart"
|
||||
@touchend="fnOnTouchEnd"
|
||||
@touchcancel="fnOnTouchEnd"
|
||||
>
|
||||
<view v-if="dataList.length == 0" class="article-empty flex flex-center">
|
||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="该分类下暂无文章~"></tm-empty>
|
||||
@@ -78,6 +82,8 @@ export default {
|
||||
isLoadMore: false,
|
||||
loadMoreText: '',
|
||||
scrollTop: 0,
|
||||
tempScrollTop: 0,
|
||||
scrollTimeout: null,
|
||||
triggered: false
|
||||
};
|
||||
},
|
||||
@@ -181,9 +187,7 @@ export default {
|
||||
});
|
||||
},
|
||||
fnOnScroll(e) {
|
||||
throttle(() => {
|
||||
this.scrollTop = e.detail.scrollTop;
|
||||
}, 1000);
|
||||
this.tempScrollTop = e.detail.scrollTop;
|
||||
},
|
||||
fnToTopScroll() {
|
||||
uni.pageScrollTo({
|
||||
@@ -191,6 +195,15 @@ export default {
|
||||
duration: 500
|
||||
});
|
||||
this.scrollTop = 0;
|
||||
this.tempScrollTop = 0;
|
||||
},
|
||||
fnOnTouchStart() {
|
||||
clearTimeout(this.scrollTimeout);
|
||||
},
|
||||
fnOnTouchEnd() {
|
||||
this.scrollTimeout = setTimeout(() => {
|
||||
this.scrollTop = this.tempScrollTop;
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user