更新
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import 'package:ef/base/widget/flutterflow/FlutterFlowTheme.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.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/CustomCard.dart';
|
||||
import 'package:vbvs_app/routers/routers.dart';
|
||||
|
||||
class RepairHistoryInfoWidget extends StatefulWidget {
|
||||
const RepairHistoryInfoWidget({super.key});
|
||||
var data;
|
||||
RepairHistoryInfoWidget({super.key, required this.data});
|
||||
|
||||
@override
|
||||
State<RepairHistoryInfoWidget> createState() =>
|
||||
@@ -29,226 +29,283 @@ class _RepairHistoryInfoWidgetState extends State<RepairHistoryInfoWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ClickableContainer(
|
||||
borderRadius: AppConstants().normal_container_radius,
|
||||
onTap: () {
|
||||
//跳转详情
|
||||
},
|
||||
// colors: [
|
||||
// themeController.currentColor.sc5,
|
||||
// ],
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: themeController.currentColor.sc21,
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(AppConstants().normal_container_radius),
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(30.rpx, 36.rpx, 0.rpx, 36.rpx),
|
||||
return Stack(
|
||||
children: [
|
||||
ClickableContainer(
|
||||
borderRadius: AppConstants().normal_container_radius,
|
||||
onTap: () {
|
||||
//跳转详情
|
||||
},
|
||||
// colors: [
|
||||
// themeController.currentColor.sc5,
|
||||
// ],
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: themeController.currentColor.sc21,
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.14,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 130.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'设备类型'.tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(AppConstants().normal_container_radius),
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(30.rpx, 36.rpx, 0.rpx, 36.rpx),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.17,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 140.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'设备类型'.tr,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'智能床',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle:
|
||||
FlutterFlowTheme.of(context).bodyMedium.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.14,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 130.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'设备ID'.tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
Text(
|
||||
'${widget.data['type']}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
Text(
|
||||
'15561651',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle:
|
||||
FlutterFlowTheme.of(context).bodyMedium.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.14,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 130.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'联系人'.tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.17,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 140.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'设备ID'.tr,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'王明',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle:
|
||||
FlutterFlowTheme.of(context).bodyMedium.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.14,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 130.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'发生时间'.tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${getDeviceInfo(widget.data)}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
Text(
|
||||
'2022-08-01 15:05',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle:
|
||||
FlutterFlowTheme.of(context).bodyMedium.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.17,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 140.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'联系人'.tr,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${widget.data['contacts']?['name']}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.17,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 140.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'发生时间'.tr,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${MyUtils.timestampToDateString(widget.data['create_time'])}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 34.rpx)),
|
||||
),
|
||||
].divide(SizedBox(height: 34.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 40.rpx,
|
||||
right: 20.rpx,
|
||||
child: Container(
|
||||
width: 123.rpx,
|
||||
height: 47.rpx,
|
||||
child: CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius, // 直角
|
||||
colors: [
|
||||
themeController.currentColor.sc4.withOpacity(0.3),
|
||||
],
|
||||
enableAnimation: true, // 有点击缩放动画
|
||||
enableGradient: false, // 不用渐变
|
||||
onTap: () {
|
||||
Get.toNamed("/repairDetailPage", arguments: widget.data);
|
||||
},
|
||||
child: Center(
|
||||
child: Text(
|
||||
"查看".tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
String getDeviceInfo(Map data) {
|
||||
if (data['device'] == null || data['device'] is! List) {
|
||||
return '';
|
||||
}
|
||||
|
||||
List deviceList = data['device'];
|
||||
List<String> result = deviceList.map((device) {
|
||||
final name = device['name'] ?? '';
|
||||
final code = device['code'];
|
||||
final mac = device['mac'] ?? '';
|
||||
final suffix = (code != null && code.toString().isNotEmpty) ? code : mac;
|
||||
return '$name($suffix)';
|
||||
}).toList();
|
||||
|
||||
return result.join(', ');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user