地址接口的视线

This commit is contained in:
czz
2025-06-21 17:55:47 +08:00
parent 41adcedad7
commit ca1995372c
16 changed files with 593 additions and 663 deletions

View File

@@ -6,6 +6,7 @@ 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/component/tool/TopSlideNotification.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';
@@ -23,133 +24,19 @@ class RepairHistoryWidget extends GetView<RepairInfoController> {
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: TextStyle(
// fontFamily: 'Readex Pro',
// color: Color(0xFF333333),
// fontSize: 30.rpx,
// letterSpacing: 0,
// ),
// ),
// ),
// Align(
// alignment: AlignmentDirectional(-1, 0),
// child: Text(
// "报修单号:${repairListController.model.repairList[index].id}",
// style: TextStyle(
// 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: TextStyle(
// 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: TextStyle(
// 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");
TopSlideNotification.show(
context,
text: "功能开发中...",
);
// Get.toNamed("/repairHistoryListPage",
// arguments: repairListController.model.repairList[index]);
},
child: Container(
// height: 119.rpx,
@@ -176,8 +63,8 @@ class RepairHistoryWidget extends GetView<RepairInfoController> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
repairListController
.model.repairList[index].device_category ??
repairListController.model.repairList[index]['device']
[0]['mac'] ??
'',
style: TextStyle(
color: Colors.white, fontSize: 30.rpx, height: 1),
@@ -185,8 +72,8 @@ class RepairHistoryWidget extends GetView<RepairInfoController> {
const SizedBox(height: 4),
Text(
"提交时间:" +
(MyUtils.formatDateTime(repairListController
.model.repairList[index].create_time!) ??
(MyUtils.formatTimestamp(repairListController
.model.repairList[index]["create_time"]) ??
''),
style: TextStyle(
color: Colors.white60, fontSize: 20.rpx, height: 1),
@@ -197,8 +84,8 @@ class RepairHistoryWidget extends GetView<RepairInfoController> {
Row(
children: [
Text(
repairListController.model.repairList[index].status ??
'',
getStatusText(repairListController
.model.repairList[index]['status']),
style: TextStyle(color: Colors.white, fontSize: 26.rpx),
),
ClickableContainer(
@@ -225,4 +112,23 @@ class RepairHistoryWidget extends GetView<RepairInfoController> {
),
)));
}
String getStatusText(dynamic status) {
switch (status?.toString()) {
case '1':
return '审核中';
case '2':
return '审核通过';
case '3':
return '维修中';
case '4':
return '维修完成';
case '5':
return '已完成';
case '6':
return '已评价';
default:
return '未知状态';
}
}
}