diff --git a/images/.DS_Store b/images/.DS_Store index 038522c8..667200aa 100755 Binary files a/images/.DS_Store and b/images/.DS_Store differ diff --git a/images/mine/icon_mine_wan_miniprogram.png b/images/mine/icon_mine_wan_miniprogram.png new file mode 100644 index 00000000..42a61877 Binary files /dev/null and b/images/mine/icon_mine_wan_miniprogram.png differ diff --git a/ios/.DS_Store b/ios/.DS_Store index 9bae6937..98eefc0f 100755 Binary files a/ios/.DS_Store and b/ios/.DS_Store differ diff --git a/lib/blue/io_protocol/io_gateway_configuringWifi.dart b/lib/blue/io_protocol/io_gateway_configuringWifi.dart index 202e9da8..4b6fd17b 100644 --- a/lib/blue/io_protocol/io_gateway_configuringWifi.dart +++ b/lib/blue/io_protocol/io_gateway_configuringWifi.dart @@ -46,8 +46,8 @@ class GatewayConfiguringWifiCommand extends SenderProtocol { subData = getFixedLengthList(subData, 20 - passwordLength); //gatewayConfigurationStr - final int clientIdLength = utf8.encode(gatewayConfigurationStr!).length; - subData.add(clientIdLength); + // final int clientIdLength = utf8.encode(gatewayConfigurationStr!).length; + // subData.add(clientIdLength); subData.addAll(utf8.encode(gatewayConfigurationStr!)); // subData = getFixedLengthList(subData, 20 - clientIdLength); diff --git a/lib/main/lockDetail/card/cardList/cardList_page.dart b/lib/main/lockDetail/card/cardList/cardList_page.dart index cb297970..bbaf9657 100755 --- a/lib/main/lockDetail/card/cardList/cardList_page.dart +++ b/lib/main/lockDetail/card/cardList/cardList_page.dart @@ -1,5 +1,5 @@ - import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; @@ -62,7 +62,8 @@ class _CardListPageState extends State with RouteAware { backgroundColor: AppColors.mainColor, actionsList: [ TextButton( - child: Text('重置'.tr, + child: Text( + '重置'.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp), ), onPressed: () async { @@ -107,14 +108,13 @@ class _CardListPageState extends State with RouteAware { SizedBox(height: 20.h), Expanded(child: _buildMainUI()), AddBottomWhiteBtn( - btnName: - '添加卡'.tr, + btnName: '添加卡'.tr, onClick: () async { - await Get.toNamed(Routers.addCardPage, - arguments: { - 'lockId': state.lockId.value, - 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - })!.then((value) { + await Get.toNamed(Routers.addCardPage, arguments: { + 'lockId': state.lockId.value, + 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 + })! + .then((value) { getHttpData(isRefresh: true); }); // if (data != null) { @@ -176,10 +176,11 @@ class _CardListPageState extends State with RouteAware { fingerprintItemData.cardName!, logic.getKeyType(fingerprintItemData), logic.getKeyDateType(fingerprintItemData), () async { - await Get.toNamed(Routers.cardDetailPage, + await Get.toNamed(Routers.cardDetailPage, arguments: { - 'fingerprintItemData': fingerprintItemData, - })!.then((value) => getHttpData(isRefresh: true)); + 'fingerprintItemData': fingerprintItemData, + })! + .then((value) => getHttpData(isRefresh: true)); // if (data != null) { // getHttpData(isRefresh: true); // } @@ -207,39 +208,34 @@ class _CardListPageState extends State with RouteAware { return GestureDetector( onTap: action, child: Container( - height: 90.h, + // height: 90.h, // margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), + padding: EdgeInsets.only(top: 10.h, bottom: 10.h), color: Colors.white, child: Row( children: [ SizedBox(width: 30.w), Image.asset(lockTypeIcon, width: 60.w, height: 60.w), SizedBox(width: 20.w), - Expanded( + SizedBox( + width: 1.sw - 30.w - 20.w - 60.w - 20.w, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - SizedBox( - width: 1.sw - 110.w - 100.w, - child: Row( - children: [ - Flexible( - child: Text(lockTypeTitle, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 24.sp, - color: AppColors.blackColor)), - ), - ], - ), + Expanded( + child: Text(lockTypeTitle, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 24.sp, color: AppColors.blackColor)), ), + SizedBox(width: 10.w), Text(ifInvalidation, style: TextStyle(fontSize: 22.sp, color: Colors.red)), - SizedBox(width: 10.w), + // SizedBox(width: 10.w), ], ), SizedBox(height: 5.h), @@ -256,11 +252,11 @@ class _CardListPageState extends State with RouteAware { ), ], ), - SizedBox(width: 20.h), + // SizedBox(width: 20.h), ], ), ), - SizedBox(width: 20.h), + SizedBox(width: 20.w), ], ), ), diff --git a/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart b/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart index 4869fbf2..c10bcd24 100755 --- a/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart +++ b/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart @@ -1,4 +1,4 @@ - +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; @@ -69,7 +69,7 @@ class _ElectronicKeyListPageState extends State { await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { final bool isNetWork = - await LockMainLogic.to()?.judgeTheNetwork() ?? false; + await LockMainLogic.to()?.judgeTheNetwork() ?? false; if (!isNetWork) { return; } @@ -191,9 +191,8 @@ class _ElectronicKeyListPageState extends State { }).then((Object? val) { if (val == 'deletScuess') { state.itemDataList.removeWhere( - (ElectronicKeyListItem item) => - item.keyId == - indexEntity.keyId!); + (ElectronicKeyListItem item) => + item.keyId == indexEntity.keyId!); setState(() {}); } else if (val != null) { logic @@ -258,7 +257,7 @@ class _ElectronicKeyListPageState extends State { onTap: action, child: Container( color: Colors.white, - padding: EdgeInsets.only(top: 20.h, bottom: 20.h), + padding: EdgeInsets.only(top: 15.h, bottom: 15.h), child: Row( children: [ SizedBox(width: 20.w), @@ -277,28 +276,27 @@ class _ElectronicKeyListPageState extends State { ), SizedBox(width: 20.w), SizedBox( - width: 1.sw - 120.w, + width: 1.sw - 20.w - 60.w - 20.w - 20.w, child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text(receiveUser, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 24.sp, - color: AppColors.blackColor)), - SizedBox(width: 5.w), + Expanded( + child: Text(receiveUser, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 24.sp, color: AppColors.blackColor)), + ), + if (isRemteUnlocking) SizedBox(width: 5.w), if (isRemteUnlocking) Image.asset( 'images/icon_electronicKey_remteUnlocking.png', width: 24.w, height: 20.w, ), - SizedBox(width: 5.w), + if (isRemteUnlocking) SizedBox(width: 5.w), if (isAdminKey) Image.asset( 'images/icon_electronicKey_admin.png', @@ -306,8 +304,8 @@ class _ElectronicKeyListPageState extends State { height: 20.w, ), // Expanded(child: SizedBox(width: 20.w,)), - // SizedBox(width: 10.w), - const Spacer(), + SizedBox(width: 10.w), + // const Spacer(), Text( keyStatus, textAlign: TextAlign.end, @@ -331,7 +329,7 @@ class _ElectronicKeyListPageState extends State { ], ), ), - // SizedBox(width: 20.h), + SizedBox(width: 20.w), ], ), ), diff --git a/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart b/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart index 2d716bcf..77a25a6c 100755 --- a/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart +++ b/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart @@ -38,18 +38,16 @@ class _FingerprintDetailPageState extends State haveBack: true, backgroundColor: AppColors.mainColor, ), - body: Column( + body: ListView( children: [ Obx(() => CommonItem( - leftTitel:'指纹号'.tr, + leftTitel: '指纹号'.tr, rightTitle: state.typeNumber.value, isHaveDirection: false, isHaveLine: true)), Obx(() => lockDataListItem('姓名'.tr, state.typeName.value, () { ShowTipView().showTFViewAlertDialog( - state.changeNameController, - '修改姓名'.tr, - '', () { + state.changeNameController, '修改姓名'.tr, '', () { if (state.changeNameController.text.isEmpty) { logic.showToast('请输入姓名'.tr); return; diff --git a/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart b/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart index e3e4d242..ad3f11c2 100755 --- a/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart +++ b/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -110,14 +109,14 @@ class _FingerprintListPageState extends State ), Expanded(child: _buildMainUI()), AddBottomWhiteBtn( - btnName: - '添加指纹'.tr, + btnName: '添加指纹'.tr, onClick: () async { await Get.toNamed(Routers.addFingerprintTypePage, - arguments: { + arguments: { 'lockId': state.lockId.value, 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - })!.then((value) => getHttpData(isRefresh: true)); + })! + .then((value) => getHttpData(isRefresh: true)); // if (data != null) { // getHttpData(isRefresh: true); // } @@ -175,11 +174,13 @@ class _FingerprintListPageState extends State fingerprintItemData.fingerprintName!, logic.getKeyType(fingerprintItemData), logic.getKeyDateType(fingerprintItemData), () async { - await Get.toNamed(Routers.fingerprintDetailPage, arguments: { + await Get.toNamed(Routers.fingerprintDetailPage, + arguments: { 'fingerprintItemData': fingerprintItemData, - })!.then((value) { - getHttpData(isRefresh: true); - }); + })! + .then((value) { + getHttpData(isRefresh: true); + }); // if (data == 'deletScuess') { // // state.fingerprintItemListData.removeWhere((FingerprintItemData item) => item.fingerprintId == fingerprintItemData.fingerprintId!); // // setState(() {}); @@ -214,45 +215,34 @@ class _FingerprintListPageState extends State return GestureDetector( onTap: action, child: Container( - height: 90.h, + // height: 90.h, // margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), + padding: EdgeInsets.only(top: 10.h, bottom: 10.h), color: Colors.white, - // decoration: BoxDecoration( - // color: Colors.white, - // // borderRadius: BorderRadius.circular(10.w), - // ), child: Row( children: [ SizedBox(width: 30.w), Image.asset(lockTypeIcon, width: 60.w, height: 60.w), SizedBox(width: 20.w), - Expanded( + SizedBox( + width: 1.sw - 30.w - 20.w - 60.w - 20.w, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - SizedBox( - width: ifInvalidation.isNotEmpty - ? 1.sw - 110.w - 100.w - : 1.sw - 110.w - 50.w, - child: Row( - children: [ - Flexible( - child: Text(lockTypeTitle, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 24.sp, - color: AppColors.blackColor)), - ), - ], - ), + Expanded( + child: Text(lockTypeTitle, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 24.sp, color: AppColors.blackColor)), ), + SizedBox(width: 10.w), Text(ifInvalidation, style: TextStyle(fontSize: 22.sp, color: Colors.red)), - SizedBox(width: 10.w), + // SizedBox(width: 10.w), ], ), SizedBox(height: 5.h), @@ -269,11 +259,11 @@ class _FingerprintListPageState extends State ), ], ), - SizedBox(width: 20.h), + // SizedBox(width: 20.h), ], ), ), - SizedBox(width: 20.h), + SizedBox(width: 20.w), ], ), ), diff --git a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index a01f6214..2d5ad28d 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -1,4 +1,3 @@ - import 'dart:async'; import 'package:flutter/scheduler.dart'; @@ -43,7 +42,8 @@ class LockDetailLogic extends BaseGetXController { // 监听设备返回的数据 void initReplySubscription() { - state.replySubscription = EventBusManager().eventBus!.on().listen((Reply reply) async { + state.replySubscription = + EventBusManager().eventBus!.on().listen((Reply reply) async { // 开门 if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) { _replyOpenLock(reply); @@ -179,7 +179,9 @@ class LockDetailLogic extends BaseGetXController { } } - Future loadData({ required LockListInfoItemEntity lockListInfoItemEntity,required bool isOnlyOneData}) async { + Future loadData( + {required LockListInfoItemEntity lockListInfoItemEntity, + required bool isOnlyOneData}) async { state.keyInfos.value = lockListInfoItemEntity; CommonDataManage().currentLockUserNo = state.keyInfos.value.lockUserNo!; CommonDataManage().initUserNo = state.keyInfos.value.initUserNo!; @@ -187,7 +189,8 @@ class LockDetailLogic extends BaseGetXController { state.lockUserNo = state.keyInfos.value.lockUserNo!; - if (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitIneffective || + if (state.keyInfos.value.keyStatus == + XSConstantMacro.keyStatusWaitIneffective || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted || @@ -203,37 +206,37 @@ class LockDetailLogic extends BaseGetXController { state.senderUserId = state.keyInfos.value.senderUserId!; state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!; state.isOpenLockNeedOnline.value = - state.keyInfos.value.lockSetting!.appUnlockOnline!; + state.keyInfos.value.lockSetting!.appUnlockOnline!; state.electricQuantity.value = state.keyInfos.value.electricQuantity!; state.isOpenPassageMode.value = state.keyInfos.value.passageMode!; state.lockAlias.value = state.keyInfos.value.lockAlias!; Storage.setString(saveLockAlias, state.lockAlias.value); BlueManage().connectDeviceName = - state.keyInfos.value.bluetooth!.bluetoothDeviceName!; + state.keyInfos.value.bluetooth!.bluetoothDeviceName!; final List publicKeyData = - state.keyInfos.value.bluetooth!.publicKey!.cast(); + state.keyInfos.value.bluetooth!.publicKey!.cast(); final List saveStrList = changeIntListToStringList(publicKeyData); Storage.setStringList(saveBluePublicKey, saveStrList); // 私钥 final List privateKeyData = - state.keyInfos.value.bluetooth!.privateKey!.cast(); + state.keyInfos.value.bluetooth!.privateKey!.cast(); final List savePrivateKeyList = - changeIntListToStringList(privateKeyData); + changeIntListToStringList(privateKeyData); Storage.setStringList(saveBluePrivateKey, savePrivateKeyList); // signKey final List signKeyData = - state.keyInfos.value.bluetooth!.signKey!.cast(); + state.keyInfos.value.bluetooth!.signKey!.cast(); final List saveSignKeyList = changeIntListToStringList(signKeyData); Storage.setStringList(saveBlueSignKey, saveSignKeyList); final bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken); if (!ifHaveKey) { final List saveTokenList = - changeIntListToStringList([0, 0, 0, 0]); + changeIntListToStringList([0, 0, 0, 0]); Storage.setStringList(saveBlueToken, saveTokenList); } } @@ -249,7 +252,9 @@ class LockDetailLogic extends BaseGetXController { void closeLuckStatus() { state.openLockBtnState.value = 0; // state.openDoorBtnisUneable.value = true; - state.animationController!.stop(canceled: true); + if (state.animationController != null) { + state.animationController!.stop(canceled: true); + } cancelBlueConnetctToastTimer(); } @@ -288,9 +293,9 @@ class LockDetailLogic extends BaseGetXController { indexMap['success'] = '1'; final int time = (0xff & indexList[3]) << 24 | - (0xff & indexList[4]) << 16 | - (0xff & indexList[5]) << 8 | - (0xFF & indexList[6]); + (0xff & indexList[4]) << 16 | + (0xff & indexList[5]) << 8 | + (0xFF & indexList[6]); indexMap['date'] = '${time * 1000}'; uploadList.add(indexMap); @@ -496,13 +501,14 @@ class LockDetailLogic extends BaseGetXController { // 电子钥匙开锁成功上报 Future lockReportLockSuccessfullyUploadData() async { - final KeyOperationRecordEntity entity = await ApiRepository.to.lockReportLockSuccessfullyUploadData( - lockId: state.keyInfos.value.lockId ?? 0, - keyId: state.keyInfos.value.keyId ?? 0 - ); + final KeyOperationRecordEntity entity = await ApiRepository.to + .lockReportLockSuccessfullyUploadData( + lockId: state.keyInfos.value.lockId ?? 0, + keyId: state.keyInfos.value.keyId ?? 0); if (entity.errorCode!.codeIsSuccessful) { // mockNetworkDataRequest(); - AppLog.log('state.keyInfos.value.keyType:${state.keyInfos.value.keyType}'); + AppLog.log( + 'state.keyInfos.value.keyType:${state.keyInfos.value.keyType}'); if (state.keyInfos.value.keyType == XSConstantMacro.keyTypeOnce) { // 单次删除 deletKeyData(); @@ -611,7 +617,6 @@ class LockDetailLogic extends BaseGetXController { getServerDatetime(); await PermissionDialog.request(Permission.location); await PermissionDialog.requestBluetooth(); - } @override diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index ad7bc065..f9bf8c35 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -1,4 +1,3 @@ - import 'dart:async'; import 'package:flutter/material.dart'; @@ -89,10 +88,17 @@ class _LockDetailPageState extends State //鑫泓佳布局 Widget xhjWidget() { - final bool isShowTip = - (state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop) - && (DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) <= 15 && DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) >= 0) - && (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitReceive); + final bool isShowTip = (state.keyInfos.value.keyType == + XSConstantMacro.keyTypeTime || + state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop) && + (DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) <= + 15 && + DateTool() + .compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) >= + 0) && + (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse || + state.keyInfos.value.keyStatus == + XSConstantMacro.keyStatusWaitReceive); return Scaffold( backgroundColor: Colors.white, body: Obx(() { @@ -771,9 +777,7 @@ class _LockDetailPageState extends State Text( state.keyInfos.value.isLockOwner == 1 ? '超级管理员'.tr - : (state.keyInfos.value.keyRight == 1 - ? '授权管理员'.tr - : '普通用户'.tr), + : (state.keyInfos.value.keyRight == 1 ? '授权管理员'.tr : '普通用户'.tr), style: TextStyle(fontSize: 20.sp, color: AppColors.darkGrayTextColor), ), if (add) SizedBox(width: 20.w) else SizedBox(width: 40.w), @@ -959,16 +963,36 @@ class _LockDetailPageState extends State Widget bottomWidget() { return SizedBox( - width: ScreenUtil().screenWidth - 20.w, - child: GridView.count( - crossAxisCount: 4, - // childAspectRatio: 3, - crossAxisSpacing: 0.h, - mainAxisSpacing: 0.h, - shrinkWrap: true, + width: ScreenUtil().screenWidth, + child: GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 4, + mainAxisSpacing: 0.h, + crossAxisSpacing: 0.h, + mainAxisExtent: 90.0, // 设置每个 item 的固定高度 + ), + itemCount: (state.keyInfos.value.isLockOwner == 1 || + state.keyInfos.value.keyRight == 1) + ? getAllWidget().length + : getNormalWidget().length, + itemBuilder: (context, index) { + Widget widget = getBottomWidget()[index]; + return widget; + }, physics: const NeverScrollableScrollPhysics(), - children: getBottomWidget()), - ); + shrinkWrap: true, + ) + + // GridView.count( + // crossAxisCount: 4, + // // childAspectRatio: 3, + // crossAxisSpacing: 0.h, + // mainAxisSpacing: 0.h, + // shrinkWrap: true, + // physics: const NeverScrollableScrollPhysics(), + // children: getBottomWidget()), + + ); } // 根据权限显示不同的底部按钮 @@ -1004,8 +1028,8 @@ class _LockDetailPageState extends State // 设置 if (F.isSKY) { - showWidgetArr.add(bottomItem('images/main/icon_main_set.png', - '设置'.tr, true, () { + showWidgetArr + .add(bottomItem('images/main/icon_main_set.png', '设置'.tr, true, () { Get.toNamed(Routers.lockSetPage, arguments: { 'lockId': state.keyInfos.value.lockId, 'isOnlyOneData': state.isOnlyOneData @@ -1077,9 +1101,8 @@ class _LockDetailPageState extends State if (state.keyInfos.value.lockFeature!.d3Face == 1) { showWidgetArr.add( bottomItem( - 'images/main/icon_face.png', - '人脸'.tr, - state.bottomBtnisEable.value, () { + 'images/main/icon_face.png', '人脸'.tr, state.bottomBtnisEable.value, + () { Get.toNamed(Routers.faceListPage, arguments: { 'lockId': state.keyInfos.value.lockId, }); @@ -1100,23 +1123,21 @@ class _LockDetailPageState extends State } // if (state.keyInfos.value.lockFeature!.palmVein == 1) { - showWidgetArr.add( - bottomItem( - 'images/main/icon_palm.png', '掌静脉'.tr, state.bottomBtnisEable.value, - () { - Get.toNamed(Routers.palmListPage, arguments: { - 'lockId': state.keyInfos.value.lockId, - }); - }), - ); + showWidgetArr.add( + bottomItem( + 'images/main/icon_palm.png', '掌静脉'.tr, state.bottomBtnisEable.value, + () { + Get.toNamed(Routers.palmListPage, arguments: { + 'lockId': state.keyInfos.value.lockId, + }); + }), + ); // } //可视对讲门锁新增->监控 if (state.keyInfos.value.lockFeature!.videoIntercom == 1) { showWidgetArr.add( - bottomItem( - 'images/main/icon_catEyes.png', - '监控'.tr, + bottomItem('images/main/icon_catEyes.png', '监控'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.realTimePicturePage, arguments: { 'lockName': state.keyInfos.value.lockName, @@ -1128,10 +1149,8 @@ class _LockDetailPageState extends State // 授权管理员 if (state.keyInfos.value.isLockOwner == 1) { - showWidgetArr.add(bottomItem( - 'images/main/icon_main_authorizedAdmin.png', - '授权管理员'.tr, - state.bottomBtnisEable.value, () { + showWidgetArr.add(bottomItem('images/main/icon_main_authorizedAdmin.png', + '授权管理员'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.authorizedAdminListPage, arguments: { 'keyInfo': state.keyInfos.value @@ -1155,10 +1174,8 @@ class _LockDetailPageState extends State if (state.keyInfos.value.lockFeature!.isSupportCatEye == 1) { //视频日志 - endWiddget.add(bottomItem( - 'images/main/icon_lockDetail_videoLog.png', - '视频日志'.tr, - state.bottomBtnisEable.value, () { + endWiddget.add(bottomItem('images/main/icon_lockDetail_videoLog.png', + '视频日志'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.videoLogPage, arguments: { 'lockId': state.keyInfos.value.lockId, }); @@ -1166,9 +1183,7 @@ class _LockDetailPageState extends State } endWiddget.add( // 消息提醒 - bottomItem( - 'images/main/icon_lockDetail_messageReminding.png', - '消息提醒'.tr, + bottomItem('images/main/icon_lockDetail_messageReminding.png', '消息提醒'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.msgNotificationPage, arguments: { 'lockId': state.keyInfos.value.lockId, @@ -1180,8 +1195,7 @@ class _LockDetailPageState extends State if (F.isSKY) { endWiddget.add( // 设置 - bottomItem('images/main/icon_main_set.png', - '设置'.tr, true, () { + bottomItem('images/main/icon_main_set.png', '设置'.tr, true, () { // logic.clickItemBtnAction(10); Get.toNamed(Routers.lockSetPage, arguments: { 'lockId': state.keyInfos.value.lockId, @@ -1216,7 +1230,7 @@ class _LockDetailPageState extends State fit: BoxFit.fitWidth), ), ), - SizedBox(height: 5.w), + SizedBox(height: 5.h), Expanded( child: Text(name, style: TextStyle( @@ -1230,9 +1244,10 @@ class _LockDetailPageState extends State ), xhjCall: () => Container( color: Colors.white, + padding: EdgeInsets.only(left: 3.w, right: 3.w, bottom: 5.h), child: Column( crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox( width: 42.w, @@ -1248,12 +1263,16 @@ class _LockDetailPageState extends State fit: BoxFit.fitWidth), ), ), - SizedBox(height: 5.h), + SizedBox(height: 15.h), Text( name, + // '哈水电费垃圾啊货到付款垃圾啊是老大开发机哈吉手打', textAlign: TextAlign.center, + maxLines: 4, + overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 20.sp, + height: 1.0, color: bottomBtnisEable ? AppColors.blackColor : AppColors.lockDetailBottomBtnUneable), diff --git a/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart b/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart index 80247a61..2b47048d 100755 --- a/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart +++ b/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart @@ -1,4 +1,3 @@ - import 'dart:async'; import 'package:flutter/services.dart'; @@ -78,7 +77,7 @@ class LockMonitoringLogic extends BaseGetXController { } /// 接听 - udpAnswerAction() async { + Future udpAnswerAction() async { AppLog.log('点了接听么'); UDPSenderManage.sendMainProtocol( command: 150, @@ -177,7 +176,8 @@ class LockMonitoringLogic extends BaseGetXController { // CallTalk().stopPlaySound(); // } state.allFrames.add(frame); // 将帧添加到状态变量中 - final List concatenatedFrames = concatenateFrames(state.allFrames); // 连接所有帧 + final List concatenatedFrames = + concatenateFrames(state.allFrames); // 连接所有帧 AppLog.log('pcm数据:$concatenatedFrames'); final List pcmBytes = listLinearToULaw(frame); diff --git a/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart b/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart index 1b585abc..c9883358 100755 --- a/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart +++ b/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart @@ -1,4 +1,4 @@ - +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; @@ -114,9 +114,10 @@ class _PasswordKeyListPageState extends State btnName: '获取密码'.tr, onClick: () async { await Get.toNamed(Routers.passwordKeyPerpetualPage, - arguments: { + arguments: { 'keyInfo': state.keyInfo.value - })!.then((Object? val) { + })! + .then((Object? val) { if (val != null) { getHttpData(isRefresh: true); } @@ -177,13 +178,17 @@ class _PasswordKeyListPageState extends State ), ], ), - child: _electronicKeyItem(index, 'images/icon_password.png', - passwordKeyListItem.keyboardPwdName!, useDateStr, () async { - await Get.toNamed(Routers.passwordKeyDetailPage, - arguments: { + child: _electronicKeyItem( + index, + 'images/icon_password.png', + passwordKeyListItem.keyboardPwdName!, + useDateStr, () async { + await Get.toNamed(Routers.passwordKeyDetailPage, + arguments: { 'itemData': passwordKeyListItem - })!.then((Object? val) { - getHttpData(isRefresh: true); + })! + .then((Object? val) { + getHttpData(isRefresh: true); // if (val == 'deletScuess') { // state.itemDataList.removeWhere( // (PasswordKeyListItem item) => @@ -220,8 +225,9 @@ class _PasswordKeyListPageState extends State return GestureDetector( onTap: action, child: Container( - height: 90.h, + // height: 90.h, // margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), + padding: EdgeInsets.only(top: 10.h, bottom: 10.h), color: Colors.white, child: Row( children: [ @@ -234,27 +240,19 @@ class _PasswordKeyListPageState extends State SizedBox( width: 20.w, ), - Expanded( + SizedBox( + width: 1.sw - 70.w - 60.w, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ - SizedBox( - width: passwordKeyListItem.keyboardPwdStatus == 2 || - passwordKeyListItem.keyboardPwdStatus == 3 - ? 1.sw - 110.w - 100.w - : 1.sw - 110.w - 50.w, - child: Row(children: [ - Flexible( - child: Text(lockTypeTitle, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 24.sp, - color: AppColors.blackColor)), - ) - ]), + Expanded( + child: Text(lockTypeTitle, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 24.sp, color: AppColors.blackColor)), ), SizedBox(width: 10.w), if (passwordKeyListItem.keyboardPwdStatus == 2) @@ -279,8 +277,6 @@ class _PasswordKeyListPageState extends State Flexible( child: Text( useDateStr, - maxLines: 1, - overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 18.sp, color: AppColors.placeholderTextColor), @@ -292,7 +288,7 @@ class _PasswordKeyListPageState extends State ], ), ), - SizedBox(width: 20.h), + SizedBox(width: 20.w), ], ), ), diff --git a/lib/main/lockMian/lockMain/lockMain_logic.dart b/lib/main/lockMian/lockMain/lockMain_logic.dart index f1fc9b89..e65b36c7 100755 --- a/lib/main/lockMian/lockMain/lockMain_logic.dart +++ b/lib/main/lockMian/lockMain/lockMain_logic.dart @@ -1,4 +1,3 @@ - import 'dart:async'; import 'dart:io'; import 'package:connectivity_plus/connectivity_plus.dart'; @@ -309,6 +308,7 @@ class LockMainLogic extends BaseGetXController { await jpushProvider.initLocalNotification(isCancelLocalPush: false); // 开启UDP + // AppLog.log('onReady() LockMainLogic'); UdpHelp().openUDP(); BlueManage(); } diff --git a/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart b/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart index e34da23e..b9dd1342 100755 --- a/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart +++ b/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; diff --git a/lib/mine/addLock/nearbyLock/nearbyLock_page.dart b/lib/mine/addLock/nearbyLock/nearbyLock_page.dart index e6e9d302..97275540 100755 --- a/lib/mine/addLock/nearbyLock/nearbyLock_page.dart +++ b/lib/mine/addLock/nearbyLock/nearbyLock_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_blue_plus/flutter_blue_plus.dart'; @@ -65,7 +64,8 @@ class _NearbyLockPageState extends State with RouteAware { child: ListView.separated( itemCount: state.devices.length, itemBuilder: (BuildContext c, int index) { - return nearbyLockItem('images/icon_lockGroup_item.png', state.devices[index], () { + return nearbyLockItem( + 'images/icon_lockGroup_item.png', state.devices[index], () { String advName = state.devices[index].advertisementData.advName; state.selectLockName.value = advName; logic.getServerDatetime(); diff --git a/lib/mine/mine/starLockMine_page.dart b/lib/mine/mine/starLockMine_page.dart index e1e98bf1..5d7dcd9f 100755 --- a/lib/mine/mine/starLockMine_page.dart +++ b/lib/mine/mine/starLockMine_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -13,6 +12,7 @@ import '../../baseWidget.dart'; import '../../tools/customNetworkImage.dart'; import '../../tools/submitBtn.dart'; import '../../tools/wechat/wechatManageTool.dart'; +import '../../tools/wechat/wx_push_miniProgram/wx_push_miniProgram.dart'; import 'starLockMine_logic.dart'; class StarLockMinePage extends StatefulWidget { @@ -43,7 +43,24 @@ class StarLockMinePageState extends State with BaseWidget { topWidget(), bottomListWidget(), SizedBox( - height: 40.h, + height: 60.h, + ), + GestureDetector( + onTap: () { + WechatManageTool.getAppInfo(() { + WxPushWeChatMiniProgramTool.pushWeChatMiniProgram( + 'wxbe340095d2b8fd51'); + }); + }, + child: Padding( + padding: EdgeInsets.only(left: 20.w, right: 20.w), + child: Image.asset( + 'images/mine/icon_mine_wan_miniprogram.png', + // width: 400.w, + // height: 151.h, + fit: BoxFit.fill, + ), + ), ), ], ), @@ -152,71 +169,67 @@ class StarLockMinePageState extends State with BaseWidget { } Widget bottomListWidget() { - return Expanded( - child: ListView( + return Container( padding: EdgeInsets.only( left: 60.w, top: 50.h, ), - children: [ - // mineItem('images/mine/icon_mine_main_personInfo.png', - // TranslationLoader.lanKeys!.personalInformation!.tr, () { - // Navigator.pushNamed(context, Routers.minePersonInfoPage); - // }), - mineItem('images/mine/icon_mine_main_addLock.png', - '添加设备'.tr, () { - Get.back(); - Get.toNamed(Routers.selectLockTypePage); - }), - // mineItem('images/mine/icon_mine_main_gateway.png', - // TranslationLoader.lanKeys!.gateway!.tr, () { - // Navigator.pushNamed(context, Routers.gatewayListPage); - // }), - mineItem('images/mine/icon_mine_main_message.png', - '消息'.tr, () { - Get.back(); - Get.toNamed(Routers.messageListPage); - // Toast.show(msg: "功能暂未开放"); - }), - //删除“客服”行 - // mineItem('images/mine/icon_mine_main_supportStaff.png', - // TranslationLoader.lanKeys!.supportStaff!.tr, () { - // Navigator.pushNamed(context, Routers.supportStaffPage); - // }), - mineItem('images/mine/icon_mine_main_set.png', - '设置'.tr, () { - Get.back(); - Get.toNamed(Routers.mineSetPage); - }), - //上架审核 - if (F.isLite) - Container() - else - mineItem('images/mine/icon_mine_main_vip.png', '增值服务'.tr, () { + child: Column( + children: [ + // mineItem('images/mine/icon_mine_main_personInfo.png', + // TranslationLoader.lanKeys!.personalInformation!.tr, () { + // Navigator.pushNamed(context, Routers.minePersonInfoPage); + // }), + mineItem('images/mine/icon_mine_main_addLock.png', '添加设备'.tr, () { Get.back(); - Get.toNamed(Routers.valueAddedServicesPage); + Get.toNamed(Routers.selectLockTypePage); }), - if (F.isLite) - Container() - else - mineItem('images/mine/icon_mine_main_shoppingcart.png', '配件商城'.tr, - () { + // mineItem('images/mine/icon_mine_main_gateway.png', + // TranslationLoader.lanKeys!.gateway!.tr, () { + // Navigator.pushNamed(context, Routers.gatewayListPage); + // }), + mineItem('images/mine/icon_mine_main_message.png', '消息'.tr, () { Get.back(); - Get.toNamed(Routers.lockMallPage); + Get.toNamed(Routers.messageListPage); + // Toast.show(msg: "功能暂未开放"); }), - if (F.isSKY) - mineItem('images/mine/icon_mine_main_shoppingcart.png', - '客服'.tr, () { + //删除“客服”行 + // mineItem('images/mine/icon_mine_main_supportStaff.png', + // TranslationLoader.lanKeys!.supportStaff!.tr, () { + // Navigator.pushNamed(context, Routers.supportStaffPage); + // }), + mineItem('images/mine/icon_mine_main_set.png', '设置'.tr, () { Get.back(); - WechatManageTool.getAppInfo(CustomerTool.openCustomerService); + Get.toNamed(Routers.mineSetPage); }), - mineItem('images/mine/icon_mine_main_about.png', '关于'.tr, () { - Get.back(); - Get.toNamed(Routers.aboutPage); - }), - ], - ), - ); + //上架审核 + if (F.isLite) + Container() + else + mineItem('images/mine/icon_mine_main_vip.png', '增值服务'.tr, () { + Get.back(); + Get.toNamed(Routers.valueAddedServicesPage); + }), + if (F.isLite) + Container() + else + mineItem('images/mine/icon_mine_main_shoppingcart.png', '配件商城'.tr, + () { + Get.back(); + Get.toNamed(Routers.lockMallPage); + }), + if (F.isSKY) + mineItem('images/mine/icon_mine_main_shoppingcart.png', '客服'.tr, + () { + Get.back(); + WechatManageTool.getAppInfo(CustomerTool.openCustomerService); + }), + mineItem('images/mine/icon_mine_main_about.png', '关于'.tr, () { + Get.back(); + Get.toNamed(Routers.aboutPage); + }), + ], + )); } Widget keyBottomWidget() { diff --git a/lib/tools/wechat/wx_push_miniProgram/wx_push_miniProgram.dart b/lib/tools/wechat/wx_push_miniProgram/wx_push_miniProgram.dart new file mode 100644 index 00000000..2779eb4b --- /dev/null +++ b/lib/tools/wechat/wx_push_miniProgram/wx_push_miniProgram.dart @@ -0,0 +1,49 @@ +import 'package:fluwx/fluwx.dart'; + +import '../../storage.dart'; + +/// +/// 进入微信小程序 +/// +/// +class WxPushWeChatMiniProgramTool { + static Fluwx fluwx = Fluwx(); + static bool isInit = false; + + static void setAssociationUrl(String associationUrl) { + Storage.saveAssociationUrl(associationUrl); + } + + static Future initWeChatMiniProgram( + String appId, String universalLink) async { + fluwx.registerApi( + appId: appId, + universalLink: universalLink, + doOnAndroid: true, + doOnIOS: true); + } + + static Future pushWeChatMiniProgram(String appId) async { + if (!isInit) { + isInit = true; + final String _associationUrl = await Storage.getAssociationUrl(); + await initWeChatMiniProgram(appId, _associationUrl); + + final MiniProgram miniProgram = MiniProgram( + username: 'gh_93a4493485e1', // 微信小程序原始ID + path: 'pages/index/index', // 跳转的小程序页面路径,可选 + miniProgramType: WXMiniProgramType.release, // 小程序版本类型 + ); + + await fluwx.open(target: miniProgram); + } else { + final MiniProgram miniProgram = MiniProgram( + username: 'gh_93a4493485e1', // 微信小程序原始ID + path: 'pages/index/index', // 跳转的小程序页面路径,可选 + miniProgramType: WXMiniProgramType.release, // 小程序版本类型 + ); + + await fluwx.open(target: miniProgram); + } + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 5567f272..45cd6940 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -95,7 +95,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.80+2024091902:网关功能去掉网关通信不够16倍数凑够16倍数功能 # 1.0.80+2024091902:给欧阳打包测试国际化 -version: 1.0.84+2024101601 +version: 1.0.84+2024111201 environment: sdk: '>=2.12.0 <3.0.0'