From cb86f0b7d842905fd5e6559c274205466dd15773 Mon Sep 17 00:00:00 2001 From: fengerli <528575642@qq.com> Date: Fri, 26 Sep 2025 13:43:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E9=83=A8=E5=88=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/common/index/index.vue | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pages/common/index/index.vue b/pages/common/index/index.vue index 5ee3b99..4947bab 100644 --- a/pages/common/index/index.vue +++ b/pages/common/index/index.vue @@ -360,29 +360,24 @@ this.loadedCount = 0; // 重置计数 console.log(`第1页加载 - 总数据量: ${this.total}`); } - const newDevices = res.rows.map(device => ({ ...device, showConfirm: false })); - - // 累加已加载数量 this.loadedCount += newDevices.length; console.log(`第${this.page}页加载 - 新增: ${newDevices.length}, 累计: ${this.loadedCount}`); - - // 数据累加逻辑(第一页替换,其他页追加) + // 数据累加 if (this.page === 1) { this.deviceList = newDevices; } else { this.deviceList = [...this.deviceList, ...newDevices]; } - // 关键:正确判断是否加载完成 if (this.loadedCount >= this.total || newDevices.length < this.size) { this.finished = true; console.log(`加载完成 - 已加载${this.loadedCount}/${this.total}`); } else { - this.page++; // 只有还有数据时才增加页码 + this.page++; } resolve(); } else {