diff --git a/ios/Runner/RunnerDebug-dev.entitlements b/ios/Runner/RunnerDebug-dev.entitlements
index d7b50f42..4e8ae9e6 100755
--- a/ios/Runner/RunnerDebug-dev.entitlements
+++ b/ios/Runner/RunnerDebug-dev.entitlements
@@ -8,6 +8,8 @@
applinks:lock.skychip.top
+ com.apple.developer.networking.wifi-info
+
com.apple.external-accessory.wireless-configuration
diff --git a/ios/Runner/RunnerRelease-sky.entitlements b/ios/Runner/RunnerRelease-sky.entitlements
index d7b50f42..4e8ae9e6 100755
--- a/ios/Runner/RunnerRelease-sky.entitlements
+++ b/ios/Runner/RunnerRelease-sky.entitlements
@@ -8,6 +8,8 @@
applinks:lock.skychip.top
+ com.apple.developer.networking.wifi-info
+
com.apple.external-accessory.wireless-configuration
diff --git a/ios/Runner/RunnerRelease-xhj.entitlements b/ios/Runner/RunnerRelease-xhj.entitlements
index 66cd751d..82c8924b 100755
--- a/ios/Runner/RunnerRelease-xhj.entitlements
+++ b/ios/Runner/RunnerRelease-xhj.entitlements
@@ -8,6 +8,8 @@
applinks:lock.xhjcn.ltd
+ com.apple.developer.networking.wifi-info
+
com.apple.external-accessory.wireless-configuration
diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile
index 169ea544..3591770d 100644
--- a/ios/fastlane/Fastfile
+++ b/ios/fastlane/Fastfile
@@ -77,7 +77,7 @@ platform :ios do
UI.user_error!("flavor is required") unless flavor
UI.user_error!("env is required") unless env
print_log "build #{flavor} on #{env}"
- build_number = Time.now.strftime("%Y%m%d%H")
+ build_number = Time.now.strftime("%Y%m%d%H%M")
print_log "Build Commits #{build_number}"
build_version = $next_version # Time.now.strftime("%Y%m%d%H%M%S")
print_log "build_version #{build_version}"
@@ -130,7 +130,7 @@ platform :ios do
flavor = options[:flavor]
UI.user_error!("flavor is required") unless flavor
print_log "build flavor: #{flavor}"
- build_number = Time.now.strftime("%Y%m%d%H")
+ build_number = Time.now.strftime("%Y%m%d%H%M")
print_log "Build Commits #{build_number}"
build_version = $current_tag.match(/^v(\d+\.\d+\.\d+)/).captures[0]
print_log "build_version #{build_version}"
diff --git a/lan/lan_en.json b/lan/lan_en.json
index 54c8f340..e72ecdae 100644
--- a/lan/lan_en.json
+++ b/lan/lan_en.json
@@ -62,6 +62,7 @@
"批量授权锁": "Grant multiple locks",
"授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "The authorized administrator will have majority permission to operate this lock.",
"功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "This feature allows you to Unlock the Smart Lock Remotely via a Gateway.This Feature can ONLY be Turned ON or OFF via Bluetooth.",
+ "功能开启后,你将可以通过网关远程开锁。": "After the function is enabled, you will be able to remotely unlock through the gateway。",
"排列方式": "List Type",
"早到榜": "Early List",
"迟到榜": "Late List",
@@ -1125,6 +1126,7 @@
"通话连接失败": "Call connection failed",
"已挂断": "Hanging up",
"正在说话...": "Talking now...",
+ "设备不在线": "The device is not online",
"下载完成,请到相册查看": "Download completed, please go to the album to view",
"重置后,该锁的遥控都将被删除哦,确认要重置吗?": "After reset, the remote control of the lock will be deleted. Do you want to reset it?",
"版本说明": "Version description",
diff --git a/lan/lan_keys.json b/lan/lan_keys.json
index 2c9cb07e..9a3145af 100755
--- a/lan/lan_keys.json
+++ b/lan/lan_keys.json
@@ -62,6 +62,7 @@
"批量授权锁": "批量授权锁",
"授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人",
"功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。",
+ "功能开启后,你将可以通过网关远程开锁。": "功能开启后,你将可以通过网关远程开锁。",
"排列方式": "排列方式",
"早到榜": "早到榜",
"迟到榜": "迟到榜",
@@ -1126,6 +1127,7 @@
"通话连接失败": "通话连接失败",
"已挂断": "已挂断",
"正在说话...": "正在说话...",
+ "设备不在线": "设备不在线",
"下载完成,请到相册查看": "下载完成,请到相册查看",
"重置后,该锁的遥控都将被删除哦,确认要重置吗?": "重置后,该锁的遥控都将被删除哦,确认要重置吗?",
"版本说明": "版本说明"
diff --git a/lan/lan_zh.json b/lan/lan_zh.json
index 141f90aa..1b455063 100755
--- a/lan/lan_zh.json
+++ b/lan/lan_zh.json
@@ -62,6 +62,7 @@
"批量授权锁": "批量授权锁",
"授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人",
"功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。",
+ "功能开启后,你将可以通过网关远程开锁。": "功能开启后,你将可以通过网关远程开锁。",
"排列方式": "排列方式",
"早到榜": "早到榜",
"迟到榜": "迟到榜",
@@ -1126,6 +1127,7 @@
"通话连接失败": "通话连接失败",
"已挂断": "已挂断",
"正在说话...": "正在说话...",
+ "设备不在线": "设备不在线",
"下载完成,请到相册查看": "下载完成,请到相册查看",
"重置后,该锁的遥控都将被删除哦,确认要重置吗?": "重置后,该锁的遥控都将被删除哦,确认要重置吗?",
"版本说明": "版本说明"
diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart
index c57b3cbf..421d0762 100755
--- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart
+++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart
@@ -67,8 +67,6 @@ class _LockDetailPageState extends State
logic.loadData(
lockListInfoItemEntity: widget.lockListInfoItemEntity,
isOnlyOneData: widget.isOnlyOneData);
-
-
}
@override
@@ -618,6 +616,14 @@ class _LockDetailPageState extends State
fontSize: 18.sp,
color: AppColors.darkGrayTextColor)),
SizedBox(width: 2.w),
+ state.keyInfos.value.network?.isOnline == 1
+ ? Icon(
+ Icons.wifi,
+ color: AppColors.mainColor,
+ size: 22.sp,
+ )
+ : SizedBox.shrink(),
+ SizedBox(width: 4.w),
FlavorsImg(
child: Icon(
Icons.info, // 使用内置的 warning 图标,它是一个叹号
@@ -1164,6 +1170,10 @@ class _LockDetailPageState extends State
showWidgetArr.add(
bottomItem('images/main/icon_catEyes.png', '监控'.tr,
state.bottomBtnisEable.value, () async {
+ if (state.keyInfos.value.network?.isOnline == 0) {
+ logic.showToast('设备不在线'.tr);
+ return;
+ }
logic.sendMonitorMessage();
}),
);
@@ -1571,5 +1581,4 @@ class _LockDetailPageState extends State
logic.closeLuckStatus();
BlueManage().disconnect();
}
-
}
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 {
),
);
}
-
}
diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart b/lib/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart
index 4e01541b..8e1d29d2 100755
--- a/lib/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart
+++ b/lib/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart
@@ -1,5 +1,6 @@
-class LockSetInfoEntity {
+import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
+class LockSetInfoEntity {
LockSetInfoEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
@@ -9,6 +10,7 @@ class LockSetInfoEntity {
errorMsg = json['errorMsg'];
data = json['data'] != null ? LockSetInfoData.fromJson(json['data']) : null;
}
+
int? errorCode;
String? description;
String? errorMsg;
@@ -27,7 +29,6 @@ class LockSetInfoEntity {
}
class LockSetInfoData {
-
LockSetInfoData(
{this.lockId,
this.lockStatus,
@@ -50,6 +51,7 @@ class LockSetInfoData {
? LockSettingInfo.fromJson(json['lockSettingInfo'])
: null;
}
+
int? lockId;
LockStatus? lockStatus;
LockFeature? lockFeature;
@@ -76,12 +78,12 @@ class LockSetInfoData {
}
class LockStatus {
-
LockStatus({this.roomStatus});
LockStatus.fromJson(Map json) {
roomStatus = json['roomStatus'];
}
+
int? roomStatus;
Map toJson() {
@@ -91,7 +93,8 @@ class LockStatus {
}
}
-class LockFeature { //人脸开关 0:关闭 1:开启
+class LockFeature {
+ //人脸开关 0:关闭 1:开启
LockFeature({
this.password,
@@ -206,6 +209,7 @@ class LockFeature { //人脸开关 0:关闭 1:开启
abnormalWarn = json['abnormalWarn'];
isSupportBackupBattery = json['isSupportBackupBattery'];
}
+
int? password;
int? icCard;
int? fingerprint;
@@ -322,7 +326,6 @@ class LockFeature { //人脸开关 0:关闭 1:开启
}
class LockBasicInfo {
-
LockBasicInfo(
{this.lockId,
this.electricQuantityDate,
@@ -348,7 +351,8 @@ class LockBasicInfo {
this.weekDays,
this.address,
this.network,
- this.vendor});
+ this.vendor,
+ this.networkInfo});
LockBasicInfo.fromJson(Map json) {
lockId = json['lockId'];
@@ -381,7 +385,11 @@ class LockBasicInfo {
address = json['address'];
network = json['network'];
vendor = json['vendor'];
+ networkInfo = json['networkInfo'] != null
+ ? NetworkInfo.fromJson(json['networkInfo'])
+ : null;
}
+
int? lockId;
int? electricQuantityDate;
int? keyId;
@@ -407,6 +415,7 @@ class LockBasicInfo {
String? address;
String? network;
String? vendor;
+ NetworkInfo? networkInfo;
Map toJson() {
final Map data = {};
@@ -437,18 +446,21 @@ class LockBasicInfo {
data['address'] = address;
data['network'] = network;
data['vendor'] = vendor;
+ if (networkInfo != null) {
+ data['networkInfo'] = networkInfo!.toJson();
+ }
return data;
}
}
class GroupData {
-
GroupData({this.id, this.name});
GroupData.fromJson(Map json) {
id = json['id'];
name = json['name'];
}
+
int? id;
String? name;
@@ -460,7 +472,8 @@ class GroupData {
}
}
-class LockSettingInfo { // 防误开
+class LockSettingInfo {
+ // 防误开
LockSettingInfo({
this.remoteUnlock,
this.autoLock,
@@ -540,6 +553,7 @@ class LockSettingInfo { // 防误开
autoLightScreenTime = json['autoLightScreenTime'];
faceEnErrUnlock = json['faceEnErrUnlock'];
}
+
int? remoteUnlock;
int? autoLock;
int? autoLockSecond;
@@ -619,7 +633,6 @@ class LockSettingInfo { // 防误开
}
class PassageModeConfig {
-
PassageModeConfig(
{this.startDate, this.endDate, this.weekDays, this.isAllDay});
@@ -629,6 +642,7 @@ class PassageModeConfig {
weekDays = json['weekDays'].cast();
isAllDay = json['isAllDay'];
}
+
int? startDate;
int? endDate;
List? weekDays;
@@ -645,7 +659,6 @@ class PassageModeConfig {
}
class CatEyeConfig {
-
CatEyeConfig({this.catEyeMode, this.catEyeModeConfig});
CatEyeConfig.fromJson(Map json) {
@@ -654,6 +667,7 @@ class CatEyeConfig {
? CatEyeModeConfig.fromJson(json['catEyeModeConfig'])
: null;
}
+
int? catEyeMode; //1省电模式 2逗留抓拍模式 3实时监控模式 4自定义模式(自定义模式下存在其他设置参数)
CatEyeModeConfig? catEyeModeConfig;
@@ -667,7 +681,8 @@ class CatEyeConfig {
}
}
-class CatEyeModeConfig { //人体侦测距离
+class CatEyeModeConfig {
+ //人体侦测距离
CatEyeModeConfig(
{this.recordMode,
@@ -689,6 +704,7 @@ class CatEyeModeConfig { //人体侦测距离
recordStartTime = json['recordStartTime'];
detectionDistance = json['detectionDistance'];
}
+
int? recordMode; //录像时段 0全天 1自定义时间
String? recordTime; //有人出现时录像
int? realTimeMode; //实时画面 0发生事件事查看 1实时查看
diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart
index 44277007..83fada97 100755
--- a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart
+++ b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart
@@ -500,7 +500,10 @@ class _LockSetPageState extends State
isHaveLine: true,
isHaveDirection: true,
action: () {
- Get.toNamed(Routers.motorPowerPage);
+ Get.toNamed(Routers.motorPowerPage,
+ arguments: {
+ 'lockSetInfoData': state.lockSetInfoData.value
+ });
})),
// 蓝牙广播(关闭则不能使用蓝牙主动开锁)
/* 2024-01-12 会议确定去掉“蓝牙广播” by DaisyWu
diff --git a/lib/main/lockDetail/lockSet/motorPower/motorPower_logic.dart b/lib/main/lockDetail/lockSet/motorPower/motorPower_logic.dart
index 0085779e..44b72e64 100755
--- a/lib/main/lockDetail/lockSet/motorPower/motorPower_logic.dart
+++ b/lib/main/lockDetail/lockSet/motorPower/motorPower_logic.dart
@@ -2,6 +2,7 @@ import 'dart:async';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
+import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsWithParameters.dart';
import 'package:star_lock/login/login/entity/LoginEntity.dart';
import '../../../../blue/blue_manage.dart';
@@ -28,6 +29,7 @@ class MotorPowerLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) {
state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue =
state.motorTorsion.value;
+
eventBus
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
showToast('操作成功'.tr);
@@ -36,6 +38,7 @@ class MotorPowerLogic extends BaseGetXController {
// 获取解析后的数据
late StreamSubscription _replySubscription;
+
void _initReplySubscription() {
_replySubscription =
EventBusManager().eventBus!.on().listen((Reply reply) {
@@ -43,6 +46,10 @@ class MotorPowerLogic extends BaseGetXController {
_replySetSupportFunctionsWithParameters(reply);
}
+ if (reply is SetSupportFunctionsWithParametersReply) {
+ _replySetSupportFunctionsWithParameters(reply);
+ }
+
// 读取支持功能(带参数)
// if(reply is ReadSupportFunctionsNoParametersReply) {
// _readSupportFunctionsWithParametersReply(reply);
diff --git a/lib/main/lockDetail/lockSet/motorPower/motorPower_page.dart b/lib/main/lockDetail/lockSet/motorPower/motorPower_page.dart
index ac023d66..7aa478c6 100755
--- a/lib/main/lockDetail/lockSet/motorPower/motorPower_page.dart
+++ b/lib/main/lockDetail/lockSet/motorPower/motorPower_page.dart
@@ -21,53 +21,60 @@ class _MotorPowerPageState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
- backgroundColor: Colors.white,
- appBar: TitleAppBar(
- barTitle: '电机功率设置'.tr,
- haveBack: true,
- backgroundColor: AppColors.mainColor),
- body: Column(
- children: [
- SizedBox(
- height: 40.h,
+ backgroundColor: Colors.white,
+ appBar: TitleAppBar(
+ barTitle: '电机功率设置'.tr,
+ haveBack: true,
+ backgroundColor: AppColors.mainColor),
+ body: Column(
+ children: [
+ SizedBox(
+ height: 40.h,
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 40.w),
+ alignment: Alignment.centerLeft,
+ child: Text(
+ '请根据门锁实际情况,请谨慎选择电机功率:'.tr,
+ style: TextStyle(
+ fontSize: 24.sp,
+ color: Colors.black,
+ fontWeight: FontWeight.w500),
),
- Container(
- margin: EdgeInsets.only(left: 40.w),
- alignment: Alignment.centerLeft,
- child: Text(
- '请根据门锁实际情况,请谨慎选择电机功率:'.tr,
- style: TextStyle(
- fontSize: 24.sp,
- color: Colors.black,
- fontWeight: FontWeight.w500),
- ),
- ),
- SizedBox(
- height: 40.h,
- ),
- _buildTipsView(
+ ),
+ SizedBox(
+ height: 40.h,
+ ),
+ Obx(
+ () => _buildTipsView(
'${'小功率:'.tr}\n', '耗电少'.tr, state.motorTorsion.value == 1, () {
state.motorTorsion.value = 1;
logic.sendOpenDoorDirection();
}),
- SizedBox(
- height: 20.h,
- ),
- _buildTipsView(
+ ),
+ SizedBox(
+ height: 20.h,
+ ),
+ Obx(
+ () => _buildTipsView(
'${'中功率'.tr}\n', '常规使用'.tr, state.motorTorsion.value == 2, () {
state.motorTorsion.value = 2;
logic.sendOpenDoorDirection();
}),
- SizedBox(
- height: 20.h,
- ),
- _buildTipsView(
+ ),
+ SizedBox(
+ height: 20.h,
+ ),
+ Obx(
+ () => _buildTipsView(
'${'大功率'.tr}\n', '大功率提示'.tr, state.motorTorsion.value == 3, () {
state.motorTorsion.value = 3;
logic.sendOpenDoorDirection();
}),
- ],
- ));
+ )
+ ],
+ ),
+ );
}
Widget _buildTipsView(
diff --git a/lib/main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart b/lib/main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart
index 2147a824..3489df75 100755
--- a/lib/main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart
+++ b/lib/main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart
@@ -40,7 +40,7 @@ class _RemoteUnlockingPageState extends State with RouteAwa
children: [
Expanded(
child: Text(
- '功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。'.tr,
+ '功能开启后,你将可以通过网关远程开锁。'.tr,
style: TextStyle(
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
)),
diff --git a/lib/main/lockMian/entity/lockListInfo_entity.dart b/lib/main/lockMian/entity/lockListInfo_entity.dart
index 2a462bcc..b3b46464 100755
--- a/lib/main/lockMian/entity/lockListInfo_entity.dart
+++ b/lib/main/lockMian/entity/lockListInfo_entity.dart
@@ -422,17 +422,26 @@ class LockSetting {
class NetworkInfo {
NetworkInfo({
this.peerId,
+ this.isOnline,
+ this.wifiName,
+
});
NetworkInfo.fromJson(Map json) {
peerId = json['peerId'];
+ isOnline = json['isOnline'];
+ wifiName = json['wifiName'];
}
String? peerId;
+ String? wifiName;
+ int? isOnline;
Map toJson() {
final Map data = {};
data['peerId'] = peerId;
+ data['wifiName'] = wifiName;
+ data['isOnline'] = isOnline;
return data;
}
}
diff --git a/lib/mine/about/about_page.dart b/lib/mine/about/about_page.dart
index 46632a87..ac764871 100755
--- a/lib/mine/about/about_page.dart
+++ b/lib/mine/about/about_page.dart
@@ -2,12 +2,15 @@ import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/mine/about/about_console.dart';
+import 'package:star_lock/tools/NativeInteractionTool.dart';
import '../../app_settings/app_colors.dart';
import '../../flavors.dart';
@@ -261,6 +264,16 @@ class _AboutPageState extends State {
),
),
GestureDetector(
+ onLongPress: () async {
+ final PackageInfo packageInfo =
+ await PackageInfo.fromPlatform();
+ final String? registrationId =
+ await Storage.getString(pushDeviceID);
+ Clipboard.setData(ClipboardData(text: registrationId ?? ''));
+ EasyLoading.showToast(
+ '${packageInfo.packageName}的registration(${registrationId ?? ''})复制成功'
+ .tr);
+ },
onTap: logic.handleTap,
child: ClipRRect(
borderRadius: BorderRadius.circular(20.r),
diff --git a/lib/talk/starChart/handle/impl/udp_talk_hangup_handler.dart b/lib/talk/starChart/handle/impl/udp_talk_hangup_handler.dart
index 686b8bc3..c73dcce3 100644
--- a/lib/talk/starChart/handle/impl/udp_talk_hangup_handler.dart
+++ b/lib/talk/starChart/handle/impl/udp_talk_hangup_handler.dart
@@ -36,6 +36,7 @@ class UdpTalkHangUpHandler extends ScpMessageBaseHandle
EasyLoading.showToast('已挂断'.tr);
startChartManage.stopSendingRbcuInfoMessages();
startChartManage.stopSendingRbcuProBeMessages();
+ startChartManage.stopTalkHangupMessageTimer();
Get.back();
}
}
@@ -53,6 +54,7 @@ class UdpTalkHangUpHandler extends ScpMessageBaseHandle
talkDataOverTimeTimerManager.cancel();
startChartManage.stopSendingRbcuInfoMessages();
startChartManage.stopSendingRbcuProBeMessages();
+ startChartManage.stopTalkHangupMessageTimer();
}
@override
diff --git a/lib/talk/starChart/handle/impl/udp_talk_reject_handler.dart b/lib/talk/starChart/handle/impl/udp_talk_reject_handler.dart
index b1fbcb15..15c16a16 100644
--- a/lib/talk/starChart/handle/impl/udp_talk_reject_handler.dart
+++ b/lib/talk/starChart/handle/impl/udp_talk_reject_handler.dart
@@ -33,6 +33,7 @@ class UdpTalkRejectHandler extends ScpMessageBaseHandle
talkDataOverTimeTimerManager.cancel();
startChartManage.stopSendingRbcuInfoMessages();
startChartManage.stopSendingRbcuProBeMessages();
+ startChartManage.stopTalkRejectMessageTimer();
}
@override
@@ -47,6 +48,7 @@ class UdpTalkRejectHandler extends ScpMessageBaseHandle
talkDataOverTimeTimerManager.cancel();
startChartManage.stopSendingRbcuInfoMessages();
startChartManage.stopSendingRbcuProBeMessages();
+ startChartManage.stopTalkRejectMessageTimer();
}
@override
diff --git a/lib/talk/starChart/handle/other/talke_data_over_time_timer_manager.dart b/lib/talk/starChart/handle/other/talke_data_over_time_timer_manager.dart
index 3fe67456..a988d44a 100644
--- a/lib/talk/starChart/handle/other/talke_data_over_time_timer_manager.dart
+++ b/lib/talk/starChart/handle/other/talke_data_over_time_timer_manager.dart
@@ -30,7 +30,7 @@ class TalkDataOverTimeTimerManager {
static void _handleTalkeDataOverTime() {
EasyLoading.showToast('通话连接失败'.tr, duration: 2000.milliseconds);
// 没有通话数据,发送挂断数据
- StartChartManage().sendTalkHangupMessage();
+ StartChartManage().startTalkHangupMessageTimer();
StartChartManage().stopTalkPingMessageTimer();
StartChartManage().stopTalkExpectMessageTimer();
StartChartManage().stopSendingRbcuInfoMessages();
diff --git a/lib/talk/starChart/handle/other/talke_ping_over_time_timer_manager.dart b/lib/talk/starChart/handle/other/talke_ping_over_time_timer_manager.dart
index 4fa9b85a..22632b13 100644
--- a/lib/talk/starChart/handle/other/talke_ping_over_time_timer_manager.dart
+++ b/lib/talk/starChart/handle/other/talke_ping_over_time_timer_manager.dart
@@ -36,7 +36,7 @@ class TalkePingOverTimeTimerManager {
StartChartManage().stopTalkPingMessageTimer();
StartChartManage().stopTalkExpectMessageTimer();
// 如果通话异常,则发送通话中挂断
- StartChartManage().sendTalkHangupMessage();
+ StartChartManage().startTalkHangupMessageTimer();
StartChartManage().stopSendingRbcuInfoMessages();
StartChartManage().stopSendingRbcuProBeMessages();
talkStatus.setNotTalkPing();
diff --git a/lib/talk/starChart/handle/other/talke_request_over_time_timer_manager.dart b/lib/talk/starChart/handle/other/talke_request_over_time_timer_manager.dart
index 2ec529f6..44bb1630 100644
--- a/lib/talk/starChart/handle/other/talke_request_over_time_timer_manager.dart
+++ b/lib/talk/starChart/handle/other/talke_request_over_time_timer_manager.dart
@@ -31,7 +31,7 @@ class TalkeRequestOverTimeTimerManager {
talkStatus.status == TalkStatus.proactivelyCallWaitingAnswer) {
EasyLoading.showToast('通话未接通,已挂断'.tr, duration: 2000.milliseconds);
// 超时未接听,发送挂断请求
- StartChartManage().sendTalkRejectMessage();
+ StartChartManage().startTalkRejectMessageTimer();
StartChartManage().stopSendingRbcuInfoMessages();
StartChartManage().stopSendingRbcuProBeMessages();
talkStatus.setInitializationCompleted();
diff --git a/lib/talk/starChart/star_chart_manage.dart b/lib/talk/starChart/star_chart_manage.dart
index 04457339..9fc24737 100644
--- a/lib/talk/starChart/star_chart_manage.dart
+++ b/lib/talk/starChart/star_chart_manage.dart
@@ -97,6 +97,9 @@ class StartChartManage {
Timer? rbcuInfoTimer; // p2p地址交换定时器
Timer? rbcuProbeTimer; // p2p打洞包
Timer? rbcuConfirmTimer; // p2p打洞确认包
+ Timer? talkHangupTimer; // 添加挂断消息定时器
+ Timer? talkRejectTimer; // 添加拒绝接听定时器
+
String _rbcuSessionId = ''; // p2p SessionId
Timer? talkRequestTimer; // 对讲请求定时器
final int maxAttempts = 15; // 最大执行次数
@@ -570,14 +573,23 @@ class StartChartManage {
stopTalkExpectMessageTimer();
}
- // 发送拒绝接听消息
- void sendTalkRejectMessage() async {
+ void _sendTalkRejectMessage() {
final message = MessageCommand.talkRejectMessage(
ToPeerId: ToPeerId,
FromPeerId: FromPeerId,
MessageId: MessageCommand.getNextMessageId(ToPeerId, increment: true),
);
- await _sendMessage(message: message);
+ _sendMessage(message: message);
+ }
+
+ // 发送拒绝接听消息
+ void startTalkRejectMessageTimer() async {
+ talkRejectTimer ??= Timer.periodic(
+ Duration(seconds: _defaultIntervalTime),
+ (Timer timer) async {
+ _sendTalkRejectMessage();
+ },
+ );
// 设置状态为拒绝
StartChartTalkStatus.instance.setRejected();
@@ -652,14 +664,24 @@ class StartChartManage {
// _log(text: '发送通话保持');
}
- // 发送通话中挂断消息
- Future sendTalkHangupMessage() async {
+ void _sendTalkHangupMessage() async {
final message = MessageCommand.talkHangupMessage(
ToPeerId: ToPeerId,
FromPeerId: FromPeerId,
MessageId: MessageCommand.getNextMessageId(ToPeerId, increment: true),
);
await _sendMessage(message: message);
+ }
+
+ // 发送通话中挂断消息
+ // 启动定时发送挂断消息
+ void startTalkHangupMessageTimer() {
+ talkHangupTimer ??= Timer.periodic(
+ Duration(seconds: _defaultIntervalTime),
+ (Timer timer) async {
+ _sendTalkHangupMessage();
+ },
+ );
// 设置状态为通话中挂断
StartChartTalkStatus.instance.setHangingUpDuring();
@@ -676,6 +698,18 @@ class StartChartManage {
talkDataOverTimeTimerManager.cancel();
}
+ // 停止发送挂断消息
+ void stopTalkHangupMessageTimer() {
+ talkHangupTimer?.cancel();
+ talkHangupTimer = null;
+ }
+
+ // 停止发送挂断消息
+ void stopTalkRejectMessageTimer() {
+ talkRejectTimer?.cancel();
+ talkRejectTimer = null;
+ }
+
// 重新上线
Future reStartOnlineStartChartServer() async {
if (isOnlineStarChartServer) {
@@ -1131,13 +1165,15 @@ class StartChartManage {
/// 销毁资源
void destruction() async {
- // 发送挂断消息
- sendTalkHangupMessage();
isOnlineStarChartServer = false;
// 停止发送心跳消息
stopHeartbeat();
// 取消发送期望数据
stopTalkExpectMessageTimer();
+ // 取消发送拒绝定时器
+ stopTalkRejectMessageTimer();
+ // 取消发送挂断定时器
+ stopTalkHangupMessageTimer();
// 取消发送通话保持消息
stopTalkPingMessageTimer();
// 取消发送上线消息
diff --git a/lib/talk/starChart/status/appLifecycle_observer.dart b/lib/talk/starChart/status/appLifecycle_observer.dart
index d1f55e73..03a0a37f 100644
--- a/lib/talk/starChart/status/appLifecycle_observer.dart
+++ b/lib/talk/starChart/status/appLifecycle_observer.dart
@@ -1,5 +1,7 @@
import 'package:flutter/widgets.dart';
+import 'package:get/get.dart';
import 'package:star_lock/network/start_chart_api.dart';
+import 'package:star_lock/talk/starChart/constant/talk_status.dart';
import 'package:star_lock/talk/starChart/star_chart_manage.dart';
import 'package:star_lock/tools/storage.dart';
@@ -27,6 +29,15 @@ class AppLifecycleObserver extends WidgetsBindingObserver {
void onAppPaused() {
// 处理应用程序进入后台的逻辑
print('App has entered the background.');
+ if (StartChartManage().talkStatus.status ==
+ TalkStatus.passiveCallWaitingAnswer ||
+ StartChartManage().talkStatus.status ==
+ TalkStatus.proactivelyCallWaitingAnswer) {
+ StartChartManage().startTalkHangupMessageTimer();
+ StartChartManage().startTalkRejectMessageTimer();
+ // 如果是等待接听时就退出页面
+ Get.back();
+ }
StartChartManage().destruction();
}
diff --git a/lib/talk/starChart/views/talkView/talk_view_logic.dart b/lib/talk/starChart/views/talkView/talk_view_logic.dart
index a7d67466..bbc980c7 100644
--- a/lib/talk/starChart/views/talkView/talk_view_logic.dart
+++ b/lib/talk/starChart/views/talkView/talk_view_logic.dart
@@ -71,10 +71,10 @@ class TalkViewLogic extends BaseGetXController {
void udpHangUpAction() async {
if (state.talkStatus.value == TalkStatus.answeredSuccessfully) {
// 如果是通话中就挂断
- StartChartManage().sendTalkHangupMessage();
+ StartChartManage().startTalkHangupMessageTimer();
} else {
// 拒绝
- StartChartManage().sendTalkRejectMessage();
+ StartChartManage().startTalkRejectMessageTimer();
}
Get.back();
}
diff --git a/lib/tools/push/xs_jPhush.dart b/lib/tools/push/xs_jPhush.dart
index dc13b13b..bbeaa07a 100755
--- a/lib/tools/push/xs_jPhush.dart
+++ b/lib/tools/push/xs_jPhush.dart
@@ -88,9 +88,9 @@ class XSJPushProvider {
//绑定设备id
final String rid = await jpush.getRegistrationID();
AppLog.log('onConnected registration id : $rid');
- await Storage.setString(pushDeviceID, rid);
deviceID = rid;
}
+ await Storage.setString(pushDeviceID, deviceID);
final MineUnbindPhoneOrEmailEntity entity = await ApiRepository.to
.pushBindAppId(deviceID, Platform.isAndroid ? 10 : 20);
if (entity.errorCode!.codeIsSuccessful) {