1、添加删除账号时切换邮箱手机功能。2、添加部分模块国际化

This commit is contained in:
魏少阳 2024-04-07 14:03:59 +08:00
parent c57426cbcc
commit b70327fda6
54 changed files with 815 additions and 590 deletions

View File

@ -1,5 +1,6 @@
{ {
"starLock":"Star Lock", "starLock":"Star Lock",
"lockThrough":"Lock Through",
"clickUnlockAndHoldDownClose":"Click To Unlock And Hold Down to Close", "clickUnlockAndHoldDownClose":"Click To Unlock And Hold Down to Close",
"checkingIn":"Checking In", "checkingIn":"Checking In",
"electronicKey":"Electronic Key", "electronicKey":"Electronic Key",
@ -202,7 +203,6 @@
"videoIntercomDoorLock":"Video intercom door lock", "videoIntercomDoorLock":"Video intercom door lock",
"NFCPassiveLock":"NFC Passive Lock", "NFCPassiveLock":"NFC Passive Lock",
"addDevice":"Add device", "addDevice":"Add device",
"shoppingCart":"Lock Mall",
"gateway":"Gateway", "gateway":"Gateway",
"message":"Message", "message":"Message",
"supportStaff":"Support Staff", "supportStaff":"Support Staff",
@ -476,5 +476,77 @@
"judgmentMethodContent": "The man stood outside the house, facing the entrance door. \nIf the hinge or shaft of the door is on the left, the door is left open; \nA door is right-open if its hinge or shaft is on the right. \nIf the setting is wrong, it will not open and close the door properly. \nRecommended to be operated by installation or maintenance personnel.", "judgmentMethodContent": "The man stood outside the house, facing the entrance door. \nIf the hinge or shaft of the door is on the left, the door is left open; \nA door is right-open if its hinge or shaft is on the right. \nIf the setting is wrong, it will not open and close the door properly. \nRecommended to be operated by installation or maintenance personnel.",
"customMode": "Custom mode", "customMode": "Custom mode",
"videoSlot": "Video slot" "videoSlot": "Video slot",
"密码":"Password",
"卡":"Card",
"指纹":"Fingerprint",
"人脸":"Face",
"配件商城":"Lock Mall",
"公司名称":"Company Name",
"修改公司名字":"Change company name",
"请输入公司名字":"Please nter the company name",
"提示":"Hint",
"是否删除?":"Whether to delete",
"员工信息":"Staff's Information",
"员工":"Staff",
"打卡方式无效":"The clocking method is invalid",
"中国":"China",
"选择钥匙":"Select the key",
"编辑":"Edit",
"无":"Unhave",
"有":"have",
"请输入姓名": "Please enter name",
"获取人脸":"Getting faces",
"选择密码":"Choosing a password",
"选择卡":"Select card",
"选择指纹":"Select fingerprint",
"选择人脸":"Select face",
"员工是否有人脸":"Whether the employee has a face",
"同时删除员工钥匙":"Also delete the employee key",
"删除":"Delet",
"确定要删除员工吗?":"Are you sure you want to delete the employee?",
"月统计":"Monthly statistics",
"迟到":"Be late",
"早退":"Leave early",
"未打卡":"No card punched",
"钥匙将在":"The key will be in",
"天后失效":"Days later invalid",
"锁更新时间:":"Lock update time:",
"新增配件":"Add accessories",
"请在锁旁边完成第一次开锁":"Please complete the first unlock next to the lock",
"正在开锁中...":"Unlocking...",
"你的钥匙": "Your key",
"常开模式启动!长按闭锁": "Open mode started! Long press to lock",
"演示模式": "Demo mode",
"请先同意用户协议及隐私政策": "Please agree to the user agreement and privacy policy first",
"用户协议": "User agreement",
"隐私政策": "Privacy policy",
"注册成功": "Registration success",
"你所在的": "You are in",
"手机号": "Mobile phone number",
"忘记密码": "Forget password",
"重置成功": "Reset success",
"确定要退出吗?": "Are you sure you want to exit?",
"功能暂未开放": "Function is not yet open",
"设置成功": "Set up successfully",
"删除成功": "Delete successfully",
"单次": "Once",
"永久": "Permanent",
"限时": "Time limit",
"自定义": "Custom",
"清空码": "Clear code",
"循环": "Cycle",
"工作日": "Workday",
"周末": "Weekend",
"周一": "Monday",
"周二": "Tuesday",
"周三": "Wednesday",
"周四": "Thursday",
"周五": "Friday",
"周六": "Saturday",
"周日": "Sunday",
"确定要删除吗?": "Are you sure you want to delete?",
"该锁的密码都将被删除": "The password of the lock will be deleted",
"已过期": "Expired"
} }

View File

@ -1,5 +1,6 @@
{ {
"starLock":"starLock", "starLock":"starLock",
"lockThrough":"lockThrough",
"clickUnlockAndHoldDownClose":"clickUnlockAndHoldDownClose", "clickUnlockAndHoldDownClose":"clickUnlockAndHoldDownClose",
"checkingIn":"checkingIn", "checkingIn":"checkingIn",
"electronicKey":"electronicKey", "electronicKey":"electronicKey",
@ -202,7 +203,6 @@
"videoIntercomDoorLock":"videoIntercomDoorLock", "videoIntercomDoorLock":"videoIntercomDoorLock",
"NFCPassiveLock":"NFCPassiveLock", "NFCPassiveLock":"NFCPassiveLock",
"addDevice":"addDevice", "addDevice":"addDevice",
"shoppingCart":"shoppingCart",
"gateway":"gateway", "gateway":"gateway",
"message":"message", "message":"message",
"supportStaff":"supportStaff", "supportStaff":"supportStaff",
@ -476,5 +476,78 @@
"judgmentMethodContent": "judgmentMethodContent", "judgmentMethodContent": "judgmentMethodContent",
"customMode": "customMode", "customMode": "customMode",
"videoSlot": "videoSlot" "videoSlot": "videoSlot",
"密码":"密码",
"卡":"卡",
"指纹":"指纹",
"人脸":"人脸",
"配件商城":"配件商城",
"公司名称":"公司名称",
"修改公司名字":"修改公司名字",
"请输入公司名字":"请输入公司名字",
"提示":"提示",
"是否删除?":"是否删除?",
"员工信息":"员工信息",
"员工":"员工",
"打卡方式无效":"打卡方式无效",
"中国":"中国",
"选择钥匙":"选择钥匙",
"编辑":"编辑",
"无":"无",
"有":"有",
"请输入姓名":"请输入姓名",
"获取人脸":"获取人脸",
"选择密码":"选择密码",
"选择卡":"选择卡",
"选择指纹":"选择指纹",
"选择人脸":"选择人脸",
"员工是否有人脸":"员工是否有人脸",
"同时删除员工钥匙":"同时删除员工钥匙",
"删除":"删除",
"打卡方式无效":"打卡方式无效",
"确定要删除员工吗?":"确定要删除员工吗?",
"月统计":"月统计",
"迟到":"迟到",
"早退":"早退",
"未打卡":"未打卡",
"钥匙将在":"钥匙将在",
"天后失效":"天后失效",
"锁更新时间:":"锁更新时间:",
"新增配件":"新增配件",
"请在锁旁边完成第一次开锁":"请在锁旁边完成第一次开锁",
"正在开锁中...":"正在开锁中...",
"你的钥匙": "你的钥匙",
"常开模式启动!长按闭锁": "常开模式启动!长按闭锁",
"演示模式": "演示模式",
"请先同意用户协议及隐私政策": "请先同意用户协议及隐私政策",
"用户协议": "用户协议",
"隐私政策": "隐私政策",
"注册成功": "注册成功",
"你所在的": "你所在的",
"手机号": "公司已经开通了",
"忘记密码": "忘记密码",
"重置成功": "重置成功",
"确定要退出吗?": "确定要退出吗?",
"功能暂未开放": "功能暂未开放",
"设置成功": "设置成功",
"删除成功": "删除成功",
"单次": "单次",
"永久": "永久",
"限时": "限时",
"自定义": "自定义",
"清空码": "清空码",
"循环": "循环",
"工作日": "工作日",
"周末": "周末",
"周一": "周一",
"周二": "周二",
"周三": "周三",
"周四": "周四",
"周五": "周五",
"周六": "周六",
"周日": "周日",
"确定要删除吗?": "确定要删除吗?",
"该锁的密码都将被删除": "该锁的密码都将被删除",
"已过期": "已过期"
} }

View File

@ -1,5 +1,6 @@
{ {
"starLock":"星锁", "starLock":"星锁",
"lockThrough":"锁通通",
"clickUnlockAndHoldDownClose":"点击开锁,长按闭锁", "clickUnlockAndHoldDownClose":"点击开锁,长按闭锁",
"checkingIn":"考勤", "checkingIn":"考勤",
"electronicKey":"电子钥匙", "electronicKey":"电子钥匙",
@ -202,7 +203,6 @@
"videoIntercomDoorLock":"可视对讲门锁", "videoIntercomDoorLock":"可视对讲门锁",
"NFCPassiveLock":"NFC无源锁", "NFCPassiveLock":"NFC无源锁",
"addDevice":"添加设备", "addDevice":"添加设备",
"shoppingCart":"配件商城",
"gateway":"网关", "gateway":"网关",
"message":"消息", "message":"消息",
"supportStaff":"客服", "supportStaff":"客服",
@ -479,5 +479,76 @@
"judgmentMethodContent": "人站在屋外,面向入户门。\n如果门的合页或门轴在左边则门是左开\n如果门的合页或门轴在右边则门是右开。\n如果设置错误将无法正常开关门。\n建议由安装或维修人员操作。", "judgmentMethodContent": "人站在屋外,面向入户门。\n如果门的合页或门轴在左边则门是左开\n如果门的合页或门轴在右边则门是右开。\n如果设置错误将无法正常开关门。\n建议由安装或维修人员操作。",
"customMode": "自定义模式", "customMode": "自定义模式",
"videoSlot": "录像时段" "videoSlot": "录像时段",
"密码":"密码",
"卡":"卡",
"指纹":"指纹",
"人脸":"人脸",
"配件商城":"配件商城",
"公司名称":"公司名称",
"修改公司名字":"修改公司名字",
"请输入公司名字":"请输入公司名字",
"提示":"提示",
"是否删除?":"是否删除?",
"员工信息":"员工信息",
"员工":"员工",
"打卡方式无效":"打卡方式无效",
"中国":"中国",
"选择钥匙":"选择钥匙",
"编辑":"编辑",
"无":"无",
"有":"有",
"请输入姓名":"请输入姓名",
"获取人脸":"获取人脸",
"选择密码":"选择密码",
"选择卡":"选择卡",
"选择指纹":"选择指纹",
"选择人脸":"选择人脸",
"员工是否有人脸":"员工是否有人脸",
"同时删除员工钥匙":"同时删除员工钥匙",
"删除":"删除",
"确定要删除员工吗?":"确定要删除员工吗?",
"月统计":"月统计",
"迟到":"迟到",
"早退":"早退",
"钥匙将在":"钥匙将在",
"天后失效":"天后失效",
"锁更新时间:":"锁更新时间:",
"新增配件":"新增配件",
"请在锁旁边完成第一次开锁":"请在锁旁边完成第一次开锁",
"正在开锁中...":"正在开锁中...",
"你的钥匙": "你的钥匙",
"常开模式启动!长按闭锁": "常开模式启动!长按闭锁",
"演示模式": "演示模式",
"请先同意用户协议及隐私政策": "请先同意用户协议及隐私政策",
"用户协议": "用户协议",
"隐私政策": "隐私政策",
"注册成功": "注册成功",
"你所在的": "你所在的",
"手机号": "公司已经开通了",
"忘记密码": "忘记密码",
"重置成功": "重置成功",
"确定要退出吗?": "确定要退出吗?",
"功能暂未开放": "功能暂未开放",
"设置成功": "设置成功",
"删除成功": "删除成功",
"单次": "单次",
"永久": "永久",
"限时": "限时",
"自定义": "自定义",
"清空码": "清空码",
"循环": "循环",
"工作日": "工作日",
"周末": "周末",
"周一": "周一",
"周二": "周二",
"周三": "周三",
"周四": "周四",
"周五": "周五",
"周六": "周六",
"周日": "周日",
"确定要删除吗?": "确定要删除吗?",
"该锁的密码都将被删除": "该锁的密码都将被删除",
"已过期": "已过期"
} }

View File

@ -45,6 +45,8 @@ class SenderAddFingerprintCommand extends SenderProtocol {
List<int> subData = []; List<int> subData = [];
List<int> ebcData = []; List<int> ebcData = [];
print("pwdNopwdNopwdNopwdNo:$fingerNo");
// //
int type = commandType!.typeValue; int type = commandType!.typeValue;
double typeDouble = type / 256; double typeDouble = type / 256;

View File

@ -46,6 +46,8 @@ class SenderCustomPasswordsCommand extends SenderProtocol {
List<int> subData = []; List<int> subData = [];
List<int> ebcData = []; List<int> ebcData = [];
// print("pwdNopwdNopwdNopwdNo:$pwdNo");
// //
int type = commandType!.typeValue; int type = commandType!.typeValue;
double typeDouble = type / 256; double typeDouble = type / 256;

View File

@ -1,3 +1,5 @@
import 'package:get/get.dart';
enum Flavor { enum Flavor {
xie, xie,
dev, dev,
@ -41,11 +43,11 @@ class F {
static String get navTitle { static String get navTitle {
switch (appFlavor) { switch (appFlavor) {
case Flavor.xie: case Flavor.xie:
return '星锁-xie'; return '${"starLock".tr}-xie';
case Flavor.dev: case Flavor.dev:
return '星锁-dev'; return '${"starLock".tr}-dev';
case Flavor.pre: case Flavor.pre:
return '星锁'; return "starLock".tr;
case Flavor.sky: case Flavor.sky:
return '锁通通'; return '锁通通';
case Flavor.xhj: case Flavor.xhj:

View File

@ -37,10 +37,8 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
"B748F838-94EE-4BDB-A0E6-7B2D16849792", "B748F838-94EE-4BDB-A0E6-7B2D16849792",
state.verificationCode.value); state.verificationCode.value);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("重置成功"); showToast("重置成功".tr);
Get.back(); Get.back();
} else {
print('Error');
} }
} }
@ -54,7 +52,7 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
xWidth:state.xWidth.value.toString()); xWidth:state.xWidth.value.toString());
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
_startTimer(); _startTimer();
} else {} }
} }
void checkNext(TextEditingController controller) { void checkNext(TextEditingController controller) {
@ -85,6 +83,5 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
void _resetCanSub() { void _resetCanSub() {
state.canSub.value = state.pwdIsOK && state.codeIsOK; state.canSub.value = state.pwdIsOK && state.codeIsOK;
print("22222:${state.canSub.value}");
} }
} }

