Merge branch 'develop_liyi' of code-internal.star-lock.cn:StarlockTeam/app-starlock into develop_liyi

This commit is contained in:
“DaisyWu” 2025-02-18 10:42:19 +08:00
commit 6b74cfe9c2
25 changed files with 286 additions and 142 deletions

View File

@ -8,6 +8,8 @@
<array> <array>
<string>applinks:lock.skychip.top</string> <string>applinks:lock.skychip.top</string>
</array> </array>
<key>com.apple.developer.networking.wifi-info</key>
<true/>
<key>com.apple.external-accessory.wireless-configuration</key> <key>com.apple.external-accessory.wireless-configuration</key>
<true/> <true/>
</dict> </dict>

View File

@ -8,6 +8,8 @@
<array> <array>
<string>applinks:lock.skychip.top</string> <string>applinks:lock.skychip.top</string>
</array> </array>
<key>com.apple.developer.networking.wifi-info</key>
<true/>
<key>com.apple.external-accessory.wireless-configuration</key> <key>com.apple.external-accessory.wireless-configuration</key>
<true/> <true/>
</dict> </dict>

View File

@ -8,6 +8,8 @@
<array> <array>
<string>applinks:lock.xhjcn.ltd</string> <string>applinks:lock.xhjcn.ltd</string>
</array> </array>
<key>com.apple.developer.networking.wifi-info</key>
<true/>
<key>com.apple.external-accessory.wireless-configuration</key> <key>com.apple.external-accessory.wireless-configuration</key>
<true/> <true/>
</dict> </dict>

View File

@ -77,7 +77,7 @@ platform :ios do
UI.user_error!("flavor is required") unless flavor UI.user_error!("flavor is required") unless flavor
UI.user_error!("env is required") unless env UI.user_error!("env is required") unless env
print_log "build #{flavor} on #{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}" print_log "Build Commits #{build_number}"
build_version = $next_version # Time.now.strftime("%Y%m%d%H%M%S") build_version = $next_version # Time.now.strftime("%Y%m%d%H%M%S")
print_log "build_version #{build_version}" print_log "build_version #{build_version}"
@ -130,7 +130,7 @@ platform :ios do
flavor = options[:flavor] flavor = options[:flavor]
UI.user_error!("flavor is required") unless flavor UI.user_error!("flavor is required") unless flavor
print_log "build flavor: #{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}" print_log "Build Commits #{build_number}"
build_version = $current_tag.match(/^v(\d+\.\d+\.\d+)/).captures[0] build_version = $current_tag.match(/^v(\d+\.\d+\.\d+)/).captures[0]
print_log "build_version #{build_version}" print_log "build_version #{build_version}"

View File

@ -62,6 +62,7 @@
"批量授权锁": "Grant multiple locks", "批量授权锁": "Grant multiple locks",
"授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "The authorized administrator will have majority permission to operate this lock.", "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "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.", "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "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", "排列方式": "List Type",
"早到榜": "Early List", "早到榜": "Early List",
"迟到榜": "Late List", "迟到榜": "Late List",
@ -1125,6 +1126,7 @@
"通话连接失败": "Call connection failed", "通话连接失败": "Call connection failed",
"已挂断": "Hanging up", "已挂断": "Hanging up",
"正在说话...": "Talking now...", "正在说话...": "Talking now...",
"设备不在线": "The device is not online",
"下载完成,请到相册查看": "Download completed, please go to the album to view", "下载完成,请到相册查看": "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?", "重置后,该锁的遥控都将被删除哦,确认要重置吗?": "After reset, the remote control of the lock will be deleted. Do you want to reset it?",
"版本说明": "Version description", "版本说明": "Version description",

View File

