diff --git a/src/main/ets/view/RefreshView.ets b/src/main/ets/view/RefreshView.ets index 88cb913..ffb6fd8 100644 --- a/src/main/ets/view/RefreshView.ets +++ b/src/main/ets/view/RefreshView.ets @@ -12,6 +12,7 @@ export struct RefreshView { private endY: number = 0 private lastNum: number = 0 private _openMore: boolean = false + private _oTime: number = 0 aboutToAppear(): void { this.onRefresh && this.onRefresh() @@ -43,7 +44,13 @@ export struct RefreshView { if (this.endY - this.startY < -100 && this._openMore) { const v = this.data && (this.data.length % this.pageSize) === 0 if (v) { - this.onLoadMore && this.onLoadMore(Math.floor(this.data.length / this.pageSize)) + + const cTime = new Date().getTime() + // 2024.11.21 测试觉得刷新太多了,暂时改为1秒5间隔 + if (cTime - this._oTime > 1500) { + this.onLoadMore && this.onLoadMore(Math.floor(this.data.length / this.pageSize)) + this._oTime = cTime + } } else { ToolsHelper.showMessage('没有更多数据了') }