View File

@ -32,8 +32,7 @@ class _StarLockForgetPasswordPageState
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
backgroundColor: const Color(0xFFFFFFFF), backgroundColor: const Color(0xFFFFFFFF),
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: barTitle: "忘记密码".tr,
"忘记密码",
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: ListView( body: ListView(
@ -196,8 +195,8 @@ class _StarLockForgetPasswordPageState
: null, : null,
child: Container( child: Container(
width: 180.w, width: 180.w,
height: 60.h, // height: 60.h,
padding: EdgeInsets.all(5.h), padding: EdgeInsets.all(10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: state.phoneStrIsOK.value color: state.phoneStrIsOK.value
? AppColors.mainColor ? AppColors.mainColor

View File

@ -15,7 +15,7 @@ class StarLockForgetPasswordState {
} }
var countryCode = "86".obs; var countryCode = "86".obs;
var countryName = '中国'.obs; var countryName = '中国'.tr.obs;
var codeType = '2'.obs; // 1: 2: var codeType = '2'.obs; // 1: 2:
var pwd = ''.obs; var pwd = ''.obs;
var surePwd = ''.obs; var surePwd = ''.obs;

View File

@ -1,4 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -8,7 +8,6 @@ import 'package:star_lock/flavors.dart';
import '../../appRouters.dart'; import '../../appRouters.dart';
import '../../app_settings/app_colors.dart'; import '../../app_settings/app_colors.dart';
import '../../common/XSConstantMacro/XSConstantMacro.dart'; import '../../common/XSConstantMacro/XSConstantMacro.dart';
import '../../tools/commonItem.dart';
import '../../tools/tf_loginInput.dart'; import '../../tools/tf_loginInput.dart';
import '../../tools/submitBtn.dart'; import '../../tools/submitBtn.dart';
import '../../tools/titleAppBar.dart'; import '../../tools/titleAppBar.dart';
@ -141,7 +140,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
onTap: () { onTap: () {
Get.toNamed(Routers.webviewShowPage, arguments: { Get.toNamed(Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.userAgreementURL, "url": XSConstantMacro.userAgreementURL,
"title": '用户协议' "title": '用户协议'.tr
}); });
}, },
)), )),
@ -156,7 +155,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
onTap: () { onTap: () {
Get.toNamed(Routers.webviewShowPage, arguments: { Get.toNamed(Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.privacyPolicyURL, "url": XSConstantMacro.privacyPolicyURL,
"title": '隐私政策' "title": '隐私政策'.tr
}); });
}, },
)), )),
@ -175,7 +174,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
onClick: state.canNext.value onClick: state.canNext.value
? () { ? () {
if (state.agree.value == false) { if (state.agree.value == false) {
logic.showToast('请先同意用户协议及隐私政策'); logic.showToast('请先同意用户协议及隐私政策'.tr);
return; return;
} else { } else {
logic.login(); logic.login();
@ -215,7 +214,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
height: 50.h, height: 50.h,
// color: Colors.red, // color: Colors.red,
child: Center( child: Center(
child: Text('演示模式', child: Text('演示模式'.tr,
style: TextStyle( style: TextStyle(
fontSize: 22.sp, fontSize: 22.sp,
color: AppColors.mainColor)), color: AppColors.mainColor)),

View File

@ -36,9 +36,7 @@ class StarLockRegisterLogic extends BaseGetXController {
password: state.pwd.value, password: state.pwd.value,
verificationCode: state.verificationCode.value); verificationCode: state.verificationCode.value);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
// await loginSuccess(loginEntity: entity); showToast("注册成功".tr);
// Toast.show(msg: "注册成功");
showToast("注册成功");
Get.back(result:{ Get.back(result:{
"phoneOrEmailStr":state.phoneOrEmailStr.value, "phoneOrEmailStr":state.phoneOrEmailStr.value,
"pwd":state.pwd.value "pwd":state.pwd.value

View File

@ -51,7 +51,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
onClick: state.canSub.value onClick: state.canSub.value
? () { ? () {
if (state.agree.value == false) { if (state.agree.value == false) {
logic.showToast('请先同意用户协议及隐私政策'); logic.showToast('请先同意用户协议及隐私政策'.tr);
return; return;
} else { } else {
logic.register(); logic.register();
@ -158,7 +158,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
children: [ children: [
SizedBox(width: 5.w), SizedBox(width: 5.w),
Expanded( Expanded(
child: Text("你所在的${TranslationLoader.lanKeys!.countryAndRegion!.tr}", child: Text("${"你所在的".tr}${TranslationLoader.lanKeys!.countryAndRegion!.tr}",
style: TextStyle( style: TextStyle(
fontSize: 26.sp, color: AppColors.blackColor))), fontSize: 26.sp, color: AppColors.blackColor))),
SizedBox(width: 20.w), SizedBox(width: 20.w),
@ -211,7 +211,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
height: 30.w, height: 30.w,
), ),
), ),
hintText: "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${state.isIphoneType.value ? "手机号" : TranslationLoader.lanKeys!.email!.tr}", hintText: "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${state.isIphoneType.value ? "手机号".tr : TranslationLoader.lanKeys!.email!.tr}",
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
inputFormatters: [ inputFormatters: [
// FilteringTextInputFormatter.allow(RegExp('[0-9]')), // FilteringTextInputFormatter.allow(RegExp('[0-9]')),
@ -305,8 +305,8 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
: null, : null,
child: Container( child: Container(
width: 180.w, width: 180.w,
height: 60.h, // height: 60.h,
padding: EdgeInsets.all(5.h), padding: EdgeInsets.all(10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: state.phoneOrEmailStrIsOK.value color: state.phoneOrEmailStrIsOK.value
? AppColors.mainColor ? AppColors.mainColor
@ -364,7 +364,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
onTap: () { onTap: () {
Get.toNamed(Routers.webviewShowPage, arguments: { Get.toNamed(Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.userAgreementURL, "url": XSConstantMacro.userAgreementURL,
"title": '用户协议' "title": '用户协议'.tr
}); });
}, },
)), )),
@ -378,7 +378,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
onTap: () { onTap: () {
Get.toNamed(Routers.webviewShowPage, arguments: { Get.toNamed(Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.privacyPolicyURL, "url": XSConstantMacro.privacyPolicyURL,
"title": '隐私政策' "title": '隐私政策'.tr
}); });
}, },
)), )),

View File

@ -11,7 +11,7 @@ class StarLockRegisterState {
final TextEditingController codeController = TextEditingController(); final TextEditingController codeController = TextEditingController();
var countryCode = 86.obs; var countryCode = 86.obs;
var countryName = '中国'.obs; var countryName = '中国'.tr.obs;
var phoneOrEmailStr = ''.obs; var phoneOrEmailStr = ''.obs;
var phoneOrEmailStrIsOK = false.obs; var phoneOrEmailStrIsOK = false.obs;

View File

@ -78,80 +78,85 @@ class _SelectCountryRegionPageState extends State<SelectCountryRegionPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return GestureDetector(
resizeToAvoidBottomInset: false, onTap: (){
backgroundColor: const Color(0xFFFFFFFF), FocusScope.of(context).unfocus();
appBar: TitleAppBar( },
barTitle: child: Scaffold(
"${TranslationLoader.lanKeys!.select!.tr} ${TranslationLoader.lanKeys!.countryAndRegion!.tr}", resizeToAvoidBottomInset: false,
haveBack: true, backgroundColor: const Color(0xFFFFFFFF),
backgroundColor: AppColors.mainColor, appBar: TitleAppBar(
), barTitle:
body: Column( "${TranslationLoader.lanKeys!.select!.tr} ${TranslationLoader.lanKeys!.countryAndRegion!.tr}",
children: [ haveBack: true,
KeySearchWidget( backgroundColor: AppColors.mainColor,
editingController: searchController, ),
backgroundColor: AppColors.mainBackgroundColor, body: Column(
onSubmittedAction: () { children: [
if(searchController.text.isEmpty){ KeySearchWidget(
getCountriesListRequest(); editingController: searchController,
}else{ backgroundColor: AppColors.mainBackgroundColor,
var searchList = <CountryRegionModel>[]; onSubmittedAction: () {
for (int i = 0, length = countriesList.length; i < length; i++) { if(searchController.text.isEmpty){
CountryRegionModel countryModel = countriesList[i]; getCountriesListRequest();
if(countryModel.name!.contains(searchController.text) || countryModel.code!.contains(searchController.text)){ }else{
searchList.add(countryModel); var searchList = <CountryRegionModel>[];
Get.log('countryModel.name:${countryModel.name} countryModel.code:${countryModel.code}'); for (int i = 0, length = countriesList.length; i < length; i++) {
CountryRegionModel countryModel = countriesList[i];
if(countryModel.name!.contains(searchController.text) || countryModel.code!.contains(searchController.text)){
searchList.add(countryModel);
Get.log('countryModel.name:${countryModel.name} countryModel.code:${countryModel.code}');
}
} }
countriesList= searchList;
Get.log('searchList.length:${searchList.length}');
_handleList(searchList);
} }
countriesList= searchList; setState(() {});
Get.log('searchList.length:${searchList.length}');
_handleList(searchList);
}
setState(() {});
},
),
SizedBox(height:20.h),
Visibility(
visible: searchController.text.isEmpty,
child: Utils.getSusItem(context, '')
),
countriesList.isNotEmpty ? Visibility(
visible: searchController.text.isEmpty,
child: Utils.getListItem(context, topCountriesList[0], () {
CountryRegionModel model = topCountriesList[0];
Map<String, dynamic> resultMap = {};
resultMap['code'] = model.code ?? '';
resultMap['countryId'] = model.countryId.toString() ?? '';
resultMap['countryName'] = model.name ?? '' ;
Navigator.pop(context, resultMap);
})
): Container(),
Expanded(
child: AzListView(
data: countriesList,
itemCount: countriesList.length,
itemBuilder: (BuildContext context, int index) {
CountryRegionModel model = countriesList[index];
return Utils.getListItem(context, model, () {
Map<String, dynamic> resultMap = {};
resultMap['code'] = model.code;
resultMap['countryId'] = model.countryId.toString();
resultMap['countryName'] = model.name;
print("model.name:${model.name} model.code:${model.code} model.countryId:${model.countryId} model.flag:${model.flag} model.group:${model.group} model.tagIndex:${model.tagIndex}");
Navigator.pop(context, resultMap);
});
}, },
padding: EdgeInsets.zero,
susItemBuilder: (BuildContext context, int index) {
CountryRegionModel model = countriesList[index];
String tag = model.getSuspensionTag();
return Utils.getSusItem(context, tag);
},
indexBarData: const ['', ...kIndexBarData],
), ),
), SizedBox(height:20.h),
], Visibility(
visible: searchController.text.isEmpty,
child: Utils.getSusItem(context, '')
),
countriesList.isNotEmpty ? Visibility(
visible: searchController.text.isEmpty,
child: Utils.getListItem(context, topCountriesList[0], () {
CountryRegionModel model = topCountriesList[0];
Map<String, dynamic> resultMap = {};
resultMap['code'] = model.code ?? '';
resultMap['countryId'] = model.countryId.toString() ?? '';
resultMap['countryName'] = model.name ?? '' ;
Navigator.pop(context, resultMap);
})
): Container(),
Expanded(
child: AzListView(
data: countriesList,
itemCount: countriesList.length,
itemBuilder: (BuildContext context, int index) {
CountryRegionModel model = countriesList[index];
return Utils.getListItem(context, model, () {
Map<String, dynamic> resultMap = {};
resultMap['code'] = model.code;
resultMap['countryId'] = model.countryId.toString();
resultMap['countryName'] = model.name;
print("model.name:${model.name} model.code:${model.code} model.countryId:${model.countryId} model.flag:${model.flag} model.group:${model.group} model.tagIndex:${model.tagIndex}");
Navigator.pop(context, resultMap);
});
},
padding: EdgeInsets.zero,
susItemBuilder: (BuildContext context, int index) {
CountryRegionModel model = countriesList[index];
String tag = model.getSuspensionTag();
return Utils.getSusItem(context, tag);
},
indexBarData: const ['', ...kIndexBarData],
),
),
],
),
), ),
); );
} }

View File

@ -83,7 +83,7 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: "张三", barTitle: state.staffName.value,
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: SingleChildScrollView( body: SingleChildScrollView(
@ -309,7 +309,7 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
padding: EdgeInsets.only(left: 50.w, top: 5.h, bottom: 5.h), padding: EdgeInsets.only(left: 50.w, top: 5.h, bottom: 5.h),
color: Colors.grey, color: Colors.grey,
child: Text( child: Text(
"月统计", "月统计".tr,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 26.sp, fontSize: 26.sp,
@ -318,9 +318,9 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
), ),
], ],
), ),
_bottomStatisticsItemWidget(const Color(0xFFE83523), "迟到", state.lateTimes.value), _bottomStatisticsItemWidget(const Color(0xFFE83523), "迟到".tr, state.lateTimes.value),
_bottomStatisticsItemWidget(const Color(0xFFEDB459), "早退", state.earlyTimes.value), _bottomStatisticsItemWidget(const Color(0xFFEDB459), "早退".tr, state.earlyTimes.value),
_bottomStatisticsItemWidget(const Color(0xFF666666), "未打卡", state.noPunchTimes.value), _bottomStatisticsItemWidget(const Color(0xFF666666), "未打卡".tr, state.noPunchTimes.value),
], ],
); );
} }

View File

