Files
tuiche/lib/pages/mh_page/repair_history_widget.dart
2025-06-11 08:47:06 +08:00

229 lines
9.3 KiB
Dart

import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/appColors.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/controller/mh_controller/repair_info_controller.dart';
import 'package:vbvs_app/controller/mh_controller/repair_list_controller.dart';
import 'package:vbvs_app/pages/mh_page/ColorChangeOnTap.dart';
import '../../common/color/appFontsize.dart';
class RepairHistoryWidget extends GetView<RepairInfoController> {
int index;
RepairListController repairListController;
RepairHistoryWidget(
{required this.index, required this.repairListController}) {}
@override
Widget build(BuildContext context) {
int tmp = index;
index = tmp;
// return ColorChangeOnPress(
// pressColor: AppColors().press_color, // 按下时的颜色
// shouldNavigate: true, // 是否需要跳转
// routeName: "/repairHistoryListPage", // 路由名称
// topLeft: 16,
// topRight: 16,
// bottomLeft: 16,
// bottomRight: 16,
// onTap: () async {
// print("object");
// final RepairInfoController repairInfoController =
// Get.find<RepairInfoController>();
// await repairInfoController
// .initData(repairListController.model.repairList[index])
// .then((_) {
// repairInfoController.updateAll();
// // Get.toNamed("/repairHistoryListPage"); // 这个在 ColorChangeOnPress 中已经处理
// });
// },
// child: Container(
// width: MediaQuery.sizeOf(context).width,
// constraints: BoxConstraints(
// minHeight: 70,
// ),
// child: Padding(
// padding: EdgeInsetsDirectional.fromSTEB(15, 14, 15, 13),
// child: Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Container(
// width: MediaQuery.sizeOf(context).width * 0.5,
// child: Column(
// mainAxisSize: MainAxisSize.max,
// children: [
// Align(
// alignment: AlignmentDirectional(-1, 0),
// child: Text(
// repairListController
// .model.repairList[index].device_category ??
// '',
// style: FlutterFlowTheme.of(context).bodyMedium.override(
// fontFamily: 'Readex Pro',
// color: Color(0xFF333333),
// fontSize: 30.rpx,
// letterSpacing: 0,
// ),
// ),
// ),
// Align(
// alignment: AlignmentDirectional(-1, 0),
// child: Text(
// "报修单号:${repairListController.model.repairList[index].id}",
// style: FlutterFlowTheme.of(context).bodyMedium.override(
// fontFamily: 'Readex Pro',
// color: Color(0xFFC8CBD2),
// fontSize: AppFontsize.small_text_size,
// letterSpacing: 0,
// ),
// ),
// ),
// Align(
// alignment: AlignmentDirectional(-1, 0),
// child: Text(
// "提交时间:" +
// (MyUtils.formatDateTime(repairListController
// .model.repairList[index].create_time!) ??
// ''),
// style: FlutterFlowTheme.of(context).bodyMedium.override(
// fontFamily: 'Readex Pro',
// color: Color(0xFFC8CBD2),
// fontSize: AppFontsize.small_text_size,
// letterSpacing: 0,
// ),
// ),
// ),
// ],
// ),
// ),
// Container(
// width: MediaQuery.sizeOf(context).width * 0.2,
// height: MediaQuery.sizeOf(context).height * 0.075,
// constraints: BoxConstraints(
// maxWidth: 130,
// ),
// child: Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Align(
// alignment: AlignmentDirectional(0, 0),
// child: Text(
// repairListController.model.repairList[index].status ??
// '',
// style: FlutterFlowTheme.of(context).bodyMedium.override(
// fontFamily: 'Readex Pro',
// color: Color(0xFF333333),
// fontSize: AppFontsize.normal_text_size,
// letterSpacing: 0,
// ),
// ),
// ),
// Flexible(
// child: Align(
// alignment: AlignmentDirectional(0, 0.05),
// child: Icon(
// Icons.arrow_forward_ios,
// color: FlutterFlowTheme.of(context).secondaryText,
// size: 10,
// ),
// ),
// ),
// ].divide(SizedBox(width: 27)),
// ),
// ),
// ],
// ),
// ),
// ),
// );
return ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: Color(0XFF055466),
padding: EdgeInsets.only(top: 0),
onTap: () {
Get.toNamed("/repairHistoryListPage");
},
child: Container(
// height: 119.rpx,
height: MediaQuery.sizeOf(context).height * 0.0733,
decoration: BoxDecoration(
// color: const Color(0xFF06486F),
border: Border(
top: index == 0
? BorderSide(color: const Color(0xFF929699), width: 1.rpx)
: BorderSide.none,
bottom:
BorderSide(color: const Color(0xFF929699), width: 1.rpx),
),
),
child: Padding(
padding: EdgeInsets.fromLTRB(17.rpx, 0, 30.rpx, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// 左侧设备信息
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
repairListController
.model.repairList[index].device_category ??
'',
style: TextStyle(
color: Colors.white, fontSize: 30.rpx, height: 1),
),
const SizedBox(height: 4),
Text(
"提交时间:" +
(MyUtils.formatDateTime(repairListController
.model.repairList[index].create_time!) ??
''),
style: TextStyle(
color: Colors.white60, fontSize: 20.rpx, height: 1),
),
],
),
// 右侧状态
Row(
children: [
Text(
repairListController.model.repairList[index].status ??
'',
style: TextStyle(color: Colors.white, fontSize: 26.rpx),
),
ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: Colors.transparent,
padding: EdgeInsets.only(right: 0),
onTap: () {},
child: Container(
height: 30.rpx,
width: 30.rpx,
child: SvgPicture.asset(
'assets/img/icon/expand.svg',
color: Colors.white,
)
// Icon(
// Icons.arrow_forward_ios,
// color: Colors.white,
// // size: 14.rpx,
// ),
)),
],
)
],
),
)));
}
}