This commit is contained in:
魏少阳 2024-04-22 11:18:43 +08:00
commit f4e3ac03af
11 changed files with 104 additions and 36 deletions

View File

@ -743,5 +743,24 @@
"胁迫开门":"Forced door opening", "胁迫开门":"Forced door opening",
"有人按门铃":"Someone rings the doorbell", "有人按门铃":"Someone rings the doorbell",
"有人出现在门口":"Someone appears at the door", "有人出现在门口":"Someone appears at the door",
"提醒方式":"Reminder mode" "提醒方式":"Reminder mode",
"开门方式":"Opening mode",
"请选择":"Please select",
"家人":"Family",
"保存":"Save",
"APP推送":"APP push",
"管理员":"Administrator",
"未启用":"Not enabled",
"已启用":"Enabled",
"省电模式":"Power saving mode",
"逗留抓拍模式":"Stay capture mode",
"实时监控模式":"Real-time monitoring mode",
"自定义模式":"Custom mode",
"秒":"second",
"猫眼设置":"Cat eye setting",
"猫眼工作模式":"Cat eye working mode",
"自动亮屏":"Automatic bright screen",
"亮屏持续时间":"Screen on time",
"逗留警告":"Stay warning",
"异常警告":"Abnormal warning"
} }

View File

@ -742,5 +742,24 @@
"胁迫开门":"胁迫开门", "胁迫开门":"胁迫开门",
"有人按门铃":"有人按门铃", "有人按门铃":"有人按门铃",
"有人出现在门口":"有人出现在门口", "有人出现在门口":"有人出现在门口",
"提醒方式":"提醒方式" "提醒方式":"提醒方式",
"开门方式":"开门方式",
"请选择":"请选择",
"家人":"家人",
"保存":"保存",
"APP推送":"APP推送",
"管理员":"管理员",
"未启用":"未启用",
"已启用":"已启用",
"省电模式":"省电模式",
"逗留抓拍模式":"逗留抓拍模式",
"实时监控模式":"实时监控模式",
"自定义模式":"自定义模式",
"秒":"秒",
"猫眼设置":"猫眼设置",
"猫眼工作模式":"猫眼工作模式",
"自动亮屏":"自动亮屏",
"亮屏持续时间":"亮屏持续时间",
"逗留警告":"逗留警告",
"异常警告":"异常警告"
} }

View File

@ -745,5 +745,24 @@
"有人按门铃":"有人按门铃", "有人按门铃":"有人按门铃",
"有人出现在门口":"有人出现在门口", "有人出现在门口":"有人出现在门口",
"提醒方式":"提醒方式", "提醒方式":"提醒方式",
"电子钥匙":"电子钥匙" "电子钥匙":"电子钥匙",
"开门方式":"开门方式",
"请选择":"请选择",
"家人":"家人",
"保存":"保存",
"APP推送":"APP推送",
"管理员":"管理员",
"未启用":"未启用",
"已启用":"已启用",
"省电模式":"省电模式",
"逗留抓拍模式":"逗留抓拍模式",
"实时监控模式":"实时监控模式",
"自定义模式":"自定义模式",
"秒":"秒",
"猫眼设置":"猫眼设置",
"猫眼工作模式":"猫眼工作模式",
"自动亮屏":"自动亮屏",
"亮屏持续时间":"亮屏持续时间",
"逗留警告":"逗留警告",
"异常警告":"异常警告"
} }

View File

@ -1,3 +1,4 @@
import 'package:get/get.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.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';
import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/network/api_repository.dart';
@ -15,7 +16,7 @@ class CatEyeSetLogic extends BaseGetXController {
autoLightScreen: state.isAutoBright.value == true ? 1 : 0, autoLightScreen: state.isAutoBright.value == true ? 1 : 0,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功'); showToast(state.settingSuccess);
} }
} }
@ -24,10 +25,10 @@ class CatEyeSetLogic extends BaseGetXController {
var entity = await ApiRepository.to.updateLightScreenTimeConfig( var entity = await ApiRepository.to.updateLightScreenTimeConfig(
lockId: state.lockSetInfoData.value.lockId!, lockId: state.lockSetInfoData.value.lockId!,
autoLightScreenTime: autoLightScreenTime:
int.parse(state.selectBrightDuration.value.replaceAll('', '')), int.parse(state.selectBrightDuration.value.replaceAll(''.tr, '')),
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功'); showToast(state.settingSuccess);
} }
} }
@ -38,7 +39,7 @@ class CatEyeSetLogic extends BaseGetXController {
stayWarn: state.isStayWarning.value == true ? 1 : 0, stayWarn: state.isStayWarning.value == true ? 1 : 0,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功'); showToast(state.settingSuccess);
} }
} }
@ -49,7 +50,7 @@ class CatEyeSetLogic extends BaseGetXController {
abnormalWarn: state.isExceptionWarning.value == true ? 1 : 0, abnormalWarn: state.isExceptionWarning.value == true ? 1 : 0,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功'); showToast(state.settingSuccess);
} }
} }
@ -83,19 +84,19 @@ class CatEyeSetLogic extends BaseGetXController {
if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0] if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0]
.catEyeMode == .catEyeMode ==
XSConstantMacro.catEyeWorkModePowerSaving) { XSConstantMacro.catEyeWorkModePowerSaving) {
state.selectCatEyeWorkMode.value = '省电模式'; state.selectCatEyeWorkMode.value = '省电模式'.tr;
} else if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0] } else if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0]
.catEyeMode == .catEyeMode ==
XSConstantMacro.catEyeWorkModeStayCapture) { XSConstantMacro.catEyeWorkModeStayCapture) {
state.selectCatEyeWorkMode.value = '逗留抓拍模式'; state.selectCatEyeWorkMode.value = '逗留抓拍模式'.tr;
} else if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0] } else if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0]
.catEyeMode == .catEyeMode ==
XSConstantMacro.catEyeWorkModeRealTimeMonitoring) { XSConstantMacro.catEyeWorkModeRealTimeMonitoring) {
state.selectCatEyeWorkMode.value = '实时监控模式'; state.selectCatEyeWorkMode.value = '实时监控模式'.tr;
} else if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0] } else if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0]
.catEyeMode == .catEyeMode ==
XSConstantMacro.catEyeWorkModeCustom) { XSConstantMacro.catEyeWorkModeCustom) {
state.selectCatEyeWorkMode.value = '自定义模式'; state.selectCatEyeWorkMode.value = '自定义模式'.tr;
} }
} }
} }