@ -8,6 +8,7 @@ class CheckingInDetailState{
// final getKeyInfosData = LockListInfoItemEntity().obs; // final getKeyInfosData = LockListInfoItemEntity().obs;
final companyId = "".obs; final companyId = "".obs;
final staffId = 0.obs; final staffId = 0.obs;
final staffName = "".obs;
final checkDate = DateTime.now().millisecondsSinceEpoch.obs; final checkDate = DateTime.now().millisecondsSinceEpoch.obs;
@ -17,9 +18,15 @@ class CheckingInDetailState{
final monthListData = <MonthList>[].obs; final monthListData = <MonthList>[].obs;
CheckingInDetailState() { CheckingInDetailState() {
Map map = Get.arguments; Map map = Get.arguments;
// getKeyInfosData.value = map["getKeyInfosData"]; if(companyId.value.isEmpty && map["companyId"] != null){
companyId.value = map["companyId"]; companyId.value = map["companyId"];
staffId.value = map["staffId"]; }
if(map["staffId"] != null){
staffId.value = map["staffId"];
}
if(staffName.value.isEmpty && map["staffName"] != null){
staffName.value = map["staffName"];
}
} }
} }

View File

@ -110,12 +110,13 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
}, },
child: Container( child: Container(
width: 90.w, width: 90.w,
height: 70.h, // height: 100.h,
color: Colors.white, color: Colors.white,
child: Obx(() => Column( child: Obx(() => Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Text(TranslationLoader.lanKeys!.dailyCharts!.tr, style: TextStyle(color: state.isDay.value ? AppColors.mainColor : Colors.black, fontSize: 22.sp)), Text(TranslationLoader.lanKeys!.dailyCharts!.tr, style: TextStyle(color: state.isDay.value ? AppColors.mainColor : Colors.black, fontSize: 22.sp)),
SizedBox(height: 10.h),
Visibility( Visibility(
visible: state.isDay.value, visible: state.isDay.value,
child: Container( child: Container(
@ -147,12 +148,13 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
}, },
child: Container( child: Container(
width: 90.w, width: 90.w,
height: 70.h, // height: 100.h,
color: Colors.white, color: Colors.white,
child: Obx(() => Column( child: Obx(() => Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Text(TranslationLoader.lanKeys!.monthlyLeaderboard!.tr, style: TextStyle(color: !state.isDay.value ? AppColors.mainColor : Colors.black, fontSize: 22.sp)), Text(TranslationLoader.lanKeys!.monthlyLeaderboard!.tr, style: TextStyle(color: !state.isDay.value ? AppColors.mainColor : Colors.black, fontSize: 22.sp)),
SizedBox(height: 10.h),
Visibility( Visibility(
visible: !state.isDay.value, visible: !state.isDay.value,
child: Container(width: 20.w, height: 2.h, color: !state.isDay.value ? AppColors.mainColor : Colors.black)) child: Container(width: 20.w, height: 2.h, color: !state.isDay.value ? AppColors.mainColor : Colors.black))
@ -259,11 +261,12 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
itemCount: state.checkingInDayListData.value.length, itemCount: state.checkingInDayListData.value.length,
itemBuilder: (c, index) { itemBuilder: (c, index) {
AttendanceRecordDayList attendanceRecordList= state.checkingInDayListData.value[index]; AttendanceRecordDayList attendanceRecordList= state.checkingInDayListData.value[index];
return _checkingInListItem(index, attendanceRecordList.headurl, attendanceRecordList.staffName,() { return _checkingInListItem(index, attendanceRecordList.headurl, attendanceRecordList.staffName, () {
Get.toNamed(Routers.checkingInDetailPage, arguments: { Get.toNamed(Routers.checkingInDetailPage, arguments: {
// "getKeyInfosData": state.getKeyInfosData.value, // "getKeyInfosData": state.getKeyInfosData.value,
"companyId": state.companyId.value, "companyId": state.companyId.value,
"staffId": attendanceRecordList.staffId, "staffId": attendanceRecordList.staffId,
"staffName": attendanceRecordList.staffName,
}); });
}); });
}, },
@ -280,9 +283,9 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
AttendanceRecordMonthList attendanceRecordList= state.checkingInMonthListData.value[index]; AttendanceRecordMonthList attendanceRecordList= state.checkingInMonthListData.value[index];
return _checkingInListItem(index, attendanceRecordList.headurl, attendanceRecordList.staffName, () { return _checkingInListItem(index, attendanceRecordList.headurl, attendanceRecordList.staffName, () {
Get.toNamed(Routers.checkingInDetailPage, arguments: { Get.toNamed(Routers.checkingInDetailPage, arguments: {
"getKeyInfosData": state.getKeyInfosData.value,
"companyId": state.companyId.value, "companyId": state.companyId.value,
"staffId": attendanceRecordList.staffId, "staffId": attendanceRecordList.staffId,
"staffName": attendanceRecordList.staffName,
}); });
}); });
}, },
@ -348,8 +351,8 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
} }
}, },
child: Obx(() => Container( child: Obx(() => Container(
width: 200.w, // width: 200.w,
height: 60.h, // height: 60.h,
color: AppColors.mainColor, color: AppColors.mainColor,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

View File

@ -8,6 +8,7 @@ import 'package:star_lock/app_settings/app_colors.dart';
import '../../../../appRouters.dart'; import '../../../../appRouters.dart';
import '../../../../tools/commonItem.dart'; import '../../../../tools/commonItem.dart';
import '../../../../tools/showTFView.dart'; import '../../../../tools/showTFView.dart';
import '../../../../tools/showTipView.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../translations/trans_lib.dart';
@ -37,7 +38,7 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
children: [ children: [
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: leftTitel:
"公司名称", "公司名称".tr,
// rightTitle: state.companyName.value ?? "", // rightTitle: state.companyName.value ?? "",
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: getTFWidget(), rightWidget: getTFWidget(),
@ -119,14 +120,17 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
visible: state.getKeyInfosData.value.isLockOwner == 1, visible: state.getKeyInfosData.value.isLockOwner == 1,
child: SubmitBtn( child: SubmitBtn(
btnName: btnName:
"${TranslationLoader.lanKeys!.delete!.tr}${TranslationLoader.lanKeys!.company!.tr}", "${TranslationLoader.lanKeys!.delete!.tr} ${TranslationLoader.lanKeys!.company!.tr}",
borderRadius: 20.w, borderRadius: 20.w,
fontSize: 32.sp, fontSize: 32.sp,
isDelete: true, isDelete: true,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w), margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w),
padding: EdgeInsets.only(top: 20.w, bottom: 20.w), padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
onClick: () { onClick: () {
showDeletCompanyAlertDialog(context); ShowTipView().showIosTipWithContentDialog("是否删除?".tr, () {
logic.deletCompanyData();
});
// showDeletCompanyAlertDialog(context);
}), }),
), ),
], ],
@ -139,12 +143,12 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return ShowTFView( return ShowTFView(
title: "修改公司名字", title: "修改公司名字".tr,
tipTitle: "", tipTitle: "",
controller: state.changeNameController, controller: state.changeNameController,
sureClick: () { sureClick: () {
if(state.changeNameController.text.isEmpty){ if(state.changeNameController.text.isEmpty){
logic.showToast("请输入公司名字"); logic.showToast("请输入公司名字".tr);
return; return;
} }
Get.back(); Get.back();
@ -202,30 +206,4 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
); );
} }
void showDeletCompanyAlertDialog(context) {
showCupertinoDialog(
context: context,
builder: (context) {
return CupertinoAlertDialog(
title: const Text("提示"),
content: const Text('是否删除?'),
actions: [
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
onPressed: () {
Get.back();
},
),
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.sure!.tr),
onPressed: () {
Get.back();
logic.deletCompanyData();
},
),
],
);
},
);
}
} }

View File

@ -106,7 +106,7 @@ class CheckingInAddStaffLogic extends BaseGetXController{
isCoerced: 1); isCoerced: 1);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print('获取密码成功'); // print('获取密码成功');
if (entity.data != null) { if (entity.data != null) {
state.attendanceWayNumber.value = entity.data!.keyboardPwd!; state.attendanceWayNumber.value = entity.data!.keyboardPwd!;
isCanClickAction(); isCanClickAction();
@ -134,7 +134,7 @@ class CheckingInAddStaffLogic extends BaseGetXController{
}else{ }else{
state.isCanClick.value = state.staffNameIsNotEmpty && state.attendanceWayNumberIsNotEmpty; state.isCanClick.value = state.staffNameIsNotEmpty && state.attendanceWayNumberIsNotEmpty;
} }
print("state.isCanClick.value = ${state.isCanClick.value}"); // print("state.isCanClick.value = ${state.isCanClick.value}");
} }
@override @override

View File

@ -29,7 +29,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: barTitle:
"${state.isAdd.value == "1" ? TranslationLoader.lanKeys!.add!.tr : "编辑"}${TranslationLoader.lanKeys!.staff!.tr}", "${state.isAdd.value == "1" ? TranslationLoader.lanKeys!.add!.tr : "编辑".tr}${TranslationLoader.lanKeys!.staff!.tr}",
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Column( body: Column(
@ -50,11 +50,11 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
var list = ["APP", "密码", "", "指纹"]; var list = ["APP", "密码".tr, "".tr, "指纹".tr];
if(state.getKeyInfosData.value.lockName!.contains("T9A")){ if(state.getKeyInfosData.value.lockName!.contains("T9A")){
list.add("人脸"); list.add("人脸".tr);
} }
_showSelectClockInType(list, list, "1", "选择钥匙"); _showSelectClockInType(list, list, "1", "选择钥匙".tr);
})), })),
SizedBox(height: 10.h), SizedBox(height: 10.h),
//App //App
@ -65,7 +65,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: Row( rightWidget: Row(
children: [ children: [
whetherTheEmployeeHasAKeyWidget("", state.appUnHaveAccount.value, () { whetherTheEmployeeHasAKeyWidget("".tr, state.appUnHaveAccount.value, () {
setState(() { setState(() {
state.appUnHaveAccount.value = true; state.appUnHaveAccount.value = true;
state.attendanceWayNumber.value = ""; state.attendanceWayNumber.value = "";
@ -75,7 +75,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
SizedBox( SizedBox(
width: 30.w, width: 30.w,
), ),
whetherTheEmployeeHasAKeyWidget("", !state.appUnHaveAccount.value, () { whetherTheEmployeeHasAKeyWidget("".tr, !state.appUnHaveAccount.value, () {
setState(() { setState(() {
state.appUnHaveAccount.value = false; state.appUnHaveAccount.value = false;
state.attendanceWayNumber.value = ""; state.attendanceWayNumber.value = "";
@ -95,7 +95,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
isHaveLine: true, isHaveLine: true,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: getTFWidget( rightWidget: getTFWidget(
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}员工${TranslationLoader.lanKeys!.accountNumber!.tr}", "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${"员工".tr}${TranslationLoader.lanKeys!.accountNumber!.tr}",
state.staffAccountController)), state.staffAccountController)),
CommonItem( CommonItem(
leftTitel: leftTitel:
@ -146,7 +146,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
case 3: case 3:
// //
if (state.staffNameController.text.isEmpty) { if (state.staffNameController.text.isEmpty) {
logic.showToast("请输入姓名"); logic.showToast("请输入姓名".tr);
return; return;
} }
@ -164,7 +164,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
case 4: case 4:
// //
if (state.staffNameController.text.isEmpty) { if (state.staffNameController.text.isEmpty) {
logic.showToast("请输入姓名"); logic.showToast("请输入姓名".tr);
return; return;
} }
@ -308,7 +308,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
state.attendanceWayNumber.value = numberList[index].toString(); state.attendanceWayNumber.value = numberList[index].toString();
} }
logic.isCanClickAction(); logic.isCanClickAction();
print("object:$index str:$str type:$showBottomSheetToolType state.selectPrintingMethodType.value:${state.selectPrintingMethodType.value}"); // print("object:$index str:$str type:$showBottomSheetToolType state.selectPrintingMethodType.value:${state.selectPrintingMethodType.value}");
}); });
}); });
} }
@ -361,7 +361,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
title = TranslationLoader.lanKeys!.whetherTheEmployeeHasFingerprint!.tr; title = TranslationLoader.lanKeys!.whetherTheEmployeeHasFingerprint!.tr;
break; break;
case 4: case 4:
title = "员工是否有人脸"; title = "员工是否有人脸".tr;
break; break;
} }
return title; return title;
@ -405,7 +405,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
title = TranslationLoader.lanKeys!.getFingerprint!.tr; title = TranslationLoader.lanKeys!.getFingerprint!.tr;
break; break;
case 5: case 5:
title = "获取人脸"; title = "获取人脸".tr;
break; break;
} }
return title; return title;

View File

@ -17,7 +17,7 @@ class CheckingInAddStaffState{
final selectPrintingMethodType = "1".obs;// 1APP 2 3 4 5 final selectPrintingMethodType = "1".obs;// 1APP 2 3 4 5
final selectPrintingMethodStr = "APP".obs;// final selectPrintingMethodStr = "APP".obs;//
final countryName = "中国".obs; final countryName = "中国".tr.obs;
final countryCode = "86".obs; final countryCode = "86".obs;
final appUnHaveAccount = true.obs;// final appUnHaveAccount = true.obs;//
@ -48,13 +48,13 @@ class CheckingInAddStaffState{
selectPrintingMethodStr.value = "APP"; selectPrintingMethodStr.value = "APP";
break; break;
case 2: case 2:
selectPrintingMethodStr.value = "密码"; selectPrintingMethodStr.value = "密码".tr;
break; break;
case 3: case 3:
selectPrintingMethodStr.value = ""; selectPrintingMethodStr.value = "".tr;
break; break;
case 4: case 4:
selectPrintingMethodStr.value = "指纹"; selectPrintingMethodStr.value = "指纹".tr;
break; break;
} }

View File

@ -74,16 +74,19 @@ class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
onPressed: (BuildContext context){ onPressed: (BuildContext context){
// 1APP 2 3 4 5 // 1APP 2 3 4 5
if(staffListItem.attendanceType == 1){ if(staffListItem.attendanceType == 1){
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除员工钥匙', (isAllData) { ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除员工钥匙'.tr, (isAllData) {
logic.deletStaff(staffListItem.staffId!, (isAllData ? 1 : 0)); logic.deletStaff(staffListItem.staffId!, (isAllData ? 1 : 0));
}); });
}else{ }else{
showIosTipViewDialog(staffListItem.staffId!, context); ShowTipView().showIosTipWithContentDialog("确定要删除员工吗?".tr, () {
logic.deletStaff(staffListItem.staffId!, 0);
});
// showIosTipViewDialog(staffListItem.staffId!, context);
} }
}, },
backgroundColor: Colors.red, backgroundColor: Colors.red,
foregroundColor: Colors.white, foregroundColor: Colors.white,
label: '删除', label: '删除'.tr,
padding: EdgeInsets.only(left: 5.w, right: 5.w), padding: EdgeInsets.only(left: 5.w, right: 5.w),
), ),
], ],
@ -150,7 +153,7 @@ class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
borderRadius: BorderRadius.circular(5.w), borderRadius: BorderRadius.circular(5.w),
color: AppColors.openPassageModeColor, color: AppColors.openPassageModeColor,
), ),
child: Text("打卡方式无效", style: TextStyle(fontSize: 18.sp, color: AppColors.appBarIconColor)), child: Text("打卡方式无效".tr, style: TextStyle(fontSize: 18.sp, color: AppColors.appBarIconColor)),
), ),
), ),
], ],
@ -187,23 +190,23 @@ class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
return title; return title;
} }
void showIosTipViewDialog(int staffId, BuildContext context) { // void showIosTipViewDialog(int staffId, BuildContext context) {
showDialog( // showDialog(
context: context, // context: context,
builder: (BuildContext context) { // builder: (BuildContext context) {
return ShowIosTipView( // return ShowIosTipView(
title: "提示", // title: "提示",
tipTitle: "确定要删除员工吗?", // tipTitle: "确定要删除员工吗?",
sureClick: () async { // sureClick: () async {
Get.back(); // Get.back();
logic.deletStaff(staffId, 0); // logic.deletStaff(staffId, 0);
}, // },
cancelClick: () { // cancelClick: () {
Get.back(); // Get.back();
}, // },
); // );
}, // },
); // );
} // }
} }

