Files
biz_xfj_cloud/lib/pages/terminal/menu_query/view.dart
T

142 lines
4.8 KiB
Dart

import 'package:ducafe_ui_core/ducafe_ui_core.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:pj_supermarket_cloud/common/index.dart';
import 'controller.dart';
import 'widgets/identity_summary.dart';
import 'widgets/query_method_panel.dart';
import 'widgets/reservation_result_panel.dart';
class ReservationMenuQueryPage extends GetView<ReservationMenuQueryController> {
const ReservationMenuQueryPage({super.key});
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.all(6.w),
child: Obx(
() => Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
SizedBox(
width: 300.w,
child: TerminalSurface(
padding: EdgeInsets.all(12.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
_QueryTitle(status: controller.status.value),
SizedBox(height: 10.h),
QueryMethodPanel(
selected: controller.method.value,
status: controller.status.value,
onSelect: controller.selectMethod,
onStart: controller.startRecognition,
),
SizedBox(height: 12.h),
const Divider(height: 1, color: XfjDesignTokens.line),
SizedBox(height: 12.h),
Expanded(
child: IdentitySummary(
status: controller.status.value,
method: controller.method.value,
result: controller.result.value,
errorMessage: controller.errorMessage.value,
onRetry: controller.startRecognition,
),
),
Container(
padding: EdgeInsets.all(12.w),
decoration: BoxDecoration(
color: XfjDesignTokens.canvas,
borderRadius: BorderRadius.circular(
XfjDesignTokens.controlRadius,
),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.info_outline_rounded,
color: XfjDesignTokens.primary,
size: 19.w,
),
SizedBox(width: 8.w),
Expanded(
child: Text(
'饭卡或人脸只用于识别当前学生本人,系统不会提供其他学生的选择入口。',
style: TextStyle(
color: XfjDesignTokens.muted,
fontSize: 13.sp,
height: 1.55,
),
),
),
],
),
),
],
),
),
),
SizedBox(width: 12.w),
Expanded(
child: ReservationResultPanel(
status: controller.status.value,
method: controller.method.value,
result: controller.result.value,
currentDays: controller.currentDays,
currentPage: controller.currentPage.value,
totalPages: controller.totalPages,
remainingSeconds: controller.remainingSeconds.value,
errorMessage: controller.errorMessage.value,
onRetry: controller.startRecognition,
onPageChanged: controller.changePage,
),
),
],
),
),
);
}
}
class _QueryTitle extends StatelessWidget {
const _QueryTitle({required this.status});
final ReservationMenuQueryStatus status;
@override
Widget build(BuildContext context) {
return Row(
children: [
Text(
'预约查询',
style: TextStyle(
color: XfjDesignTokens.ink,
fontSize: 22.sp,
fontWeight: FontWeight.w800,
),
),
const Spacer(),
Icon(
Icons.check_circle_rounded,
color: XfjDesignTokens.success,
size: 18.w,
),
SizedBox(width: 5.w),
Text(
'设备在线',
style: TextStyle(
color: XfjDesignTokens.success,
fontSize: 12.sp,
fontWeight: FontWeight.w700,
),
),
],
);
}
}