View File

@ -33,13 +33,13 @@ class _CatEyeSetPageState extends State<CatEyeSetPage> {
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: '猫眼设置', barTitle: '猫眼设置'.tr,
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Column( body: Column(
children: [ children: [
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '猫眼工作模式', leftTitel: '猫眼工作模式'.tr,
rightTitle: state.selectCatEyeWorkMode.value, rightTitle: state.selectCatEyeWorkMode.value,
allHeight: 70.h, allHeight: 70.h,
isHaveLine: true, isHaveLine: true,
@ -58,14 +58,14 @@ class _CatEyeSetPageState extends State<CatEyeSetPage> {
}); });
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '自动亮屏', leftTitel: '自动亮屏'.tr,
rightTitle: "", rightTitle: "",
isHaveLine: true, isHaveLine: true,
isHaveDirection: false, isHaveDirection: false,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: _otherToDoSwitch(1))), rightWidget: _otherToDoSwitch(1))),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '亮屏持续时间', leftTitel: '亮屏持续时间'.tr,
rightTitle: state.selectBrightDuration.value, rightTitle: state.selectBrightDuration.value,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
@ -73,14 +73,14 @@ class _CatEyeSetPageState extends State<CatEyeSetPage> {
_openBottomItemSheet(); _openBottomItemSheet();
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '逗留警告', leftTitel: '逗留警告'.tr,
rightTitle: "", rightTitle: "",
isHaveLine: true, isHaveLine: true,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: _otherToDoSwitch(2), rightWidget: _otherToDoSwitch(2),
)), )),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '异常警告', leftTitel: '异常警告'.tr,
rightTitle: "", rightTitle: "",
isHaveLine: true, isHaveLine: true,
isHaveRightWidget: true, isHaveRightWidget: true,

View File

@ -9,6 +9,7 @@ class CatEyeSetState {
var isExceptionWarning = false.obs; // var isExceptionWarning = false.obs; //
var lockSetInfoData = LockSetInfoData().obs; var lockSetInfoData = LockSetInfoData().obs;
var selectCatEyeWorkMode = ''.obs; // var selectCatEyeWorkMode = ''.obs; //
final String settingSuccess = '设置成功'.tr;
CatEyeSetState() { CatEyeSetState() {
Map map = Get.arguments; Map map = Get.arguments;

View File

@ -57,7 +57,7 @@ class LiveVideoLogic extends BaseGetXController {
], ],
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功'); showToast('设置成功'.tr);
Get.back(); Get.back();
} }
} }

View File

