Merge branch 'develop_liyi' of code-internal.star-lock.cn:StarlockTeam/app-starlock into develop_liyi
This commit is contained in:
commit
6b74cfe9c2
@ -8,6 +8,8 @@
|
||||
<array>
|
||||
<string>applinks:lock.skychip.top</string>
|
||||
</array>
|
||||
<key>com.apple.developer.networking.wifi-info</key>
|
||||
<true/>
|
||||
<key>com.apple.external-accessory.wireless-configuration</key>
|
||||
<true/>
|
||||
</dict>
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
<array>
|
||||
<string>applinks:lock.skychip.top</string>
|
||||
</array>
|
||||
<key>com.apple.developer.networking.wifi-info</key>
|
||||
<true/>
|
||||
<key>com.apple.external-accessory.wireless-configuration</key>
|
||||
<true/>
|
||||
</dict>
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
<array>
|
||||
<string>applinks:lock.xhjcn.ltd</string>
|
||||
</array>
|
||||
<key>com.apple.developer.networking.wifi-info</key>
|
||||
<true/>
|
||||
<key>com.apple.external-accessory.wireless-configuration</key>
|
||||
<true/>
|
||||
</dict>
|
||||
|
||||
@ -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}"
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -62,6 +62,7 @@
|
||||
"批量授权锁": "批量授权锁",
|
||||
"授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人",
|
||||
"功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。",
|
||||
"功能开启后,你将可以通过网关远程开锁。": "功能开启后,你将可以通过网关远程开锁。",
|
||||
"排列方式": "排列方式",
|
||||
"早到榜": "早到榜",
|
||||
"迟到榜": "迟到榜",
|
||||
@ -1126,6 +1127,7 @@
|
||||
"通话连接失败": "通话连接失败",
|
||||
"已挂断": "已挂断",
|
||||
"正在说话...": "正在说话...",
|
||||
"设备不在线": "设备不在线",
|
||||
"下载完成,请到相册查看": "下载完成,请到相册查看",
|
||||
"重置后,该锁的遥控都将被删除哦,确认要重置吗?": "重置后,该锁的遥控都将被删除哦,确认要重置吗?",
|
||||
"版本说明": "版本说明"
|
||||
|
||||
@ -62,6 +62,7 @@
|
||||
"批量授权锁": "批量授权锁",
|
||||
"授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人",
|
||||
"功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。",
|
||||
"功能开启后,你将可以通过网关远程开锁。": "功能开启后,你将可以通过网关远程开锁。",
|
||||
"排列方式": "排列方式",
|
||||
"早到榜": "早到榜",
|
||||
"迟到榜": "迟到榜",
|
||||
@ -1126,6 +1127,7 @@
|
||||
"通话连接失败": "通话连接失败",
|
||||
"已挂断": "已挂断",
|
||||
"正在说话...": "正在说话...",
|
||||
"设备不在线": "设备不在线",
|
||||
"下载完成,请到相册查看": "下载完成,请到相册查看",
|
||||
"重置后,该锁的遥控都将被删除哦,确认要重置吗?": "重置后,该锁的遥控都将被删除哦,确认要重置吗?",
|
||||
"版本说明": "版本说明"
|
||||
|
||||
@ -67,8 +67,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
logic.loadData(
|
||||
lockListInfoItemEntity: widget.lockListInfoItemEntity,
|
||||
isOnlyOneData: widget.isOnlyOneData);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
@ -618,6 +616,14 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
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<LockDetailPage>
|
||||
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<LockDetailPage>
|
||||
logic.closeLuckStatus();
|
||||
BlueManage().disconnect();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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<BasicInformationPage> {
|
||||
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<BasicInformationPage> {
|
||||
),
|
||||
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: <String, LockSetInfoData>{
|
||||
'lockSetInfoData': state.lockSetInfoData.value
|
||||
});
|
||||
Get.toNamed(Routers.uploadElectricQuantityPage,
|
||||
arguments: <String, LockSetInfoData>{
|
||||
'lockSetInfoData': state.lockSetInfoData.value
|
||||
});
|
||||
})),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: '有效期'.tr,
|
||||
@ -85,38 +86,47 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
||||
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: <String, LockSetInfoData>{
|
||||
'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: <String, LockSetInfoData>{
|
||||
'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: <String, LockSetInfoData>{
|
||||
'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: <String, LockSetInfoData>{
|
||||
'lockSetInfoData': state.lockSetInfoData.value
|
||||
})!
|
||||
.then((val) {
|
||||
if (val != null) {
|
||||
// mockNetworkDataRequest();
|
||||
setState(() {});
|
||||
@ -124,43 +134,47 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
||||
});
|
||||
})),
|
||||
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: <String, LockSetInfoData>{
|
||||
'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: <String, LockSetInfoData>{
|
||||
'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<BasicInformationPage> {
|
||||
));
|
||||
}
|
||||
|
||||
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<BasicInformationPage> {
|
||||
color: AppColors.greyLineColor, // 设置边框颜色
|
||||
width: 2.0.h, // 设置边框宽度
|
||||
),
|
||||
)
|
||||
),
|
||||
)),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
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<BasicInformationPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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<String, dynamic> json) {
|
||||
roomStatus = json['roomStatus'];
|
||||
}
|
||||
|
||||
int? roomStatus;
|
||||
|
||||
Map<String, dynamic> 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<String, dynamic> 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<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
@ -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<String, dynamic> 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<int>();
|
||||
isAllDay = json['isAllDay'];
|
||||
}
|
||||
|
||||
int? startDate;
|
||||
int? endDate;
|
||||
List<int>? weekDays;
|
||||
@ -645,7 +659,6 @@ class PassageModeConfig {
|
||||
}
|
||||
|
||||
class CatEyeConfig {
|
||||
|
||||
CatEyeConfig({this.catEyeMode, this.catEyeModeConfig});
|
||||
|
||||
CatEyeConfig.fromJson(Map<String, dynamic> 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实时查看
|
||||
|
||||
@ -500,7 +500,10 @@ class _LockSetPageState extends State<LockSetPage>
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.motorPowerPage);
|
||||
Get.toNamed(Routers.motorPowerPage,
|
||||
arguments: <String, LockSetInfoData>{
|
||||
'lockSetInfoData': state.lockSetInfoData.value
|
||||
});
|
||||
})),
|
||||
// 蓝牙广播(关闭则不能使用蓝牙主动开锁)
|
||||
/* 2024-01-12 会议确定去掉“蓝牙广播” by DaisyWu
|
||||
|
||||
@ -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<Reply> _replySubscription;
|
||||
|
||||
void _initReplySubscription() {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().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);
|
||||
|
||||
@ -21,53 +21,60 @@ class _MotorPowerPageState extends State<MotorPowerPage> {
|
||||
@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(
|
||||
|
||||
@ -40,7 +40,7 @@ class _RemoteUnlockingPageState extends State<RemoteUnlockingPage> with RouteAwa
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
'功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。'.tr,
|
||||
'功能开启后,你将可以通过网关远程开锁。'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
||||
)),
|
||||
|
||||
@ -422,17 +422,26 @@ class LockSetting {
|
||||
class NetworkInfo {
|
||||
NetworkInfo({
|
||||
this.peerId,
|
||||
this.isOnline,
|
||||
this.wifiName,
|
||||
|
||||
});
|
||||
|
||||
NetworkInfo.fromJson(Map<String, dynamic> json) {
|
||||
peerId = json['peerId'];
|
||||
isOnline = json['isOnline'];
|
||||
wifiName = json['wifiName'];
|
||||
}
|
||||
|
||||
String? peerId;
|
||||
String? wifiName;
|
||||
int? isOnline;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['peerId'] = peerId;
|
||||
data['wifiName'] = wifiName;
|
||||
data['isOnline'] = isOnline;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<AboutPage> {
|
||||
),
|
||||
),
|
||||
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),
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -36,7 +36,7 @@ class TalkePingOverTimeTimerManager {
|
||||
StartChartManage().stopTalkPingMessageTimer();
|
||||
StartChartManage().stopTalkExpectMessageTimer();
|
||||
// 如果通话异常,则发送通话中挂断
|
||||
StartChartManage().sendTalkHangupMessage();
|
||||
StartChartManage().startTalkHangupMessageTimer();
|
||||
StartChartManage().stopSendingRbcuInfoMessages();
|
||||
StartChartManage().stopSendingRbcuProBeMessages();
|
||||
talkStatus.setNotTalkPing();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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<void> 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<void> reStartOnlineStartChartServer() async {
|
||||
if (isOnlineStarChartServer) {
|
||||
@ -1131,13 +1165,15 @@ class StartChartManage {
|
||||
|
||||
/// 销毁资源
|
||||
void destruction() async {
|
||||
// 发送挂断消息
|
||||
sendTalkHangupMessage();
|
||||
isOnlineStarChartServer = false;
|
||||
// 停止发送心跳消息
|
||||
stopHeartbeat();
|
||||
// 取消发送期望数据
|
||||
stopTalkExpectMessageTimer();
|
||||
// 取消发送拒绝定时器
|
||||
stopTalkRejectMessageTimer();
|
||||
// 取消发送挂断定时器
|
||||
stopTalkHangupMessageTimer();
|
||||
// 取消发送通话保持消息
|
||||
stopTalkPingMessageTimer();
|
||||
// 取消发送上线消息
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user