调整
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:getx_scaffold/getx_scaffold.dart';
|
||||
import 'package:ln_jq_app/common/model/base_model.dart';
|
||||
import 'package:ln_jq_app/common/styles/theme.dart';
|
||||
import 'package:ln_jq_app/storage_service.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
enum ReservationStatus {
|
||||
pending, // 待处理 ( addStatus: 0)
|
||||
@@ -144,6 +145,7 @@ class SiteController extends GetxController with BaseControllerMixin {
|
||||
|
||||
final TextEditingController searchController = TextEditingController();
|
||||
bool isNotice = false;
|
||||
final RefreshController refreshController = RefreshController(initialRefresh: false);
|
||||
|
||||
@override
|
||||
bool get listenLifecycleEvent => true;
|
||||
@@ -200,6 +202,8 @@ class SiteController extends GetxController with BaseControllerMixin {
|
||||
});
|
||||
}
|
||||
|
||||
void onRefresh() => renderData(isRefresh: true);
|
||||
|
||||
///停止定时器的方法
|
||||
void stopAutoRefresh() {
|
||||
// 如果定时器存在并且是激活状态,就取消它
|
||||
@@ -222,7 +226,7 @@ class SiteController extends GetxController with BaseControllerMixin {
|
||||
'pageNum': 1,
|
||||
'pageSize': 50, // 暂时不考虑分页,一次获取30条
|
||||
'keyword': searchText, // 加氢站名称、手机号
|
||||
'stationId': StorageService.to.userId
|
||||
'stationId': StorageService.to.userId,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -588,7 +592,7 @@ class SiteController extends GetxController with BaseControllerMixin {
|
||||
String orderTotalAmount = "";
|
||||
String orderUnfinishedAmount = "";
|
||||
|
||||
Future<void> renderData() async {
|
||||
Future<void> renderData({bool isRefresh = false}) async {
|
||||
try {
|
||||
var responseData = await HttpService.to.get(
|
||||
'appointment/station/getStationInfoById?hydrogenId=${StorageService.to.userId}',
|
||||
@@ -621,6 +625,10 @@ class SiteController extends GetxController with BaseControllerMixin {
|
||||
} finally {
|
||||
//加载列表数据
|
||||
fetchReservationData();
|
||||
|
||||
if (isRefresh) {
|
||||
refreshController.refreshCompleted();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user