fix:增加wifi标识

This commit is contained in:
liyi 2025-02-17 17:10:26 +08:00
parent e3aa467829
commit 2f219d1f38

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -50,7 +49,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: 'MAC/ID', leftTitel: 'MAC/ID',
rightTitle: rightTitle:
"${state.lockBasicInfo.value.mac??""}/${state.lockBasicInfo.value.lockId??""}", "${state.lockBasicInfo.value.mac ?? ""}/${state.lockBasicInfo.value.lockId ?? ""}",
allHeight: 70.h, allHeight: 70.h,
isHaveLine: true)), isHaveLine: true)),
// Obx(() => CommonItem( // Obx(() => CommonItem(
@ -68,13 +67,15 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
), ),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '电量'.tr, leftTitel: '电量'.tr,
rightTitle: '${state.lockBasicInfo.value.electricQuantity??0}%', rightTitle:
'${state.lockBasicInfo.value.electricQuantity ?? 0}%',
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Get.toNamed(Routers.uploadElectricQuantityPage, arguments: <String, LockSetInfoData>{ Get.toNamed(Routers.uploadElectricQuantityPage,
'lockSetInfoData': state.lockSetInfoData.value arguments: <String, LockSetInfoData>{
}); 'lockSetInfoData': state.lockSetInfoData.value
});
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '有效期'.tr, leftTitel: '有效期'.tr,
@ -85,38 +86,47 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
allHeight: 70.h, allHeight: 70.h,
isHaveLine: true)), isHaveLine: true)),
Obx(() => Visibility( Obx(() => Visibility(
visible: (state.lockBasicInfo.value.keyType ?? 0) == 4, visible: (state.lockBasicInfo.value.keyType ?? 0) == 4,
child: CommonItem( child: CommonItem(
leftTitel: '有效日'.tr, leftTitel: '有效日'.tr,
rightTitle: logic.weekDayStr.join(',').toString(), rightTitle: logic.weekDayStr.join(',').toString(),
allHeight: 70.h, allHeight: 70.h,
isHaveLine: true), isHaveLine: true),
)), )),
Obx(() => Visibility( Obx(() => Visibility(
visible: (state.lockBasicInfo.value.keyType ?? 0) == 4, visible: (state.lockBasicInfo.value.keyType ?? 0) == 4,
child: CommonItem( child: CommonItem(
leftTitel: '有效时间'.tr, leftTitel: '有效时间'.tr,
rightTitle: '${DateTool().dateToHNString((state.lockBasicInfo.value.startDate ?? 0).toString())}-${DateTool().dateToHNString((state.lockBasicInfo.value.endDate ?? 0).toString())}', rightTitle:
allHeight: 70.h, '${DateTool().dateToHNString((state.lockBasicInfo.value.startDate ?? 0).toString())}-${DateTool().dateToHNString((state.lockBasicInfo.value.endDate ?? 0).toString())}',
isHaveLine: true), allHeight: 70.h,
)), isHaveLine: true),
)),
SizedBox(height: 10.h), SizedBox(height: 10.h),
Obx(() => Visibility( Obx(() => Visibility(
visible: state.lockBasicInfo.value.isLockOwner == 1 || state.lockBasicInfo.value.keyRight == 1, visible: state.lockBasicInfo.value.isLockOwner == 1 ||
child: lockDataListItem('名称'.tr, state.lockBasicInfo.value.lockAlias ?? '', () async { state.lockBasicInfo.value.keyRight == 1,
var data = await Get.toNamed(Routers.editLockNamePage, arguments: <String, LockSetInfoData>{ child: lockDataListItem(
'lockSetInfoData': state.lockSetInfoData.value '名称'.tr, state.lockBasicInfo.value.lockAlias ?? '',
}); () async {
if (data != null) { var data = await Get.toNamed(Routers.editLockNamePage,
setState(() { arguments: <String, LockSetInfoData>{
state.lockBasicInfo.value = data['lockBasicInfo']; 'lockSetInfoData': state.lockSetInfoData.value
}); });
} if (data != null) {
}))), setState(() {
Obx(() => lockDataListItem('锁分组'.tr, state.lockBasicInfo.value.groupName ?? '', () async { state.lockBasicInfo.value = data['lockBasicInfo'];
Get.toNamed(Routers.lockSelectGroupingPage, arguments: <String, LockSetInfoData>{ });
'lockSetInfoData': state.lockSetInfoData.value }
})!.then((val) { }))),
Obx(() => lockDataListItem(
'锁分组'.tr, state.lockBasicInfo.value.groupName ?? '',
() async {
Get.toNamed(Routers.lockSelectGroupingPage,
arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value
})!
.then((val) {
if (val != null) { if (val != null) {
// mockNetworkDataRequest(); // mockNetworkDataRequest();
setState(() {}); setState(() {});
@ -124,43 +134,47 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
}); });
})), })),
Obx(() => Visibility( Obx(() => Visibility(
visible: state.lockBasicInfo.value.isLockOwner == 1, visible: state.lockBasicInfo.value.isLockOwner == 1,
child: CommonItem( child: CommonItem(
leftTitel:'管理员开锁密码'.tr, leftTitel: '管理员开锁密码'.tr,
rightTitle: rightTitle: state.lockBasicInfo.value.adminPwd,
state.lockBasicInfo.value.adminPwd, isHaveLine: true,
isHaveLine: true, isHaveDirection: true,
isHaveDirection: true, action: () {
action: () { Get.toNamed(Routers.adminOpenLockPasswordPage,
Get.toNamed(Routers.adminOpenLockPasswordPage, arguments: <String, LockSetInfoData>{ arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value 'lockSetInfoData': state.lockSetInfoData.value
}); });
}), }),
)), )),
Obx(() => Visibility( Obx(() => Visibility(
visible: (state.lockBasicInfo.value.lockName ?? '').contains('T9A'), visible: (state.lockBasicInfo.value.lockName ?? '')
child: CommonItem( .contains('T9A'),
leftTitel: '当前网络'.tr, child: CommonItem(
rightTitle: state.lockBasicInfo.value.network ?? '-', leftTitel: '当前网络'.tr,
allHeight: 70.h, rightTitle:
isHaveLine: true), state.lockBasicInfo.value.networkInfo?.wifiName ??
)), '-',
allHeight: 70.h,
isHaveLine: true),
)),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '位置信息'.tr, leftTitel: '位置信息'.tr,
// rightTitle: state.lockBasicInfo.value.address ?? "-", // rightTitle: state.lockBasicInfo.value.address ?? "-",
allHeight: 80.h, allHeight: 80.h,
isHaveLine: false, isHaveLine: false,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: SizedBox( rightWidget: SizedBox(
width: 300.w, width: 300.w,
child: Text(state.lockBasicInfo.value.address ?? ''.tr, child: Text(state.lockBasicInfo.value.address ?? ''.tr,
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
fontSize: 22.sp, fontSize: 22.sp,
color: AppColors.darkGrayTextColor)), color: AppColors.darkGrayTextColor)),
),)), ),
)),
/* 2024-01-12 by DaisyWu /* 2024-01-12 by DaisyWu
CommonItem( CommonItem(
leftTitel: leftTitel:
@ -176,12 +190,14 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
)); ));
} }
Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){ Widget lockDataListItem(
String leftTitle, String conentStr, Function()? action) {
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
// height: 70.h, // height: 70.h,
padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), padding:
EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
border: Border( border: Border(
@ -189,15 +205,17 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
color: AppColors.greyLineColor, // color: AppColors.greyLineColor, //
width: 2.0.h, // width: 2.0.h, //
), ),
) )),
),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Text(leftTitle, style: TextStyle(fontSize: 22.sp)), Text(leftTitle, style: TextStyle(fontSize: 22.sp)),
SizedBox(width: 10.w), SizedBox(width: 10.w),
Expanded( Expanded(
child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, )) child: Text(conentStr,
), textAlign: TextAlign.end,
style: TextStyle(
fontSize: 22.sp,
))),
SizedBox(width: 10.w), SizedBox(width: 10.w),
Image.asset( Image.asset(
'images/icon_right_grey.png', 'images/icon_right_grey.png',
@ -209,5 +227,4 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
), ),
); );
} }
} }