From 701a29546fc1562c5c2d06c4a841c4b09862d537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=A3=9E=E6=B4=8B?= <15778543+xufeiyang6017@user.noreply.gitee.com> Date: Sat, 10 Jan 2026 15:16:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8B=E6=8B=89=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E5=90=8E=E5=8A=A0=E8=BD=BD=E9=94=99=E8=AF=AF=E5=95=86?= =?UTF-8?q?=E5=93=81=E7=8A=B6=E6=80=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pages/index/index.js b/pages/index/index.js index 4777554..ab1ac9b 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -457,7 +457,10 @@ Page({ // 保存当前筛选条件,用于验证请求结果 refreshCategory: currentCategory, refreshKeyword: currentKeyword, - refreshRegion: currentRegion + refreshRegion: currentRegion, + // 下拉刷新时确保从published状态开始加载 + isQueryingSoldOut: false, + publishedHasMore: true }) const timestamp = new Date().getTime(); @@ -956,6 +959,9 @@ Page({ const currentKeyword = this.data.searchKeyword; const cacheKey = `${currentCategory}_${currentKeyword}`; + // 下拉刷新后检查返回的商品数量,决定是否还有更多published商品 + const hasMorePublished = newGoodsOnly.length >= this.data.pageSize; + this.setData({ goods: newGoodsOnly, filteredGoods: filteredGoods, @@ -963,6 +969,11 @@ Page({ loadingMore: false, isLoading: false, page: this.data.page + 1, + // 确保下拉刷新后继续加载published状态商品 + isQueryingSoldOut: !hasMorePublished, + publishedHasMore: hasMorePublished, + // 如果切换到售空商品,重置售空商品页码 + soldOutPage: !hasMorePublished ? 1 : this.data.soldOutPage, // 更新缓存时间戳 lastDataTimestamp: new Date().getTime() })