刷新条件

This commit is contained in:
2025-12-11 13:45:26 +08:00
parent b52659df6c
commit 4ace3c9f27
2 changed files with 6 additions and 5 deletions

View File

@@ -140,8 +140,7 @@ class SiteController extends GetxController with BaseControllerMixin {
void onInit() { void onInit() {
super.onInit(); super.onInit();
renderData(); renderData();
//加载列表数据
fetchReservationData();
startAutoRefresh(); startAutoRefresh();
} }
@@ -158,7 +157,7 @@ class SiteController extends GetxController with BaseControllerMixin {
// 创建一个每5分钟执行一次的周期性定时器 // 创建一个每5分钟执行一次的周期性定时器
_refreshTimer = Timer.periodic(const Duration(minutes: 5), (timer) { _refreshTimer = Timer.periodic(const Duration(minutes: 5), (timer) {
fetchReservationData(); renderData();
}); });
} }
@@ -578,7 +577,9 @@ class SiteController extends GetxController with BaseControllerMixin {
} }
} catch (e) { } catch (e) {
} finally { } finally {
updateUi();
//加载列表数据
fetchReservationData();
} }
} }
} }

View File

@@ -145,7 +145,7 @@ class SitePage extends GetView<SiteController> {
), ),
ElevatedButton.icon( ElevatedButton.icon(
onPressed: () { onPressed: () {
controller.fetchReservationData(); controller.renderData();
}, },
icon: const Icon(Icons.refresh, size: 16), icon: const Icon(Icons.refresh, size: 16),
label: const Text('刷新'), label: const Text('刷新'),