1,猫眼自定义模式相关设置同步

2,猫眼设置相关接口类型修改及处理
3,猫眼设置部分逻辑优化及完善
This commit is contained in:
Daisy 2024-04-07 14:05:31 +08:00
parent bc781eba98
commit 18dd3aa211
16 changed files with 390 additions and 289 deletions

View File

@ -24,9 +24,10 @@ class CatEyeCustomModeLogic extends BaseGetXController {
}
state.recordTime.value =
state.catEyeConfigData.value.catEyeModeConfig!.recordTime!;
state.catEyeConfigData.value.catEyeModeConfig!.recordTime ?? '';
state.detectionDistance.value =
'${state.catEyeConfigData.value.catEyeModeConfig!.detectionDistance!}';
state.catEyeConfigData.value.catEyeModeConfig!.detectionDistance ??
'';
state.realTimeMode.value =
state.catEyeConfigData.value.catEyeModeConfig!.realTimeMode == 0
? '发生事件时查看'
@ -36,8 +37,8 @@ class CatEyeCustomModeLogic extends BaseGetXController {
return entity;
}
//
void updateCatEyeModeConfig() async {
// 0- 1-
void updateCatEyeModeConfig(int clickIndex) async {
var entity = await ApiRepository.to.updateCatEyeModeConfig(
lockId: state.lockSetInfoData.value.lockId!,
catEyeConfig: [
@ -50,9 +51,15 @@ class CatEyeCustomModeLogic extends BaseGetXController {
state.catEyeConfigData.value.catEyeModeConfig!.recordStartTime,
'recordEndTime':
state.catEyeConfigData.value.catEyeModeConfig!.recordEndTime,
'recordTime': state.recordTime.value,
'detectionDistance': state.detectionDistance.value,
'realTimeMode': state.realTimeMode.value,
'recordTime': clickIndex == 0
? state.recordTime.value
: state.catEyeConfigData.value.catEyeModeConfig!.recordTime,
'detectionDistance': clickIndex == 1
? state.detectionDistance.value
: state
.catEyeConfigData.value.catEyeModeConfig!.detectionDistance,
'realTimeMode':
state.catEyeConfigData.value.catEyeModeConfig!.realTimeMode,
}
}
],

View File

@ -37,9 +37,9 @@ class _CatEyeCustomModePageState extends State<CatEyeCustomModePage> {
Navigator.pop(context, true);
},
backgroundColor: AppColors.mainColor),
body: Column(
children: [
Obx(() => CommonItem(
body: Obx(() => Column(
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.videoSlot!.tr,
rightTitle: "",
isHaveLine: false,
@ -59,22 +59,22 @@ class _CatEyeCustomModePageState extends State<CatEyeCustomModePage> {
: null
}).then((value) => {logic.getLockSettingInfoData()});
},
)),
Obx(() => _buildSubTitleItem('有人出现时录像',
'有人在门口出现10秒后开始录像。\n有人按门铃时立即录像', state.recordTime.value, () {
),
_buildSubTitleItem('有人出现时录像', '有人在门口出现10秒后开始录像。\n有人按门铃时立即录像',
state.recordTime.value, () {
_openBottomItemSheet(state.showsUpVideoList.value, 0);
})),
SizedBox(
height: 30.h,
),
Obx(() => _buildSubTitleItem('人体侦测距离', '有人出现在门前1.5米范围时启动录像',
}),
SizedBox(
height: 30.h,
),
_buildSubTitleItem('人体侦测距离', '有人出现在门前1.5米范围时启动录像',
state.detectionDistance.value, () {
_openBottomItemSheet(state.detectionRangeList.value, 1);
})),
SizedBox(
height: 30.h,
),
Obx(() => CommonItem(
}),
SizedBox(
height: 30.h,
),
CommonItem(
leftTitel: '实时画面',
rightTitle: state.realTimeMode.value,
isHaveLine: false,
@ -91,9 +91,9 @@ class _CatEyeCustomModePageState extends State<CatEyeCustomModePage> {
: null
}).then((value) => {logic.getLockSettingInfoData()});
},
))
],
));
)
],
)));
}
Widget _buildSubTitleItem(
@ -157,8 +157,7 @@ class _CatEyeCustomModePageState extends State<CatEyeCustomModePage> {
);
}
Future _openBottomItemSheet(
List<String> bottomItemList, int clickIndex) async {
Future _openBottomItemSheet(List bottomItemList, int clickIndex) async {
showModalBottomSheet(
context: context,
shape: RoundedRectangleBorder(
@ -172,11 +171,11 @@ class _CatEyeCustomModePageState extends State<CatEyeCustomModePage> {
//
state.recordTime.value = state.showsUpVideoList.value[value];
} else if (clickIndex == 1) {
//
//
state.detectionDistance.value =
state.detectionRangeList.value[value];
}
logic.updateCatEyeModeConfig();
logic.updateCatEyeModeConfig(clickIndex);
},
);
});

