145 lines
5.7 KiB
Dart
145 lines
5.7 KiB
Dart
import 'package:ef/ef.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
|
import 'package:vbvs_app/common/color/appColors.dart';
|
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
|
import 'package:vbvs_app/controller/mh/repair_info_controller.dart';
|
|
import 'package:vbvs_app/controller/mh/repair_list_controller.dart';
|
|
import 'package:vbvs_app/pages/device_control/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: AppFontsize.title_size,
|
|
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)),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|