1,新增猫眼设置部分接口处理逻辑
2,退出登录新增推送deviceID以处理退出登录后仍可收到通知
This commit is contained in:
parent
b7fcb60f28
commit
76d212c933
@ -282,7 +282,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
// senderReferEventRecordTime();
|
// senderReferEventRecordTime();
|
||||||
// senderReferEventRecordNumber();
|
// senderReferEventRecordNumber();
|
||||||
|
|
||||||
testReadJsonData();
|
// testReadJsonData();
|
||||||
mockNetworkDataRequest();
|
mockNetworkDataRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
|||||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_logic.dart';
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_logic.dart';
|
||||||
import 'package:star_lock/tools/advancedCalendar/src/widget.dart';
|
import 'package:star_lock/tools/advancedCalendar/src/widget.dart';
|
||||||
import 'package:star_lock/tools/menuItem/xsDropDownWidget.dart';
|
import 'package:star_lock/tools/menuItem/xsDropDownWidget.dart';
|
||||||
|
import 'package:star_lock/tools/noData.dart';
|
||||||
import 'package:timelines/timelines.dart';
|
import 'package:timelines/timelines.dart';
|
||||||
|
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
@ -140,91 +141,93 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(16.w),
|
borderRadius: BorderRadius.circular(16.w),
|
||||||
),
|
),
|
||||||
child: Timeline.tileBuilder(
|
child: timelineDataList.isNotEmpty
|
||||||
builder: TimelineTileBuilder.fromStyle(
|
? Timeline.tileBuilder(
|
||||||
contentsAlign: ContentsAlign.basic,
|
builder: TimelineTileBuilder.fromStyle(
|
||||||
itemCount: timelineDataList.length,
|
contentsAlign: ContentsAlign.basic,
|
||||||
contentsBuilder: (context, index) {
|
itemCount: timelineDataList.length,
|
||||||
DoorLockLogDataItem timelineData = timelineDataList[index];
|
contentsBuilder: (context, index) {
|
||||||
DateTime dateTime =
|
DoorLockLogDataItem timelineData = timelineDataList[index];
|
||||||
DateTime.fromMillisecondsSinceEpoch(timelineData.operateDate!);
|
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
|
||||||
String formattedTime =
|
timelineData.operateDate!);
|
||||||
'${dateTime.hour.toString().padLeft(2, '0')}:${dateTime.minute.toString().padLeft(2, '0')}';
|
String formattedTime =
|
||||||
|
'${dateTime.hour.toString().padLeft(2, '0')}:${dateTime.minute.toString().padLeft(2, '0')}';
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(left: 20.w, top: 20.h),
|
padding: EdgeInsets.only(left: 20.w, top: 20.h),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'$formattedTime ${timelineData.recordTypeName}',
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.black,
|
|
||||||
fontSize: 24.sp,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10.h,
|
|
||||||
),
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Get.toNamed(Routers.videoLogDetailPage);
|
|
||||||
},
|
|
||||||
child: Stack(
|
|
||||||
children: [
|
children: [
|
||||||
timelineData.imagesUrl != null
|
Text(
|
||||||
?
|
'$formattedTime ${timelineData.recordTypeName}',
|
||||||
// Image.network(
|
textAlign: TextAlign.left,
|
||||||
// timelineData.imagesUrl!,
|
style: TextStyle(
|
||||||
// width: 260.w,
|
color: Colors.black,
|
||||||
// height: 260.h,
|
fontSize: 24.sp,
|
||||||
// )
|
fontWeight: FontWeight.w600,
|
||||||
Image(
|
|
||||||
image: const AssetImage(
|
|
||||||
'images/main/icon_lockDetail_monitoringvoiceFrist.png'),
|
|
||||||
width: 240.w,
|
|
||||||
height: 180.h,
|
|
||||||
fit: BoxFit.contain,
|
|
||||||
)
|
|
||||||
: Container(),
|
|
||||||
Positioned(
|
|
||||||
top: 150.h,
|
|
||||||
left: 10.w,
|
|
||||||
child: Image(
|
|
||||||
image: const AssetImage(
|
|
||||||
'images/main/icon_lockLog_play.png'),
|
|
||||||
width: 24.w,
|
|
||||||
height: 20.w,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.h,
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(Routers.videoLogDetailPage);
|
||||||
|
},
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
timelineData.imagesUrl != null
|
||||||
|
?
|
||||||
|
// Image.network(
|
||||||
|
// timelineData.imagesUrl!,
|
||||||
|
// width: 260.w,
|
||||||
|
// height: 260.h,
|
||||||
|
// )
|
||||||
|
Image(
|
||||||
|
image: const AssetImage(
|
||||||
|
'images/main/icon_lockDetail_monitoringvoiceFrist.png'),
|
||||||
|
width: 240.w,
|
||||||
|
height: 180.h,
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
Positioned(
|
||||||
|
top: 150.h,
|
||||||
|
left: 10.w,
|
||||||
|
child: Image(
|
||||||
|
image: const AssetImage(
|
||||||
|
'images/main/icon_lockLog_play.png'),
|
||||||
|
width: 24.w,
|
||||||
|
height: 20.w,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
SizedBox(
|
},
|
||||||
height: 20.h,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
theme: TimelineThemeData(
|
||||||
},
|
nodePosition: 0.04, //居左侧距离
|
||||||
),
|
connectorTheme: const ConnectorThemeData(
|
||||||
theme: TimelineThemeData(
|
thickness: 1.0,
|
||||||
nodePosition: 0.04, //居左侧距离
|
color: AppColors.greyLineColor,
|
||||||
connectorTheme: const ConnectorThemeData(
|
indent: 0.5,
|
||||||
thickness: 1.0,
|
),
|
||||||
color: AppColors.greyLineColor,
|
indicatorTheme: const IndicatorThemeData(
|
||||||
indent: 0.5,
|
size: 8.0,
|
||||||
),
|
color: AppColors.greyLineColor,
|
||||||
indicatorTheme: const IndicatorThemeData(
|
position: 0.4,
|
||||||
size: 8.0,
|
),
|
||||||
color: AppColors.greyLineColor,
|
),
|
||||||
position: 0.4,
|
)
|
||||||
),
|
: NoData(),
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,9 @@ class _CatEyeSetPageState extends State<CatEyeSetPage> {
|
|||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.catEyeWorkModePage, arguments: {
|
Get.toNamed(Routers.catEyeWorkModePage, arguments: {
|
||||||
'lockSetInfoData': state.lockSetInfoData.value
|
'lockSetInfoData': state.lockSetInfoData.value,
|
||||||
|
'catEyeConfigata': state
|
||||||
|
.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0]
|
||||||
})?.then((value) {
|
})?.then((value) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
state.selectCatEyeWorkMode.value = value;
|
state.selectCatEyeWorkMode.value = value;
|
||||||
|
|||||||
@ -9,20 +9,28 @@ class CatEyeWorkModeLogic extends BaseGetXController {
|
|||||||
void updateCatEyeModeConfig() async {
|
void updateCatEyeModeConfig() async {
|
||||||
var entity = await ApiRepository.to.updateCatEyeModeConfig(
|
var entity = await ApiRepository.to.updateCatEyeModeConfig(
|
||||||
lockId: state.lockSetInfoData.value.lockId!,
|
lockId: state.lockSetInfoData.value.lockId!,
|
||||||
catEyeConfig: {
|
catEyeConfig: [
|
||||||
'catEyeMode': state.selectCatEyeWorkMode.value,
|
{
|
||||||
'catEyeModeConfig': {
|
'catEyeMode': state.selectCatEyeWorkMode.value,
|
||||||
'recordMode': state.recordMode.value,
|
'catEyeModeConfig': {
|
||||||
'recordStartTime': state.recordStartTime.value,
|
'recordMode': state.recordMode.value,
|
||||||
'recordEndTime': state.recordEndTime.value,
|
'recordStartTime': state.recordStartTime.value,
|
||||||
'recordTime': state.recordTime.value,
|
'recordEndTime': state.recordEndTime.value,
|
||||||
'detectionDistance': state.detectionDistance.value,
|
'recordTime': state.recordTime.value,
|
||||||
'realTimeMode': state.realTimeMode.value,
|
'detectionDistance': state.detectionDistance.value,
|
||||||
|
'realTimeMode': state.realTimeMode.value,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
],
|
||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast('设置成功');
|
showToast('设置成功');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
// TODO: implement onReady
|
||||||
|
super.onReady();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,20 +1,38 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
||||||
|
|
||||||
class CatEyeWorkModeState {
|
class CatEyeWorkModeState {
|
||||||
var lockSetInfoData = LockSetInfoData().obs;
|
var lockSetInfoData = LockSetInfoData().obs;
|
||||||
var selectCatEyeWorkMode = 0.obs; //猫眼工作模式
|
var selectCatEyeWorkMode = 0.obs; //猫眼工作模式
|
||||||
var boolList = [true, false, false, false].obs;
|
var boolList = [false, false, false, false].obs;
|
||||||
var recordMode = 0.obs; //录像时段 0全天 1自定义时间
|
var recordMode = 0.obs; //录像时段 0全天 1自定义时间
|
||||||
//自定义时间需要填:recordStartTime与recordEndTime参数
|
//自定义时间需要填:recordStartTime与recordEndTime参数
|
||||||
var recordStartTime = 0.obs; // 1709715049775,
|
var recordStartTime = 0.obs; // 1709715049775,
|
||||||
var recordEndTime = 0.obs; //1709715049775,
|
var recordEndTime = 0.obs; //1709715049775,
|
||||||
var recordTime = 0.obs; //有人出现时录像
|
var recordTime = ''.obs; //有人出现时录像
|
||||||
var detectionDistance = 0.obs; //人体侦测距离
|
var detectionDistance = 0.obs; //人体侦测距离
|
||||||
var realTimeMode = 0.obs; //实时画面 0发生事件事查看 1实时查看
|
var realTimeMode = 0.obs; //实时画面 0发生事件事查看 1实时查看
|
||||||
|
var catEyeConfigData = CatEyeConfig().obs;
|
||||||
|
|
||||||
CatEyeWorkModeState() {
|
CatEyeWorkModeState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
lockSetInfoData.value = map["lockSetInfoData"];
|
lockSetInfoData.value = map["lockSetInfoData"];
|
||||||
|
catEyeConfigData.value = map['catEyeConfigata'];
|
||||||
|
selectCatEyeWorkMode.value = catEyeConfigData.value.catEyeMode!;
|
||||||
|
|
||||||
|
if (catEyeConfigData.value.catEyeMode ==
|
||||||
|
XSConstantMacro.catEyeWorkModePowerSaving) {
|
||||||
|
boolList[0] = true;
|
||||||
|
} else if (catEyeConfigData.value.catEyeMode ==
|
||||||
|
XSConstantMacro.catEyeWorkModeStayCapture) {
|
||||||
|
boolList[1] = true;
|
||||||
|
} else if (catEyeConfigData.value.catEyeMode ==
|
||||||
|
XSConstantMacro.catEyeWorkModeRealTimeMonitoring) {
|
||||||
|
boolList[2] = true;
|
||||||
|
} else if (catEyeConfigData.value.catEyeMode ==
|
||||||
|
XSConstantMacro.catEyeWorkModeCustom) {
|
||||||
|
boolList[3] = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -458,19 +458,27 @@ class LockSettingInfo {
|
|||||||
int? motorTorsion;
|
int? motorTorsion;
|
||||||
int? stayWarn;
|
int? stayWarn;
|
||||||
int? abnormalWarn;
|
int? abnormalWarn;
|
||||||
List<CatEyeModeConfig>? catEyeConfig;
|
List<CatEyeConfig>? catEyeConfig;
|
||||||
int? faceSwitch; //人脸开关 0:关闭 1:开启
|
int? faceSwitch; //人脸开关 0:关闭 1:开启
|
||||||
int? faceAutoLightScreen; //人脸自动亮屏开关 0:关闭 1:开启
|
int? faceAutoLightScreen; //人脸自动亮屏开关 0:关闭 1:开启
|
||||||
int? faceInductionDistance; //人脸感应距离
|
int? faceInductionDistance; //人脸感应距离
|
||||||
int? faceAntiMistakeOpen; //人脸防误开门 0:关闭 1:开启
|
int? faceAntiMistakeOpen; //人脸防误开门 0:关闭 1:开启
|
||||||
int? autoLightScreen; //猫眼-自动亮屏开关 0:关闭 1:开启
|
int? autoLightScreen; //猫眼-自动亮屏开关 0:关闭 1:开启
|
||||||
int? autoLightScreenTime; //猫眼-自动亮屏时间
|
int? autoLightScreenTime; //猫眼-自动亮屏时间
|
||||||
int? dayNotOpenDoorSwitch; //N天未开门开关 (启用/禁用)
|
|
||||||
int? dayNotOpenDoorValue; //N天未开门值
|
// List<CatEyeModeConfig>? catEyeConfigList;
|
||||||
int? doorNotCloseSwitch; //门未关闭开关 (启用/禁用)
|
// int? faceSwitch; //人脸开关 0:关闭 1:开启
|
||||||
int? lowElecNoticeSwitch; //低电量开关 (启用/禁用)
|
// int? faceAutoLightScreen; //人脸自动亮屏开关 0:关闭 1:开启
|
||||||
int? doorbellNoticeSwitch; //有人按门铃开关 (启用/禁用)
|
// int? faceInductionDistance; //人脸感应距离
|
||||||
int? someoneAtDoorSwitch; //有人出现在门口开关 (启用/禁用)//
|
// int? faceAntiMistakeOpen; //人脸防误开门 0:关闭 1:开启
|
||||||
|
// int? autoLightScreen; //猫眼-自动亮屏开关 0:关闭 1:开启
|
||||||
|
// int? autoLightScreenTime; //猫眼-自动亮屏时间
|
||||||
|
// int? dayNotOpenDoorSwitch; //N天未开门开关 (启用/禁用)
|
||||||
|
// int? dayNotOpenDoorValue; //N天未开门值
|
||||||
|
// int? doorNotCloseSwitch; //门未关闭开关 (启用/禁用)
|
||||||
|
// int? lowElecNoticeSwitch; //低电量开关 (启用/禁用)
|
||||||
|
// int? doorbellNoticeSwitch; //有人按门铃开关 (启用/禁用)
|
||||||
|
// int? someoneAtDoorSwitch; //有人出现在门口开关 (启用/禁用)//
|
||||||
|
|
||||||
LockSettingInfo({
|
LockSettingInfo({
|
||||||
this.remoteUnlock,
|
this.remoteUnlock,
|
||||||
@ -505,12 +513,12 @@ class LockSettingInfo {
|
|||||||
this.faceAntiMistakeOpen,
|
this.faceAntiMistakeOpen,
|
||||||
this.autoLightScreen,
|
this.autoLightScreen,
|
||||||
this.autoLightScreenTime,
|
this.autoLightScreenTime,
|
||||||
this.dayNotOpenDoorSwitch,
|
// this.dayNotOpenDoorSwitch,
|
||||||
this.dayNotOpenDoorValue,
|
// this.dayNotOpenDoorValue,
|
||||||
this.doorNotCloseSwitch,
|
// this.doorNotCloseSwitch,
|
||||||
this.lowElecNoticeSwitch,
|
// this.lowElecNoticeSwitch,
|
||||||
this.doorbellNoticeSwitch,
|
// this.doorbellNoticeSwitch,
|
||||||
this.someoneAtDoorSwitch,
|
// this.someoneAtDoorSwitch,
|
||||||
});
|
});
|
||||||
|
|
||||||
LockSettingInfo.fromJson(Map<String, dynamic> json) {
|
LockSettingInfo.fromJson(Map<String, dynamic> json) {
|
||||||
@ -545,9 +553,9 @@ class LockSettingInfo {
|
|||||||
stayWarn = json['stayWarn'];
|
stayWarn = json['stayWarn'];
|
||||||
abnormalWarn = json['abnormalWarn'];
|
abnormalWarn = json['abnormalWarn'];
|
||||||
if (json['catEyeConfig'] != null) {
|
if (json['catEyeConfig'] != null) {
|
||||||
catEyeConfig = <CatEyeModeConfig>[];
|
catEyeConfig = <CatEyeConfig>[];
|
||||||
json['catEyeConfig'].forEach((v) {
|
json['catEyeConfig'].forEach((v) {
|
||||||
catEyeConfig!.add(CatEyeModeConfig.fromJson(v));
|
catEyeConfig!.add(CatEyeConfig.fromJson(v));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
faceSwitch = json['faceSwitch'];
|
faceSwitch = json['faceSwitch'];
|
||||||
@ -556,12 +564,12 @@ class LockSettingInfo {
|
|||||||
faceAntiMistakeOpen = json['faceAntiMistakeOpen'];
|
faceAntiMistakeOpen = json['faceAntiMistakeOpen'];
|
||||||
autoLightScreen = json['autoLightScreen'];
|
autoLightScreen = json['autoLightScreen'];
|
||||||
autoLightScreenTime = json['autoLightScreenTime'];
|
autoLightScreenTime = json['autoLightScreenTime'];
|
||||||
dayNotOpenDoorSwitch = json['dayNotOpenDoorSwitch'];
|
// dayNotOpenDoorSwitch = json['dayNotOpenDoorSwitch'];
|
||||||
dayNotOpenDoorValue = json['dayNotOpenDoorValue'];
|
// dayNotOpenDoorValue = json['dayNotOpenDoorValue'];
|
||||||
doorNotCloseSwitch = json['doorNotCloseSwitch'];
|
// doorNotCloseSwitch = json['doorNotCloseSwitch'];
|
||||||
lowElecNoticeSwitch = json['lowElecNoticeSwitch'];
|
// lowElecNoticeSwitch = json['lowElecNoticeSwitch'];
|
||||||
doorbellNoticeSwitch = json['doorbellNoticeSwitch'];
|
// doorbellNoticeSwitch = json['doorbellNoticeSwitch'];
|
||||||
someoneAtDoorSwitch = json['someoneAtDoorSwitch'];
|
// someoneAtDoorSwitch = json['someoneAtDoorSwitch'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@ -603,12 +611,12 @@ class LockSettingInfo {
|
|||||||
data['faceAntiMistakeOpen'] = faceAntiMistakeOpen;
|
data['faceAntiMistakeOpen'] = faceAntiMistakeOpen;
|
||||||
data['autoLightScreen'] = autoLightScreen;
|
data['autoLightScreen'] = autoLightScreen;
|
||||||
data['autoLightScreenTime'] = autoLightScreenTime;
|
data['autoLightScreenTime'] = autoLightScreenTime;
|
||||||
data['dayNotOpenDoorSwitch'] = dayNotOpenDoorSwitch;
|
// data['dayNotOpenDoorSwitch'] = dayNotOpenDoorSwitch;
|
||||||
data['dayNotOpenDoorValue'] = dayNotOpenDoorValue;
|
// data['dayNotOpenDoorValue'] = dayNotOpenDoorValue;
|
||||||
data['doorNotCloseSwitch'] = doorNotCloseSwitch;
|
// data['doorNotCloseSwitch'] = doorNotCloseSwitch;
|
||||||
data['lowElecNoticeSwitch'] = lowElecNoticeSwitch;
|
// data['lowElecNoticeSwitch'] = lowElecNoticeSwitch;
|
||||||
data['doorbellNoticeSwitch'] = doorbellNoticeSwitch;
|
// data['doorbellNoticeSwitch'] = doorbellNoticeSwitch;
|
||||||
data['someoneAtDoorSwitch'] = someoneAtDoorSwitch;
|
// data['someoneAtDoorSwitch'] = someoneAtDoorSwitch;
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@ -641,7 +649,7 @@ class PassageModeConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class CatEyeConfig {
|
class CatEyeConfig {
|
||||||
int? catEyeMode;
|
int? catEyeMode; //1省电模式 2逗留抓拍模式 3实时监控模式 4自定义模式(自定义模式下存在其他设置参数)
|
||||||
CatEyeModeConfig? catEyeModeConfig;
|
CatEyeModeConfig? catEyeModeConfig;
|
||||||
|
|
||||||
CatEyeConfig({this.catEyeMode, this.catEyeModeConfig});
|
CatEyeConfig({this.catEyeMode, this.catEyeModeConfig});
|
||||||
@ -664,12 +672,12 @@ class CatEyeConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class CatEyeModeConfig {
|
class CatEyeModeConfig {
|
||||||
int? recordMode;
|
int? recordMode; //录像时段 0全天 1自定义时间
|
||||||
String? recordTime;
|
String? recordTime; //有人出现时录像
|
||||||
int? realTimeMode;
|
int? realTimeMode; //实时画面 0发生事件事查看 1实时查看
|
||||||
int? recordEndTime;
|
int? recordEndTime; //录像时段自定义时间-结束时间
|
||||||
int? recordStartTime;
|
int? recordStartTime; //录像时段自定义时间-开始时间
|
||||||
double? detectionDistance;
|
int? detectionDistance; //人体侦测距离
|
||||||
|
|
||||||
CatEyeModeConfig(
|
CatEyeModeConfig(
|
||||||
{this.recordMode,
|
{this.recordMode,
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class StarLockMineLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//删除账号请求
|
//删除账号请求
|
||||||
Future<void> userLogoutRequest() async {
|
Future<void> userLogoutRequest() async {
|
||||||
LoginEntity entity = await ApiRepository.to.userLogout();
|
LoginEntity entity = await ApiRepository.to.userLogout(deviceld: '');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {}
|
if (entity.errorCode!.codeIsSuccessful) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,10 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//退出登录请求
|
//退出登录请求
|
||||||
Future<void> userLogoutRequest() async {
|
Future<void> userLogoutRequest() async {
|
||||||
LoginEntity entity = await ApiRepository.to.userLogout();
|
var getPushDeviceID = await Storage.getString(pushDeviceID);
|
||||||
|
|
||||||
|
LoginEntity entity =
|
||||||
|
await ApiRepository.to.userLogout(deviceld: getPushDeviceID!);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UdpHelp().closeUDP();
|
UdpHelp().closeUDP();
|
||||||
logOut();
|
logOut();
|
||||||
|
|||||||
@ -600,12 +600,13 @@ class ApiProvider extends BaseProvider {
|
|||||||
'pageSize': pageSize,
|
'pageSize': pageSize,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Future<Response> expireFingerprintList(String pageNo, String pageSize) => post(
|
Future<Response> expireFingerprintList(String pageNo, String pageSize) =>
|
||||||
expireFingerprintListURL.toUrl,
|
post(
|
||||||
jsonEncode({
|
expireFingerprintListURL.toUrl,
|
||||||
'pageNo': pageNo,
|
jsonEncode({
|
||||||
'pageSize': pageSize,
|
'pageNo': pageNo,
|
||||||
}));
|
'pageSize': pageSize,
|
||||||
|
}));
|
||||||
|
|
||||||
Future<Response> expireFaceList(String pageNo, String pageSize) => post(
|
Future<Response> expireFaceList(String pageNo, String pageSize) => post(
|
||||||
expireFaceListURL.toUrl,
|
expireFaceListURL.toUrl,
|
||||||
@ -1500,7 +1501,8 @@ class ApiProvider extends BaseProvider {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
//退出登录
|
//退出登录
|
||||||
Future<Response> userLogout() => get(userLogoutURL.toUrl);
|
Future<Response> userLogout(String deviceld) =>
|
||||||
|
post(userLogoutURL.toUrl, jsonEncode({'deviceld': deviceld}));
|
||||||
|
|
||||||
//删除账号
|
//删除账号
|
||||||
Future<Response> deleteAccount(
|
Future<Response> deleteAccount(
|
||||||
@ -1657,12 +1659,13 @@ class ApiProvider extends BaseProvider {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// 设置猫眼工作模式
|
// 设置猫眼工作模式
|
||||||
Future<Response> updateCatEyeModeConfig(int lockId, Map catEyeConfig) => post(
|
Future<Response> updateCatEyeModeConfig(int lockId, List catEyeConfig) =>
|
||||||
updateCatEyeConfigURL.toUrl,
|
post(
|
||||||
jsonEncode({
|
updateCatEyeConfigURL.toUrl,
|
||||||
'lockId': lockId,
|
jsonEncode({
|
||||||
'catEyeConfig': catEyeConfig,
|
'lockId': lockId,
|
||||||
}));
|
'catEyeConfig': catEyeConfig,
|
||||||
|
}));
|
||||||
|
|
||||||
// 设置自动亮屏
|
// 设置自动亮屏
|
||||||
Future<Response> updateAutoLightScreenConfig(
|
Future<Response> updateAutoLightScreenConfig(
|
||||||
|
|||||||
@ -336,20 +336,27 @@ class ApiRepository {
|
|||||||
|
|
||||||
//编辑电子钥匙有效期
|
//编辑电子钥匙有效期
|
||||||
Future<KeyOperationRecordEntity> updateKeyDate(
|
Future<KeyOperationRecordEntity> updateKeyDate(
|
||||||
{
|
{required String keyId,
|
||||||
required String keyId,
|
required String lockId,
|
||||||
required String lockId,
|
required String endDate,
|
||||||
required String endDate,
|
required String startDate,
|
||||||
required String startDate,
|
required List weekDays,
|
||||||
required List weekDays,
|
required int keyType,
|
||||||
required int keyType,
|
required int startTime,
|
||||||
required int startTime,
|
required int endTime,
|
||||||
required int endTime,
|
required int isOnlyManageSelf,
|
||||||
required int isOnlyManageSelf,
|
required int remoteEnable}) async {
|
||||||
required int remoteEnable
|
|
||||||
}) async {
|
|
||||||
final res = await apiProvider.updateKeyDate(
|
final res = await apiProvider.updateKeyDate(
|
||||||
keyId, lockId, endDate, startDate, weekDays, keyType, startTime, endTime, isOnlyManageSelf, remoteEnable);
|
keyId,
|
||||||
|
lockId,
|
||||||
|
endDate,
|
||||||
|
startDate,
|
||||||
|
weekDays,
|
||||||
|
keyType,
|
||||||
|
startTime,
|
||||||
|
endTime,
|
||||||
|
isOnlyManageSelf,
|
||||||
|
remoteEnable);
|
||||||
return KeyOperationRecordEntity.fromJson(res.body);
|
return KeyOperationRecordEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -538,10 +545,7 @@ class ApiRepository {
|
|||||||
|
|
||||||
//删除电子钥匙
|
//删除电子钥匙
|
||||||
Future<ElectronicKeyListEntity> deleteElectronicKey(
|
Future<ElectronicKeyListEntity> deleteElectronicKey(
|
||||||
{
|
{required String keyId, required int includeUnderlings}) async {
|
||||||
required String keyId,
|
|
||||||
required int includeUnderlings
|
|
||||||
}) async {
|
|
||||||
final res = await apiProvider.deleteElectronicKey(keyId, includeUnderlings);
|
final res = await apiProvider.deleteElectronicKey(keyId, includeUnderlings);
|
||||||
return ElectronicKeyListEntity.fromJson(res.body);
|
return ElectronicKeyListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
@ -566,13 +570,15 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//设置授权管理员
|
//设置授权管理员
|
||||||
Future<ElectronicKeyListEntity> setAdministrator({required String keyId}) async {
|
Future<ElectronicKeyListEntity> setAdministrator(
|
||||||
|
{required String keyId}) async {
|
||||||
final res = await apiProvider.setAdministrator(keyId);
|
final res = await apiProvider.setAdministrator(keyId);
|
||||||
return ElectronicKeyListEntity.fromJson(res.body);
|
return ElectronicKeyListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
//取消授权管理员
|
//取消授权管理员
|
||||||
Future<ElectronicKeyListEntity> cancelAdministrator({required String keyId}) async {
|
Future<ElectronicKeyListEntity> cancelAdministrator(
|
||||||
|
{required String keyId}) async {
|
||||||
final res = await apiProvider.cancelAdministrator(keyId);
|
final res = await apiProvider.cancelAdministrator(keyId);
|
||||||
return ElectronicKeyListEntity.fromJson(res.body);
|
return ElectronicKeyListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
@ -604,13 +610,15 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//即将到期的卡列表
|
//即将到期的卡列表
|
||||||
Future<ExpireCardEntity> expireCardList(String pageNo, String pageSize) async {
|
Future<ExpireCardEntity> expireCardList(
|
||||||
|
String pageNo, String pageSize) async {
|
||||||
final res = await apiProvider.expireCardList(pageNo, pageSize);
|
final res = await apiProvider.expireCardList(pageNo, pageSize);
|
||||||
return ExpireCardEntity.fromJson(res.body);
|
return ExpireCardEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
//即将到期的指纹列表
|
//即将到期的指纹列表
|
||||||
Future<ExpireFingerprintEntity> expireFingerprintList(String pageNo, String pageSize) async {
|
Future<ExpireFingerprintEntity> expireFingerprintList(
|
||||||
|
String pageNo, String pageSize) async {
|
||||||
final res = await apiProvider.expireFingerprintList(pageNo, pageSize);
|
final res = await apiProvider.expireFingerprintList(pageNo, pageSize);
|
||||||
return ExpireFingerprintEntity.fromJson(res.body);
|
return ExpireFingerprintEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
@ -851,19 +859,17 @@ class ApiRepository {
|
|||||||
|
|
||||||
//群发电子钥匙
|
//群发电子钥匙
|
||||||
Future<KeyDetailEntity> batchSendKey(
|
Future<KeyDetailEntity> batchSendKey(
|
||||||
{
|
{required String endDate,
|
||||||
required String endDate,
|
required List keyGroupIdList,
|
||||||
required List keyGroupIdList,
|
required List lockIdList,
|
||||||
required List lockIdList,
|
required String createUser,
|
||||||
required String createUser,
|
required String isRemoteUnlock,
|
||||||
required String isRemoteUnlock,
|
required String keyNameForAdmin,
|
||||||
required String keyNameForAdmin,
|
required String receiverUsername,
|
||||||
required String receiverUsername,
|
required String startDate,
|
||||||
required String startDate,
|
required String countryCode,
|
||||||
required String countryCode,
|
required String usernameType,
|
||||||
required String usernameType,
|
required List weekDays}) async {
|
||||||
required List weekDays
|
|
||||||
}) async {
|
|
||||||
final res = await apiProvider.batchSendKey(
|
final res = await apiProvider.batchSendKey(
|
||||||
endDate,
|
endDate,
|
||||||
keyGroupIdList,
|
keyGroupIdList,
|
||||||
@ -1467,8 +1473,8 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 退出登录
|
// 退出登录
|
||||||
Future<LoginEntity> userLogout() async {
|
Future<LoginEntity> userLogout({required String deviceld}) async {
|
||||||
final res = await apiProvider.userLogout();
|
final res = await apiProvider.userLogout(deviceld);
|
||||||
return LoginEntity.fromJson(res.body);
|
return LoginEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1693,7 +1699,7 @@ class ApiRepository {
|
|||||||
|
|
||||||
// 设置猫眼工作模式
|
// 设置猫眼工作模式
|
||||||
Future<VersionUndateEntity> updateCatEyeModeConfig(
|
Future<VersionUndateEntity> updateCatEyeModeConfig(
|
||||||
{required int lockId, required Map catEyeConfig}) async {
|
{required int lockId, required List catEyeConfig}) async {
|
||||||
final res = await apiProvider.updateCatEyeModeConfig(lockId, catEyeConfig);
|
final res = await apiProvider.updateCatEyeModeConfig(lockId, catEyeConfig);
|
||||||
return VersionUndateEntity.fromJson(res.body);
|
return VersionUndateEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'dart:typed_data';
|
|||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/talk/udp/udp_manage.dart';
|
import 'package:star_lock/talk/udp/udp_manage.dart';
|
||||||
|
import 'package:star_lock/tools/storage.dart';
|
||||||
|
|
||||||
import '../../blue/io_tool/io_tool.dart';
|
import '../../blue/io_tool/io_tool.dart';
|
||||||
import '../../tools/eventBusEventManage.dart';
|
import '../../tools/eventBusEventManage.dart';
|
||||||
|
|||||||
@ -20,6 +20,7 @@ const isAgreeCamera = "isAgreeCamera"; //是否同意获取相机/相册弹窗
|
|||||||
|
|
||||||
const isShowUpdateVersion = "isShowUpdateVersion"; //是否更新弹窗
|
const isShowUpdateVersion = "isShowUpdateVersion"; //是否更新弹窗
|
||||||
const saveLockAlias = "saveLockAlias"; //锁别名
|
const saveLockAlias = "saveLockAlias"; //锁别名
|
||||||
|
const pushDeviceID = 'pushDeviceID'; //推送设备ID
|
||||||
|
|
||||||
const saveUserLoginData = "userLoginData";
|
const saveUserLoginData = "userLoginData";
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,10 @@ class XSJPushProvider {
|
|||||||
// Platform messages may fail, so we use a try/catch PlatformException.
|
// Platform messages may fail, so we use a try/catch PlatformException.
|
||||||
jpush.getRegistrationID().then((rid) {
|
jpush.getRegistrationID().then((rid) {
|
||||||
print("flutter get registration id : $rid");
|
print("flutter get registration id : $rid");
|
||||||
|
Storage.setString(
|
||||||
|
pushDeviceID,
|
||||||
|
rid,
|
||||||
|
);
|
||||||
pushBindDeviceID(rid, Platform.isAndroid ? 10 : 20);
|
pushBindDeviceID(rid, Platform.isAndroid ? 10 : 20);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user