View File

@ -20,7 +20,7 @@ class CatEyeCustomModeState {
'30${TranslationLoader.lanKeys!.second!.tr}',
'60${TranslationLoader.lanKeys!.second!.tr}'
].obs;
var detectionRangeList = ['约0.8米', '约1.5米', '约3'].obs;
var detectionRangeList = ['约0.8米', '约1.5米', '约3.0'].obs;
//
final TextStyle titleStyle = TextStyle(
color: Colors.black, fontSize: 24.sp, fontWeight: FontWeight.w500);

View File

@ -13,48 +13,64 @@ class CatEyeWorkModeLogic extends BaseGetXController {
lockId: state.lockSetInfoData.value.lockId!,
catEyeConfig: [
{
'catEyeMode': state.selectCatEyeWorkMode.value,
'catEyeMode':
state.boolList.value.indexWhere((element) => element == true) + 1,
'catEyeModeConfig': {
'recordMode': state.recordMode.value,
'recordStartTime': state.recordStartTime.value,
'recordEndTime': state.recordEndTime.value,
'recordTime': state.recordTime.value,
'detectionDistance': state.detectionDistance.value,
'realTimeMode': state.realTimeMode.value,
'recordMode':
state.catEyeConfigData.value.catEyeModeConfig!.recordMode,
'recordStartTime':
state.catEyeConfigData.value.catEyeModeConfig!.recordStartTime,
'recordEndTime':
state.catEyeConfigData.value.catEyeModeConfig!.recordEndTime,
'recordTime':
state.catEyeConfigData.value.catEyeModeConfig!.recordTime,
'detectionDistance': state
.catEyeConfigData.value.catEyeModeConfig!.detectionDistance,
'realTimeMode':
state.catEyeConfigData.value.catEyeModeConfig!.realTimeMode!,
}
}
],
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
getLockSettingInfoData();
}
}
//
Future<LockSetInfoEntity> getLockSettingInfoData() async {
void getLockSettingInfoData() async {
LockSetInfoEntity entity = await ApiRepository.to.getLockSettingInfoData(
lockId: state.lockSetInfoData.value.lockId.toString(),
);
if (entity.errorCode!.codeIsSuccessful) {
state.lockSetInfoData.value = entity.data!;
state.selectCatEyeWorkMode.value =
state.catEyeConfigData.value.catEyeMode!;
state.catEyeConfigData.value =
entity.data!.lockSettingInfo!.catEyeConfig![0];
// state.selectCatEyeWorkMode.value =
// state.catEyeConfigData.value.catEyeMode!;
// print('得到了选中哪个模式:${state.catEyeConfigData.value.catEyeMode}');
if (state.catEyeConfigData.value.catEyeMode ==
XSConstantMacro.catEyeWorkModePowerSaving) {
state.boolList.value[0] = true;
// state.boolList.value[0] = true;
state.boolList.value = [true, false, false, false];
} else if (state.catEyeConfigData.value.catEyeMode ==
XSConstantMacro.catEyeWorkModeStayCapture) {
state.boolList.value[1] = true;
// state.boolList.value[1] = true;
state.boolList.value = [false, true, false, false];
} else if (state.catEyeConfigData.value.catEyeMode ==
XSConstantMacro.catEyeWorkModeRealTimeMonitoring) {
state.boolList.value[2] = true;
// state.boolList.value[2] = true;
state.boolList.value = [false, false, true, false];
} else if (state.catEyeConfigData.value.catEyeMode ==
XSConstantMacro.catEyeWorkModeCustom) {
state.boolList.value[3] = true;
// state.boolList.value[3] = true;
state.boolList.value = [false, false, false, true];
}
}
return entity;
}
}