View File

@ -26,7 +26,7 @@ class _CheckingInStaffDetailPageState extends State<CheckingInStaffDetailPage> {
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,
actionsList: [ actionsList: [
@ -64,9 +64,10 @@ class _CheckingInStaffDetailPageState extends State<CheckingInStaffDetailPage> {
child: Row( child: Row(
children: [ children: [
Container( Container(
height: 50.h, width: 1.sw,
padding: EdgeInsets.only(left: 20.w), // height: 50.h,
child: Text("${state.staffListItemData.value.reason}," "打卡方式无效", style: TextStyle(fontSize: 22.sp, color: AppColors.openPassageModeColor))) padding: EdgeInsets.only(left: 20.w, right: 20.w, top: 10.h),
child: Text("${state.staffListItemData.value.reason}${"打卡方式无效".tr}", style: TextStyle(fontSize: 22.sp, color: AppColors.openPassageModeColor)))
], ],
), ),
)), )),
@ -79,6 +80,7 @@ class _CheckingInStaffDetailPageState extends State<CheckingInStaffDetailPage> {
// "getKeyInfosData": state.getKeyInfosData.value, // "getKeyInfosData": state.getKeyInfosData.value,
"companyId": state.companyId.value, "companyId": state.companyId.value,
"staffId": state.staffListItemData.value.staffId, "staffId": state.staffListItemData.value.staffId,
"staffName": state.staffListItemData.value.staffName,
}); });
}), }),
], ],

View File

@ -23,13 +23,13 @@ class CheckingInStaffDetailState{
attendanceType.value = "APP"; attendanceType.value = "APP";
break; break;
case 2: case 2:
attendanceType.value = "密码"; attendanceType.value = "密码".tr;
break; break;
case 3: case 3:
attendanceType.value = ""; attendanceType.value = "".tr;
break; break;
case 4: case 4:
attendanceType.value = "指纹"; attendanceType.value = "指纹".tr;
break; break;
} }
} }

View File

@ -1,6 +1,4 @@
import 'dart:ffi';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_state.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_state.dart';
@ -12,10 +10,7 @@ import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../../tools/custom_bottom_sheet.dart'; import '../../../../../tools/custom_bottom_sheet.dart';
import '../../../../../tools/dateTool.dart'; import '../../../../../tools/dateTool.dart';
import '../../../../../tools/eventBusEventManage.dart'; import '../../../../../tools/eventBusEventManage.dart';
import '../../../../../tools/jh_pop_menus.dart';
import '../../../../../tools/showDeleteAdministratorIsHaveAllDataWidget.dart';
import '../../../../../tools/showTipView.dart'; import '../../../../../tools/showTipView.dart';
import '../../../../../translations/trans_lib.dart';
typedef BlockIsHaveAllDataCallback = void Function(bool isAllData); typedef BlockIsHaveAllDataCallback = void Function(bool isAllData);
@ -54,7 +49,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
startTime:int.parse(state.starTime.value), startTime:int.parse(state.starTime.value),
endTime:int.parse(state.endTime.value), endTime:int.parse(state.endTime.value),
isOnlyManageSelf: state.onlyManageYouCreatesUser.value ? 1 : 0, isOnlyManageSelf: state.onlyManageYouCreatesUser.value ? 1 : 0,
remoteEnable: state.isRemoteUnlock.value ? 1 : 0); remoteEnable: state.isRemoteUnlock.value ? 1 : 2);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
// if(updateType == 1){ // if(updateType == 1){
// state.onlyManageYouCreatesUser.value = !state.onlyManageYouCreatesUser.value; // state.onlyManageYouCreatesUser.value = !state.onlyManageYouCreatesUser.value;

View File

