From 2f219d1f38bf7be8f1b1393fc29eb15ef067ea65 Mon Sep 17 00:00:00 2001 From: liyi Date: Mon, 17 Feb 2025 17:10:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=A2=9E=E5=8A=A0wifi=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basicInformation_page.dart | 171 ++++++++++-------- 1 file changed, 94 insertions(+), 77 deletions(-) diff --git a/lib/main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart b/lib/main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart index d73c4ba2..58c5a9bb 100755 --- a/lib/main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart +++ b/lib/main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart @@ -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 { 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 { ), 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: { - 'lockSetInfoData': state.lockSetInfoData.value - }); + Get.toNamed(Routers.uploadElectricQuantityPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); })), Obx(() => CommonItem( leftTitel: '有效期'.tr, @@ -85,38 +86,47 @@ class _BasicInformationPageState extends State { 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: { - '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: { - '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: { + '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: { + 'lockSetInfoData': state.lockSetInfoData.value + })! + .then((val) { if (val != null) { // mockNetworkDataRequest(); setState(() {}); @@ -124,43 +134,47 @@ class _BasicInformationPageState extends State { }); })), 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: { - '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: { + '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 { )); } - 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 { color: AppColors.greyLineColor, // 设置边框颜色 width: 2.0.h, // 设置边框宽度 ), - ) - ), + )), child: Row( children: [ 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 { ), ); } - }