Merge branch 'master' of gitee.com:starlock-cn/app-starlock

This commit is contained in:
Daisy 2024-04-07 14:05:48 +08:00
commit 1f8b24da20
55 changed files with 817 additions and 591 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -78,80 +78,85 @@ class _SelectCountryRegionPageState extends State<SelectCountryRegionPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: const Color(0xFFFFFFFF),
appBar: TitleAppBar(
barTitle:
"${TranslationLoader.lanKeys!.select!.tr} ${TranslationLoader.lanKeys!.countryAndRegion!.tr}",
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: Column(
children: [
KeySearchWidget(
editingController: searchController,
backgroundColor: AppColors.mainBackgroundColor,
onSubmittedAction: () {
if(searchController.text.isEmpty){
getCountriesListRequest();
}else{
var searchList = <CountryRegionModel>[];
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}');
return GestureDetector(
onTap: (){
FocusScope.of(context).unfocus();
},
child: Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: const Color(0xFFFFFFFF),
appBar: TitleAppBar(
barTitle:
"${TranslationLoader.lanKeys!.select!.tr} ${TranslationLoader.lanKeys!.countryAndRegion!.tr}",
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: Column(
children: [
KeySearchWidget(
editingController: searchController,
backgroundColor: AppColors.mainBackgroundColor,
onSubmittedAction: () {
if(searchController.text.isEmpty){
getCountriesListRequest();
}else{
var searchList = <CountryRegionModel>[];
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;
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);
});
setState(() {});
},
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) {
return Scaffold(
appBar: TitleAppBar(
barTitle: "张三",
barTitle: state.staffName.value,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: SingleChildScrollView(
@ -309,7 +309,7 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
padding: EdgeInsets.only(left: 50.w, top: 5.h, bottom: 5.h),
color: Colors.grey,
child: Text(
"月统计",
"月统计".tr,
style: TextStyle(
color: Colors.white,
fontSize: 26.sp,
@ -318,9 +318,9 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
),
],
),
_bottomStatisticsItemWidget(const Color(0xFFE83523), "迟到", state.lateTimes.value),
_bottomStatisticsItemWidget(const Color(0xFFEDB459), "早退", state.earlyTimes.value),
_bottomStatisticsItemWidget(const Color(0xFF666666), "未打卡", state.noPunchTimes.value),
_bottomStatisticsItemWidget(const Color(0xFFE83523), "迟到".tr, state.lateTimes.value),
_bottomStatisticsItemWidget(const Color(0xFFEDB459), "早退".tr, state.earlyTimes.value),
_bottomStatisticsItemWidget(const Color(0xFF666666), "未打卡".tr, state.noPunchTimes.value),
],
);
}

View File

@ -8,6 +8,7 @@ class CheckingInDetailState{
// final getKeyInfosData = LockListInfoItemEntity().obs;
final companyId = "".obs;
final staffId = 0.obs;
final staffName = "".obs;
final checkDate = DateTime.now().millisecondsSinceEpoch.obs;
@ -17,9 +18,15 @@ class CheckingInDetailState{
final monthListData = <MonthList>[].obs;
CheckingInDetailState() {
Map map = Get.arguments;
// getKeyInfosData.value = map["getKeyInfosData"];
companyId.value = map["companyId"];
staffId.value = map["staffId"];
if(companyId.value.isEmpty && map["companyId"] != null){
companyId.value = map["companyId"];
}
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(
width: 90.w,
height: 70.h,
// height: 100.h,
color: Colors.white,
child: Obx(() => Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(TranslationLoader.lanKeys!.dailyCharts!.tr, style: TextStyle(color: state.isDay.value ? AppColors.mainColor : Colors.black, fontSize: 22.sp)),
SizedBox(height: 10.h),
Visibility(
visible: state.isDay.value,
child: Container(
@ -147,12 +148,13 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
},
child: Container(
width: 90.w,
height: 70.h,
// height: 100.h,
color: Colors.white,
child: Obx(() => Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(TranslationLoader.lanKeys!.monthlyLeaderboard!.tr, style: TextStyle(color: !state.isDay.value ? AppColors.mainColor : Colors.black, fontSize: 22.sp)),
SizedBox(height: 10.h),
Visibility(
visible: !state.isDay.value,
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,
itemBuilder: (c, 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: {
// "getKeyInfosData": state.getKeyInfosData.value,
"companyId": state.companyId.value,
"staffId": attendanceRecordList.staffId,
"staffName": attendanceRecordList.staffName,
});
});
},
@ -280,9 +283,9 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
AttendanceRecordMonthList attendanceRecordList= state.checkingInMonthListData.value[index];
return _checkingInListItem(index, attendanceRecordList.headurl, attendanceRecordList.staffName, () {
Get.toNamed(Routers.checkingInDetailPage, arguments: {
"getKeyInfosData": state.getKeyInfosData.value,
"companyId": state.companyId.value,
"staffId": attendanceRecordList.staffId,
"staffName": attendanceRecordList.staffName,
});
});
},
@ -348,8 +351,8 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
}
},
child: Obx(() => Container(
width: 200.w,
height: 60.h,
// width: 200.w,
// height: 60.h,
color: AppColors.mainColor,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,

View File

@ -8,6 +8,7 @@ import 'package:star_lock/app_settings/app_colors.dart';
import '../../../../appRouters.dart';
import '../../../../tools/commonItem.dart';
import '../../../../tools/showTFView.dart';
import '../../../../tools/showTipView.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
@ -37,7 +38,7 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
children: [
Obx(() => CommonItem(
leftTitel:
"公司名称",
"公司名称".tr,
// rightTitle: state.companyName.value ?? "",
isHaveRightWidget: true,
rightWidget: getTFWidget(),
@ -119,14 +120,17 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
visible: state.getKeyInfosData.value.isLockOwner == 1,
child: SubmitBtn(
btnName:
"${TranslationLoader.lanKeys!.delete!.tr}${TranslationLoader.lanKeys!.company!.tr}",
"${TranslationLoader.lanKeys!.delete!.tr} ${TranslationLoader.lanKeys!.company!.tr}",
borderRadius: 20.w,
fontSize: 32.sp,
isDelete: true,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w),
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
onClick: () {
showDeletCompanyAlertDialog(context);
ShowTipView().showIosTipWithContentDialog("是否删除?".tr, () {
logic.deletCompanyData();
});
// showDeletCompanyAlertDialog(context);
}),
),
],
@ -139,12 +143,12 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
context: context,
builder: (BuildContext context) {
return ShowTFView(
title: "修改公司名字",
title: "修改公司名字".tr,
tipTitle: "",
controller: state.changeNameController,
sureClick: () {
if(state.changeNameController.text.isEmpty){
logic.showToast("请输入公司名字");
logic.showToast("请输入公司名字".tr);
return;
}
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);
if (entity.errorCode!.codeIsSuccessful) {
print('获取密码成功');
// print('获取密码成功');
if (entity.data != null) {
state.attendanceWayNumber.value = entity.data!.keyboardPwd!;
isCanClickAction();
@ -134,7 +134,7 @@ class CheckingInAddStaffLogic extends BaseGetXController{
}else{
state.isCanClick.value = state.staffNameIsNotEmpty && state.attendanceWayNumberIsNotEmpty;
}
print("state.isCanClick.value = ${state.isCanClick.value}");
// print("state.isCanClick.value = ${state.isCanClick.value}");
}
@override

View File

@ -29,7 +29,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
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,
backgroundColor: AppColors.mainColor),
body: Column(
@ -50,11 +50,11 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
isHaveLine: false,
isHaveDirection: true,
action: () {
var list = ["APP", "密码", "", "指纹"];
var list = ["APP", "密码".tr, "".tr, "指纹".tr];
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),
//App
@ -65,7 +65,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
isHaveRightWidget: true,
rightWidget: Row(
children: [
whetherTheEmployeeHasAKeyWidget("", state.appUnHaveAccount.value, () {
whetherTheEmployeeHasAKeyWidget("".tr, state.appUnHaveAccount.value, () {
setState(() {
state.appUnHaveAccount.value = true;
state.attendanceWayNumber.value = "";
@ -75,7 +75,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
SizedBox(
width: 30.w,
),
whetherTheEmployeeHasAKeyWidget("", !state.appUnHaveAccount.value, () {
whetherTheEmployeeHasAKeyWidget("".tr, !state.appUnHaveAccount.value, () {
setState(() {
state.appUnHaveAccount.value = false;
state.attendanceWayNumber.value = "";
@ -95,7 +95,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: getTFWidget(
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}员工${TranslationLoader.lanKeys!.accountNumber!.tr}",
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${"员工".tr}${TranslationLoader.lanKeys!.accountNumber!.tr}",
state.staffAccountController)),
CommonItem(
leftTitel:
@ -146,7 +146,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
case 3:
//
if (state.staffNameController.text.isEmpty) {
logic.showToast("请输入姓名");
logic.showToast("请输入姓名".tr);
return;
}
@ -164,7 +164,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
case 4:
//
if (state.staffNameController.text.isEmpty) {
logic.showToast("请输入姓名");
logic.showToast("请输入姓名".tr);
return;
}
@ -308,7 +308,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
state.attendanceWayNumber.value = numberList[index].toString();
}
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;
break;
case 4:
title = "员工是否有人脸";
title = "员工是否有人脸".tr;
break;
}
return title;
@ -405,7 +405,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
title = TranslationLoader.lanKeys!.getFingerprint!.tr;
break;
case 5:
title = "获取人脸";
title = "获取人脸".tr;
break;
}
return title;

View File

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

View File

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

View File

@ -26,7 +26,7 @@ class _CheckingInStaffDetailPageState extends State<CheckingInStaffDetailPage> {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: "员工信息",
barTitle: "员工信息".tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
actionsList: [
@ -64,9 +64,10 @@ class _CheckingInStaffDetailPageState extends State<CheckingInStaffDetailPage> {
child: Row(
children: [
Container(
height: 50.h,
padding: EdgeInsets.only(left: 20.w),
child: Text("${state.staffListItemData.value.reason}," "打卡方式无效", style: TextStyle(fontSize: 22.sp, color: AppColors.openPassageModeColor)))
width: 1.sw,
// height: 50.h,
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,
"companyId": state.companyId.value,
"staffId": state.staffListItemData.value.staffId,
"staffName": state.staffListItemData.value.staffName,
});
}),
],

View File

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

View File

@ -1,6 +1,4 @@
import 'dart:ffi';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.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/dateTool.dart';
import '../../../../../tools/eventBusEventManage.dart';
import '../../../../../tools/jh_pop_menus.dart';
import '../../../../../tools/showDeleteAdministratorIsHaveAllDataWidget.dart';
import '../../../../../tools/showTipView.dart';
import '../../../../../translations/trans_lib.dart';
typedef BlockIsHaveAllDataCallback = void Function(bool isAllData);
@ -54,7 +49,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
startTime:int.parse(state.starTime.value),
endTime:int.parse(state.endTime.value),
isOnlyManageSelf: state.onlyManageYouCreatesUser.value ? 1 : 0,
remoteEnable: state.isRemoteUnlock.value ? 1 : 0);
remoteEnable: state.isRemoteUnlock.value ? 1 : 2);
if (entity.errorCode!.codeIsSuccessful) {
// if(updateType == 1){
// 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:get/get.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 '../../../../../app_settings/app_colors.dart';
import '../../../../../common/XSConstantMacro/XSConstantMacro.dart';
import '../../../../../tools/commonItem.dart';
import '../../../../../tools/dateTool.dart';
import '../../../../../tools/showIosTipView.dart';
import '../../../../../tools/showTFView.dart';
import '../../../../../tools/submitBtn.dart';
import '../../../../../tools/titleAppBar.dart';
@ -62,9 +61,9 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
allHeight: 70.h,
// rightTitle:"2023.09.19 11:27\n2023.09.25 11:27",
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,
action: () async {
action: state.itemData.value.keyStatus! == XSConstantMacro.keyStatusExpired ? null :() async {
if(state.keyType.value == 2 || state.keyType.value == 1){
// /
var data = await Get.toNamed(Routers.electronicKeyDetailChangeDate, arguments: {

View File

@ -30,7 +30,7 @@ class ElectronicKeyDetailState {
changeNameController.text = 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;
starDate.value = itemData.value.startDate!.toString();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
import 'package:flutter/material.dart';
import 'package:get/get.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 {
final keyInfos = LockListInfoItemEntity().obs;
final lockOperatingRecordListData = <KeyRecordDataItem>[].obs;
final TextEditingController searchController = TextEditingController();
LockOperatingRecordState() {
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/io_protocol/io_changeAdministratorPassword.dart';
import '../../../../../blue/io_protocol/io_readAdminPassword.dart';
import '../../../../../blue/io_protocol/io_senderCustomPasswords.dart';
import '../../../../../blue/io_reply.dart';
import '../../../../../blue/io_tool/io_tool.dart';
import '../../../../../blue/io_tool/manager_event_bus.dart';
@ -25,7 +26,7 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{
late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() {
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
if (reply is ChangeAdministratorPasswordReply) {
if (reply is SenderCustomPasswordsReply) {// ChangeAdministratorPasswordReply
_replyChangeAdministratorPassword(reply);
}
@ -66,7 +67,7 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
IoSenderManage.senderCustomPasswordsCommand(
keyID: "1",
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
userID: await Storage.getUid(),
pwdNo: 254,
pwd:state.changePwdController.text,
@ -251,7 +252,7 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{
// token: getTokenList);
IoSenderManage.senderCustomPasswordsCommand(
keyID: "1",
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
userID: await Storage.getUid(),
pwdNo: 254,
pwd:state.changePwdController.text,

View File

@ -74,18 +74,18 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
allHeight: 70.h,
isHaveLine: true)),
Obx(() => Visibility(
visible: state.lockBasicInfo.value.keyType == 4 ? true : false,
visible: (state.lockBasicInfo.value.keyType ?? 0) == 4 ? true : false,
child: CommonItem(
leftTitel: "有效日".tr,
rightTitle: state.lockBasicInfo.value!.weekDays!.join(",").toString(),
rightTitle: (state.lockBasicInfo.value.weekDays ?? []).join(",").toString(),
allHeight: 70.h,
isHaveLine: true),
)),
Obx(() => Visibility(
visible: state.lockBasicInfo.value.keyType == 4 ? true : false,
visible: (state.lockBasicInfo.value.keyType ?? 0) == 4 ? true : false,
child: CommonItem(
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,
isHaveLine: true),
)),

View File

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

View File

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

View File

@ -11,8 +11,8 @@ import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/EasyRefreshTool.dart';
import '../../../../tools/keySearchWidget.dart';
import '../../../../tools/left_slide_actions.dart';
import '../../../../tools/showIosTipView.dart';
import '../../../../tools/showTipView.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
@ -61,9 +61,12 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
onPressed: () async {
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) {
_showDialog(context);
ShowTipView().showIosTipWithContentDialog('该锁的密码都将被删除'.tr, () {
logic.resetPasswordKeyListRequest();
setState(() {});
});
} else {
logic.showToast("演示模式");
logic.showToast("演示模式".tr);
}
},
),
@ -134,11 +137,14 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
children: [
SlidableAction(
onPressed: (BuildContext context){
showIosTipViewDialog(context, passwordKeyListItem);
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () {
logic.deletePwdRequest(passwordKeyListItem.lockId.toString(),
passwordKeyListItem.keyboardPwdId.toString(), 1);
});
},
backgroundColor: Colors.red,
foregroundColor: Colors.white,
label: '删除',
label: '删除'.tr,
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) {
PasswordKeyListItem passwordKeyListItem = state.itemDataList[itemIndex];
@ -220,7 +206,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
),
),
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)
],
),
@ -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 '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/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_state.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/sender_manage.dart';
import '../../../../tools/baseGetXController.dart';
import '../../../../tools/dateTool.dart';
import '../../../../tools/storage.dart';
class PasswordKeyPerpetualLogic extends BaseGetXController {
@ -37,15 +39,37 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
*/
//
Future<void> getKeyboardPwdRequest() async {
String getFailureDateTime = '0';
String getEffectiveDateTime = '0';
var startDate = DateTool().dateToTimestamp(state.beginTime.value, 1);
var endDate = DateTool().dateToTimestamp(state.endTime.value, 1);
String lockId = state.keyInfo.value.lockId.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) {
//
getKeyType = '2';
} else if (state.widgetType.value == 1) {
//
if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
showToast("生效时间不能小于当前时间");
return;
}
if (startDate >= endDate) {
showToast("失效时间要大于生效时间");
return;
}
getKeyType = '3';
} else if (state.widgetType.value == 2) {
//
@ -54,6 +78,12 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
//
} else if (state.widgetType.value == 4) {
//
//
if (endDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
showToast("结束时间不能小于当前时间");
return;
}
if (state.loopModeStr.value == '周末') {
getKeyType = '5';
} else if (state.loopModeStr.value == '每日') {
@ -79,21 +109,12 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
//
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(
endDate: getFailureDateTime,
endDate: endDate.toString(),
keyboardPwdName: state.nameController.text,
keyboardPwdType: getKeyType,
lockId: lockId,
startDate: getEffectiveDateTime,
startDate: startDate.toString(),
startHours: state.loopStartHours.value,
endHours: state.loopEndHours.value,
isCoerced: 1);
@ -115,21 +136,15 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
//
Future<void> addKeyboardPwdRequest() async {
String getFailureDateTime = '0';
String getEffectiveDateTime = '0';
String getFailureDateTime = '0';
String lockId = state.keyInfo.value.lockId.toString();
String getKeyType = '3';
String getKeyType = '2';
//
if (state.isPermanent.value == false) {
getKeyType = '3';
getFailureDateTime = DateTime.parse(state.selectFailureDate.value)
.millisecondsSinceEpoch
.toString();
getEffectiveDateTime = DateTime.parse(state.selectEffectiveDate.value)
.millisecondsSinceEpoch
.toString();
} else {
getKeyType = '2';
getEffectiveDateTime = DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
getFailureDateTime = DateTool().dateToTimestamp(state.endTime.value, 1).toString();
}
var entity = await ApiRepository.to.addPasswordKey(
lockId,
@ -155,7 +170,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
}
}
late DateTime getStartDateTime;
// late DateTime getStartDateTime;
//
late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() {
@ -195,8 +210,8 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
pwdNo: state.isAdministrator.value == true ? 254 : 1,
pwd:state.pwdController.text,
useCountLimit: 0xff,
startTime: state.effectiveDateTime.value.millisecondsSinceEpoch~/1000,
endTime: state.failureDateTime.value.millisecondsSinceEpoch~/1000,
startTime: DateTool().dateToTimestamp(state.beginTime.value, 1)~/1000,
endTime: DateTool().dateToTimestamp(state.endTime.value, 1)~/1000,
needAuthor: 1,
signKey: signKeyDataList,
privateKey: getPrivateKeyList,
@ -222,12 +237,46 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
});
}
void getStartDate(DateTime startDate) {
getStartDateTime = startDate;
}
// void getStartDate(DateTime startDate) {
// getStartDateTime = startDate;
// }
//
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){
return;
}
@ -248,16 +297,16 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!);
print("openDoorTokenPubToken:$getTokenList");
// Get.log("state.isAdministrator.value:${state.isAdministrator.value}");
IoSenderManage.senderCustomPasswordsCommand(
keyID: "1",
userID: await Storage.getUid(),
pwdNo: state.isAdministrator.value == true ? 254 : 1,
pwd: state.pwdController.text,
useCountLimit: 0xff,
startTime: state.effectiveDateTime.value.millisecondsSinceEpoch~/1000,
endTime: state.failureDateTime.value.millisecondsSinceEpoch~/1000,
startTime:state.isPermanent.value == false ? startDate ~/ 1000 : 0,
endTime: state.isPermanent.value == false ? endDate ~/ 1000 : 0,
needAuthor: 1,
signKey: signKeyDataList,
privateKey: getPrivateKeyList,
@ -289,17 +338,17 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
case 1:
// 24使
useDateStr =
'类型:限时\n有效期:${state.selectEffectiveDate.value} -- ${state.selectFailureDate.value}';
'类型:限时\n有效期:${state.beginTime.value} -- ${state.endTime.value}';
break;
case 2:
// 6使
useDateStr =
'类型:单次\n有效期:${state.selectEffectiveDate.value} -- ${state.selectFailureDate.value}';
'类型:单次\n有效期:${state.beginTime.value} -- ${state.endTime.value}';
break;
case 3:
//
if (state.isPermanent.value == false) {
'类型:自定义-限时\n有效期:${state.selectEffectiveDate.value} -- ${state.selectFailureDate.value}';
'类型:自定义-限时\n有效期:${state.beginTime.value} -- ${state.endTime.value}';
} else {
useDateStr = '类型:自定义-永久';
}

View File

@ -1,4 +1,4 @@
import 'package:date_format/date_format.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -18,6 +18,7 @@ import '../../../../tools/NativeInteractionTool.dart';
import '../../../../tools/appRouteObserver.dart';
import '../../../../tools/commonItem.dart';
import '../../../../tools/dateTool.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../translations/trans_lib.dart';
import '../../../lockMian/entity/lockListInfo_entity.dart';
@ -194,50 +195,33 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
rightTitle: state.selectEffectiveDate.value,
rightTitle: state.beginTime.value,
isHaveLine: true,
isHaveDirection: true,
action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDH,
onConfirm: (p) {
Pickers.showDatePicker(context, mode: state.widgetType.value == 3 ? DateMode.YMDHM:DateMode.YMDH, onConfirm: (p) {
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.selectEffectiveDate.value = formatDate(state.effectiveDateTime.value, [yyyy, '-', mm, '-', dd, ' ', HH, ':', nn]); //
state.beginTime.value = DateTool().getYMDHNDateString(p, 1);
} else {
state.effectiveDateTime.value = DateTime.parse('${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}');
state.selectEffectiveDate.value = "${formatDate(state.effectiveDateTime.value, [yyyy, '-', mm, '-', dd, ' ', HH])}:00"; //
state.beginTime.value = DateTool().getYMDHNDateString(p, 4);
}
Get.log("beginTime:${state.beginTime.value}");
});
}),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
rightTitle: state.selectFailureDate.value,
rightTitle: state.endTime.value,
isHaveDirection: true,
action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDH,
onConfirm: (p) {
if (state.widgetType.value == 3) {
//
state.failureDateTime.value = DateTime.parse(
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}');
state.selectFailureDate.value = formatDate(
state.failureDateTime.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";
}
Pickers.showDatePicker(context, mode: DateMode.YMDH, onConfirm: (p) {
if (state.widgetType.value == 3) {
//
state.endTime.value = DateTool().getYMDHNDateString(p, 1);
} else {
state.endTime.value = DateTool().getYMDHNDateString(p, 4);
}
Get.log("endTime:${state.endTime.value}");
});
}),
Container(height: 10.h),
@ -304,24 +288,12 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
}),
CommonItem(
leftTitel: '结束日期',
rightTitle: state.selectFailureDate.value,
rightTitle: state.endTime.value,
isHaveLine: true,
isHaveDirection: true,
action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDH,
onConfirm: (p) {
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";
Pickers.showDatePicker(context, mode: DateMode.YMDH, onConfirm: (p) {
state.endTime.value = DateTool().getYMDHNDateString(p, 4);
});
}),
CommonItem(
@ -331,23 +303,8 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
isHaveDirection: true,
action: () {
Pickers.showDatePicker(context, mode: DateMode.H, onConfirm: (p) {
DateTime selectedDateTime = DateTime(
DateTime.now().year,
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 {
// 使
}
state.loopEffectiveDate.value = DateTool().getYMDHNDateString(p, 5);
state.loopStartHours.value = p.hour!;
});
}),
CommonItem(
@ -356,21 +313,8 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
isHaveDirection: true,
action: () {
Pickers.showDatePicker(context, mode: DateMode.H, onConfirm: (p) {
DateTime selectedDateTime = DateTime(
DateTime.now().year,
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 {
// 使
}
state.loopFailureDate.value = DateTool().getYMDHNDateString(p, 5);
state.loopEndHours.value = p.hour!;
});
}),
],
@ -417,71 +361,10 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
onClick: () async {
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
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) {
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();
} 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();
}
} else {

View File

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

View File

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

View File

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

View File

@ -67,19 +67,41 @@ class _SafeVerifyPageState extends State<SafeVerifyPage> {
SizedBox(
height: 30.h,
),
Obx(() => SizedBox(
width: 200.w,
child: SubmitBtn(
btnName: state.btnText.value,
onClick: state.canResend.value ? () {
logic.sendValidationCode();
} : null,
Obx(() => GestureDetector(
onTap: (){
if(state.canResend.value){
logic.sendValidationCode();
}
},
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(
height: 60.h,
),
Obx(() => Padding(
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Obx(() => Padding(
padding: EdgeInsets.only(left: 60.w, right: 60.w),
child: Text(
'请点击获取验证码,验证码将发送到${state.accountStr.value}',
@ -87,6 +109,41 @@ class _SafeVerifyPageState extends State<SafeVerifyPage> {
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(
height: 120.h,
),

View File

@ -1,5 +1,6 @@
import 'dart:async';
import 'package:get/get.dart';
import 'package:star_lock/login/login/entity/LoginEntity.dart';
import 'package:star_lock/network/api_repository.dart';
@ -30,8 +31,9 @@ class StarLockMineLogic extends BaseGetXController {
final data = await Storage.getString(saveUserLoginData);
if (data != null && data.isNotEmpty) {
state.userNickName.value = (await Storage.getNickname())!;
state.userMobile.value = (await Storage.getMobile())!;
state.userMobile.value = (await Storage.getMobile())! ?? '';
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/tools/baseGetXController.dart';
import '../../../tools/eventBusEventManage.dart';
import '../../../tools/storage.dart';
class MineBindPhoneOrEmailLogic extends BaseGetXController {
final MineBindPhoneOrEmailState state = MineBindPhoneOrEmailState();
@ -48,8 +51,13 @@ class MineBindPhoneOrEmailLogic extends BaseGetXController {
state.verificationCode.value,
state.unbindToken.value);
if (entity.errorCode!.codeIsSuccessful) {
showToast("邮箱绑定成功");
Get.until((route) => route.settings.name == Routers.minePersonInfoPage);
showToast("邮箱绑定成功", something: () async {
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.unbindToken.value);
if (entity.errorCode!.codeIsSuccessful) {
showToast("手机绑定成功");
Get.until((route) => route.settings.name == Routers.minePersonInfoPage);
showToast("手机绑定成功", something: () async {
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
.setAlertMode('1', state.isPrompTone.value == true ? '1' : '2');
if (entity.errorCode!.codeIsSuccessful) {
showToast("设置成功");
showToast("设置成功".tr);
userSettingsInfoRequest();
}
}
@ -78,7 +78,7 @@ class MineSetLogic extends BaseGetXController {
ExpireLockListEntity entity = await ApiRepository.to
.setTouchUnlockFlag(state.isTouchUnlock.value == true ? '1' : '2');
if (entity.errorCode!.codeIsSuccessful) {
showToast("设置成功");
showToast("设置成功".tr);
userSettingsInfoRequest();
}
}

View File

@ -11,6 +11,7 @@ import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart';
import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart';
import '../../../tools/commonItem.dart';
import '../../../tools/showTipView.dart';
import '../../../tools/submitBtn.dart';
import '../../../tools/titleAppBar.dart';
import '../../../translations/trans_lib.dart';
@ -212,7 +213,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
isHaveLine: true,
isHaveDirection: true,
action: () {
logic.showToast("功能暂未开放");
logic.showToast("功能暂未开放".tr);
}),
F.isLite
? Container()
@ -222,7 +223,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
isHaveLine: true,
isHaveDirection: true,
action: () {
logic.showToast("功能暂未开放");
logic.showToast("功能暂未开放".tr);
}),
F.isLite
? Container()
@ -232,7 +233,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
isHaveLine: false,
isHaveDirection: true,
action: () {
logic.showToast("功能暂未开放");
logic.showToast("功能暂未开放".tr);
}),
// CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){
//
@ -272,7 +273,10 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
isDelete: true,
onClick: () {
//退
showLoginOutAlertTipDialog();
ShowTipView().showIosTipWithContentDialog("确定要退出吗?".tr, (){
logic.userLogoutRequest();
});
// showLoginOutAlertTipDialog();
}),
Container(
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),
),
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(
child: Text(TranslationLoader.lanKeys!.sure!.tr),
onPressed: () {
Navigator.of(context).pop();
Get.back();
//
Navigator.pushNamed(context, Routers.safeVerifyPage);
Get.toNamed(Routers.safeVerifyPage);
setState(() {});
},
),
@ -329,32 +336,32 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
);
}
void showLoginOutAlertTipDialog() {
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: const Text("退出"),
onPressed: () {
Get.back();
logic.userLogoutRequest();
},
),
],
);
},
);
}
// void showLoginOutAlertTipDialog() {
// 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: const Text("退出"),
// onPressed: () {
// Get.back();
// logic.userLogoutRequest();
// },
// ),
// ],
// );
// },
// );
// }
CupertinoSwitch _isPrompToneSwitch() {
return CupertinoSwitch(

View File

@ -170,7 +170,7 @@ class BaseGetXController extends GetxController {
String useDateStr = '';
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) {
//
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
@ -183,7 +183,7 @@ class BaseGetXController extends GetxController {
useDateStr = '单次';
} 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;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,8 +26,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 1.0.21+20240328021、打包斯凯、预发布环境给欧阳测试
# 1.0.22+202404031、打包预发布环境给欧阳测试
# 1.0.23+202404061、打包预发布环境给欧阳测试
# 1.0.24+202404071、打包预发布环境给欧阳测试
version: 1.0.23+20240406
version: 1.0.24+20240407
environment:
sdk: '>=2.12.0 <3.0.0'