@ -3,13 +3,12 @@ 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/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart';
import 'package:star_lock/tools/jh_pop_menus.dart';
import '../../../../../appRouters.dart'; import '../../../../../appRouters.dart';
import '../../../../../app_settings/app_colors.dart'; import '../../../../../app_settings/app_colors.dart';
import '../../../../../common/XSConstantMacro/XSConstantMacro.dart';
import '../../../../../tools/commonItem.dart'; import '../../../../../tools/commonItem.dart';
import '../../../../../tools/dateTool.dart'; import '../../../../../tools/dateTool.dart';
import '../../../../../tools/showIosTipView.dart';
import '../../../../../tools/showTFView.dart'; import '../../../../../tools/showTFView.dart';
import '../../../../../tools/submitBtn.dart'; import '../../../../../tools/submitBtn.dart';
import '../../../../../tools/titleAppBar.dart'; import '../../../../../tools/titleAppBar.dart';
@ -62,9 +61,9 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
allHeight: 70.h, allHeight: 70.h,
// rightTitle:"2023.09.19 11:27\n2023.09.25 11:27", // rightTitle:"2023.09.19 11:27\n2023.09.25 11:27",
rightTitle: logic.getKeyTypeShowDateTime(), rightTitle: logic.getKeyTypeShowDateTime(),
isHaveDirection: state.keyType.value == 3 ? false : true, isHaveDirection: state.itemData.value.keyStatus! == XSConstantMacro.keyStatusExpired ? false : state.keyType.value == 3 ? false : true ,
isHaveLine: true, isHaveLine: true,
action: () async { action: state.itemData.value.keyStatus! == XSConstantMacro.keyStatusExpired ? null :() async {
if(state.keyType.value == 2 || state.keyType.value == 1){ if(state.keyType.value == 2 || state.keyType.value == 1){
// / // /
var data = await Get.toNamed(Routers.electronicKeyDetailChangeDate, arguments: { var data = await Get.toNamed(Routers.electronicKeyDetailChangeDate, arguments: {

View File

@ -30,7 +30,7 @@ class ElectronicKeyDetailState {
changeNameController.text = itemData.value.keyName!; changeNameController.text = itemData.value.keyName!;
keyName.value = itemData.value.keyName!; keyName.value = itemData.value.keyName!;
isRemoteUnlock.value = itemData.value.remoteEnable! == 0 ? false : true; isRemoteUnlock.value = itemData.value.remoteEnable! == 2 ? false : true;
onlyManageYouCreatesUser.value = itemData.value.isOnlyManageSelf! == 0 ? false : true; onlyManageYouCreatesUser.value = itemData.value.isOnlyManageSelf! == 0 ? false : true;
starDate.value = itemData.value.startDate!.toString(); starDate.value = itemData.value.startDate!.toString();

View File

@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -8,11 +9,11 @@ import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/electr
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
import 'package:star_lock/tools/noData.dart'; import 'package:star_lock/tools/noData.dart';
import 'package:star_lock/tools/storage.dart'; import 'package:star_lock/tools/storage.dart';
import '../../../../appRouters.dart'; import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../app_settings/app_colors.dart';
import '../../../../tools/EasyRefreshTool.dart'; import '../../../../tools/EasyRefreshTool.dart';
import '../../../../tools/keySearchWidget.dart'; import '../../../../tools/keySearchWidget.dart';
import '../../../../tools/showIosTipView.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../translations/trans_lib.dart';
@ -63,7 +64,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
// //
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
_showDialog(context); _showDialog();
} else { } else {
logic.showToast("演示模式"); logic.showToast("演示模式");
} }
@ -314,9 +315,9 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
} }
// //
void _showDialog(widgetContext) { void _showDialog() {
showCupertinoDialog( showCupertinoDialog(
context: widgetContext, context: Get.context!,
builder: (context) { builder: (context) {
return CupertinoAlertDialog( return CupertinoAlertDialog(
title: const Text('该锁的电子钥匙都将被删除'), title: const Text('该锁的电子钥匙都将被删除'),

View File

@ -95,17 +95,23 @@ class AddFingerprintLogic extends BaseGetXController {
case 0x07: case 0x07:
// //
print("${reply.commandType!.typeValue} 用户无权限"); print("${reply.commandType!.typeValue} 用户无权限");
showToast("添加指纹失败", something: (){
Get.back();
});
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType!.typeValue} 权限校验错误"); print("${reply.commandType!.typeValue} 权限校验错误");
showToast("添加指纹失败", something: (){
Get.back();
});
break; break;
default: default:
// //
print("${reply.commandType!.typeValue} 失败"); print("${reply.commandType!.typeValue} 失败");
showToast("添加指纹失败", something: (){
Get.back();
});
break; break;
} }
} }
@ -276,8 +282,8 @@ class AddFingerprintLogic extends BaseGetXController {
var token = await Storage.getStringList(saveBlueToken); var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!); List<int> getTokenList = changeStringListToIntList(token!);
print("openDoorTokenPubToken:$getTokenList state.startDate.value:${state.startDate.value}");
Get.log("state.isAdministrator.value:${state.isAdministrator.value}");
IoSenderManage.senderAddFingerprintCommand( IoSenderManage.senderAddFingerprintCommand(
keyID:"1", keyID:"1",
userID:await Storage.getUid(), userID:await Storage.getUid(),

View File

@ -112,7 +112,7 @@ class LockDetailLogic extends BaseGetXController {
var tokenData = reply.data.sublist(2, 6); var tokenData = reply.data.sublist(2, 6);
var saveStrList = changeIntListToStringList(tokenData); var saveStrList = changeIntListToStringList(tokenData);
Storage.setStringList(saveBlueToken, saveStrList); Storage.setStringList(saveBlueToken, saveStrList);
Get.log("openDoorToken:$tokenData"); // Get.log("openDoorToken:$tokenData");
IoSenderManage.senderOpenLock( IoSenderManage.senderOpenLock(
keyID: BlueManage().connectDeviceName, keyID: BlueManage().connectDeviceName,
@ -129,20 +129,20 @@ class LockDetailLogic extends BaseGetXController {
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType}用户无权限"); Get.log("${reply.commandType}用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType}校验错误"); Get.log("${reply.commandType}校验错误");
break; break;
case 0x16: case 0x16:
// ... // ...
print("${reply.commandType}正在开锁中..."); Get.log("${reply.commandType}正在开锁中...");
state.openLockBtnState.value = 0; state.openLockBtnState.value = 0;
eventBus.fire(RefreshLockDetailInfoDataEvent()); eventBus.fire(RefreshLockDetailInfoDataEvent());
showToast("正在开锁中...", something: () { showToast("正在开锁中...".tr, something: () {
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
}); });
break; break;
@ -318,7 +318,7 @@ class LockDetailLogic extends BaseGetXController {
switch (status) { switch (status) {
case 0x00: case 0x00:
// //
print("添加用户数据解析成功"); Get.log("添加用户数据解析成功");
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
state.lockUserNo = reply.data[47]; state.lockUserNo = reply.data[47];
_updateLockUserNo(); _updateLockUserNo();
@ -657,9 +657,6 @@ class LockDetailLogic extends BaseGetXController {
keyId: state.keyInfos.value.keyId.toString(), keyId: state.keyInfos.value.keyId.toString(),
lockUserNo: state.lockUserNo.toString()); lockUserNo: state.lockUserNo.toString());
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
// state.keyInfos.value.lockUserNo = state.lockUserNo;
// state.bottomBtnisEable.value = true;
// print("state.bottomBtnisEable.value:${state.bottomBtnisEable.value} state.keyInfos.value.lockUserNo:${state.keyInfos.value.lockUserNo}");
eventBus.fire(RefreshLockDetailInfoDataEvent()); eventBus.fire(RefreshLockDetailInfoDataEvent());
SchedulerBinding.instance.addPostFrameCallback((_) { SchedulerBinding.instance.addPostFrameCallback((_) {
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
@ -772,11 +769,10 @@ class LockDetailLogic extends BaseGetXController {
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) { state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) {
text = text = "${"你的钥匙".tr}${XSConstantMacro.getKeyStatusStr(state.keyInfos.value.keyStatus!)}";
"你的钥匙${XSConstantMacro.getKeyStatusStr(state.keyInfos.value.keyStatus!)}";
} else { } else {
text = state.isOpenPassageMode.value == 1 text = state.isOpenPassageMode.value == 1
? "常开模式启动!长按闭锁" ? "常开模式启动!长按闭锁".tr
: TranslationLoader.lanKeys!.clickUnlockAndHoldDownClose!.tr; : TranslationLoader.lanKeys!.clickUnlockAndHoldDownClose!.tr;
} }
return text; return text;

View File

@ -152,7 +152,7 @@ class _LockDetailPageState extends State<LockDetailPage>
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
"钥匙将在${DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!)}天后失效", "${"钥匙将在".tr}${DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!)}${"天后失效".tr}",
style: TextStyle( style: TextStyle(
color: const Color(0xffCBA74B), fontSize: 24.sp)) color: const Color(0xffCBA74B), fontSize: 24.sp))
], ],
@ -234,7 +234,7 @@ class _LockDetailPageState extends State<LockDetailPage>
GestureDetector( GestureDetector(
onTap: () { onTap: () {
// logic.getStarLockStatus(); // logic.getStarLockStatus();
ShowTipView().showSureAlertDialog("锁更新时间:${DateTool().dateToYMDHNString(state ShowTipView().showSureAlertDialog("${"锁更新时间:".tr}${DateTool().dateToYMDHNString(state
.keyInfos.value.electricQuantityDate! .keyInfos.value.electricQuantityDate!
.toString())}"); .toString())}");
}, },
@ -297,7 +297,7 @@ class _LockDetailPageState extends State<LockDetailPage>
: null, : null,
onLongPressStart: state.openDoorBtnisUneable.value == true onLongPressStart: state.openDoorBtnisUneable.value == true
? (details) { ? (details) {
Get.log("长按闭锁"); // Get.log("长按闭锁");
setState(() { setState(() {
startUnLock(); startUnLock();
}); });
@ -504,7 +504,7 @@ class _LockDetailPageState extends State<LockDetailPage>
// '开门器', state.bottomBtnisUneable.value, () {})); // '开门器', state.bottomBtnisUneable.value, () {}));
// //
showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件', showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件'.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () {
Navigator.pushNamed(context, Routers.accessoriesListPage); Navigator.pushNamed(context, Routers.accessoriesListPage);
})); }));
@ -760,7 +760,7 @@ class _LockDetailPageState extends State<LockDetailPage>
? (bottomBtnisEable ? (bottomBtnisEable
? onClick ? onClick
: () { : () {
logic.showToast("请在锁旁边完成第一次开锁"); logic.showToast("请在锁旁边完成第一次开锁".tr);
}) })
: null, : null,
child: Container( child: Container(
@ -934,7 +934,6 @@ class _LockDetailPageState extends State<LockDetailPage>
// print("state.isOpenLockNeedOnline.value:${state.isOpenLockNeedOnline.value}"); // print("state.isOpenLockNeedOnline.value:${state.isOpenLockNeedOnline.value}");
if (state.isOpenLockNeedOnline.value == 0) { if (state.isOpenLockNeedOnline.value == 0) {
// //
print("开锁开锁开锁开锁开锁开锁开锁开锁");
state.openDoorModel = 1; state.openDoorModel = 1;
logic.openDoorAction(); logic.openDoorAction();
} else { } else {
@ -958,7 +957,6 @@ class _LockDetailPageState extends State<LockDetailPage>
// lockUserNo为0 // lockUserNo为0
logic.addUserConnectBlue(); logic.addUserConnectBlue();
} else { } else {
print("闭锁闭锁闭锁闭锁闭锁闭锁闭锁闭锁");
state.openDoorModel = 32; state.openDoorModel = 32;
logic.openDoorAction(); logic.openDoorAction();
} }

View File

@ -69,15 +69,20 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
), ),
body: Column( body: Column(
children: [ children: [
Container( (state.keyInfos.value.isLockOwner == 1 || state.keyInfos.value.keyRight == 1) ?
padding: EdgeInsets.all(20.h), Column(
child: Text( children: [
TranslationLoader.lanKeys!.lockOperatingRecordTip!.tr, Container(
textAlign: TextAlign.start, padding: EdgeInsets.all(20.h),
style: TextStyle(fontSize: 20.sp), child: Text(
), TranslationLoader.lanKeys!.lockOperatingRecordTip!.tr,
), textAlign: TextAlign.start,
_searchWidget(), style: TextStyle(fontSize: 20.sp),
),
),
_searchWidget(),
],
) : Container(),
SizedBox(height: 10.h), SizedBox(height: 10.h),
Expanded(child: _buildMainUI()), Expanded(child: _buildMainUI()),
], ],

View File

@ -1,3 +1,4 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
@ -6,6 +7,8 @@ import '../../lockMian/entity/lockListInfo_entity.dart';
class LockOperatingRecordState { class LockOperatingRecordState {
final keyInfos = LockListInfoItemEntity().obs; final keyInfos = LockListInfoItemEntity().obs;
final lockOperatingRecordListData = <KeyRecordDataItem>[].obs; final lockOperatingRecordListData = <KeyRecordDataItem>[].obs;
final TextEditingController searchController = TextEditingController();
LockOperatingRecordState() { LockOperatingRecordState() {
keyInfos.value = Get.arguments["keyInfo"]; keyInfos.value = Get.arguments["keyInfo"];
} }

View File

@ -8,6 +8,7 @@ import 'package:star_lock/blue/io_type.dart';
import '../../../../../blue/blue_manage.dart'; import '../../../../../blue/blue_manage.dart';
import '../../../../../blue/io_protocol/io_changeAdministratorPassword.dart'; import '../../../../../blue/io_protocol/io_changeAdministratorPassword.dart';
import '../../../../../blue/io_protocol/io_readAdminPassword.dart'; import '../../../../../blue/io_protocol/io_readAdminPassword.dart';
import '../../../../../blue/io_protocol/io_senderCustomPasswords.dart';
import '../../../../../blue/io_reply.dart'; import '../../../../../blue/io_reply.dart';
import '../../../../../blue/io_tool/io_tool.dart'; import '../../../../../blue/io_tool/io_tool.dart';
import '../../../../../blue/io_tool/manager_event_bus.dart'; import '../../../../../blue/io_tool/manager_event_bus.dart';
@ -25,7 +26,7 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{
late StreamSubscription<Reply> _replySubscription; late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() { void _initReplySubscription() {
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) { _replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
if (reply is ChangeAdministratorPasswordReply) { if (reply is SenderCustomPasswordsReply) {// ChangeAdministratorPasswordReply
_replyChangeAdministratorPassword(reply); _replyChangeAdministratorPassword(reply);
} }
@ -66,7 +67,7 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
IoSenderManage.senderCustomPasswordsCommand( IoSenderManage.senderCustomPasswordsCommand(
keyID: "1", keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
userID: await Storage.getUid(), userID: await Storage.getUid(),
pwdNo: 254, pwdNo: 254,
pwd:state.changePwdController.text, pwd:state.changePwdController.text,
@ -251,7 +252,7 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{
// token: getTokenList); // token: getTokenList);
IoSenderManage.senderCustomPasswordsCommand( IoSenderManage.senderCustomPasswordsCommand(
keyID: "1", keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
userID: await Storage.getUid(), userID: await Storage.getUid(),
pwdNo: 254, pwdNo: 254,
pwd:state.changePwdController.text, pwd:state.changePwdController.text,

View File

@ -74,18 +74,18 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
allHeight: 70.h, allHeight: 70.h,
isHaveLine: true)), isHaveLine: true)),
Obx(() => Visibility( Obx(() => Visibility(
visible: state.lockBasicInfo.value.keyType == 4 ? true : false, visible: (state.lockBasicInfo.value.keyType ?? 0) == 4 ? true : false,
child: CommonItem( child: CommonItem(
leftTitel: "有效日".tr, leftTitel: "有效日".tr,
rightTitle: state.lockBasicInfo.value!.weekDays!.join(",").toString(), rightTitle: (state.lockBasicInfo.value.weekDays ?? []).join(",").toString(),
allHeight: 70.h, allHeight: 70.h,
isHaveLine: true), isHaveLine: true),
)), )),
Obx(() => Visibility( Obx(() => Visibility(
visible: state.lockBasicInfo.value.keyType == 4 ? true : false, visible: (state.lockBasicInfo.value.keyType ?? 0) == 4 ? true : false,
child: CommonItem( child: CommonItem(
leftTitel: "有效时间", leftTitel: "有效时间",
rightTitle: "${DateTool().dateToHNString(state.lockBasicInfo.value.startDate.toString())}-${DateTool().dateToHNString(state.lockBasicInfo.value.endDate.toString())}", rightTitle: "${DateTool().dateToHNString((state.lockBasicInfo.value.startDate ?? 0).toString())}-${DateTool().dateToHNString((state.lockBasicInfo.value.endDate ?? 0).toString())}",
allHeight: 70.h, allHeight: 70.h,
isHaveLine: true), isHaveLine: true),
)), )),

View File

@ -57,8 +57,8 @@ class PasswordKeyDetailLogic extends BaseGetXController {
String useDateStr = ''; String useDateStr = '';
DateTime startDateStr = DateTime.fromMillisecondsSinceEpoch(state.itemData.value.startDate!); DateTime startDateStr = DateTime.fromMillisecondsSinceEpoch(state.itemData.value.startDate!);
DateTime endDateStr = DateTime.fromMillisecondsSinceEpoch(state.itemData.value.endDate!); DateTime endDateStr = DateTime.fromMillisecondsSinceEpoch(state.itemData.value.endDate!);
int starHour = startDateStr.hour; String starHour = "${state.itemData.value.hoursStart}";
int endHour = endDateStr.hour; String endHour = "${state.itemData.value.hoursEnd}";
switch (getPwdType) { switch (getPwdType) {
case 1: case 1:

View File

@ -1,5 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart'; import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_state.dart'; import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_state.dart';
import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/network/api_repository.dart';
@ -26,7 +27,6 @@ class PasswordKeyListLogic extends BaseGetXController {
} else { } else {
if (entity.data!.itemList!.isNotEmpty) { if (entity.data!.itemList!.isNotEmpty) {
state.itemDataList.value.addAll(entity.data!.itemList!); state.itemDataList.value.addAll(entity.data!.itemList!);
print("state.itemDataList.value.length:${state.itemDataList.value.length}");
pageNo++; pageNo++;
} }
} }
@ -40,7 +40,7 @@ class PasswordKeyListLogic extends BaseGetXController {
.keyboardPwdReset(state.keyInfo.value.lockId.toString()); .keyboardPwdReset(state.keyInfo.value.lockId.toString());
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
// print("重置电子钥匙成功啦啦啦啦啦"); // print("重置电子钥匙成功啦啦啦啦啦");
showToast("重置成功", something: (){ showToast("重置成功".tr, something: (){
pageNo = 1; pageNo = 1;
mockNetworkDataRequest(); mockNetworkDataRequest();
}); });
@ -53,7 +53,7 @@ class PasswordKeyListLogic extends BaseGetXController {
PasswordKeyEntity entity = await ApiRepository.to PasswordKeyEntity entity = await ApiRepository.to
.deleteKeyboardPwd(lockId, keyboardPwdId, deleteType); .deleteKeyboardPwd(lockId, keyboardPwdId, deleteType);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("删除成功", something: (){ showToast("删除成功".tr, something: (){
pageNo = 1; pageNo = 1;
mockNetworkDataRequest(); mockNetworkDataRequest();
}); });
@ -74,70 +74,70 @@ class PasswordKeyListLogic extends BaseGetXController {
switch (getPwdType) { switch (getPwdType) {
case 1: case 1:
// 1 6使 // 1 6使
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 单次'; useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} ${"单次".tr}';
break; break;
case 2: case 2:
// 2 24使 // 2 24使
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 永久 ${indexEntity.isCustom! == 1? "自定义" : ""}'; useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} ${"永久".tr} ${indexEntity.isCustom! == 1? "自定义".tr : ""}';
break; break;
case 3: case 3:
// 3 24使 // 3 24使
useDateStr = useDateStr =
'${startDateStr.toLocal().toString().substring(0, 16)} - ${endDateStr.toLocal().toString().substring(0, 16)} 限时 ${indexEntity.isCustom! == 1? "自定义" : ""}'; '${startDateStr.toLocal().toString().substring(0, 16)} - ${endDateStr.toLocal().toString().substring(0, 16)} ${"限时".tr} ${indexEntity.isCustom! == 1? "自定义".tr : ""}';
break; break;
case 4: case 4:
// 4 使使 // 4 使使
useDateStr = '${startDateStr.toLocal().toString().substring(0, 16)} 清空码'; useDateStr = '${startDateStr.toLocal().toString().substring(0, 16)} ${"清空码".tr}';
break; break;
case 5: case 5:
// 5 // 5
useDateStr = useDateStr =
'${startDateStr.toLocal().toString().substring(0, 16)} 周末$starHour:00-$endHour:00 循环'; '${endDateStr.toLocal().toString().substring(0, 16)} ${"周末".tr}$starHour:00-$endHour:00 ${"循环".tr}';
break; break;
case 6: case 6:
// 6 // 6
useDateStr = useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周日$starHour:00-$endHour:00 循环'; '${endDateStr.toLocal().toString().substring(0, 16)} ${"周日".tr}$starHour:00-$endHour:00 ${"循环"}';
break; break;
case 7: case 7:
// 7 // 7
useDateStr = useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 工作日$starHour:00-$endHour:00 循环'; '${endDateStr.toLocal().toString().substring(0, 16)} ${"工作日".tr}$starHour:00-$endHour:00 ${"循环".tr}';
break; break;
case 8: case 8:
// 8 // 8
useDateStr = useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周一$starHour:00-$endHour:00 循环'; '${endDateStr.toLocal().toString().substring(0, 16)} ${"周一".tr}$starHour:00-$endHour:00 ${"循环".tr}';
break; break;
case 9: case 9:
// 9 // 9
useDateStr = useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周二$starHour:00-$endHour:00 循环'; '${endDateStr.toLocal().toString().substring(0, 16)} ${"周二".tr}$starHour:00-$endHour:00 ${"循环".tr}';
break; break;
case 10: case 10:
// 10 // 10
useDateStr = useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周三$starHour:00-$endHour:00 循环'; '${endDateStr.toLocal().toString().substring(0, 16)} ${"周三".tr}$starHour:00-$endHour:00 ${"循环".tr}';
break; break;
case 11: case 11:
// 11 // 11
useDateStr = useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周四$starHour:00-$endHour:00 循环'; '${endDateStr.toLocal().toString().substring(0, 16)} ${"周四".tr}$starHour:00-$endHour:00 ${"循环".tr}';
break; break;
case 12: case 12:
// 12 // 12
useDateStr = useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周五$starHour:00-$endHour:00 循环'; '${endDateStr.toLocal().toString().substring(0, 16)} ${"周五".tr}$starHour:00-$endHour:00 ${"循环".tr}';
break; break;
case 13: case 13:
// 13 // 13
useDateStr = useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周六$starHour:00-$endHour:00 循环'; '${endDateStr.toLocal().toString().substring(0, 16)} ${"周六".tr}$starHour:00-$endHour:00 ${"循环".tr}';
break; break;
case 14: case 14:
// 14 // 14
useDateStr = useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周天$starHour:00-$endHour:00 循环'; '${endDateStr.toLocal().toString().substring(0, 16)} ${"周天".tr}$starHour:00-$endHour:00 ${"循环".tr}';
break; break;
default: default:

View File

@ -11,8 +11,8 @@ import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../app_settings/app_colors.dart';
import '../../../../tools/EasyRefreshTool.dart'; import '../../../../tools/EasyRefreshTool.dart';
import '../../../../tools/keySearchWidget.dart'; import '../../../../tools/keySearchWidget.dart';
import '../../../../tools/left_slide_actions.dart';
import '../../../../tools/showIosTipView.dart'; import '../../../../tools/showIosTipView.dart';
import '../../../../tools/showTipView.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../translations/trans_lib.dart';
@ -61,9 +61,12 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
onPressed: () async { onPressed: () async {
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
_showDialog(context); ShowTipView().showIosTipWithContentDialog('该锁的密码都将被删除'.tr, () {
logic.resetPasswordKeyListRequest();
setState(() {});
});
} else { } else {
logic.showToast("演示模式"); logic.showToast("演示模式".tr);
} }
}, },
), ),
@ -134,11 +137,14 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
children: [ children: [
SlidableAction( SlidableAction(
onPressed: (BuildContext context){ onPressed: (BuildContext context){
showIosTipViewDialog(context, passwordKeyListItem); ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () {
logic.deletePwdRequest(passwordKeyListItem.lockId.toString(),
passwordKeyListItem.keyboardPwdId.toString(), 1);
});
}, },
backgroundColor: Colors.red, backgroundColor: Colors.red,
foregroundColor: Colors.white, foregroundColor: Colors.white,
label: '删除', label: '删除'.tr,
padding: EdgeInsets.only(left: 5.w, right: 5.w), padding: EdgeInsets.only(left: 5.w, right: 5.w),
), ),
], ],
@ -164,26 +170,6 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
)); ));
} }
void showIosTipViewDialog(
BuildContext context, PasswordKeyListItem passwordKeyListItem) {
showDialog(
context: context,
builder: (BuildContext context) {
return ShowIosTipView(
title: "提示",
tipTitle: "确定要删除吗?",
sureClick: () {
Get.back();
logic.deletePwdRequest(passwordKeyListItem.lockId.toString(),
passwordKeyListItem.keyboardPwdId.toString(), 1);
},
cancelClick: () {
Get.back();
},
);
});
}
Widget _electronicKeyItem(int itemIndex, String lockTypeIcon, String lockTypeTitle, String useDateStr, Function()? action) { Widget _electronicKeyItem(int itemIndex, String lockTypeIcon, String lockTypeTitle, String useDateStr, Function()? action) {
PasswordKeyListItem passwordKeyListItem = state.itemDataList[itemIndex]; PasswordKeyListItem passwordKeyListItem = state.itemDataList[itemIndex];
@ -220,7 +206,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
), ),
), ),
SizedBox(width: 10.w), SizedBox(width: 10.w),
passwordKeyListItem.keyboardPwdStatus == 2 ? Text('已过期', style: TextStyle(color: Colors.red, fontSize: 20.sp),) : Container(), passwordKeyListItem.keyboardPwdStatus == 2 ? Text('已过期'.tr, style: TextStyle(color: Colors.red, fontSize: 20.sp),) : Container(),
// SizedBox(width: 15.w) // SizedBox(width: 15.w)
], ],
), ),
@ -249,31 +235,4 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
); );
} }
//
void _showDialog(widgetContext) {
showCupertinoDialog(
context: widgetContext,
builder: (context) {
return CupertinoAlertDialog(
title: const Text('该锁的密码都将被删除'),
actions: [
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
onPressed: () {
Navigator.of(context).pop();
},
),
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.reset!.tr),
onPressed: () {
Navigator.of(context).pop();
logic.resetPasswordKeyListRequest();
setState(() {});
},
),
],
);
},
);
}
} }

View File

@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/blue/io_type.dart'; import 'package:star_lock/blue/io_type.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_state.dart'; import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_state.dart';
import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/network/api_repository.dart';
@ -13,6 +14,7 @@ import '../../../../blue/io_tool/io_tool.dart';
import '../../../../blue/io_tool/manager_event_bus.dart'; import '../../../../blue/io_tool/manager_event_bus.dart';
import '../../../../blue/sender_manage.dart'; import '../../../../blue/sender_manage.dart';
import '../../../../tools/baseGetXController.dart'; import '../../../../tools/baseGetXController.dart';
import '../../../../tools/dateTool.dart';
import '../../../../tools/storage.dart'; import '../../../../tools/storage.dart';
class PasswordKeyPerpetualLogic extends BaseGetXController { class PasswordKeyPerpetualLogic extends BaseGetXController {
@ -37,15 +39,37 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
*/ */
// //
Future<void> getKeyboardPwdRequest() async { Future<void> getKeyboardPwdRequest() async {
String getFailureDateTime = '0'; var startDate = DateTool().dateToTimestamp(state.beginTime.value, 1);
String getEffectiveDateTime = '0'; var endDate = DateTool().dateToTimestamp(state.endTime.value, 1);
String lockId = state.keyInfo.value.lockId.toString(); String lockId = state.keyInfo.value.lockId.toString();
String getKeyType = state.widgetType.value.toString(); String getKeyType = state.widgetType.value.toString();
if (state.nameController.text.isEmpty) {
showToast("请输入姓名");
return;
}
//
if (state.widgetType.value == 4) {
if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
showToast("生效时间不能小于当前时间");
return;
}
}
if (state.widgetType.value == 0) { if (state.widgetType.value == 0) {
// //
getKeyType = '2'; getKeyType = '2';
} else if (state.widgetType.value == 1) { } else if (state.widgetType.value == 1) {
// //
if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
showToast("生效时间不能小于当前时间");
return;
}
if (startDate >= endDate) {
showToast("失效时间要大于生效时间");
return;
}
getKeyType = '3'; getKeyType = '3';
} else if (state.widgetType.value == 2) { } else if (state.widgetType.value == 2) {
// //
@ -54,6 +78,12 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
// //
} else if (state.widgetType.value == 4) { } else if (state.widgetType.value == 4) {
// //
//
if (endDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
showToast("结束时间不能小于当前时间");
return;
}
if (state.loopModeStr.value == '周末') { if (state.loopModeStr.value == '周末') {
getKeyType = '5'; getKeyType = '5';
} else if (state.loopModeStr.value == '每日') { } else if (state.loopModeStr.value == '每日') {
@ -79,21 +109,12 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
// //
getKeyType = '4'; getKeyType = '4';
} }
if (state.widgetType.value != 0 &&
state.widgetType.value != 2 &&
state.widgetType.value != 5) {
getFailureDateTime =
state.failureDateTime.value.millisecondsSinceEpoch.toString();
getEffectiveDateTime =
state.effectiveDateTime.value.millisecondsSinceEpoch.toString();
}
var entity = await ApiRepository.to.getPasswordKey( var entity = await ApiRepository.to.getPasswordKey(
endDate: getFailureDateTime, endDate: endDate.toString(),
keyboardPwdName: state.nameController.text, keyboardPwdName: state.nameController.text,
keyboardPwdType: getKeyType, keyboardPwdType: getKeyType,
lockId: lockId, lockId: lockId,
startDate: getEffectiveDateTime, startDate: startDate.toString(),
startHours: state.loopStartHours.value, startHours: state.loopStartHours.value,
endHours: state.loopEndHours.value, endHours: state.loopEndHours.value,
isCoerced: 1); isCoerced: 1);
@ -115,21 +136,15 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
// //
Future<void> addKeyboardPwdRequest() async { Future<void> addKeyboardPwdRequest() async {
String getFailureDateTime = '0';
String getEffectiveDateTime = '0'; String getEffectiveDateTime = '0';
String getFailureDateTime = '0';
String lockId = state.keyInfo.value.lockId.toString(); String lockId = state.keyInfo.value.lockId.toString();
String getKeyType = '3'; String getKeyType = '2';
// //
if (state.isPermanent.value == false) { if (state.isPermanent.value == false) {
getKeyType = '3'; getKeyType = '3';
getFailureDateTime = DateTime.parse(state.selectFailureDate.value) getEffectiveDateTime = DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
.millisecondsSinceEpoch getFailureDateTime = DateTool().dateToTimestamp(state.endTime.value, 1).toString();
.toString();
getEffectiveDateTime = DateTime.parse(state.selectEffectiveDate.value)
.millisecondsSinceEpoch
.toString();
} else {
getKeyType = '2';
} }
var entity = await ApiRepository.to.addPasswordKey( var entity = await ApiRepository.to.addPasswordKey(
lockId, lockId,
@ -155,7 +170,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
} }
} }
late DateTime getStartDateTime; // late DateTime getStartDateTime;
// //
late StreamSubscription<Reply> _replySubscription; late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() { void _initReplySubscription() {
@ -195,8 +210,8 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
pwdNo: state.isAdministrator.value == true ? 254 : 1, pwdNo: state.isAdministrator.value == true ? 254 : 1,
pwd:state.pwdController.text, pwd:state.pwdController.text,
useCountLimit: 0xff, useCountLimit: 0xff,
startTime: state.effectiveDateTime.value.millisecondsSinceEpoch~/1000, startTime: DateTool().dateToTimestamp(state.beginTime.value, 1)~/1000,
endTime: state.failureDateTime.value.millisecondsSinceEpoch~/1000, endTime: DateTool().dateToTimestamp(state.endTime.value, 1)~/1000,
needAuthor: 1, needAuthor: 1,
signKey: signKeyDataList, signKey: signKeyDataList,
privateKey: getPrivateKeyList, privateKey: getPrivateKeyList,
@ -222,12 +237,46 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
}); });
} }
void getStartDate(DateTime startDate) { // void getStartDate(DateTime startDate) {
getStartDateTime = startDate; // getStartDateTime = startDate;
} // }
// //
Future<void> senderCustomPasswords() async { Future<void> senderCustomPasswords() async {
if (state.nameController.text.isEmpty) {
showToast("请输入姓名");
return;
}
if (state.pwdController.text.isEmpty) {
showToast("请输入密码");
return;
}
var startDate = DateTool().dateToTimestamp(state.beginTime.value, 1);
var endDate = DateTool().dateToTimestamp(state.endTime.value, 1);
//
if (state.isPermanent.value == false) {
if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
showToast("生效时间不能小于当前时间");
return;
}
if (endDate < startDate) {
showToast("失效时间需大于生效时间");
return;
}
}else{
startDate = 0;
endDate = 0;
}
if (state.pwdController.text.length < 6 || state.pwdController.text.length > 9) {
showToast("请输入6-9位数字密码");
return;
}
Get.log("startDate:$startDate endDate:$endDate");
if(state.sureBtnState.value == 1){ if(state.sureBtnState.value == 1){
return; return;
} }
@ -248,16 +297,16 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
var token = await Storage.getStringList(saveBlueToken); var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!); List<int> getTokenList = changeStringListToIntList(token!);
print("openDoorTokenPubToken:$getTokenList");
// Get.log("state.isAdministrator.value:${state.isAdministrator.value}");
IoSenderManage.senderCustomPasswordsCommand( IoSenderManage.senderCustomPasswordsCommand(
keyID: "1", keyID: "1",
userID: await Storage.getUid(), userID: await Storage.getUid(),
pwdNo: state.isAdministrator.value == true ? 254 : 1, pwdNo: state.isAdministrator.value == true ? 254 : 1,
pwd: state.pwdController.text, pwd: state.pwdController.text,
useCountLimit: 0xff, useCountLimit: 0xff,
startTime: state.effectiveDateTime.value.millisecondsSinceEpoch~/1000, startTime:state.isPermanent.value == false ? startDate ~/ 1000 : 0,
endTime: state.failureDateTime.value.millisecondsSinceEpoch~/1000, endTime: state.isPermanent.value == false ? endDate ~/ 1000 : 0,
needAuthor: 1, needAuthor: 1,
signKey: signKeyDataList, signKey: signKeyDataList,
privateKey: getPrivateKeyList, privateKey: getPrivateKeyList,
@ -289,17 +338,17 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
case 1: case 1:
// 24使 // 24使
useDateStr = useDateStr =
'类型:限时\n有效期:${state.selectEffectiveDate.value} -- ${state.selectFailureDate.value}'; '类型:限时\n有效期:${state.beginTime.value} -- ${state.endTime.value}';
break; break;
case 2: case 2:
// 6使 // 6使
useDateStr = useDateStr =
'类型:单次\n有效期:${state.selectEffectiveDate.value} -- ${state.selectFailureDate.value}'; '类型:单次\n有效期:${state.beginTime.value} -- ${state.endTime.value}';
break; break;
case 3: case 3:
// //
if (state.isPermanent.value == false) { if (state.isPermanent.value == false) {
'类型:自定义-限时\n有效期:${state.selectEffectiveDate.value} -- ${state.selectFailureDate.value}'; '类型:自定义-限时\n有效期:${state.beginTime.value} -- ${state.endTime.value}';
} else { } else {
useDateStr = '类型:自定义-永久'; useDateStr = '类型:自定义-永久';
} }

View File

@ -1,4 +1,4 @@
import 'package:date_format/date_format.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -18,6 +18,7 @@ import '../../../../tools/NativeInteractionTool.dart';
import '../../../../tools/appRouteObserver.dart'; import '../../../../tools/appRouteObserver.dart';
import '../../../../tools/commonItem.dart'; import '../../../../tools/commonItem.dart';
import '../../../../tools/dateTool.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../translations/trans_lib.dart';
import '../../../lockMian/entity/lockListInfo_entity.dart'; import '../../../lockMian/entity/lockListInfo_entity.dart';
@ -194,50 +195,33 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
children: [ children: [
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
rightTitle: state.selectEffectiveDate.value, rightTitle: state.beginTime.value,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDH, Pickers.showDatePicker(context, mode: state.widgetType.value == 3 ? DateMode.YMDHM:DateMode.YMDH, onConfirm: (p) {
onConfirm: (p) {
if (state.widgetType.value == 3) { if (state.widgetType.value == 3) {
// //
state.effectiveDateTime.value = DateTime.parse('${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}'); state.beginTime.value = DateTool().getYMDHNDateString(p, 1);
state.selectEffectiveDate.value = formatDate(state.effectiveDateTime.value, [yyyy, '-', mm, '-', dd, ' ', HH, ':', nn]); //
} else { } else {
state.effectiveDateTime.value = DateTime.parse('${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}'); state.beginTime.value = DateTool().getYMDHNDateString(p, 4);
state.selectEffectiveDate.value = "${formatDate(state.effectiveDateTime.value, [yyyy, '-', mm, '-', dd, ' ', HH])}:00"; //
} }
Get.log("beginTime:${state.beginTime.value}");
}); });
}), }),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
rightTitle: state.selectFailureDate.value, rightTitle: state.endTime.value,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDH, Pickers.showDatePicker(context, mode: DateMode.YMDH, onConfirm: (p) {
onConfirm: (p) { if (state.widgetType.value == 3) {
if (state.widgetType.value == 3) { //
// state.endTime.value = DateTool().getYMDHNDateString(p, 1);
state.failureDateTime.value = DateTime.parse( } else {
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}'); state.endTime.value = DateTool().getYMDHNDateString(p, 4);
state.selectFailureDate.value = formatDate( }
state.failureDateTime.value, Get.log("endTime:${state.endTime.value}");
[yyyy, '-', mm, '-', dd, ' ', HH, ':', nn]); //
} else {
state.failureDateTime.value = DateTime.parse(
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}');
state.selectFailureDate.value =
"${formatDate(state.failureDateTime.value, [
yyyy,
'-',
mm,
'-',
dd,
' ',
HH
])}:00";
}
}); });
}), }),
Container(height: 10.h), Container(height: 10.h),
@ -304,24 +288,12 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
}), }),
CommonItem( CommonItem(
leftTitel: '结束日期', leftTitel: '结束日期',
rightTitle: state.selectFailureDate.value, rightTitle: state.endTime.value,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDH, Pickers.showDatePicker(context, mode: DateMode.YMDH, onConfirm: (p) {
onConfirm: (p) { state.endTime.value = DateTool().getYMDHNDateString(p, 4);
state.failureDateTime.value = DateTime.parse(
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}');
state.selectFailureDate.value =
"${formatDate(state.failureDateTime.value, [
yyyy,
'-',
mm,
'-',
dd,
' ',
HH
])}:00";
}); });
}), }),
CommonItem( CommonItem(
@ -331,23 +303,8 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Pickers.showDatePicker(context, mode: DateMode.H, onConfirm: (p) { Pickers.showDatePicker(context, mode: DateMode.H, onConfirm: (p) {
DateTime selectedDateTime = DateTime( state.loopEffectiveDate.value = DateTool().getYMDHNDateString(p, 5);
DateTime.now().year, state.loopStartHours.value = p.hour!;
DateTime.now().month,
DateTime.now().day,
p.hour!,
);
if (isValidDateTime(selectedDateTime)) {
state.effectiveDateTime.value = selectedDateTime;
state.loopEffectiveDate.value =
"${formatDate(state.effectiveDateTime.value, [HH])}:00";
state.loopStartHours.value = p.hour!;
// state.selectEffectiveDate.value =
// formatDate(state.effectiveDateTime.value, [HH]);
} else {
// 使
}
}); });
}), }),
CommonItem( CommonItem(
@ -356,21 +313,8 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Pickers.showDatePicker(context, mode: DateMode.H, onConfirm: (p) { Pickers.showDatePicker(context, mode: DateMode.H, onConfirm: (p) {
DateTime selectedDateTime = DateTime( state.loopFailureDate.value = DateTool().getYMDHNDateString(p, 5);
DateTime.now().year, state.loopEndHours.value = p.hour!;
DateTime.now().month,
DateTime.now().day,
p.hour!,
);
if (isValidDateTime(selectedDateTime)) {
state.failureDateTime.value = selectedDateTime;
state.loopFailureDate.value =
"${formatDate(state.failureDateTime.value, [HH])}:00";
state.loopEndHours.value = p.hour!;
} else {
// 使
}
}); });
}), }),
], ],
@ -417,71 +361,10 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
onClick: () async { onClick: () async {
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
DateTime startDateTime = DateTime(
state.effectiveDateTime.value.year,
state.effectiveDateTime.value.month,
state.effectiveDateTime.value.day,
state.effectiveDateTime.value.hour);
DateTime endDateTime = DateTime(
state.failureDateTime.value.year,
state.failureDateTime.value.month,
state.failureDateTime.value.day,
state.failureDateTime.value.hour);
// //
if (state.widgetType.value == 3) { if (state.widgetType.value == 3) {
logic.getStartDate(state.effectiveDateTime.value);
if (state.nameController.text.isEmpty) {
logic.showToast("请输入姓名");
return;
}
if (state.pwdController.text.isEmpty) {
logic.showToast("请输入密码");
return;
}
//
if (state.isPermanent.value == false) {
if (!startDateTime.isBefore(endDateTime) ||
startDateTime.isAtSameMomentAs(endDateTime)) {
logic.showToast("失效时间需大于生效时间");
return;
}
}
if (state.pwdController.text.length < 6 || state.pwdController.text.length > 9) {
logic.showToast("请输入6-9位数字密码");
return;
}
logic.senderCustomPasswords(); logic.senderCustomPasswords();
} else { } else {
if (state.nameController.text.isEmpty) {
logic.showToast("请输入姓名");
return;
}
//
if (state.widgetType.value == 1) {
if (!startDateTime.isBefore(endDateTime) ||
startDateTime.isAtSameMomentAs(endDateTime)) {
logic.showToast("失效时间需大于生效时间");
return;
}
}
//
if (state.widgetType.value == 4) {
if (!startDateTime.isBefore(endDateTime) ||
startDateTime.isAtSameMomentAs(endDateTime)) {
logic.showToast("结束时间需大于当前时间");
return;
}
if (state.loopEndHours.value <=
state.loopStartHours.value) {
logic.showToast("失效时间需大于生效时间");
return;
}
}
logic.getKeyboardPwdRequest(); logic.getKeyboardPwdRequest();
} }
} else { } else {

View File

@ -2,6 +2,7 @@ import 'package:date_format/date_format.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart'; import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
import 'package:star_lock/tools/dateTool.dart';
class PasswordKeyPerpetualState { class PasswordKeyPerpetualState {
final TextEditingController nameController = TextEditingController(); final TextEditingController nameController = TextEditingController();
@ -14,14 +15,11 @@ class PasswordKeyPerpetualState {
var pwdNameStr = ''; var pwdNameStr = '';
final isAdministrator = false.obs;// final isAdministrator = false.obs;//
final effectiveDateTime = DateTime.now().obs; var beginTime = DateTool().getNowDateWithType(3).obs; //
final failureDateTime = DateTime.now().obs; var endTime = DateTool().getNowDateWithType(3).obs;//
var selectEffectiveDate = "${formatDate(DateTime.now(), [yyyy,'-',mm,'-', dd, ' ', HH,])}:00".obs; // var loopEffectiveDate = DateTool().getNowDateWithType(7).obs; //
var selectFailureDate = "${formatDate(DateTime.now(), [yyyy, '-', mm, '-', dd, ' ', HH,])}:00".obs; // var loopFailureDate = DateTool().getNowDateWithType(7).obs; //
var loopEffectiveDate = "${formatDate(DateTime.now(), [HH])}:00".obs; //
var loopFailureDate = "${formatDate(DateTime.now(), [HH])}:00".obs; //
var loopStartHours = DateTime.now().hour.obs; var loopStartHours = DateTime.now().hour.obs;
var loopEndHours = DateTime.now().hour.obs; var loopEndHours = DateTime.now().hour.obs;
var loopModeStr = '周末'.obs; // var loopModeStr = '周末'.obs; //

View File

@ -56,7 +56,7 @@ class _LockMallPageState extends State<LockMallPage> {
} }
String getWebTitle() { String getWebTitle() {
String webTitleStr = TranslationLoader.lanKeys!.shoppingCart!.tr; String webTitleStr = "配件商城".tr;
state.mallWebView.getTitle().then((result) { state.mallWebView.getTitle().then((result) {
webTitleStr = result!; webTitleStr = result!;
}); });

View File

@ -50,7 +50,7 @@ class SafeVerifyLogic extends BaseGetXController {
// //
Future<void> deleteAccountRequest() async { Future<void> deleteAccountRequest() async {
LoginEntity entity = LoginEntity entity =
await ApiRepository.to.deleteAccount("1", state.verificationCode.value); await ApiRepository.to.deleteAccount(state.channel.value, state.verificationCode.value);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("验证成功,账号已删除"); showToast("验证成功,账号已删除");
// //
@ -83,7 +83,7 @@ class SafeVerifyLogic extends BaseGetXController {
/// ///
void initLoginData() async { void initLoginData() async {
final data = await Storage.getString(saveUserLoginData); final data = await Storage.getString(saveUserLoginData);
// print("getLoginData:$data"); print("getLoginData:$data");
if (data != null && data.isNotEmpty) { if (data != null && data.isNotEmpty) {
state.loginData.value = LoginData.fromJson(jsonDecode(data)); state.loginData.value = LoginData.fromJson(jsonDecode(data));
bool mobileIsNotEmpty = state.loginData.value.mobile != null && state.loginData.value.mobile!.isNotEmpty; bool mobileIsNotEmpty = state.loginData.value.mobile != null && state.loginData.value.mobile!.isNotEmpty;

View File

@ -67,19 +67,41 @@ class _SafeVerifyPageState extends State<SafeVerifyPage> {
SizedBox( SizedBox(
height: 30.h, height: 30.h,
), ),
Obx(() => SizedBox( Obx(() => GestureDetector(
width: 200.w, onTap: (){
child: SubmitBtn( if(state.canResend.value){
btnName: state.btnText.value, logic.sendValidationCode();
onClick: state.canResend.value ? () { }
logic.sendValidationCode(); },
} : null, child: Container(
padding: EdgeInsets.only(left:20.w, right: 20.w, top: 10.h, bottom: 10.h),
// height: 60.h,
width: 200.w,
decoration: BoxDecoration(
color: AppColors.mainColor,
borderRadius: BorderRadius.circular(10.h),
// borderRadius: BorderRadius.circular(30.w)
),
child:Text(state.btnText.value,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 22.sp)),
// SubmitBtn(
// btnName: state.btnText.value,
// onClick: state.canResend.value ? () {
// logic.sendValidationCode();
// } : null,
// ),
), ),
)), )),
SizedBox( SizedBox(
height: 60.h, height: 60.h,
), ),
Obx(() => Padding( Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Obx(() => Padding(
padding: EdgeInsets.only(left: 60.w, right: 60.w), padding: EdgeInsets.only(left: 60.w, right: 60.w),
child: Text( child: Text(
'请点击获取验证码,验证码将发送到${state.accountStr.value}', '请点击获取验证码,验证码将发送到${state.accountStr.value}',
@ -87,6 +109,41 @@ class _SafeVerifyPageState extends State<SafeVerifyPage> {
color: AppColors.darkGrayTextColor, fontSize: 22.sp), color: AppColors.darkGrayTextColor, fontSize: 22.sp),
), ),
)), )),
SizedBox(height: 10.h),
Obx(() => Visibility(
visible: state.isToggle.value,
child: GestureDetector(
onTap: (){
if(state.channel.value == '1'){
//
state.channel.value = '2';
state.accountStr.value = state.loginData.value.email!;
}else{
//
state.channel.value = '1';
state.accountStr.value = state.loginData.value.mobile!;
}
},
child: Container(
margin: EdgeInsets.only(left: 60.w, right: 60.w),
padding: EdgeInsets.only(left:10.w, right: 10.w, top: 5.h, bottom: 5.h),
// height: 60.h,
width: 100.w,
decoration: BoxDecoration(
color: AppColors.mainColor,
borderRadius: BorderRadius.circular(10.h),
// borderRadius: BorderRadius.circular(30.w)
),
child:Text("切换",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 22.sp)),
),
),
)),
],
),
SizedBox( SizedBox(
height: 120.h, height: 120.h,
), ),

View File

@ -1,5 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:get/get.dart';
import 'package:star_lock/login/login/entity/LoginEntity.dart'; import 'package:star_lock/login/login/entity/LoginEntity.dart';
import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/network/api_repository.dart';
@ -30,8 +31,9 @@ class StarLockMineLogic extends BaseGetXController {
final data = await Storage.getString(saveUserLoginData); final data = await Storage.getString(saveUserLoginData);
if (data != null && data.isNotEmpty) { if (data != null && data.isNotEmpty) {
state.userNickName.value = (await Storage.getNickname())!; state.userNickName.value = (await Storage.getNickname())!;
state.userMobile.value = (await Storage.getMobile())!; state.userMobile.value = (await Storage.getMobile())! ?? '';
state.userEmail.value = (await Storage.getEmail())!; state.userEmail.value = (await Storage.getEmail())!;
Get.log("userNickName:${state.userNickName.value} userMobile:${state.userMobile.value} userEmail:${state.userEmail.value}");
} }
} }

View File

@ -8,6 +8,9 @@ import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/mineBindPhoneO
import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../tools/eventBusEventManage.dart';
import '../../../tools/storage.dart';
class MineBindPhoneOrEmailLogic extends BaseGetXController { class MineBindPhoneOrEmailLogic extends BaseGetXController {
final MineBindPhoneOrEmailState state = MineBindPhoneOrEmailState(); final MineBindPhoneOrEmailState state = MineBindPhoneOrEmailState();
@ -48,8 +51,13 @@ class MineBindPhoneOrEmailLogic extends BaseGetXController {
state.verificationCode.value, state.verificationCode.value,
state.unbindToken.value); state.unbindToken.value);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("邮箱绑定成功"); showToast("邮箱绑定成功", something: () async {
Get.until((route) => route.settings.name == Routers.minePersonInfoPage); final loginData = await Storage.getLoginData();
loginData!.email = state.inputAccount.value;
Storage.saveLoginData(loginData);
eventBus.fire(MineInfoChangeRefreshUI());
Get.until((route) => route.settings.name == Routers.minePersonInfoPage);
});
} }
} }
@ -61,8 +69,13 @@ class MineBindPhoneOrEmailLogic extends BaseGetXController {
state.verificationCode.value, state.verificationCode.value,
state.unbindToken.value); state.unbindToken.value);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("手机绑定成功"); showToast("手机绑定成功", something: () async {
Get.until((route) => route.settings.name == Routers.minePersonInfoPage); final loginData = await Storage.getLoginData();
loginData!.mobile = state.inputAccount.value;
Storage.saveLoginData(loginData);
eventBus.fire(MineInfoChangeRefreshUI());
Get.until((route) => route.settings.name == Routers.minePersonInfoPage);
});
} }
} }

View File

@ -44,7 +44,7 @@ class MineSetLogic extends BaseGetXController {
ExpireLockListEntity entity = await ApiRepository.to ExpireLockListEntity entity = await ApiRepository.to
.setAlertMode('1', state.isPrompTone.value == true ? '1' : '2'); .setAlertMode('1', state.isPrompTone.value == true ? '1' : '2');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("设置成功"); showToast("设置成功".tr);
userSettingsInfoRequest(); userSettingsInfoRequest();
} }
} }
@ -78,7 +78,7 @@ class MineSetLogic extends BaseGetXController {
ExpireLockListEntity entity = await ApiRepository.to ExpireLockListEntity entity = await ApiRepository.to
.setTouchUnlockFlag(state.isTouchUnlock.value == true ? '1' : '2'); .setTouchUnlockFlag(state.isTouchUnlock.value == true ? '1' : '2');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("设置成功"); showToast("设置成功".tr);
userSettingsInfoRequest(); userSettingsInfoRequest();
} }
} }

