预约页面
This commit is contained in:
@@ -6,13 +6,28 @@ class SiteController extends GetxController with BaseControllerMixin {
|
||||
|
||||
SiteController();
|
||||
|
||||
bool hasReservationData = false;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
fetchReservationData();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
Future<void> fetchReservationData() async {
|
||||
|
||||
showLoading("加载中");
|
||||
// 模拟网络请求延迟
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
|
||||
hasReservationData = !hasReservationData;
|
||||
|
||||
dismissLoading();
|
||||
updateUi();
|
||||
}
|
||||
|
||||
// 如果需要一个方法来清空数据
|
||||
void clearData() {
|
||||
hasReservationData = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user