地址接口的视线
This commit is contained in:
@@ -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();
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
))),
|
||||
|
||||
Reference in New Issue
Block a user