@ -62,6 +62,7 @@
"批量授权锁": "批量授权锁", "批量授权锁": "批量授权锁",
"授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人", "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人",
"功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。", "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。",
"功能开启后,你将可以通过网关远程开锁。": "功能开启后,你将可以通过网关远程开锁。",
"排列方式": "排列方式", "排列方式": "排列方式",
"早到榜": "早到榜", "早到榜": "早到榜",
"迟到榜": "迟到榜", "迟到榜": "迟到榜",
@ -1126,6 +1127,7 @@
"通话连接失败": "通话连接失败", "通话连接失败": "通话连接失败",
"已挂断": "已挂断", "已挂断": "已挂断",
"正在说话...": "正在说话...", "正在说话...": "正在说话...",
"设备不在线": "设备不在线",
"下载完成,请到相册查看": "下载完成,请到相册查看", "下载完成,请到相册查看": "下载完成,请到相册查看",
"重置后,该锁的遥控都将被删除哦,确认要重置吗?": "重置后,该锁的遥控都将被删除哦,确认要重置吗?", "重置后,该锁的遥控都将被删除哦,确认要重置吗?": "重置后,该锁的遥控都将被删除哦,确认要重置吗?",
"版本说明": "版本说明" "版本说明": "版本说明"

View File

@ -62,6 +62,7 @@
"批量授权锁": "批量授权锁", "批量授权锁": "批量授权锁",
"授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人", "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人",
"功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。", "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。",
"功能开启后,你将可以通过网关远程开锁。": "功能开启后,你将可以通过网关远程开锁。",
"排列方式": "排列方式", "排列方式": "排列方式",
"早到榜": "早到榜", "早到榜": "早到榜",
"迟到榜": "迟到榜", "迟到榜": "迟到榜",
@ -1126,6 +1127,7 @@
"通话连接失败": "通话连接失败", "通话连接失败": "通话连接失败",
"已挂断": "已挂断", "已挂断": "已挂断",
"正在说话...": "正在说话...", "正在说话...": "正在说话...",
"设备不在线": "设备不在线",
"下载完成,请到相册查看": "下载完成,请到相册查看", "下载完成,请到相册查看": "下载完成,请到相册查看",
"重置后,该锁的遥控都将被删除哦,确认要重置吗?": "重置后,该锁的遥控都将被删除哦,确认要重置吗?", "重置后,该锁的遥控都将被删除哦,确认要重置吗?": "重置后,该锁的遥控都将被删除哦,确认要重置吗?",
"版本说明": "版本说明" "版本说明": "版本说明"

View File

@ -67,8 +67,6 @@ class _LockDetailPageState extends State<LockDetailPage>
logic.loadData( logic.loadData(
lockListInfoItemEntity: widget.lockListInfoItemEntity, lockListInfoItemEntity: widget.lockListInfoItemEntity,
isOnlyOneData: widget.isOnlyOneData); isOnlyOneData: widget.isOnlyOneData);
} }
@override @override
@ -618,6 +616,14 @@ class _LockDetailPageState extends State<LockDetailPage>
fontSize: 18.sp, fontSize: 18.sp,
color: AppColors.darkGrayTextColor)), color: AppColors.darkGrayTextColor)),
SizedBox(width: 2.w), 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( FlavorsImg(
child: Icon( child: Icon(
Icons.info, // 使 warning Icons.info, // 使 warning
@ -1164,6 +1170,10 @@ class _LockDetailPageState extends State<LockDetailPage>
showWidgetArr.add( showWidgetArr.add(
bottomItem('images/main/icon_catEyes.png', '监控'.tr, bottomItem('images/main/icon_catEyes.png', '监控'.tr,
state.bottomBtnisEable.value, () async { state.bottomBtnisEable.value, () async {
if (state.keyInfos.value.network?.isOnline == 0) {
logic.showToast('设备不在线'.tr);
return;
}
logic.sendMonitorMessage(); logic.sendMonitorMessage();
}), }),
); );
@ -1571,5 +1581,4 @@ class _LockDetailPageState extends State<LockDetailPage>
logic.closeLuckStatus(); logic.closeLuckStatus();
BlueManage().disconnect(); BlueManage().disconnect();
} }
} }

