From 4dd891d5537a483cbe900a9b2f86091839177a54 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, 3 Jan 2026 16:25:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AD=9B=E9=80=89=E6=97=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9C=AA=E5=8A=A0=E8=BD=BD=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.js | 9 ++++++++- pages/index/index.wxml | 11 +++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pages/index/index.js b/pages/index/index.js index b303104..608921b 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -706,6 +706,7 @@ Page({ filteredGoods: filteredGoods, loadingMore: false, isLoading: false, + isRefreshing: false, // 确保下拉刷新状态被重置 page: this.data.page + 1, // 更新缓存时间戳 lastDataTimestamp: new Date().getTime() @@ -956,7 +957,11 @@ Page({ }) .catch(err => { console.error('加载商品数据失败:', err) - this.setData({ loadingMore: false, isLoading: false }) + this.setData({ + loadingMore: false, + isLoading: false, + isRefreshing: false // 确保下拉刷新状态被重置 + }) }) }, @@ -1056,6 +1061,7 @@ Page({ filteredGoods: filteredGoods, loadingMore: false, isLoading: false, + isRefreshing: false, // 确保下拉刷新状态被重置 hasMoreData: false // 缓存数据不分页 }); }, @@ -1418,6 +1424,7 @@ Page({ goods: [], filteredGoods: [], isLoading: true, + isRefreshing: true, // 添加下拉刷新状态 // 清除所有缓存以获取最新数据 categoryQueryCache: {}, lastDataTimestamp: 0, diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 03b230e..faa507a 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -105,7 +105,7 @@ - + @@ -119,7 +119,7 @@ - + + + + + 📦 + 暂无商品数据 + 下拉刷新试试 +