地址接口的视线
This commit is contained in:
@@ -15,35 +15,37 @@ import '../../controller/mh_controller/apply_repair_controller.dart';
|
||||
import '../../controller/mh_controller/repair_info_controller.dart';
|
||||
|
||||
class RepairHistoryListPage extends GetView<RepairInfoController> {
|
||||
Map data;
|
||||
RepairHistoryListPage({Key? key, required this.data});
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
BoxConstraints? bodysize;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
controller.model.applyRepairModel = ApplyRepairModel()
|
||||
..id = 1001
|
||||
..apply_name = '张三'
|
||||
..tel = '13812345678'
|
||||
..address = '北京市海淀区清华东路66号'
|
||||
..desc = '床垫传感器失灵,无法监测心率和呼吸'
|
||||
..create_time = DateTime.parse('2025-05-01 10:00:00')
|
||||
..device_type = '床垫'
|
||||
..device_category = 'BY-H'
|
||||
..device_id = 'BD202505011001'
|
||||
..device_name = '智能床垫 BY-H 型号'
|
||||
..issue_img = [
|
||||
'https://example.com/img1.jpg',
|
||||
'https://example.com/img2.jpg'
|
||||
]
|
||||
..imagesLImit = 3
|
||||
..img_bucket = 'mianhuatang_repair'
|
||||
..status = '待处理'
|
||||
..select_device = '床垫/BY-H/智能床垫'
|
||||
..device_list = ['床垫/BY-H/智能床垫', '床垫/BY-A/智能床垫', '床垫/BY-C/智能床垫']
|
||||
..score = null
|
||||
..score_time = null
|
||||
..messageType = 1
|
||||
..repairId = 1001;
|
||||
// controller.model.applyRepairModel = ApplyRepairModel()
|
||||
// ..id = 1001
|
||||
// ..apply_name = '张三'
|
||||
// ..tel = '13812345678'
|
||||
// ..desc = '床垫传感器失灵,无法监测心率和呼吸'
|
||||
// ..create_time = DateTime.parse('2025-05-01 10:00:00')
|
||||
// ..device_type = 1
|
||||
// ..device_category = 'BY-H'
|
||||
// ..device_id = 'BD202505011001'
|
||||
// ..device_name = '智能床垫 BY-H 型号'
|
||||
// ..issue_img = [
|
||||
// 'https://example.com/img1.jpg',
|
||||
// 'https://example.com/img2.jpg'
|
||||
// ]
|
||||
// ..imagesLImit = 3
|
||||
// ..img_bucket = 'mianhuatang_repair'
|
||||
// ..status = '待处理'
|
||||
// ..select_device = '床垫/BY-H/智能床垫'
|
||||
// ..device_list = ['床垫/BY-H/智能床垫', '床垫/BY-A/智能床垫', '床垫/BY-C/智能床垫']
|
||||
// ..score = null
|
||||
// ..score_time = null
|
||||
// ..messageType = 1
|
||||
// ..repairId = 1001;
|
||||
|
||||
controller.model.repairProcessList = [
|
||||
RepairProcessModel()
|
||||
@@ -154,10 +156,7 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
||||
-1, 0),
|
||||
child: Text(
|
||||
// 'SWES01号智能一键入眠床',
|
||||
controller
|
||||
.model
|
||||
.applyRepairModel!
|
||||
.device_name ??
|
||||
data['device'][0]['name'] ??
|
||||
'未命名',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
@@ -173,10 +172,8 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
||||
-1, 0),
|
||||
child: Text(
|
||||
'系列:' +
|
||||
(controller
|
||||
.model
|
||||
.applyRepairModel!
|
||||
.device_category ??
|
||||
(data['device'][0][
|
||||
'device_category'] ??
|
||||
'未命名'),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
@@ -193,11 +190,12 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
||||
-1, 0),
|
||||
child: Text(
|
||||
'类型:' +
|
||||
(controller
|
||||
.model
|
||||
.applyRepairModel!
|
||||
.device_type ??
|
||||
'未命名'),
|
||||
getDeviceTypeName(
|
||||
controller
|
||||
.model
|
||||
.applyRepairModel
|
||||
?.device_type,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: const Color(
|
||||
@@ -254,11 +252,9 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
||||
-1, 0),
|
||||
child: Text(
|
||||
'提交时间:' +
|
||||
(MyUtils.formatDateTime(
|
||||
controller
|
||||
.model
|
||||
.applyRepairModel!
|
||||
.create_time!)),
|
||||
(MyUtils.formatDateTimeDay(
|
||||
data['device'][0][
|
||||
'create_time']!)),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: const Color(
|
||||
@@ -274,10 +270,8 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
||||
-1, 0),
|
||||
child: Text(
|
||||
'问题描述:' +
|
||||
(controller
|
||||
.model
|
||||
.applyRepairModel!
|
||||
.desc ??
|
||||
(data['device'][0]
|
||||
['desc'] ??
|
||||
'未命名'),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
@@ -755,4 +749,17 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
||||
|
||||
return images;
|
||||
}
|
||||
|
||||
String getDeviceTypeName(int? type) {
|
||||
switch (type) {
|
||||
case 1:
|
||||
return '体征检测设备';
|
||||
case 2:
|
||||
return '智能床';
|
||||
case 3:
|
||||
return '智能床垫';
|
||||
default:
|
||||
return '未知设备';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,12 +41,6 @@ class DeviceRepairPage extends GetView<RepairListController> {
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(builder: (context, cc) {
|
||||
bodysize = cc;
|
||||
controller.model.repairList = List.generate(4, (index) {
|
||||
return ApplyRepairModel()
|
||||
..device_category = "SWESO1号智能一键入眠床"
|
||||
..status = index == 0 ? "已提交" : "已完成"
|
||||
..create_time = DateTime(2024, 5, 12, 12, 5, 12);
|
||||
});
|
||||
return GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
@@ -175,54 +169,7 @@ class DeviceRepairPage extends GetView<RepairListController> {
|
||||
))),
|
||||
SizedBox(height: 24.rpx),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
// bool isOk = true;
|
||||
// for (var i = 0; i < 2; i++) {
|
||||
// var d = controller.model.peopleList[i];
|
||||
// print("${d.toJson()}");
|
||||
// String before = "人员信息${i == 0 ? "A" : "B"}:";
|
||||
// if (isOk &&
|
||||
// d.height != null &&
|
||||
// d.height != "" &&
|
||||
// int.tryParse("${d.height}") == null) {
|
||||
// showToast("$before身高请输入数字");
|
||||
// isOk = false;
|
||||
// }
|
||||
// if (isOk &&
|
||||
// d.weight != null &&
|
||||
// d.weight != "" &&
|
||||
// int.tryParse("${d.weight}") == null) {
|
||||
// showToast("$before体重请输入数字");
|
||||
// isOk = false;
|
||||
// }
|
||||
// if (isOk &&
|
||||
// d.tel != null &&
|
||||
// d.tel != "" &&
|
||||
// MyUtils.isValidPhoneNumber("${d.tel}") ==
|
||||
// false) {
|
||||
// showToast("$before请输入正确的电话");
|
||||
// isOk = false;
|
||||
// }
|
||||
// if (isOk &&
|
||||
// d.emergencyContact != null &&
|
||||
// d.emergencyContact != "" &&
|
||||
// MyUtils.isValidPhoneNumber(
|
||||
// "${d.emergencyContact}") ==
|
||||
// false) {
|
||||
// showToast("$before请输入正确的紧急联系人电话");
|
||||
// isOk = false;
|
||||
// }
|
||||
// if (isOk) {
|
||||
// controller.savePeoples().then((d) {
|
||||
// showToast("保存成功", color: color_success);
|
||||
// }).catchError((d) {
|
||||
// print("$d");
|
||||
// showToast("保存失败");
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// controller.model.peopleList.forEach((d) {});
|
||||
},
|
||||
onTap: () {},
|
||||
child: CustomCard(
|
||||
borderRadius: 16.rpx,
|
||||
gradientDirection: GradientDirection.vertical,
|
||||
@@ -268,119 +215,51 @@ class DeviceRepairPage extends GetView<RepairListController> {
|
||||
),
|
||||
|
||||
SizedBox(height: 32.rpx),
|
||||
|
||||
// 报修历史列表
|
||||
// Expanded(
|
||||
// child: ListView.builder(
|
||||
// itemCount: mockData.length,
|
||||
// itemBuilder: (context, index) {
|
||||
// final item = mockData[index];
|
||||
// return ClickableContainer(
|
||||
// backgroundColor: Colors.transparent,
|
||||
// highlightColor: Color(0XFF055466),
|
||||
// padding: EdgeInsets.only(top: 0),
|
||||
// onTap: () {
|
||||
// Get.toNamed("/repairHistoryListPage");
|
||||
// },
|
||||
// child: Container(
|
||||
// height: 119.rpx,
|
||||
// // margin: const EdgeInsets.only(bottom: 10),
|
||||
// // padding: const EdgeInsets.symmetric(
|
||||
// // vertical: 12, horizontal: 16),
|
||||
// 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(
|
||||
// item.device_name ?? '',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 30.rpx),
|
||||
// ),
|
||||
// const SizedBox(height: 4),
|
||||
// Text(
|
||||
// "提交时间:${item.create_time?.toString().substring(0, 19) ?? ''}",
|
||||
// style: TextStyle(
|
||||
// color: Colors.white60,
|
||||
// fontSize: 20.rpx),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// // 右侧状态
|
||||
// Row(
|
||||
// children: [
|
||||
// Text(
|
||||
// item.status ?? '',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 26.rpx),
|
||||
// ),
|
||||
// Icon(Icons.arrow_forward_ios,
|
||||
// color: Colors.white,
|
||||
// size: 30.rpx),
|
||||
// ],
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// )));
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Obx(() {
|
||||
return Visibility(
|
||||
visible: controller.model.repairList != null &&
|
||||
controller.model.repairList!.isNotEmpty,
|
||||
replacement: EmptyMessageWidget(),
|
||||
child: Expanded(
|
||||
child: Obx(() => ListView(
|
||||
controller:
|
||||
scrollController, // 绑定 ScrollController
|
||||
shrinkWrap: true,
|
||||
scrollDirection: Axis.vertical,
|
||||
children: (controller.model.repairList
|
||||
.asMap()
|
||||
.entries
|
||||
.map((e) => RepairHistoryWidget(
|
||||
index: e.key,
|
||||
repairListController: controller))
|
||||
.toList() as List<Widget>)
|
||||
// .divide(const SizedBox(
|
||||
// height: 13,
|
||||
// ))
|
||||
// .addToEnd(SizedBox(
|
||||
// height: AppConstants.list_end_height,
|
||||
// ))
|
||||
)),
|
||||
),
|
||||
);
|
||||
}),
|
||||
// Obx(() {
|
||||
// return Visibility(
|
||||
// visible: controller.model.repairList != null &&
|
||||
// controller.model.repairList!.isNotEmpty,
|
||||
// replacement: EmptyMessageWidget(),
|
||||
// child: Expanded(
|
||||
// child: Obx(() => ListView(
|
||||
// controller:
|
||||
// scrollController, // 绑定 ScrollController
|
||||
// shrinkWrap: true,
|
||||
// scrollDirection: Axis.vertical,
|
||||
// children: (controller.model.repairList
|
||||
// .asMap()
|
||||
// .entries
|
||||
// .map((e) => RepairHistoryWidget(
|
||||
// index: e.key,
|
||||
// repairListController: controller))
|
||||
// .toList() as List<Widget>))),
|
||||
// ),
|
||||
// );
|
||||
// }),
|
||||
// 替换原来的 Obx(() => Visibility(...))
|
||||
Expanded(
|
||||
child: Obx(() {
|
||||
final hasData =
|
||||
controller.model.repairList != null &&
|
||||
controller.model.repairList!.isNotEmpty;
|
||||
return hasData
|
||||
? ListView(
|
||||
controller: scrollController,
|
||||
padding: EdgeInsets.zero,
|
||||
shrinkWrap: true,
|
||||
children: controller.model.repairList
|
||||
.asMap()
|
||||
.entries
|
||||
.map((e) => RepairHistoryWidget(
|
||||
index: e.key,
|
||||
repairListController:
|
||||
controller,
|
||||
))
|
||||
.toList(),
|
||||
)
|
||||
: EmptyMessageWidget();
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
))),
|
||||
|
||||
@@ -82,7 +82,7 @@ class _UpdateUserPageState extends State<EditUserPage> {
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
left: 20.rpx,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
Positioned(
|
||||
|
||||
@@ -491,7 +491,6 @@ class _ApplyRepairPageState extends State<ApplyRepairPage> {
|
||||
cursorColor: themeController.currentColor.sc3,
|
||||
onChanged: onChanged,
|
||||
),
|
||||
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 24.rpx)),
|
||||
|
||||
Reference in New Issue
Block a user