调整
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:ln_jq_app/common/login_util.dart';
|
||||
import 'package:ln_jq_app/common/styles/theme.dart';
|
||||
import 'package:ln_jq_app/pages/b_page/history/view.dart';
|
||||
import 'package:ln_jq_app/pages/c_page/message/view.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import 'controller.dart';
|
||||
|
||||
@@ -19,7 +20,12 @@ class SitePage extends GetView<SiteController> {
|
||||
builder: (_) {
|
||||
return Scaffold(
|
||||
backgroundColor: Color.fromRGBO(247, 249, 251, 1),
|
||||
body: SingleChildScrollView(child: _buildView(context)),
|
||||
body: SmartRefresher(
|
||||
controller: controller.refreshController,
|
||||
enablePullUp: false,
|
||||
onRefresh: controller.onRefresh,
|
||||
child: SingleChildScrollView(child: _buildView(context)),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -127,10 +133,10 @@ class SitePage extends GetView<SiteController> {
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 35.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 75.h),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -180,12 +186,11 @@ class SitePage extends GetView<SiteController> {
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async{
|
||||
onPressed: () async {
|
||||
var scanResult = await Get.to(() => const MessagePage());
|
||||
if (scanResult == null) {
|
||||
controller.msgNotice();
|
||||
}
|
||||
|
||||
},
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: Colors.grey[100],
|
||||
@@ -495,7 +500,7 @@ class SitePage extends GetView<SiteController> {
|
||||
"预约量:${item.amount}",
|
||||
style: TextStyle(
|
||||
color: Color(0xFF00A870),
|
||||
fontSize: 12.sp,
|
||||
fontSize: 13.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
@@ -510,7 +515,7 @@ class SitePage extends GetView<SiteController> {
|
||||
"${item.contactPerson} | ${item.contactPhone}",
|
||||
style: TextStyle(
|
||||
color: Color(0xFF999999),
|
||||
fontSize: 12.sp,
|
||||
fontSize: 13.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user