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

View File

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

View File

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

View File

@ -1,42 +1,34 @@
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 = [false, false, false, false].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; var catEyeConfigData = CatEyeConfig().obs;
CatEyeWorkModeState() { CatEyeWorkModeState() {
Map map = Get.arguments; Map map = Get.arguments;
lockSetInfoData.value = map["lockSetInfoData"]; lockSetInfoData.value = map["lockSetInfoData"];
if (map['catEyeConfigData'] != null) { // if (map['catEyeConfigData'] != null) {
catEyeConfigData.value = map['catEyeConfigData']; // catEyeConfigData.value = map['catEyeConfigData'];
selectCatEyeWorkMode.value = catEyeConfigData.value.catEyeMode!; // selectCatEyeWorkMode.value = catEyeConfigData.value.catEyeMode!;
if (catEyeConfigData.value.catEyeMode == // if (catEyeConfigData.value.catEyeMode ==
XSConstantMacro.catEyeWorkModePowerSaving) { // XSConstantMacro.catEyeWorkModePowerSaving) {
boolList[0] = true; // boolList[0] = true;
} else if (catEyeConfigData.value.catEyeMode == // } else if (catEyeConfigData.value.catEyeMode ==
XSConstantMacro.catEyeWorkModeStayCapture) { // XSConstantMacro.catEyeWorkModeStayCapture) {
boolList[1] = true; // boolList[1] = true;
} else if (catEyeConfigData.value.catEyeMode == // } else if (catEyeConfigData.value.catEyeMode ==
XSConstantMacro.catEyeWorkModeRealTimeMonitoring) { // XSConstantMacro.catEyeWorkModeRealTimeMonitoring) {
boolList[2] = true; // boolList[2] = true;
} else if (catEyeConfigData.value.catEyeMode == // } else if (catEyeConfigData.value.catEyeMode ==
XSConstantMacro.catEyeWorkModeCustom) { // XSConstantMacro.catEyeWorkModeCustom) {
boolList[3] = true; // boolList[3] = true;
} // }
} else { // } else {
catEyeConfigData.value = CatEyeConfig(); // catEyeConfigData.value = CatEyeConfig();
} // }
} }
} }

View File

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

View File

