预约列表增加筛选条件
This commit is contained in:
@@ -7,10 +7,13 @@ import 'package:ln_jq_app/pages/qr_code/view.dart';
|
||||
import 'package:ln_jq_app/storage_service.dart';
|
||||
|
||||
import 'controller.dart';
|
||||
import 'reservation_list_bottomsheet.dart';
|
||||
|
||||
///加氢预约
|
||||
class ReservationPage extends GetView<C_ReservationController> {
|
||||
const ReservationPage({super.key});
|
||||
ReservationPage({super.key});
|
||||
|
||||
bool init = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -18,6 +21,10 @@ class ReservationPage extends GetView<C_ReservationController> {
|
||||
init: C_ReservationController(),
|
||||
id: 'reservation',
|
||||
builder: (_) {
|
||||
if (!init) {
|
||||
_setupListener(context);
|
||||
init = true;
|
||||
}
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.grey[100],
|
||||
body: GestureDetector(
|
||||
@@ -299,7 +306,9 @@ class ReservationPage extends GetView<C_ReservationController> {
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: OutlinedButton(
|
||||
onPressed: controller.getReservationList,
|
||||
onPressed: () {
|
||||
controller.getReservationList(showPopup: true, addStatus: '');
|
||||
},
|
||||
style: OutlinedButton.styleFrom(
|
||||
minimumSize: const Size(double.infinity, 38), // 高度与另一个按钮保持一致
|
||||
side: const BorderSide(color: Colors.blue),
|
||||
@@ -326,6 +335,21 @@ class ReservationPage extends GetView<C_ReservationController> {
|
||||
);
|
||||
}
|
||||
|
||||
void _setupListener(BuildContext context) {
|
||||
ever(controller.shouldShowReservationList, (bool shouldShow) {
|
||||
if (shouldShow) {
|
||||
Get.bottomSheet(
|
||||
const ReservationListBottomSheet(),
|
||||
isScrollControlled: true, // 允许弹窗使用更多屏幕高度
|
||||
backgroundColor: Colors.transparent,
|
||||
);
|
||||
|
||||
// 重要:显示后立即将信号重置为 false,防止不必要的重复弹出
|
||||
controller.shouldShowReservationList.value = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 表单中的可点击行 (用于日期和时间选择)
|
||||
Widget _buildPickerRow({
|
||||
required String label,
|
||||
|
||||
Reference in New Issue
Block a user