104 lines
3.4 KiB
Dart
104 lines
3.4 KiB
Dart
import 'package:ef/ef.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
|
|
|
class RepairStatusWidget extends GetView {
|
|
Map data;
|
|
RepairStatusWidget({required this.data}) {}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: MediaQuery.sizeOf(context).width,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
// '2023-08-22 12:12:44',
|
|
MyUtils.timestampToDateString(data["create_time"]),
|
|
style: TextStyle(
|
|
fontFamily: 'Readex Pro',
|
|
fontSize: 21.rpx,
|
|
letterSpacing: 0,
|
|
color: Colors.white,
|
|
// index ==
|
|
// repairInfoController
|
|
// .model.repairProcessList.length -
|
|
// 1
|
|
// ? Colors.white
|
|
// : Colors.white,
|
|
),
|
|
),
|
|
Text(
|
|
// '审核中',
|
|
mapStatusText(data['status']),
|
|
style: TextStyle(
|
|
fontFamily: 'Readex Pro',
|
|
fontSize: 26.rpx,
|
|
letterSpacing: 0,
|
|
color: Colors.white,
|
|
// repairInfoController
|
|
// .model.repairProcessList[index].status ==
|
|
// RepairStatus.pending
|
|
// ? AppColors().check_Color
|
|
// : repairInfoController.model.repairProcessList[index]
|
|
// .status ==
|
|
// RepairStatus.approved ||
|
|
// repairInfoController.model
|
|
// .repairProcessList[index].status ==
|
|
// '维修中'
|
|
// ? AppColors().repair_Color
|
|
// : repairInfoController.model
|
|
// .repairProcessList[index].status ==
|
|
// RepairStatus.completed
|
|
// ? AppColors().finish_Color
|
|
// : AppColors().unOp_Color, // 根据状态设置文字颜色
|
|
),
|
|
),
|
|
|
|
// Align(
|
|
// alignment: AlignmentDirectional(-1, 0),
|
|
// child: Text(
|
|
// // repairProcessModel.content ?? '未备注',
|
|
// (repairInfoController
|
|
// .model.repairProcessList[index].desc?.isEmpty ??
|
|
// true)
|
|
// ? '未备注'
|
|
// : repairInfoController
|
|
// .model.repairProcessList[index].desc!,
|
|
// style: TextStyle(
|
|
// fontFamily: 'Readex Pro',
|
|
// color: Colors.white,
|
|
// fontSize: 20.rpx,
|
|
// letterSpacing: 0,
|
|
// ),
|
|
// ),
|
|
// ),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
/// 状态码映射为文字描述
|
|
static String mapStatusText(int status) {
|
|
switch (status) {
|
|
case 1:
|
|
return '审核中';
|
|
case 2:
|
|
return '亩核通过';
|
|
case 3:
|
|
return '维修中';
|
|
case 4:
|
|
return '维修完成';
|
|
case 5:
|
|
return '已完成';
|
|
case 6:
|
|
return '已评价';
|
|
default:
|
|
return '未知状态';
|
|
}
|
|
}
|
|
}
|