@ -20,6 +20,12 @@ class _VideoSlotPageState extends State<VideoSlotPage> {
final logic = Get.put(VideoSlotLogic()); final logic = Get.put(VideoSlotLogic());
final state = Get.find<VideoSlotLogic>().state; final state = Get.find<VideoSlotLogic>().state;
@override
initState() {
super.initState();
logic.getLockSettingInfoData();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -52,7 +58,7 @@ class _VideoSlotPageState extends State<VideoSlotPage> {
), ),
], ],
), ),
body: Column( body: Obx(() => Column(
children: [ children: [
SizedBox( SizedBox(
height: 30.h, height: 30.h,
@ -63,13 +69,13 @@ class _VideoSlotPageState extends State<VideoSlotPage> {
), ),
_buildCustomTimeView('自定义时间', 1), _buildCustomTimeView('自定义时间', 1),
], ],
)); )));
} }
// //
Widget _buildTipsView(String titleStr, int clickIndex) { Widget _buildTipsView(String titleStr, int clickIndex) {
return GestureDetector( return GestureDetector(
child: Obx(() => Container( child: Container(
width: ScreenUtil().screenWidth - 40.w, width: ScreenUtil().screenWidth - 40.w,
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h), margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -102,7 +108,7 @@ class _VideoSlotPageState extends State<VideoSlotPage> {
), ),
], ],
)), )),
)), ),
onTap: () { onTap: () {
if (clickIndex == 0) { if (clickIndex == 0) {
state.isCustom.value = false; state.isCustom.value = false;

View File

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

View File

@ -18,6 +18,12 @@ class _LiveVideoPageState extends State<LiveVideoPage> {
final logic = Get.put(LiveVideoLogic()); final logic = Get.put(LiveVideoLogic());
final state = Get.find<LiveVideoLogic>().state; final state = Get.find<LiveVideoLogic>().state;
@override
initState() {
super.initState();
logic.getLockSettingInfoData();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -25,6 +31,9 @@ class _LiveVideoPageState extends State<LiveVideoPage> {
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: '实时画面', barTitle: '实时画面',
haveBack: true, haveBack: true,
backAction: () {
Navigator.pop(context, true);
},
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
actionsList: [ actionsList: [
TextButton( TextButton(
@ -42,7 +51,7 @@ class _LiveVideoPageState extends State<LiveVideoPage> {
), ),
], ],
), ),
body: Column( body: Obx(() => Column(
children: [ children: [
SizedBox( SizedBox(
height: 80.h, height: 80.h,
@ -55,18 +64,19 @@ class _LiveVideoPageState extends State<LiveVideoPage> {
SizedBox( SizedBox(
height: 86.h, height: 86.h,
), ),
_buildTipsView('发生事件时查看\n', '仅当门锁发生事件或有人按门铃时,才能在门锁首页查看实时画面。', 0), _buildTipsView(
'发生事件时查看\n', '仅当门锁发生事件或有人按门铃时,才能在门锁首页查看实时画面。', 0),
SizedBox( SizedBox(
height: 16.h, height: 16.h,
), ),
_buildTipsView('实时查看\n', _buildTipsView('实时查看\n',
'指定时问内,无论门锁是否发生安全事件或有人按门铃,都能在门锁首页随时查看实时画面;电池续航时问将会缩短。', 1), '指定时问内,无论门锁是否发生安全事件或有人按门铃,都能在门锁首页随时查看实时画面;电池续航时问将会缩短。', 1),
], ],
)); )));
} }
Widget _buildTipsView(String titleStr, String subTitle, int clickIndex) { Widget _buildTipsView(String titleStr, String subTitle, int clickIndex) {
return Obx(() => GestureDetector( return GestureDetector(
child: Container( child: Container(
width: ScreenUtil().screenWidth - 40.w, width: ScreenUtil().screenWidth - 40.w,
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h), margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
@ -113,9 +123,7 @@ class _LiveVideoPageState extends State<LiveVideoPage> {
subTitle, subTitle,
clickIndex == 0 clickIndex == 0
? (state.isLiveView.value == false ? true : false) ? (state.isLiveView.value == false ? true : false)
: (state.isLiveView.value == true : (state.isLiveView.value == true ? true : false)),
? true
: false)),
), ),
], ],
)), )),
@ -127,7 +135,7 @@ class _LiveVideoPageState extends State<LiveVideoPage> {
state.isLiveView.value = true; state.isLiveView.value = true;
} }
}, },
)); );
} }
Widget _buildRichText(String titleStr, String subTitle, bool isClick) { Widget _buildRichText(String titleStr, String subTitle, bool isClick) {

View File

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

View File

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

View File

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

View File

@ -850,7 +850,8 @@ class ApiProvider extends BaseProvider {
})); }));
// //
Future<Response> deletStaffData(int lockId, int staffId, int deleteKey) => post( Future<Response> deletStaffData(int lockId, int staffId, int deleteKey) =>
post(
deleteStaffURL.toUrl, deleteStaffURL.toUrl,
jsonEncode({ jsonEncode({
'lockId': lockId, 'lockId': lockId,
@ -1568,8 +1569,8 @@ class ApiProvider extends BaseProvider {
})); }));
// //
Future<Response> changePassword(String date, String newPassword, Future<Response> changePassword(
String oldPassword) => String date, String newPassword, String oldPassword) =>
post( post(
changePasswordURL.toUrl, changePasswordURL.toUrl,
jsonEncode({ jsonEncode({
@ -1708,6 +1709,43 @@ class ApiProvider extends BaseProvider {
'lockId': lockId, 'lockId': lockId,
'abnormalWarn': abnormalWarn, '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 { extension ExtensionString on String {

View File

@ -1574,13 +1574,11 @@ class ApiRepository {
// 2使 sendValidationCodeAuth 5 // 2使 sendValidationCodeAuth 5
Future<SendValidationCodeEntity> sendValidationCodeAuth( Future<SendValidationCodeEntity> sendValidationCodeAuth(
{ {required String countryCode,
required String countryCode,
required String account, required String account,
required String channel, required String channel,
required String codeType, required String codeType,
required String xWidth required String xWidth}) async {
}) async {
final res = await apiProvider.sendValidationCodeAuth( final res = await apiProvider.sendValidationCodeAuth(
countryCode, account, channel, codeType, xWidth); countryCode, account, channel, codeType, xWidth);
return SendValidationCodeEntity.fromJson(res.body); return SendValidationCodeEntity.fromJson(res.body);
@ -1609,9 +1607,10 @@ class ApiRepository {
} }
// //
Future<LoginEntity> changePassword(String date, String newPassword, String oldPassword) async { Future<LoginEntity> changePassword(
final res = await apiProvider.changePassword( String date, String newPassword, String oldPassword) async {
date, newPassword, oldPassword); final res =
await apiProvider.changePassword(date, newPassword, oldPassword);
return LoginEntity.fromJson(res.body); return LoginEntity.fromJson(res.body);
} }
@ -1749,4 +1748,35 @@ class ApiRepository {
await apiProvider.updateAbnormalWarnConfig(lockId, abnormalWarn); await apiProvider.updateAbnormalWarnConfig(lockId, abnormalWarn);
return VersionUndateEntity.fromJson(res.body); 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'; import '../translations/trans_lib.dart';
class AlertBottomWidget extends StatelessWidget { class AlertBottomWidget extends StatelessWidget {
List<String> items; List items;
ValueChanged<int> chooseCallback; ValueChanged<int> chooseCallback;
String topTitle; String topTitle;