View File

@ -11,6 +11,7 @@ import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart';
import '../../../appRouters.dart'; import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart'; import '../../../app_settings/app_colors.dart';
import '../../../tools/commonItem.dart'; import '../../../tools/commonItem.dart';
import '../../../tools/showTipView.dart';
import '../../../tools/submitBtn.dart'; import '../../../tools/submitBtn.dart';
import '../../../tools/titleAppBar.dart'; import '../../../tools/titleAppBar.dart';
import '../../../translations/trans_lib.dart'; import '../../../translations/trans_lib.dart';
@ -212,7 +213,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
logic.showToast("功能暂未开放"); logic.showToast("功能暂未开放".tr);
}), }),
F.isLite F.isLite
? Container() ? Container()
@ -222,7 +223,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
logic.showToast("功能暂未开放"); logic.showToast("功能暂未开放".tr);
}), }),
F.isLite F.isLite
? Container() ? Container()
@ -232,7 +233,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
logic.showToast("功能暂未开放"); logic.showToast("功能暂未开放".tr);
}), }),
// CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){ // CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){
// //
@ -272,7 +273,10 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
isDelete: true, isDelete: true,
onClick: () { onClick: () {
//退 //退
showLoginOutAlertTipDialog(); ShowTipView().showIosTipWithContentDialog("确定要退出吗?".tr, (){
logic.userLogoutRequest();
});
// showLoginOutAlertTipDialog();
}), }),
Container( Container(
padding: EdgeInsets.only(right: 30.w, top: 30.h), padding: EdgeInsets.only(right: 30.w, top: 30.h),
@ -287,7 +291,10 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
color: AppColors.darkGrayTextColor, fontSize: 18.sp), color: AppColors.darkGrayTextColor, fontSize: 18.sp),
), ),
onPressed: () { onPressed: () {
_showDialog(context); ShowTipView().showIosTipWithContentDialog(TranslationLoader.lanKeys!.deleteAccountTips!.tr, (){
//
Get.toNamed(Routers.safeVerifyPage);
});
}, },
), ),
], ],
@ -317,9 +324,9 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
CupertinoDialogAction( CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.sure!.tr), child: Text(TranslationLoader.lanKeys!.sure!.tr),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Get.back();
// //
Navigator.pushNamed(context, Routers.safeVerifyPage); Get.toNamed(Routers.safeVerifyPage);
setState(() {}); setState(() {});
}, },
), ),
@ -329,32 +336,32 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
); );
} }
void showLoginOutAlertTipDialog() { // void showLoginOutAlertTipDialog() {
showCupertinoDialog( // showCupertinoDialog(
context: context, // context: context,
builder: (context) { // builder: (context) {
return CupertinoAlertDialog( // return CupertinoAlertDialog(
title: const Text("提示"), // title: const Text("提示"),
content: const Text('确定要退出吗?'), // content: const Text('确定要退出吗?'),
actions: [ // actions: [
CupertinoDialogAction( // CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr), // child: Text(TranslationLoader.lanKeys!.cancel!.tr),
onPressed: () { // onPressed: () {
Get.back(); // Get.back();
}, // },
), // ),
CupertinoDialogAction( // CupertinoDialogAction(
child: const Text("退出"), // child: const Text("退出"),
onPressed: () { // onPressed: () {
Get.back(); // Get.back();
logic.userLogoutRequest(); // logic.userLogoutRequest();
}, // },
), // ),
], // ],
); // );
}, // },
); // );
} // }
CupertinoSwitch _isPrompToneSwitch() { CupertinoSwitch _isPrompToneSwitch() {
return CupertinoSwitch( return CupertinoSwitch(

View File

@ -170,7 +170,7 @@ class BaseGetXController extends GetxController {
String useDateStr = ''; String useDateStr = '';
if (keyType == XSConstantMacro.keyTypeTime) { if (keyType == XSConstantMacro.keyTypeTime) {
// //
useDateStr = "${DateTool().dateToYMDHNString(startDate.toString())}-${DateTool().dateToYMDHNString(endDate.toString())}"; useDateStr = "${DateTool().dateToYMDHNString(startDate.toString())}-${DateTool().dateToYMDHNString(endDate.toString())} 限时";
} else if (keyType == XSConstantMacro.keyTypeLong) { } else if (keyType == XSConstantMacro.keyTypeLong) {
// //
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!); // DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
@ -183,7 +183,7 @@ class BaseGetXController extends GetxController {
useDateStr = '单次'; useDateStr = '单次';
} else if (keyType == XSConstantMacro.keyTypeLoop) { } else if (keyType == XSConstantMacro.keyTypeLoop) {
// //
useDateStr = "${DateTool().dateToYMDString(startDate.toString())}-${DateTool().dateToYMDString(endDate.toString())}"; useDateStr = "${DateTool().dateToYMDString(startDate.toString())}-${DateTool().dateToYMDString(endDate.toString())} 循环";
} }
return useDateStr; return useDateStr;

View File

@ -42,7 +42,7 @@ class CommonItem extends StatelessWidget {
left: 20.w, right: 10.w), // , top: 20.w, bottom: 20.w left: 20.w, right: 10.w), // , top: 20.w, bottom: 20.w
child: Row( child: Row(
children: [ children: [
SizedBox(width: 20.w), // SizedBox(width: 20.w),
SizedBox( SizedBox(
// width: isHaveRightWidget! ? 100.w : 300.w, // width: isHaveRightWidget! ? 100.w : 300.w,
child: Text(leftTitel!, style: TextStyle(fontSize: 22.sp))), child: Text(leftTitel!, style: TextStyle(fontSize: 22.sp))),
@ -69,7 +69,7 @@ class CommonItem extends StatelessWidget {
isHaveRightWidget! isHaveRightWidget!
? rightWidget! ? rightWidget!
: SizedBox( : SizedBox(
width: rightTitle!.isNotEmpty ? 260.w : 0.1.w, // width: rightTitle!.isNotEmpty ? 260.w : 0.1.w,
child: Text( child: Text(
rightTitle ?? "", rightTitle ?? "",
textAlign: TextAlign.right, textAlign: TextAlign.right,

View File

@ -7,25 +7,59 @@ import 'pickers/time_picker/model/pduration.dart';
class DateTool { class DateTool {
/// ///
// String getNowDateYMDHM(){ String getNowDateWithType(int type){
// // var dateStr = '';
// DateTime now = DateTime.now(); //
// // DateTime now = DateTime.now();
// int year = now.year; //
// // int year = now.year;
// int month = now.month; //
// // int month = now.month;
// int day = now.day; //
// // int day = now.day;
// int hour = now.hour; //
// // int hour = now.hour;
// int minute = now.minute; //
// // int minute = now.minute;
// int millisecond = now.millisecond; //
// int millisecond = now.millisecond;
// // print("组合 $year-$month-$day $hour:$minute:$millisecond");
// return "$year-$month-$day $hour:$minute"; switch(type){
// } case 1:
//
dateStr = '$year-${month.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')} ${hour.toString().padLeft(2, '0')}:${minute.toString().padLeft(2, '0')}:${millisecond.toString().padLeft(2, '0')}';
break;
case 2:
//
dateStr = '$year-${month.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')} ${hour.toString().padLeft(2, '0')}:${minute.toString().padLeft(2, '0')}';
break;
case 3:
//
dateStr = '$year-${month.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')} ${hour.toString().padLeft(2, '0')}:00';
break;
case 4:
//
dateStr = '$year-${month.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')}';
break;
case 5:
//
dateStr = '${hour.toString().padLeft(2, '0')}:${minute.toString().padLeft(2, '0')}:${millisecond.toString().padLeft(2, '0')}';
break;
case 6:
//
dateStr = '${hour.toString().padLeft(2, '0')}:${minute.toString().padLeft(2, '0')}';
break;
case 7:
//
dateStr = '${hour.toString().padLeft(2, '0')}:00';
break;
default:
dateStr = '$year-${month.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')} ${hour.toString().padLeft(2, '0')}:${minute.toString().padLeft(2, '0')}:${millisecond.toString().padLeft(2, '0')}';
break;
}
// print("组合 $year-$month-$day $hour:$minute:$millisecond");
return dateStr;
}
/// (.. :) /// (.. :)
// String dateToYMDHNStringWithDot(String timestamp){ // String dateToYMDHNStringWithDot(String timestamp){
@ -47,7 +81,7 @@ class DateTool {
var dateStr = ''; var dateStr = '';
switch(type){ switch(type){
case 1: case 1:
// (2023-01-01 12:00) // (2023-01-01 12:48)
dateStr = '$year-${month!.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')} ${hour.toString().padLeft(2, '0')}:${minute.toString().padLeft(2, '0')}'; dateStr = '$year-${month!.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')} ${hour.toString().padLeft(2, '0')}:${minute.toString().padLeft(2, '0')}';
break; break;
case 2: case 2:
@ -55,9 +89,17 @@ class DateTool {
dateStr = '$year-${month!.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')}'; dateStr = '$year-${month!.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')}';
break; break;
case 3: case 3:
// (12:00) // (12:05)
dateStr = '${hour.toString().padLeft(2, '0')}:${minute.toString().padLeft(2, '0')}'; dateStr = '${hour.toString().padLeft(2, '0')}:${minute.toString().padLeft(2, '0')}';
break; break;
case 4:
// (2023-01-01 12:00)
dateStr = '$year-${month!.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')} ${hour.toString().padLeft(2, '0')}:00';
break;
case 5:
// (12:00)
dateStr = '${hour.toString().padLeft(2, '0')}:00';
break;
default: default:
dateStr = '$year-${month!.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')} ${hour.toString().padLeft(2, '0')}:${minute.toString().padLeft(2, '0')}'; dateStr = '$year-${month!.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')} ${hour.toString().padLeft(2, '0')}:${minute.toString().padLeft(2, '0')}';
break; break;

View File

@ -12,6 +12,7 @@ typedef BlockIsHaveAllDataCallback = void Function(bool isAllData);
class ShowTipView { class ShowTipView {
//
void showSureAlertDialog(String contentStr) { void showSureAlertDialog(String contentStr) {
showCupertinoDialog( showCupertinoDialog(
context: Get.context!, context: Get.context!,
@ -31,14 +32,14 @@ class ShowTipView {
); );
} }
// //
void showDeleteAdministratorIsHaveAllDataDialog(String contentStr, BlockIsHaveAllDataCallback blockIsHaveAllDataCallback) { void showDeleteAdministratorIsHaveAllDataDialog(String contentStr, BlockIsHaveAllDataCallback blockIsHaveAllDataCallback) {
bool selet = false; bool selet = false;
showDialog( showDialog(
context: Get.context!, context: Get.context!,
builder: (BuildContext context) { builder: (BuildContext context) {
return CupertinoAlertDialog( return CupertinoAlertDialog(
title: const Text("提示"), title: Text("提示".tr),
content: SizedBox( content: SizedBox(
// height: 100.h, // height: 100.h,
child: ShowDeleteAdministratorIsHaveAllDataWidget( child: ShowDeleteAdministratorIsHaveAllDataWidget(
@ -68,6 +69,7 @@ class ShowTipView {
); );
} }
//
void showIosTipWithContentDialog(String contentStr, Function sureClick) { void showIosTipWithContentDialog(String contentStr, Function sureClick) {
showCupertinoDialog( showCupertinoDialog(
context: Get.context!, context: Get.context!,

View File

@ -160,7 +160,7 @@ class Storage {
static Future<String?> getMobile() async { static Future<String?> getMobile() async {
LoginData? loginData = await getLoginData(); LoginData? loginData = await getLoginData();
String? mobile = loginData!.mobile; String? mobile = loginData!.mobile;
return mobile; return mobile??'';
} }
static Future<String?> getEmail() async { static Future<String?> getEmail() async {

View File

@ -198,7 +198,6 @@ class LanKeyEntity {
this.videoIntercomDoorLock, this.videoIntercomDoorLock,
this.NFCPassiveLock, this.NFCPassiveLock,
this.addDevice, this.addDevice,
this.shoppingCart,
this.gateway, this.gateway,
this.message, this.message,
this.supportStaff, this.supportStaff,
@ -662,7 +661,6 @@ class LanKeyEntity {
videoIntercomDoorLock = json['videoIntercomDoorLock']; videoIntercomDoorLock = json['videoIntercomDoorLock'];
NFCPassiveLock = json['NFCPassiveLock']; NFCPassiveLock = json['NFCPassiveLock'];
addDevice = json['addDevice']; addDevice = json['addDevice'];
shoppingCart = json['shoppingCart'];
gateway = json['gateway']; gateway = json['gateway'];
message = json['message']; message = json['message'];
supportStaff = json['supportStaff']; supportStaff = json['supportStaff'];
@ -1149,7 +1147,6 @@ class LanKeyEntity {
String? videoIntercomDoorLock; String? videoIntercomDoorLock;
String? NFCPassiveLock; String? NFCPassiveLock;
String? addDevice; String? addDevice;
String? shoppingCart;
String? gateway; String? gateway;
String? message; String? message;
String? supportStaff; String? supportStaff;
@ -1632,7 +1629,6 @@ class LanKeyEntity {
map['videoIntercomDoorLock'] = videoIntercomDoorLock; map['videoIntercomDoorLock'] = videoIntercomDoorLock;
map['NFCPassiveLock'] = NFCPassiveLock; map['NFCPassiveLock'] = NFCPassiveLock;
map['addDevice'] = addDevice; map['addDevice'] = addDevice;
map['shoppingCart'] = shoppingCart;
map['gateway'] = gateway; map['gateway'] = gateway;
map['message'] = message; map['message'] = message;
map['supportStaff'] = supportStaff; map['supportStaff'] = supportStaff;