feat: 1、添加跳转小程序。2、修改网关配网逻辑。3、修复电子钥匙、卡、指纹、密码模块国际化bug

This commit is contained in:
魏少阳 2024-11-18 15:29:08 +08:00
parent d6ca149344
commit 720406913a
18 changed files with 320 additions and 257 deletions

BIN
images/.DS_Store vendored

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
ios/.DS_Store vendored

Binary file not shown.

View File

@ -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);

View File

@ -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<CardListPage> with RouteAware {
backgroundColor: AppColors.mainColor,
actionsList: <Widget>[
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<CardListPage> with RouteAware {
SizedBox(height: 20.h),
Expanded(child: _buildMainUI()),
AddBottomWhiteBtn(
btnName:
'添加卡'.tr,
btnName: '添加卡'.tr,
onClick: () async {
await Get.toNamed(Routers.addCardPage,
arguments: <String, int>{
'lockId': state.lockId.value,
'fromType': 1 // 1 2
})!.then((value) {
await Get.toNamed(Routers.addCardPage, arguments: <String, int>{
'lockId': state.lockId.value,
'fromType': 1 // 1 2
})!
.then((value) {
getHttpData(isRefresh: true);
});
// if (data != null) {
@ -176,10 +176,11 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
fingerprintItemData.cardName!,
logic.getKeyType(fingerprintItemData),
logic.getKeyDateType(fingerprintItemData), () async {
await Get.toNamed(Routers.cardDetailPage,
await Get.toNamed(Routers.cardDetailPage,
arguments: <String, FingerprintItemData>{
'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<CardListPage> 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: <Widget>[
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: <Widget>[
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
SizedBox(
width: 1.sw - 110.w - 100.w,
child: Row(
children: <Widget>[
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<CardListPage> with RouteAware {
),
],
),
SizedBox(width: 20.h),
// SizedBox(width: 20.h),
],
),
),
SizedBox(width: 20.h),
SizedBox(width: 20.w),
],
),
),

View File

@ -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<ElectronicKeyListPage> {
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<ElectronicKeyListPage> {
}).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<ElectronicKeyListPage> {
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: <Widget>[
SizedBox(width: 20.w),
@ -277,28 +276,27 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
),
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: <Widget>[
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
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<ElectronicKeyListPage> {
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<ElectronicKeyListPage> {
],
),
),
// SizedBox(width: 20.h),
SizedBox(width: 20.w),
],
),
),

View File

@ -38,18 +38,16 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: Column(
body: ListView(
children: <Widget>[
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;

View File

@ -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<FingerprintListPage>
),
Expanded(child: _buildMainUI()),
AddBottomWhiteBtn(
btnName:
'添加指纹'.tr,
btnName: '添加指纹'.tr,
onClick: () async {
await Get.toNamed(Routers.addFingerprintTypePage,
arguments: <String, int>{
arguments: <String, int>{
'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<FingerprintListPage>
fingerprintItemData.fingerprintName!,
logic.getKeyType(fingerprintItemData),
logic.getKeyDateType(fingerprintItemData), () async {
await Get.toNamed(Routers.fingerprintDetailPage, arguments: <String, FingerprintItemData>{
await Get.toNamed(Routers.fingerprintDetailPage,
arguments: <String, FingerprintItemData>{
'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<FingerprintListPage>
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: <Widget>[
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: <Widget>[
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
SizedBox(
width: ifInvalidation.isNotEmpty
? 1.sw - 110.w - 100.w
: 1.sw - 110.w - 50.w,
child: Row(
children: <Widget>[
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<FingerprintListPage>
),
],
),
SizedBox(width: 20.h),
// SizedBox(width: 20.h),
],
),
),
SizedBox(width: 20.h),
SizedBox(width: 20.w),
],
),
),

View File

@ -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<Reply>().listen((Reply reply) async {
state.replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
//
if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) {
_replyOpenLock(reply);
@ -179,7 +179,9 @@ class LockDetailLogic extends BaseGetXController {
}
}
Future<void> loadData({ required LockListInfoItemEntity lockListInfoItemEntity,required bool isOnlyOneData}) async {
Future<void> 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<int> publicKeyData =
state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
final List<String> saveStrList = changeIntListToStringList(publicKeyData);
Storage.setStringList(saveBluePublicKey, saveStrList);
//
final List<int> privateKeyData =
state.keyInfos.value.bluetooth!.privateKey!.cast<int>();
state.keyInfos.value.bluetooth!.privateKey!.cast<int>();
final List<String> savePrivateKeyList =
changeIntListToStringList(privateKeyData);
changeIntListToStringList(privateKeyData);
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
// signKey
final List<int> signKeyData =
state.keyInfos.value.bluetooth!.signKey!.cast<int>();
state.keyInfos.value.bluetooth!.signKey!.cast<int>();
final List<String> saveSignKeyList = changeIntListToStringList(signKeyData);
Storage.setStringList(saveBlueSignKey, saveSignKeyList);
final bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken);
if (!ifHaveKey) {
final List<String> saveTokenList =
changeIntListToStringList(<int>[0, 0, 0, 0]);
changeIntListToStringList(<int>[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<void> 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

View File

@ -1,4 +1,3 @@
import 'dart:async';
import 'package:flutter/material.dart';
@ -89,10 +88,17 @@ class _LockDetailPageState extends State<LockDetailPage>
//
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<LockDetailPage>
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<LockDetailPage>
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<LockDetailPage>
//
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: <String, Object?>{
'lockId': state.keyInfos.value.lockId,
'isOnlyOneData': state.isOnlyOneData
@ -1077,9 +1101,8 @@ class _LockDetailPageState extends State<LockDetailPage>
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: <String, int?>{
'lockId': state.keyInfos.value.lockId,
});
@ -1100,23 +1123,21 @@ class _LockDetailPageState extends State<LockDetailPage>
}
// if (state.keyInfos.value.lockFeature!.palmVein == 1) {
showWidgetArr.add(
bottomItem(
'images/main/icon_palm.png', '掌静脉'.tr, state.bottomBtnisEable.value,
() {
Get.toNamed(Routers.palmListPage, arguments: <String, int?>{
'lockId': state.keyInfos.value.lockId,
});
}),
);
showWidgetArr.add(
bottomItem(
'images/main/icon_palm.png', '掌静脉'.tr, state.bottomBtnisEable.value,
() {
Get.toNamed(Routers.palmListPage, arguments: <String, int?>{
'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: <String, Object?>{
'lockName': state.keyInfos.value.lockName,
@ -1128,10 +1149,8 @@ class _LockDetailPageState extends State<LockDetailPage>
//
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: <String, LockListInfoItemEntity>{
'keyInfo': state.keyInfos.value
@ -1155,10 +1174,8 @@ class _LockDetailPageState extends State<LockDetailPage>
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: <String, int?>{
'lockId': state.keyInfos.value.lockId,
});
@ -1166,9 +1183,7 @@ class _LockDetailPageState extends State<LockDetailPage>
}
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: <String, int?>{
'lockId': state.keyInfos.value.lockId,
@ -1180,8 +1195,7 @@ class _LockDetailPageState extends State<LockDetailPage>
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: <String, Object?>{
'lockId': state.keyInfos.value.lockId,
@ -1216,7 +1230,7 @@ class _LockDetailPageState extends State<LockDetailPage>
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<LockDetailPage>
),
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: <Widget>[
SizedBox(
width: 42.w,
@ -1248,12 +1263,16 @@ class _LockDetailPageState extends State<LockDetailPage>
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),

View File

@ -1,4 +1,3 @@
import 'dart:async';
import 'package:flutter/services.dart';
@ -78,7 +77,7 @@ class LockMonitoringLogic extends BaseGetXController {
}
///
udpAnswerAction() async {
Future<void> udpAnswerAction() async {
AppLog.log('点了接听么');
UDPSenderManage.sendMainProtocol(
command: 150,
@ -177,7 +176,8 @@ class LockMonitoringLogic extends BaseGetXController {
// CallTalk().stopPlaySound();
// }
state.allFrames.add(frame); //
final List<int> concatenatedFrames = concatenateFrames(state.allFrames); //
final List<int> concatenatedFrames =
concatenateFrames(state.allFrames); //
AppLog.log('pcm数据:$concatenatedFrames');
final List<int> pcmBytes = listLinearToULaw(frame);

View File

@ -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<PasswordKeyListPage>
btnName: '获取密码'.tr,
onClick: () async {
await Get.toNamed(Routers.passwordKeyPerpetualPage,
arguments: <String, LockListInfoItemEntity>{
arguments: <String, LockListInfoItemEntity>{
'keyInfo': state.keyInfo.value
})!.then((Object? val) {
})!
.then((Object? val) {
if (val != null) {
getHttpData(isRefresh: true);
}
@ -177,13 +178,17 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
),
],
),
child: _electronicKeyItem(index, 'images/icon_password.png',
passwordKeyListItem.keyboardPwdName!, useDateStr, () async {
await Get.toNamed(Routers.passwordKeyDetailPage,
arguments: <String, PasswordKeyListItem>{
child: _electronicKeyItem(
index,
'images/icon_password.png',
passwordKeyListItem.keyboardPwdName!,
useDateStr, () async {
await Get.toNamed(Routers.passwordKeyDetailPage,
arguments: <String, PasswordKeyListItem>{
'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<PasswordKeyListPage>
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: <Widget>[
@ -234,27 +240,19 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
SizedBox(
width: 20.w,
),
Expanded(
SizedBox(
width: 1.sw - 70.w - 60.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(
children: <Widget>[
SizedBox(
width: passwordKeyListItem.keyboardPwdStatus == 2 ||
passwordKeyListItem.keyboardPwdStatus == 3
? 1.sw - 110.w - 100.w
: 1.sw - 110.w - 50.w,
child: Row(children: <Widget>[
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<PasswordKeyListPage>
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<PasswordKeyListPage>
],
),
),
SizedBox(width: 20.h),
SizedBox(width: 20.w),
],
),
),

View File

@ -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();
}

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

View File

@ -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<NearbyLockPage> 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();

View File

@ -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<StarLockMinePage> 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<StarLockMinePage> with BaseWidget {
}
Widget bottomListWidget() {
return Expanded(
child: ListView(
return Container(
padding: EdgeInsets.only(
left: 60.w,
top: 50.h,
),
children: <Widget>[
// 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: <Widget>[
// 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() {

View File

@ -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<void> initWeChatMiniProgram(
String appId, String universalLink) async {
fluwx.registerApi(
appId: appId,
universalLink: universalLink,
doOnAndroid: true,
doOnIOS: true);
}
static Future<void> 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);
}
}
}

View File

@ -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'