View File

@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_logic.dart';
import '../../../../../app_settings/app_colors.dart';
@ -36,35 +35,36 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
Navigator.pop(context, true);
},
backgroundColor: AppColors.mainColor),
body: Column(
children: [
SizedBox(
height: 30.h,
),
Obx(
() => _buildTipsView('省电模式:\n',
'适合门口较为安全的环境。\n仅发生特定事件才录像,并可查看实时画面。\n一般情况下满电可使用7-8个月', 0),
),
SizedBox(
height: 30.h,
),
Obx(() => _buildTipsView('逗留抓拍模式:\n',
'有人逗留或发生特定事件才录像,可随时查看\n实时画面。\n一般情况下满电可使用5~6个月。', 1)),
SizedBox(
height: 30.h,
),
Obx(() => _buildTipsView('实时监控模式:\n',
'适合门口人员复杂、较不安全的环境。\n有人出现就录像,可随时查看实时画面。\n一般情况下满电可使用2~4个月。', 2)),
SizedBox(
height: 30.h,
),
Obx(() => _buildTipsView(
'自定义模式:\n', '根据您家门口实际情况设置录像和实时画面功能。\n可使用时长由具体设置决定。', 3))
],
));
body: Obx(() => Column(
children: [
SizedBox(
height: 30.h,
),
_buildTipsView('省电模式:\n',
'适合门口较为安全的环境。\n仅发生特定事件才录像,并可查看实时画面。\n一般情况下满电可使用7-8个月', 0),
SizedBox(
height: 30.h,
),
_buildTipsView('逗留抓拍模式:\n',
'有人逗留或发生特定事件才录像,可随时查看\n实时画面。\n一般情况下满电可使用5~6个月。', 1),
SizedBox(
height: 30.h,
),
_buildTipsView(
'实时监控模式:\n',
'适合门口人员复杂、较不安全的环境。\n有人出现就录像,可随时查看实时画面。\n一般情况下满电可使用2~4个月。',
2),
SizedBox(
height: 30.h,
),
_buildTipsView(
'自定义模式:\n', '根据您家门口实际情况设置录像和实时画面功能。\n可使用时长由具体设置决定。', 3)
],
)));
}
Widget _buildTipsView(String titleStr, String subTitle, int clickIndex) {
// print('选中了哪个模式${state.boolList.value[clickIndex]}');
return GestureDetector(
child: Container(
width: ScreenUtil().screenWidth - 40.w,
@ -138,24 +138,24 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
for (int i = 0; i < state.boolList.value.length; i++) {
if (clickIndex == i) {
state.boolList.value[clickIndex] = true;
switch (clickIndex) {
case 0:
state.selectCatEyeWorkMode.value =
XSConstantMacro.catEyeWorkModePowerSaving;
break;
case 1:
state.selectCatEyeWorkMode.value =
XSConstantMacro.catEyeWorkModeStayCapture;
break;
case 2:
state.selectCatEyeWorkMode.value =
XSConstantMacro.catEyeWorkModeRealTimeMonitoring;
break;
case 3:
state.selectCatEyeWorkMode.value =
XSConstantMacro.catEyeWorkModeCustom;
break;
}
// switch (clickIndex) {
// case 0:
// state.selectCatEyeWorkMode.value =
// XSConstantMacro.catEyeWorkModePowerSaving;
// break;
// case 1:
// state.selectCatEyeWorkMode.value =
// XSConstantMacro.catEyeWorkModeStayCapture;
// break;
// case 2:
// state.selectCatEyeWorkMode.value =
// XSConstantMacro.catEyeWorkModeRealTimeMonitoring;
// break;
// case 3:
// state.selectCatEyeWorkMode.value =
// XSConstantMacro.catEyeWorkModeCustom;
// break;
// }
logic.updateCatEyeModeConfig();
} else {
state.boolList.value[i] = false;

View File

@ -1,42 +1,34 @@
import 'package:get/get.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
class CatEyeWorkModeState {
var lockSetInfoData = LockSetInfoData().obs;
var selectCatEyeWorkMode = 0.obs; //
// var selectCatEyeWorkMode = 0.obs; //
var boolList = [false, false, false, false].obs;
var recordMode = 0.obs; // 0 1
//recordStartTime与recordEndTime参数
var recordStartTime = 0.obs; // 1709715049775,
var recordEndTime = 0.obs; //1709715049775,
var recordTime = ''.obs; //
var detectionDistance = 0.obs; //
var realTimeMode = 0.obs; // 0 1
var catEyeConfigData = CatEyeConfig().obs;
CatEyeWorkModeState() {
Map map = Get.arguments;
lockSetInfoData.value = map["lockSetInfoData"];
if (map['catEyeConfigData'] != null) {
catEyeConfigData.value = map['catEyeConfigData'];
selectCatEyeWorkMode.value = catEyeConfigData.value.catEyeMode!;
// if (map['catEyeConfigData'] != null) {
// catEyeConfigData.value = map['catEyeConfigData'];
// 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;
}
} else {
catEyeConfigData.value = CatEyeConfig();
}
// 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;
// }
// } else {
// catEyeConfigData.value = CatEyeConfig();
// }
}
}

View File

@ -19,10 +19,8 @@ class VideoSlotLogic extends BaseGetXController {
if (state.catEyeConfigData.value.catEyeModeConfig != null) {
if (state.catEyeConfigData.value.catEyeModeConfig!.recordMode == 1) {
// state.selectVideoSlot.value = '自定义时段';
state.isCustom.value = true;
} else {
// state.selectVideoSlot.value = '全天';
state.isCustom.value = false;
}
}

View File

@ -20,6 +20,12 @@ class _VideoSlotPageState extends State<VideoSlotPage> {
final logic = Get.put(VideoSlotLogic());
final state = Get.find<VideoSlotLogic>().state;
@override
initState() {
super.initState();
logic.getLockSettingInfoData();
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -52,57 +58,57 @@ class _VideoSlotPageState extends State<VideoSlotPage> {
),
],
),
body: Column(
children: [
SizedBox(
height: 30.h,
),
_buildTipsView('全天', 0),
SizedBox(
height: 30.h,
),
_buildCustomTimeView('自定义时间', 1),
],
));
body: Obx(() => Column(
children: [
SizedBox(
height: 30.h,
),
_buildTipsView('全天', 0),
SizedBox(
height: 30.h,
),
_buildCustomTimeView('自定义时间', 1),
],
)));
}
//
Widget _buildTipsView(String titleStr, int clickIndex) {
return GestureDetector(
child: Obx(() => Container(
width: ScreenUtil().screenWidth - 40.w,
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
decoration: BoxDecoration(
color: state.isCustom.value == true
? AppColors.greyBackgroundColor
: AppColors.blueViewBgColor,
borderRadius: BorderRadius.circular(10.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 20.w, top: 30.h, bottom: 30.h, right: 20.w),
child: Row(
children: [
state.isCustom.value == false
? Image.asset(
'images/mine/icon_mine_blueSelect.png',
width: 20.w,
height: 14.w,
)
: SizedBox(
width: 20.w,
height: 14.w,
),
SizedBox(width: 10.w),
Expanded(
child: _buildRichText(titleStr, false),
),
SizedBox(
width: 10.w,
),
],
)),
)),
child: Container(
width: ScreenUtil().screenWidth - 40.w,
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
decoration: BoxDecoration(
color: state.isCustom.value == true
? AppColors.greyBackgroundColor
: AppColors.blueViewBgColor,
borderRadius: BorderRadius.circular(10.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 20.w, top: 30.h, bottom: 30.h, right: 20.w),
child: Row(
children: [
state.isCustom.value == false
? Image.asset(
'images/mine/icon_mine_blueSelect.png',
width: 20.w,
height: 14.w,
)
: SizedBox(
width: 20.w,
height: 14.w,
),
SizedBox(width: 10.w),
Expanded(
child: _buildRichText(titleStr, false),
),
SizedBox(
width: 10.w,
),
],
)),
),
onTap: () {
if (clickIndex == 0) {
state.isCustom.value = false;

View File

@ -18,7 +18,9 @@ class LiveVideoLogic extends BaseGetXController {
entity.data!.lockSettingInfo!.catEyeConfig![0];
if (state.catEyeConfigData.value.catEyeModeConfig != null) {
if (state.catEyeConfigData.value.catEyeModeConfig!.recordMode == 1) {
state.realTimeMode.value =
state.catEyeConfigData.value.catEyeModeConfig!.realTimeMode!;
if (state.catEyeConfigData.value.catEyeModeConfig!.realTimeMode == 1) {
state.isLiveView.value = true;
} else {
state.isLiveView.value = false;

View File

@ -18,6 +18,12 @@ class _LiveVideoPageState extends State<LiveVideoPage> {
final logic = Get.put(LiveVideoLogic());
final state = Get.find<LiveVideoLogic>().state;
@override
initState() {
super.initState();
logic.getLockSettingInfoData();
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -25,6 +31,9 @@ class _LiveVideoPageState extends State<LiveVideoPage> {
appBar: TitleAppBar(
barTitle: '实时画面',
haveBack: true,
backAction: () {
Navigator.pop(context, true);
},
backgroundColor: AppColors.mainColor,
actionsList: [
TextButton(
@ -42,92 +51,91 @@ class _LiveVideoPageState extends State<LiveVideoPage> {
),
],
),
body: Column(
children: [
SizedBox(
height: 80.h,
),
Image.asset(
'images/lockSet_liveVideo.png',
height: 541.h,
width: 255.w,
),
SizedBox(
height: 86.h,
),
_buildTipsView('发生事件时查看\n', '仅当门锁发生事件或有人按门铃时,才能在门锁首页查看实时画面。', 0),
SizedBox(
height: 16.h,
),
_buildTipsView('实时查看\n',
'指定时问内,无论门锁是否发生安全事件或有人按门铃,都能在门锁首页随时查看实时画面;电池续航时问将会缩短。', 1),
],
));
body: Obx(() => Column(
children: [
SizedBox(
height: 80.h,
),
Image.asset(
'images/lockSet_liveVideo.png',
height: 541.h,
width: 255.w,
),
SizedBox(
height: 86.h,
),
_buildTipsView(
'发生事件时查看\n', '仅当门锁发生事件或有人按门铃时,才能在门锁首页查看实时画面。', 0),
SizedBox(
height: 16.h,
),
_buildTipsView('实时查看\n',
'指定时问内,无论门锁是否发生安全事件或有人按门铃,都能在门锁首页随时查看实时画面;电池续航时问将会缩短。', 1),
],
)));
}
Widget _buildTipsView(String titleStr, String subTitle, int clickIndex) {
return Obx(() => GestureDetector(
child: Container(
width: ScreenUtil().screenWidth - 40.w,
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
decoration: BoxDecoration(
color: clickIndex == 0
? (state.isLiveView.value == false
? AppColors.blueViewBgColor
: AppColors.greyBackgroundColor)
: (state.isLiveView.value == true
? AppColors.blueViewBgColor
: AppColors.greyBackgroundColor),
borderRadius: BorderRadius.circular(10.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 20.w, top: 30.h, bottom: 30.h, right: 20.w),
child: Row(
children: [
clickIndex == 0
? (state.isLiveView.value == false
? Image.asset(
'images/mine/icon_mine_blueSelect.png',
width: 20.w,
height: 14.w,
)
: SizedBox(
width: 20.w,
height: 14.w,
))
: (state.isLiveView.value == true
? Image.asset(
'images/mine/icon_mine_blueSelect.png',
width: 20.w,
height: 14.w,
)
: SizedBox(
width: 20.w,
height: 14.w,
)),
SizedBox(width: 10.w),
Expanded(
child: _buildRichText(
titleStr,
subTitle,
clickIndex == 0
? (state.isLiveView.value == false ? true : false)
: (state.isLiveView.value == true
? true
: false)),
),
],
)),
),
onTap: () {
if (clickIndex == 0) {
state.isLiveView.value = false;
} else {
state.isLiveView.value = true;
}
},
));
return GestureDetector(
child: Container(
width: ScreenUtil().screenWidth - 40.w,
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
decoration: BoxDecoration(
color: clickIndex == 0
? (state.isLiveView.value == false
? AppColors.blueViewBgColor
: AppColors.greyBackgroundColor)
: (state.isLiveView.value == true
? AppColors.blueViewBgColor
: AppColors.greyBackgroundColor),
borderRadius: BorderRadius.circular(10.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 20.w, top: 30.h, bottom: 30.h, right: 20.w),
child: Row(
children: [
clickIndex == 0
? (state.isLiveView.value == false
? Image.asset(
'images/mine/icon_mine_blueSelect.png',
width: 20.w,
height: 14.w,
)
: SizedBox(
width: 20.w,
height: 14.w,
))
: (state.isLiveView.value == true
? Image.asset(
'images/mine/icon_mine_blueSelect.png',
width: 20.w,
height: 14.w,
)
: SizedBox(
width: 20.w,
height: 14.w,
)),
SizedBox(width: 10.w),
Expanded(
child: _buildRichText(
titleStr,
subTitle,
clickIndex == 0
? (state.isLiveView.value == false ? true : false)
: (state.isLiveView.value == true ? true : false)),
),
],
)),
),
onTap: () {
if (clickIndex == 0) {
state.isLiveView.value = false;
} else {
state.isLiveView.value = true;
}
},
);
}
Widget _buildRichText(String titleStr, String subTitle, bool isClick) {

View File

@ -357,7 +357,7 @@ class LockBasicInfo {
this.keyRight,
this.senderUserId,
this.lockUserNo,
this.weekDays});
this.weekDays});
LockBasicInfo.fromJson(Map<String, dynamic> json) {
lockId = json['lockId'];
@ -681,7 +681,7 @@ class CatEyeModeConfig {
int? realTimeMode; // 0 1
int? recordEndTime; //-
int? recordStartTime; //-
int? detectionDistance; //
String? detectionDistance; //
CatEyeModeConfig(
{this.recordMode,
@ -693,7 +693,11 @@ class CatEyeModeConfig {
CatEyeModeConfig.fromJson(Map<String, dynamic> json) {
recordMode = json['recordMode'];
recordTime = json['recordTime'];
if (json['recordTime'] != null) {
recordTime = json['recordTime'];
} else {
recordTime = '';
}
realTimeMode = json['realTimeMode'];
recordEndTime = json['recordEndTime'];
recordStartTime = json['recordStartTime'];

View File

@ -160,7 +160,6 @@ class LockMonitoringLogic extends BaseGetXController {
userMobile: await state.userUid,
userMobileIP: await state.userMobileIP,
endData: list);
Get.back();
}
//

View File

@ -187,5 +187,7 @@ abstract class Api {
final String getVersionURL = '/app/getVersion'; //
final String updateCatEyeConfigURL =
'/lockSetting/updateCatEyeConfig'; //
'/lockSetting/updateCatEyeConfig'; //
final String updateFaceConfigURL = '/lockSetting/updateFaceConfig'; //
}

View File

@ -850,13 +850,14 @@ class ApiProvider extends BaseProvider {
}));
//
Future<Response> deletStaffData(int lockId, int staffId, int deleteKey) => post(
deleteStaffURL.toUrl,
jsonEncode({
'lockId': lockId,
'staffId': staffId,
'deleteKey': deleteKey,
}));
Future<Response> deletStaffData(int lockId, int staffId, int deleteKey) =>
post(
deleteStaffURL.toUrl,
jsonEncode({
'lockId': lockId,
'staffId': staffId,
'deleteKey': deleteKey,
}));
//
Future<Response> addStaffData(
@ -1450,19 +1451,19 @@ class ApiProvider extends BaseProvider {
jsonEncode({'endDate': endDate, 'lockIdList': lockIdList}));
Future<Response> batchSendKey(
List lockIds,
int createUser,
String countryCode,
String receiverUsername,
String keyName,
int keyType,
List weekDays,
int startDate,
int endDate,
int startTime,
int endTime,
int remoteUnlockSwitch,
int keyRight) =>
List lockIds,
int createUser,
String countryCode,
String receiverUsername,
String keyName,
int keyType,
List weekDays,
int startDate,
int endDate,
int startTime,
int endTime,
int remoteUnlockSwitch,
int keyRight) =>
post(
batchSendKeyURL.toUrl,
jsonEncode({
@ -1568,8 +1569,8 @@ class ApiProvider extends BaseProvider {
}));
//
Future<Response> changePassword(String date, String newPassword,
String oldPassword) =>
Future<Response> changePassword(
String date, String newPassword, String oldPassword) =>
post(
changePasswordURL.toUrl,
jsonEncode({
@ -1708,6 +1709,43 @@ class ApiProvider extends BaseProvider {
'lockId': lockId,
'abnormalWarn': abnormalWarn,
}));
//
Future<Response> updateFaceSwitch(int lockId, int faceSwitch) => post(
updateFaceConfigURL.toUrl,
jsonEncode({
'lockId': lockId,
'faceSwitch': faceSwitch,
}));
//
Future<Response> updateFaceConfig(int lockId, int faceInductionDistance) =>
post(
updateFaceConfigURL.toUrl,
jsonEncode({
'lockId': lockId,
'faceInductionDistance': faceInductionDistance,
}));
//
Future<Response> updateFacePreventMisrun(
int lockId, int faceAntiMistakeOpen) =>
post(
updateFaceConfigURL.toUrl,
jsonEncode({
'lockId': lockId,
'faceAntiMistakeOpen': faceAntiMistakeOpen,
}));
//
Future<Response> updateFaceAutoLightScreen(
int lockId, int faceAutoLightScreen) =>
post(
updateFaceConfigURL.toUrl,
jsonEncode({
'lockId': lockId,
'faceAutoLightScreen': faceAutoLightScreen,
}));
}
extension ExtensionString on String {

View File

@ -1574,13 +1574,11 @@ class ApiRepository {
// 2使 sendValidationCodeAuth 5
Future<SendValidationCodeEntity> sendValidationCodeAuth(
{
required String countryCode,
required String account,
required String channel,
required String codeType,
required String xWidth
}) async {
{required String countryCode,
required String account,
required String channel,
required String codeType,
required String xWidth}) async {
final res = await apiProvider.sendValidationCodeAuth(
countryCode, account, channel, codeType, xWidth);
return SendValidationCodeEntity.fromJson(res.body);
@ -1609,9 +1607,10 @@ class ApiRepository {
}
//
Future<LoginEntity> changePassword(String date, String newPassword, String oldPassword) async {
final res = await apiProvider.changePassword(
date, newPassword, oldPassword);
Future<LoginEntity> changePassword(
String date, String newPassword, String oldPassword) async {
final res =
await apiProvider.changePassword(date, newPassword, oldPassword);
return LoginEntity.fromJson(res.body);
}
@ -1749,4 +1748,35 @@ class ApiRepository {
await apiProvider.updateAbnormalWarnConfig(lockId, abnormalWarn);
return VersionUndateEntity.fromJson(res.body);
}
//
Future<VersionUndateEntity> updateFaceSwitch(
{required int lockId, required int faceSwitch}) async {
final res = await apiProvider.updateFaceSwitch(lockId, faceSwitch);
return VersionUndateEntity.fromJson(res.body);
}
//
Future<VersionUndateEntity> updateFaceConfig(
{required int lockId, required int faceInductionDistance}) async {
final res =
await apiProvider.updateFaceConfig(lockId, faceInductionDistance);
return VersionUndateEntity.fromJson(res.body);
}
//
Future<VersionUndateEntity> updateFacePreventMisrun(
{required int lockId, required int faceAntiMistakeOpen}) async {
final res =
await apiProvider.updateFacePreventMisrun(lockId, faceAntiMistakeOpen);
return VersionUndateEntity.fromJson(res.body);
}
//
Future<VersionUndateEntity> updateFaceAutoLightScreen(
{required int lockId, required int faceAutoLightScreen}) async {
final res = await apiProvider.updateFaceAutoLightScreen(
lockId, faceAutoLightScreen);
return VersionUndateEntity.fromJson(res.body);
}
}

View File

@ -6,7 +6,7 @@ import 'package:star_lock/app_settings/app_colors.dart';
import '../translations/trans_lib.dart';
class AlertBottomWidget extends StatelessWidget {
List<String> items;
List items;
ValueChanged<int> chooseCallback;
String topTitle;