|
@@ -12,6 +12,7 @@ export struct RefreshView {
|
|
private endY: number = 0
|
|
private endY: number = 0
|
|
private lastNum: number = 0
|
|
private lastNum: number = 0
|
|
private _openMore: boolean = false
|
|
private _openMore: boolean = false
|
|
|
|
+ private _oTime: number = 0
|
|
|
|
|
|
aboutToAppear(): void {
|
|
aboutToAppear(): void {
|
|
this.onRefresh && this.onRefresh()
|
|
this.onRefresh && this.onRefresh()
|
|
@@ -43,7 +44,13 @@ export struct RefreshView {
|
|
if (this.endY - this.startY < -100 && this._openMore) {
|
|
if (this.endY - this.startY < -100 && this._openMore) {
|
|
const v = this.data && (this.data.length % this.pageSize) === 0
|
|
const v = this.data && (this.data.length % this.pageSize) === 0
|
|
if (v) {
|
|
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 {
|
|
} else {
|
|
ToolsHelper.showMessage('没有更多数据了')
|
|
ToolsHelper.showMessage('没有更多数据了')
|
|
}
|
|
}
|