@ -25,7 +25,7 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: '添加家人', barTitle: '添加家人'.tr,
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Container( body: Container(
@ -33,8 +33,9 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
child: Column( child: Column(
children: [ children: [
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '开门方式', leftTitel: '开门方式'.tr,
rightTitle: state.lockUserKeys.value.currentKeyTypeStr ?? '请选择', rightTitle:
state.lockUserKeys.value.currentKeyTypeStr ?? '请选择'.tr,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
@ -48,7 +49,7 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
}); });
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '家人', leftTitel: '家人'.tr,
rightTitle: state.lockUserKeys.value.currentKeyName ?? '', rightTitle: state.lockUserKeys.value.currentKeyName ?? '',
isHaveLine: true, isHaveLine: true,
isHaveRightWidget: isHaveRightWidget:
@ -56,7 +57,7 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
? true ? true
: false, : false,
isHaveDirection: false, isHaveDirection: false,
rightWidget: getFamilyWidget('请输入'), rightWidget: getFamilyWidget('请输入'.tr),
)), )),
SizedBox( SizedBox(
height: 20.h, height: 20.h,
@ -67,7 +68,7 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
child: Column( child: Column(
children: [ children: [
CommonItem( CommonItem(
leftTitel: '提醒方式', leftTitel: '提醒方式'.tr,
rightTitle: "", rightTitle: "",
isHaveLine: false, isHaveLine: false,
isHaveRightWidget: false, isHaveRightWidget: false,
@ -85,7 +86,7 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
borderRadius: BorderRadius.circular(6.0.w), borderRadius: BorderRadius.circular(6.0.w),
), ),
child: Text( child: Text(
'APP推送 管理员', '${'APP推送'.tr} ${'管理员'.tr}',
style: TextStyle(color: Colors.black, fontSize: 20.sp), style: TextStyle(color: Colors.black, fontSize: 20.sp),
), ),
) )
@ -97,7 +98,7 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
height: 40.h, height: 40.h,
)), )),
SubmitBtn( SubmitBtn(
btnName: '保存', btnName: '保存'.tr,
isDisabled: false, isDisabled: false,
onClick: () {}, onClick: () {},
), ),

View File

@ -119,7 +119,7 @@ class _LockUserPageState extends State<LockUserPage> {
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
lockUserKeys.currentKeyName ?? '未知', lockUserKeys.currentKeyName ?? '',
style: TextStyle( style: TextStyle(
fontSize: 24.sp, color: AppColors.blackColor), fontSize: 24.sp, color: AppColors.blackColor),
), ),

View File

@ -13,14 +13,16 @@ class MsgNotificationLogic extends BaseGetXController {
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.msgNoticeInfo.value = entity.data!; state.msgNoticeInfo.value = entity.data!;
state.nDaysNotOpenDoor.value = state.nDaysNotOpenDoor.value = entity.data!.dayNotOpenDoorState! == 0
entity.data!.dayNotOpenDoorState! == 0 ? '未启用' : '已启用'; //N天未开门 ? state.notifyDisable
: state.notifyEnable; //N天未开门
state.isDoorNotShut.value = state.isDoorNotShut.value =
entity.data!.doorNotCloseState! == 0 ? false : true; // entity.data!.doorNotCloseState! == 0 ? false : true; //
state.isTamperAlarm.value = state.isTamperAlarm.value =
entity.data!.tamperAlarmState! == 0 ? false : true; // entity.data!.tamperAlarmState! == 0 ? false : true; //
state.isLowBattery.value = state.isLowBattery.value = entity.data!.lowElecNoticeState! == 0
entity.data!.lowElecNoticeState! == 0 ? '未启用' : '已启用'; // ? state.notifyDisable
: state.notifyEnable; //
state.isSomeoneRing.value = state.isSomeoneRing.value =
entity.data!.doorbellNoticeState! == 0 ? false : true; // entity.data!.doorbellNoticeState! == 0 ? false : true; //
state.isSomeoneAppeared.value = state.isSomeoneAppeared.value =
@ -36,7 +38,7 @@ class MsgNotificationLogic extends BaseGetXController {
doorNotCloseState: state.isDoorNotShut.value ? 1 : 0, doorNotCloseState: state.isDoorNotShut.value ? 1 : 0,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功'); showToast(state.settingSuccess);
} }
} }
@ -48,7 +50,7 @@ class MsgNotificationLogic extends BaseGetXController {
doorbellNoticeState: state.isSomeoneRing.value ? 1 : 0, doorbellNoticeState: state.isSomeoneRing.value ? 1 : 0,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功'); showToast(state.settingSuccess);
} }
} }
@ -60,7 +62,7 @@ class MsgNotificationLogic extends BaseGetXController {
someoneAtDoorNoticeState: state.isSomeoneAppeared.value ? 1 : 0, someoneAtDoorNoticeState: state.isSomeoneAppeared.value ? 1 : 0,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功'); showToast(state.settingSuccess);
} }
} }
@ -72,7 +74,7 @@ class MsgNotificationLogic extends BaseGetXController {
tamperAlarmState: state.isTamperAlarm.value ? 1 : 0, tamperAlarmState: state.isTamperAlarm.value ? 1 : 0,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功'); showToast(state.settingSuccess);
} }
} }
} }

View File

@ -12,11 +12,17 @@ class MsgNotificationState {
var isDoorNotShut = false.obs; // var isDoorNotShut = false.obs; //
var isSomeoneRing = false.obs; // var isSomeoneRing = false.obs; //
var isSomeoneAppeared = false.obs; // var isSomeoneAppeared = false.obs; //
final String notifyEnable = '已启用'.tr;
final String notifyDisable = '未启用'.tr;
final String settingSuccess = '设置成功'.tr;
MsgNotificationState() { MsgNotificationState() {
Map map = Get.arguments; Map map = Get.arguments;
if (map['lockId'] != null) { if (map['lockId'] != null) {
getLockId.value = map['lockId']; getLockId.value = map['lockId'];
} }
nDaysNotOpenDoor.value = notifyEnable;
isLowBattery.value = notifyEnable;
} }
} }