From 42ad1ef14cabb632c1fc10e675dd9a840624b697 Mon Sep 17 00:00:00 2001 From: czz <862977248@qq.com> Date: Thu, 24 Jul 2025 14:58:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/mh_page/device/device.dart | 101 ++++++--------------------- 1 file changed, 23 insertions(+), 78 deletions(-) diff --git a/lib/pages/mh_page/device/device.dart b/lib/pages/mh_page/device/device.dart index 746692d..aa851dd 100644 --- a/lib/pages/mh_page/device/device.dart +++ b/lib/pages/mh_page/device/device.dart @@ -103,7 +103,7 @@ class DeviceInfoWidget extends GetView { _buildInfoRow( '设备ID', deviceListController - .model.deviceList[index]["_id"] ?? + .model.deviceList[index]["mac"] ?? '', valueColor: (deviceListController .model.deviceList[index] @@ -115,7 +115,7 @@ class DeviceInfoWidget extends GetView { '房间', deviceListController.model .deviceList[index]["roomName"] ?? - '', + '未分配房间', valueColor: (deviceListController .model.deviceList[index] ["status"]?["status"]) == @@ -136,63 +136,6 @@ class DeviceInfoWidget extends GetView { 1 ? Color(0xFF6BFDAC) : Color(0xFF6BFDAC)), - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Expanded( - // child: RichText( - // text: TextSpan( - // children: [ - // TextSpan( - // text: '设备ID:' + - // (deviceListController.model - // .deviceList[ - // index]['_id'] ?? - // ''), - // style: TextStyle( - // fontFamily: 'Readex Pro', - // color: Color(0xFFC8CBD2), - // fontSize: 26.rpx, - // letterSpacing: 0, - // height: 1), - // ), - // ], - // ), - // maxLines: 1, // 限制显示一行 - // overflow: TextOverflow - // .ellipsis, // 超出部分显示省略号 - // ), - // ), - // ], - // ), - // Align( - // alignment: AlignmentDirectional(-1, 0), - // child: Text( - // '房间:' + - // (deviceListController - // .model.deviceList[index] - // ['roomName'] ?? - // ''), - // style: TextStyle( - // fontFamily: 'Readex Pro', - // color: Color(0xFFC8CBD2), - // fontSize: 26.rpx, - // letterSpacing: 0, - // height: 1), - // ), - // ), - // Align( - // alignment: AlignmentDirectional(-1, 0), - // child: Text( - // '设备状态:${(deviceListController.model.deviceList[index]["status"]?["status"]) == 1 ? '在线' : '离线'}', - // style: TextStyle( - // fontFamily: 'Readex Pro', - // color: Color(0xFFC8CBD2), - // fontSize: 26.rpx, - // letterSpacing: 0, - // height: 1), - // ), - // ) ].divide(SizedBox(height: 36.rpx)), ), ), @@ -269,9 +212,11 @@ class DeviceInfoWidget extends GetView { children: [ InkWell( onTap: () async { - await Get.toNamed("/deviceSharePage", - arguments: deviceListController - .model.deviceList[index]); + if (device['bind_type'] == 1) { + await Get.toNamed("/deviceSharePage", + arguments: deviceListController + .model.deviceList[index]); + } // if (device['type'] == 1) { // globalController.model.deviceMain = device; // await Get.toNamed("/deviceSharePage"); @@ -303,8 +248,7 @@ class DeviceInfoWidget extends GetView { '已分享:', style: TextStyle( fontFamily: 'Readex Pro', - fontSize: - AppFontsize.normal_text_size, + fontSize: 21.rpx, letterSpacing: 0, color: Colors.white, ), @@ -323,8 +267,7 @@ class DeviceInfoWidget extends GetView { style: TextStyle( fontFamily: 'Readex Pro', color: Color(0xFF85F5FF), - fontSize: - AppFontsize.normal_text_size, + fontSize: 21.rpx, letterSpacing: 0, ), ), @@ -334,8 +277,7 @@ class DeviceInfoWidget extends GetView { '人', style: TextStyle( fontFamily: 'Readex Pro', - fontSize: - AppFontsize.normal_text_size, + fontSize: 21.rpx, letterSpacing: 0, color: Colors.white, ), @@ -345,8 +287,7 @@ class DeviceInfoWidget extends GetView { '来自', style: TextStyle( fontFamily: 'Readex Pro', - fontSize: - AppFontsize.normal_text_size, + fontSize: 21.rpx, letterSpacing: 0, color: Colors.white, ), @@ -361,8 +302,7 @@ class DeviceInfoWidget extends GetView { style: TextStyle( fontFamily: 'Readex Pro', color: Color(0xFF85F5FF), - fontSize: - AppFontsize.normal_text_size, + fontSize: 21.rpx, letterSpacing: 0, ), ), @@ -372,8 +312,7 @@ class DeviceInfoWidget extends GetView { '的分享', style: TextStyle( fontFamily: 'Readex Pro', - fontSize: - AppFontsize.normal_text_size, + fontSize: 21.rpx, letterSpacing: 0, color: Colors.white, ), @@ -449,10 +388,16 @@ class DeviceInfoWidget extends GetView { return Row( mainAxisSize: MainAxisSize.min, children: [ - Text( - '$label ', - style: - TextStyle(color: Color(0XFF929699), fontSize: 26.rpx, height: 1), + Container( + constraints: BoxConstraints( + minWidth: 140.rpx, // 最小宽度 + ), + alignment: Alignment.centerLeft, + child: Text( + '$label ', + style: TextStyle( + color: Color(0XFF929699), fontSize: 26.rpx, height: 1), + ), ), Flexible( child: Text(