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';
@ -68,11 +67,13 @@ 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,
arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value 'lockSetInfoData': state.lockSetInfoData.value
}); });
})), })),
@ -96,15 +97,20 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
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:
'${DateTool().dateToHNString((state.lockBasicInfo.value.startDate ?? 0).toString())}-${DateTool().dateToHNString((state.lockBasicInfo.value.endDate ?? 0).toString())}',
allHeight: 70.h, allHeight: 70.h,
isHaveLine: true), 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(
'名称'.tr, state.lockBasicInfo.value.lockAlias ?? '',
() async {
var data = await Get.toNamed(Routers.editLockNamePage,
arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value 'lockSetInfoData': state.lockSetInfoData.value
}); });
if (data != null) { if (data != null) {
@ -113,10 +119,14 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
}); });
} }
}))), }))),
Obx(() => lockDataListItem('锁分组'.tr, state.lockBasicInfo.value.groupName ?? '', () async { Obx(() => lockDataListItem(
Get.toNamed(Routers.lockSelectGroupingPage, arguments: <String, LockSetInfoData>{ '锁分组'.tr, state.lockBasicInfo.value.groupName ?? '',
() async {
Get.toNamed(Routers.lockSelectGroupingPage,
arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value 'lockSetInfoData': state.lockSetInfoData.value
})!.then((val) { })!
.then((val) {
if (val != null) { if (val != null) {
// mockNetworkDataRequest(); // mockNetworkDataRequest();
setState(() {}); setState(() {});
@ -127,21 +137,24 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
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, arguments: <String, LockSetInfoData>{ Get.toNamed(Routers.adminOpenLockPasswordPage,
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 ?? '')
.contains('T9A'),
child: CommonItem( child: CommonItem(
leftTitel: '当前网络'.tr, leftTitel: '当前网络'.tr,
rightTitle: state.lockBasicInfo.value.network ?? '-', rightTitle:
state.lockBasicInfo.value.networkInfo?.wifiName ??
'-',
allHeight: 70.h, allHeight: 70.h,
isHaveLine: true), isHaveLine: true),
)), )),
@ -160,7 +173,8 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
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> {
), ),
); );
} }
} }