View File

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

View File

@ -1,5 +1,6 @@
class LockSetInfoEntity { import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
class LockSetInfoEntity {
LockSetInfoEntity( LockSetInfoEntity(
{this.errorCode, this.description, this.errorMsg, this.data}); {this.errorCode, this.description, this.errorMsg, this.data});
@ -9,6 +10,7 @@ class LockSetInfoEntity {
errorMsg = json['errorMsg']; errorMsg = json['errorMsg'];
data = json['data'] != null ? LockSetInfoData.fromJson(json['data']) : null; data = json['data'] != null ? LockSetInfoData.fromJson(json['data']) : null;
} }
int? errorCode; int? errorCode;
String? description; String? description;
String? errorMsg; String? errorMsg;
@ -27,7 +29,6 @@ class LockSetInfoEntity {
} }
class LockSetInfoData { class LockSetInfoData {
LockSetInfoData( LockSetInfoData(
{this.lockId, {this.lockId,
this.lockStatus, this.lockStatus,
@ -50,6 +51,7 @@ class LockSetInfoData {
? LockSettingInfo.fromJson(json['lockSettingInfo']) ? LockSettingInfo.fromJson(json['lockSettingInfo'])
: null; : null;
} }
int? lockId; int? lockId;
LockStatus? lockStatus; LockStatus? lockStatus;
LockFeature? lockFeature; LockFeature? lockFeature;
@ -76,12 +78,12 @@ class LockSetInfoData {
} }
class LockStatus { class LockStatus {
LockStatus({this.roomStatus}); LockStatus({this.roomStatus});
LockStatus.fromJson(Map<String, dynamic> json) { LockStatus.fromJson(Map<String, dynamic> json) {
roomStatus = json['roomStatus']; roomStatus = json['roomStatus'];
} }
int? roomStatus; int? roomStatus;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -91,7 +93,8 @@ class LockStatus {
} }
} }
class LockFeature { // 0: 1: class LockFeature {
// 0: 1:
LockFeature({ LockFeature({
this.password, this.password,
@ -206,6 +209,7 @@ class LockFeature { //人脸开关 0:关闭 1:开启
abnormalWarn = json['abnormalWarn']; abnormalWarn = json['abnormalWarn'];
isSupportBackupBattery = json['isSupportBackupBattery']; isSupportBackupBattery = json['isSupportBackupBattery'];
} }
int? password; int? password;
int? icCard; int? icCard;
int? fingerprint; int? fingerprint;
@ -322,7 +326,6 @@ class LockFeature { //人脸开关 0:关闭 1:开启
} }
class LockBasicInfo { class LockBasicInfo {
LockBasicInfo( LockBasicInfo(
{this.lockId, {this.lockId,
this.electricQuantityDate, this.electricQuantityDate,
@ -348,7 +351,8 @@ class LockBasicInfo {
this.weekDays, this.weekDays,
this.address, this.address,
this.network, this.network,
this.vendor}); this.vendor,
this.networkInfo});
LockBasicInfo.fromJson(Map<String, dynamic> json) { LockBasicInfo.fromJson(Map<String, dynamic> json) {
lockId = json['lockId']; lockId = json['lockId'];
@ -381,7 +385,11 @@ class LockBasicInfo {
address = json['address']; address = json['address'];
network = json['network']; network = json['network'];
vendor = json['vendor']; vendor = json['vendor'];
networkInfo = json['networkInfo'] != null
? NetworkInfo.fromJson(json['networkInfo'])
: null;
} }
int? lockId; int? lockId;
int? electricQuantityDate; int? electricQuantityDate;
int? keyId; int? keyId;
@ -407,6 +415,7 @@ class LockBasicInfo {
String? address; String? address;
String? network; String? network;
String? vendor; String? vendor;
NetworkInfo? networkInfo;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{}; final Map<String, dynamic> data = <String, dynamic>{};
@ -437,18 +446,21 @@ class LockBasicInfo {
data['address'] = address; data['address'] = address;
data['network'] = network; data['network'] = network;
data['vendor'] = vendor; data['vendor'] = vendor;
if (networkInfo != null) {
data['networkInfo'] = networkInfo!.toJson();
}
return data; return data;
} }
} }
class GroupData { class GroupData {
GroupData({this.id, this.name}); GroupData({this.id, this.name});
GroupData.fromJson(Map<String, dynamic> json) { GroupData.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
name = json['name']; name = json['name'];
} }
int? id; int? id;
String? name; String? name;
@ -460,7 +472,8 @@ class GroupData {
} }
} }
class LockSettingInfo { // class LockSettingInfo {
//
LockSettingInfo({ LockSettingInfo({
this.remoteUnlock, this.remoteUnlock,
this.autoLock, this.autoLock,
@ -540,6 +553,7 @@ class LockSettingInfo { // 防误开
autoLightScreenTime = json['autoLightScreenTime']; autoLightScreenTime = json['autoLightScreenTime'];
faceEnErrUnlock = json['faceEnErrUnlock']; faceEnErrUnlock = json['faceEnErrUnlock'];
} }
int? remoteUnlock; int? remoteUnlock;
int? autoLock; int? autoLock;
int? autoLockSecond; int? autoLockSecond;
@ -619,7 +633,6 @@ class LockSettingInfo { // 防误开
} }
class PassageModeConfig { class PassageModeConfig {
PassageModeConfig( PassageModeConfig(
{this.startDate, this.endDate, this.weekDays, this.isAllDay}); {this.startDate, this.endDate, this.weekDays, this.isAllDay});
@ -629,6 +642,7 @@ class PassageModeConfig {
weekDays = json['weekDays'].cast<int>(); weekDays = json['weekDays'].cast<int>();
isAllDay = json['isAllDay']; isAllDay = json['isAllDay'];
} }
int? startDate; int? startDate;
int? endDate; int? endDate;
List<int>? weekDays; List<int>? weekDays;
@ -645,7 +659,6 @@ class PassageModeConfig {
} }
class CatEyeConfig { class CatEyeConfig {
CatEyeConfig({this.catEyeMode, this.catEyeModeConfig}); CatEyeConfig({this.catEyeMode, this.catEyeModeConfig});
CatEyeConfig.fromJson(Map<String, dynamic> json) { CatEyeConfig.fromJson(Map<String, dynamic> json) {
@ -654,6 +667,7 @@ class CatEyeConfig {
? CatEyeModeConfig.fromJson(json['catEyeModeConfig']) ? CatEyeModeConfig.fromJson(json['catEyeModeConfig'])
: null; : null;
} }
int? catEyeMode; //1 2 3 4 int? catEyeMode; //1 2 3 4
CatEyeModeConfig? catEyeModeConfig; CatEyeModeConfig? catEyeModeConfig;
@ -667,7 +681,8 @@ class CatEyeConfig {
} }
} }
class CatEyeModeConfig { // class CatEyeModeConfig {
//
CatEyeModeConfig( CatEyeModeConfig(
{this.recordMode, {this.recordMode,
@ -689,6 +704,7 @@ class CatEyeModeConfig { //人体侦测距离
recordStartTime = json['recordStartTime']; recordStartTime = json['recordStartTime'];
detectionDistance = json['detectionDistance']; detectionDistance = json['detectionDistance'];
} }
int? recordMode; // 0 1 int? recordMode; // 0 1
String? recordTime; // String? recordTime; //
int? realTimeMode; // 0 1 int? realTimeMode; // 0 1

View File

@ -500,7 +500,10 @@ class _LockSetPageState extends State<LockSetPage>
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Get.toNamed(Routers.motorPowerPage); Get.toNamed(Routers.motorPowerPage,
arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value
});
})), })),
// 广使 // 广使
/* 2024-01-12 广 by DaisyWu /* 2024-01-12 广 by DaisyWu

View File

@ -2,6 +2,7 @@ import 'dart:async';
import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.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 'package:star_lock/login/login/entity/LoginEntity.dart';
import '../../../../blue/blue_manage.dart'; import '../../../../blue/blue_manage.dart';
@ -28,6 +29,7 @@ class MotorPowerLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue = state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue =
state.motorTorsion.value; state.motorTorsion.value;
eventBus eventBus
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); .fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
showToast('操作成功'.tr); showToast('操作成功'.tr);
@ -36,6 +38,7 @@ class MotorPowerLogic extends BaseGetXController {
// //
late StreamSubscription<Reply> _replySubscription; late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() { void _initReplySubscription() {
_replySubscription = _replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) { EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
@ -43,6 +46,10 @@ class MotorPowerLogic extends BaseGetXController {
_replySetSupportFunctionsWithParameters(reply); _replySetSupportFunctionsWithParameters(reply);
} }
if (reply is SetSupportFunctionsWithParametersReply) {
_replySetSupportFunctionsWithParameters(reply);
}
// () // ()
// if(reply is ReadSupportFunctionsNoParametersReply) { // if(reply is ReadSupportFunctionsNoParametersReply) {
// _readSupportFunctionsWithParametersReply(reply); // _readSupportFunctionsWithParametersReply(reply);

View File

@ -21,53 +21,60 @@ class _MotorPowerPageState extends State<MotorPowerPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: '电机功率设置'.tr, barTitle: '电机功率设置'.tr,
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Column( body: Column(
children: [ children: [
SizedBox( SizedBox(
height: 40.h, 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), SizedBox(
alignment: Alignment.centerLeft, height: 40.h,
child: Text( ),
'请根据门锁实际情况,请谨慎选择电机功率:'.tr, Obx(
style: TextStyle( () => _buildTipsView(
fontSize: 24.sp,
color: Colors.black,
fontWeight: FontWeight.w500),
),
),
SizedBox(
height: 40.h,
),
_buildTipsView(
'${'小功率:'.tr}\n', '耗电少'.tr, state.motorTorsion.value == 1, () { '${'小功率:'.tr}\n', '耗电少'.tr, state.motorTorsion.value == 1, () {
state.motorTorsion.value = 1; state.motorTorsion.value = 1;
logic.sendOpenDoorDirection(); logic.sendOpenDoorDirection();
}), }),
SizedBox( ),
height: 20.h, SizedBox(
), height: 20.h,
_buildTipsView( ),
Obx(
() => _buildTipsView(
'${'中功率'.tr}\n', '常规使用'.tr, state.motorTorsion.value == 2, () { '${'中功率'.tr}\n', '常规使用'.tr, state.motorTorsion.value == 2, () {
state.motorTorsion.value = 2; state.motorTorsion.value = 2;
logic.sendOpenDoorDirection(); logic.sendOpenDoorDirection();
}), }),
SizedBox( ),
height: 20.h, SizedBox(
), height: 20.h,
_buildTipsView( ),
Obx(
() => _buildTipsView(
'${'大功率'.tr}\n', '大功率提示'.tr, state.motorTorsion.value == 3, () { '${'大功率'.tr}\n', '大功率提示'.tr, state.motorTorsion.value == 3, () {
state.motorTorsion.value = 3; state.motorTorsion.value = 3;
logic.sendOpenDoorDirection(); logic.sendOpenDoorDirection();
}), }),
], )
)); ],
),
);
} }
Widget _buildTipsView( Widget _buildTipsView(

View File

@ -40,7 +40,7 @@ class _RemoteUnlockingPageState extends State<RemoteUnlockingPage> with RouteAwa
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Text( child: Text(
'功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。'.tr, '功能开启后,你将可以通过网关远程开锁。'.tr,
style: TextStyle( style: TextStyle(
fontSize: 20.sp, color: AppColors.darkGrayTextColor), fontSize: 20.sp, color: AppColors.darkGrayTextColor),
)), )),

View File

@ -422,17 +422,26 @@ class LockSetting {
class NetworkInfo { class NetworkInfo {
NetworkInfo({ NetworkInfo({
this.peerId, this.peerId,
this.isOnline,
this.wifiName,
}); });
NetworkInfo.fromJson(Map<String, dynamic> json) { NetworkInfo.fromJson(Map<String, dynamic> json) {
peerId = json['peerId']; peerId = json['peerId'];
isOnline = json['isOnline'];
wifiName = json['wifiName'];
} }
String? peerId; String? peerId;
String? wifiName;
int? isOnline;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{}; final Map<String, dynamic> data = <String, dynamic>{};
data['peerId'] = peerId; data['peerId'] = peerId;
data['wifiName'] = wifiName;
data['isOnline'] = isOnline;
return data; return data;
} }
} }

View File

@ -2,12 +2,15 @@ import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart'; import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/material.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:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
import 'package:star_lock/appRouters.dart'; import 'package:star_lock/appRouters.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/mine/about/about_console.dart'; import 'package:star_lock/mine/about/about_console.dart';
import 'package:star_lock/tools/NativeInteractionTool.dart';
import '../../app_settings/app_colors.dart'; import '../../app_settings/app_colors.dart';
import '../../flavors.dart'; import '../../flavors.dart';
@ -261,6 +264,16 @@ class _AboutPageState extends State<AboutPage> {
), ),
), ),
GestureDetector( 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, onTap: logic.handleTap,
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),

View File

@ -36,6 +36,7 @@ class UdpTalkHangUpHandler extends ScpMessageBaseHandle
EasyLoading.showToast('已挂断'.tr); EasyLoading.showToast('已挂断'.tr);
startChartManage.stopSendingRbcuInfoMessages(); startChartManage.stopSendingRbcuInfoMessages();
startChartManage.stopSendingRbcuProBeMessages(); startChartManage.stopSendingRbcuProBeMessages();
startChartManage.stopTalkHangupMessageTimer();
Get.back(); Get.back();
} }
} }
@ -53,6 +54,7 @@ class UdpTalkHangUpHandler extends ScpMessageBaseHandle
talkDataOverTimeTimerManager.cancel(); talkDataOverTimeTimerManager.cancel();
startChartManage.stopSendingRbcuInfoMessages(); startChartManage.stopSendingRbcuInfoMessages();
startChartManage.stopSendingRbcuProBeMessages(); startChartManage.stopSendingRbcuProBeMessages();
startChartManage.stopTalkHangupMessageTimer();
} }
@override @override

View File

@ -33,6 +33,7 @@ class UdpTalkRejectHandler extends ScpMessageBaseHandle
talkDataOverTimeTimerManager.cancel(); talkDataOverTimeTimerManager.cancel();
startChartManage.stopSendingRbcuInfoMessages(); startChartManage.stopSendingRbcuInfoMessages();
startChartManage.stopSendingRbcuProBeMessages(); startChartManage.stopSendingRbcuProBeMessages();
startChartManage.stopTalkRejectMessageTimer();
} }
@override @override
@ -47,6 +48,7 @@ class UdpTalkRejectHandler extends ScpMessageBaseHandle
talkDataOverTimeTimerManager.cancel(); talkDataOverTimeTimerManager.cancel();
startChartManage.stopSendingRbcuInfoMessages(); startChartManage.stopSendingRbcuInfoMessages();
startChartManage.stopSendingRbcuProBeMessages(); startChartManage.stopSendingRbcuProBeMessages();
startChartManage.stopTalkRejectMessageTimer();
} }
@override @override

View File

@ -30,7 +30,7 @@ class TalkDataOverTimeTimerManager {
static void _handleTalkeDataOverTime() { static void _handleTalkeDataOverTime() {
EasyLoading.showToast('通话连接失败'.tr, duration: 2000.milliseconds); EasyLoading.showToast('通话连接失败'.tr, duration: 2000.milliseconds);
// //
StartChartManage().sendTalkHangupMessage(); StartChartManage().startTalkHangupMessageTimer();
StartChartManage().stopTalkPingMessageTimer(); StartChartManage().stopTalkPingMessageTimer();
StartChartManage().stopTalkExpectMessageTimer(); StartChartManage().stopTalkExpectMessageTimer();
StartChartManage().stopSendingRbcuInfoMessages(); StartChartManage().stopSendingRbcuInfoMessages();

View File

@ -36,7 +36,7 @@ class TalkePingOverTimeTimerManager {
StartChartManage().stopTalkPingMessageTimer(); StartChartManage().stopTalkPingMessageTimer();
StartChartManage().stopTalkExpectMessageTimer(); StartChartManage().stopTalkExpectMessageTimer();
// //
StartChartManage().sendTalkHangupMessage(); StartChartManage().startTalkHangupMessageTimer();
StartChartManage().stopSendingRbcuInfoMessages(); StartChartManage().stopSendingRbcuInfoMessages();
StartChartManage().stopSendingRbcuProBeMessages(); StartChartManage().stopSendingRbcuProBeMessages();
talkStatus.setNotTalkPing(); talkStatus.setNotTalkPing();

View File

@ -31,7 +31,7 @@ class TalkeRequestOverTimeTimerManager {
talkStatus.status == TalkStatus.proactivelyCallWaitingAnswer) { talkStatus.status == TalkStatus.proactivelyCallWaitingAnswer) {
EasyLoading.showToast('通话未接通,已挂断'.tr, duration: 2000.milliseconds); EasyLoading.showToast('通话未接通,已挂断'.tr, duration: 2000.milliseconds);
// //
StartChartManage().sendTalkRejectMessage(); StartChartManage().startTalkRejectMessageTimer();
StartChartManage().stopSendingRbcuInfoMessages(); StartChartManage().stopSendingRbcuInfoMessages();
StartChartManage().stopSendingRbcuProBeMessages(); StartChartManage().stopSendingRbcuProBeMessages();
talkStatus.setInitializationCompleted(); talkStatus.setInitializationCompleted();

View File

@ -97,6 +97,9 @@ class StartChartManage {
Timer? rbcuInfoTimer; // p2p地址交换定时器 Timer? rbcuInfoTimer; // p2p地址交换定时器
Timer? rbcuProbeTimer; // p2p打洞包 Timer? rbcuProbeTimer; // p2p打洞包
Timer? rbcuConfirmTimer; // p2p打洞确认包 Timer? rbcuConfirmTimer; // p2p打洞确认包
Timer? talkHangupTimer; //
Timer? talkRejectTimer; //
String _rbcuSessionId = ''; // p2p SessionId String _rbcuSessionId = ''; // p2p SessionId
Timer? talkRequestTimer; // Timer? talkRequestTimer; //
final int maxAttempts = 15; // final int maxAttempts = 15; //
@ -570,14 +573,23 @@ class StartChartManage {
stopTalkExpectMessageTimer(); stopTalkExpectMessageTimer();
} }
// void _sendTalkRejectMessage() {
void sendTalkRejectMessage() async {
final message = MessageCommand.talkRejectMessage( final message = MessageCommand.talkRejectMessage(
ToPeerId: ToPeerId, ToPeerId: ToPeerId,
FromPeerId: FromPeerId, FromPeerId: FromPeerId,
MessageId: MessageCommand.getNextMessageId(ToPeerId, increment: true), 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(); StartChartTalkStatus.instance.setRejected();
@ -652,14 +664,24 @@ class StartChartManage {
// _log(text: '发送通话保持'); // _log(text: '发送通话保持');
} }
// void _sendTalkHangupMessage() async {
Future<void> sendTalkHangupMessage() async {
final message = MessageCommand.talkHangupMessage( final message = MessageCommand.talkHangupMessage(
ToPeerId: ToPeerId, ToPeerId: ToPeerId,
FromPeerId: FromPeerId, FromPeerId: FromPeerId,
MessageId: MessageCommand.getNextMessageId(ToPeerId, increment: true), MessageId: MessageCommand.getNextMessageId(ToPeerId, increment: true),
); );
await _sendMessage(message: message); await _sendMessage(message: message);
}
//
//
void startTalkHangupMessageTimer() {
talkHangupTimer ??= Timer.periodic(
Duration(seconds: _defaultIntervalTime),
(Timer timer) async {
_sendTalkHangupMessage();
},
);
// //
StartChartTalkStatus.instance.setHangingUpDuring(); StartChartTalkStatus.instance.setHangingUpDuring();
@ -676,6 +698,18 @@ class StartChartManage {
talkDataOverTimeTimerManager.cancel(); talkDataOverTimeTimerManager.cancel();
} }
//
void stopTalkHangupMessageTimer() {
talkHangupTimer?.cancel();
talkHangupTimer = null;
}
//
void stopTalkRejectMessageTimer() {
talkRejectTimer?.cancel();
talkRejectTimer = null;
}
// 线 // 线
Future<void> reStartOnlineStartChartServer() async { Future<void> reStartOnlineStartChartServer() async {
if (isOnlineStarChartServer) { if (isOnlineStarChartServer) {
@ -1131,13 +1165,15 @@ class StartChartManage {
/// ///
void destruction() async { void destruction() async {
//
sendTalkHangupMessage();
isOnlineStarChartServer = false; isOnlineStarChartServer = false;
// //
stopHeartbeat(); stopHeartbeat();
// //
stopTalkExpectMessageTimer(); stopTalkExpectMessageTimer();
//
stopTalkRejectMessageTimer();
//
stopTalkHangupMessageTimer();
// //
stopTalkPingMessageTimer(); stopTalkPingMessageTimer();
// 线 // 线

View File

@ -1,5 +1,7 @@
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:star_lock/network/start_chart_api.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/talk/starChart/star_chart_manage.dart';
import 'package:star_lock/tools/storage.dart'; import 'package:star_lock/tools/storage.dart';
@ -27,6 +29,15 @@ class AppLifecycleObserver extends WidgetsBindingObserver {
void onAppPaused() { void onAppPaused() {
// //
print('App has entered the background.'); 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(); StartChartManage().destruction();
} }

View File

@ -71,10 +71,10 @@ class TalkViewLogic extends BaseGetXController {
void udpHangUpAction() async { void udpHangUpAction() async {
if (state.talkStatus.value == TalkStatus.answeredSuccessfully) { if (state.talkStatus.value == TalkStatus.answeredSuccessfully) {
// //
StartChartManage().sendTalkHangupMessage(); StartChartManage().startTalkHangupMessageTimer();
} else { } else {
// //
StartChartManage().sendTalkRejectMessage(); StartChartManage().startTalkRejectMessageTimer();
} }
Get.back(); Get.back();
} }

View File

@ -88,9 +88,9 @@ class XSJPushProvider {
//id //id
final String rid = await jpush.getRegistrationID(); final String rid = await jpush.getRegistrationID();
AppLog.log('onConnected registration id : $rid'); AppLog.log('onConnected registration id : $rid');
await Storage.setString(pushDeviceID, rid);
deviceID = rid; deviceID = rid;
} }
await Storage.setString(pushDeviceID, deviceID);
final MineUnbindPhoneOrEmailEntity entity = await ApiRepository.to final MineUnbindPhoneOrEmailEntity entity = await ApiRepository.to
.pushBindAppId(deviceID, Platform.isAndroid ? 10 : 20); .pushBindAppId(deviceID, Platform.isAndroid ? 10 : 20);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {