|
@@ -75,15 +75,26 @@ export default {
|
|
|
});
|
|
|
}, 300);
|
|
|
},
|
|
|
- handleScroll() {
|
|
|
- const observer = uni.createIntersectionObserver(this);
|
|
|
- observer.relativeToViewport({bottom: 100}).observe('.loading-status', (res) => {
|
|
|
- if (res.intersectionRatio > 0 && !this.loading && !this.noMore) {
|
|
|
- this.notice_system_list();
|
|
|
- this.page++;
|
|
|
+ handleScroll() {
|
|
|
+ // 先销毁之前的观察器
|
|
|
+ if (this.observer) {
|
|
|
+ this.observer.disconnect();
|
|
|
+ this.observer = null;
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
+ // 创建新的观察器
|
|
|
+ this.observer = uni.createIntersectionObserver(this);
|
|
|
+ this.observer.relativeToViewport({
|
|
|
+ bottom: 50 // 调整为更小的阈值,提高触发灵敏度
|
|
|
+ }).observe('.loading-status', (res) => {
|
|
|
+ if (res.intersectionRatio > 0 && !this.loading && !this.noMore) {
|
|
|
+ this.loading = true; // 添加加载状态
|
|
|
+ this.notice_system_list().finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ this.page++;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
formatTimestamp(timestamp) {
|
|
|
if (timestamp) {
|
|
|
timestamp = timestamp * 1000;
|