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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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