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