修复密码模块bug

This commit is contained in:
魏少阳 2024-01-23 18:37:03 +08:00
parent f314d6fe05
commit d05f40370c
50 changed files with 713 additions and 557 deletions

View File

@ -62,8 +62,8 @@
"getPasswordTip1":"密码在24小时内至少要使用过一次否则将无效", "getPasswordTip1":"密码在24小时内至少要使用过一次否则将无效",
"getPasswordTip2":"限时密码可以再有下期内不限次数使用 \n密码在生效后的24小时内至少要使用过一次否则将失效", "getPasswordTip2":"限时密码可以再有下期内不限次数使用 \n密码在生效后的24小时内至少要使用过一次否则将失效",
"getPasswordTip3":"密码有限期为6个小时只能使用一次", "getPasswordTip3":"密码有限期为6个小时只能使用一次",
"getPasswordTip4":"可在锁旁边通过手机蓝牙添加,也可以通过网关远程添加", "getPasswordTip4":"手动输入6-9位数字作为密码。可在锁旁边通过手机蓝牙添加,也可以通过网关远程添加",
"getPasswordTip5":"密码在生效后的24小时内至少要使用过一次,否则将失效", "getPasswordTip5":"限时密码可以再有下期内不限次数使用 \n密码在生效后的24小时内至少要使用过一次,否则将失效",
"getPasswordTip6":"密码有效期为24小时在锁上输入后将使之前使用过的密码都失效", "getPasswordTip6":"密码有效期为24小时在锁上输入后将使之前使用过的密码都失效",
"getTip":"获取", "getTip":"获取",
"addTip":"添加", "addTip":"添加",

View File

@ -63,8 +63,8 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
hintText: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, hintText: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow(RegExp('[0-9]')), // FilteringTextInputFormatter.allow(RegExp('[0-9]')),
LengthLimitingTextInputFormatter(20), LengthLimitingTextInputFormatter(30),
]), ]),
SizedBox(height: 10.h), SizedBox(height: 10.h),
LoginInput( LoginInput(

View File

@ -215,8 +215,8 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
hintText: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, hintText: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow(RegExp('[0-9]')), // FilteringTextInputFormatter.allow(RegExp('[0-9]')),
LengthLimitingTextInputFormatter(20), LengthLimitingTextInputFormatter(30),
]), ]),
SizedBox(height: 10.w), SizedBox(height: 10.w),
LoginInput( LoginInput(

View File

@ -41,6 +41,7 @@ class _AddCardManageTabbarState extends State<AddCardManageTabbar> with SingleTi
length: _itemTabs.length, length: _itemTabs.length,
initialIndex: widget.initialIndex); initialIndex: widget.initialIndex);
_tabController.addListener(() { _tabController.addListener(() {
if (_tabController.animation!.value==_tabController.index){ if (_tabController.animation!.value==_tabController.index){
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
} }
@ -96,8 +97,7 @@ class _AddCardManageTabbarState extends State<AddCardManageTabbar> with SingleTi
return Expanded( return Expanded(
child: TabBarView( child: TabBarView(
controller: _tabController, controller: _tabController,
children: _itemTabs children: _itemTabs.map((ItemView item) => AddCardPage(
.map((ItemView item) => AddCardPage(
seletType: item.seletType, seletType: item.seletType,
lockId: widget.lockId, lockId: widget.lockId,
fromType: widget.fromType, fromType: widget.fromType,

View File

@ -317,6 +317,7 @@ class _AddCardPageState extends State<AddCardPage> {
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(18), LengthLimitingTextInputFormatter(18),
], ],
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
controller: state.nameController, controller: state.nameController,
autofocus: false, autofocus: false,
textAlign: TextAlign.end, textAlign: TextAlign.end,

View File

@ -37,7 +37,7 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
children: [ children: [
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: leftTitel:
"${TranslationLoader.lanKeys!.company!.tr}${TranslationLoader.lanKeys!.name!.tr}", "公司名称",
// rightTitle: state.companyName.value ?? "", // rightTitle: state.companyName.value ?? "",
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: getTFWidget(), rightWidget: getTFWidget(),
@ -136,12 +136,12 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return ShowTFView( return ShowTFView(
title: "请输入公司名字", title: "修改公司名字",
tipTitle: "", tipTitle: "",
controller: state.changeNameController, controller: state.changeNameController,
sureClick: () { sureClick: () {
if(state.changeNameController.text.isEmpty){ if(state.changeNameController.text.isEmpty){
logic.showToast("请输入公司"); logic.showToast("请输入公司");
return; return;
} }
Get.back(); Get.back();
@ -173,10 +173,10 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(30), LengthLimitingTextInputFormatter(30),
], ],
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
controller: state.nameController, controller: state.nameController,
autofocus: false, autofocus: false,
enabled: false, enabled: false,
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
textAlign: TextAlign.end, textAlign: TextAlign.end,
decoration: InputDecoration( decoration: InputDecoration(
// //

View File

@ -257,6 +257,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(30), LengthLimitingTextInputFormatter(30),
], ],
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
controller: tf, controller: tf,
autofocus: false, autofocus: false,
textAlign: TextAlign.end, textAlign: TextAlign.end,

View File

@ -297,6 +297,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(18), LengthLimitingTextInputFormatter(18),
], ],
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
controller: state.nameController, controller: state.nameController,
autofocus: false, autofocus: false,
textAlign: TextAlign.end, textAlign: TextAlign.end,

View File

@ -2,6 +2,7 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart'; import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:get/get.dart';
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsWithParameters.dart'; import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsWithParameters.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../blue/blue_manage.dart'; import '../../../../blue/blue_manage.dart';
@ -46,6 +47,7 @@ class AutomaticBlockingLogic extends BaseGetXController{
showToast("操作成功", something: (){ showToast("操作成功", something: (){
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
Get.back();
}); });
} }
} }
@ -213,6 +215,18 @@ class AutomaticBlockingLogic extends BaseGetXController{
}); });
} }
void ifCanNext() {
if(((state.isOpen.value != (state.lockSetInfoData.value.lockSettingInfo!.autoLock! == 1 ? true : false)) &&
(state.autoLockTime.value != state.lockSetInfoData.value.lockSettingInfo!.autoLockSecond!.toString()) &&
(state.isJustForShow.value == false)) || ((state.isOpen.value = true) && (state.lockSetInfoData.value.lockSettingInfo!.autoLock! == 1) &&
(state.autoLockTime.value != state.lockSetInfoData.value.lockSettingInfo!.autoLockSecond!.toString()) &&
(state.isJustForShow.value == false))){
state.canNext.value = true;
}else{
state.canNext.value = false;
}
}
@override @override
void onReady() { void onReady() {
// TODO: implement onReady // TODO: implement onReady

View File

@ -34,20 +34,25 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> with Rout
haveBack: true, haveBack: true,
actionsList: [ actionsList: [
Obx(() => TextButton( Obx(() => TextButton(
onPressed: state.canNext.value == false ? null :() {
// if(state.isJustForShow.value == true){
// return;
// }
// if(state.isCustomLockTime.value == true && state.timeController.text.isEmpty){
// logic.showToast("请输入自定义时间");
// return;
// }
if(state.isOpen.value == false){
showDeletAlertTipDialog(context);
}else{
logic.sendAutoLock();
}
},
child: Text( child: Text(
state.isJustForShow.value == true ? "" : TranslationLoader.lanKeys!.save!.tr, state.canNext.value == false ? "" : TranslationLoader.lanKeys!.save!.tr,
style: TextStyle(color: Colors.white, fontSize: 24.sp), style: TextStyle(color: Colors.white, fontSize: 24.sp),
), ),
onPressed: () {
if(state.isJustForShow.value == true){
return;
}
if(state.isCustomLockTime.value == true && state.timeController.text.isEmpty){
logic.showToast("请输入自定义时间");
return;
}
logic.sendAutoLock();
},
)), )),
], ],
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
@ -55,97 +60,106 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> with Rout
children: [ children: [
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr, leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr,
rightTitle: "${state.autoLockTime}s",
isHaveLine: false, isHaveLine: false,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: rightWidget:
SizedBox(width: 60.w, height: 50.h, child: _switch())),), SizedBox(width: 60.w, height: 50.h, child: _switch())),),
Container(height: 10.h,), Visibility(
Builder(builder: (context) { visible: state.isOpen.value == true ? true : false,
return Obx(() => CommonItem( child: Column(
leftTitel: TranslationLoader.lanKeys!.delayTime!.tr, children: [
rightTitle: state.isCustomLockTime.value == true ? "自定义" : "${state.autoLockTime.value}s", Container(height: 10.h,),
isHaveLine: false, Builder(builder: (context) {
isHaveDirection: true, return Obx(() => CommonItem(
action: () { leftTitel: TranslationLoader.lanKeys!.delayTime!.tr,
if(state.isJustForShow.value == true){ rightTitle: state.isCustomLockTime.value == true ? "自定义" : (state.autoLockTime.value.isNotEmpty && state.autoLockTime.value != "0") ? "${state.autoLockTime}s" : "",
return; isHaveLine: false,
} isHaveDirection: true,
var list = [ action: () {
"5", if(state.isJustForShow.value == true){
"10", return;
"15",
"30",
"60",
TranslationLoader.lanKeys!.custom!.tr
];
ShowBottomSheetTool().showSingleRowPicker(
//
context,
//
normalIndex: 0,
title: TranslationLoader.lanKeys!.time!.tr,
cancelTitle: TranslationLoader.lanKeys!.cancel!.tr,
sureTitle: TranslationLoader.lanKeys!.sure!.tr,
//
//
//adapter: PickerAdapter(),
data: list,
//
clickCallBack: (int index, var str) {
if(index != 5){
state.isCustomLockTime.value = false;
state.autoLockTime.value = str.toString();
}else{
state.isCustomLockTime.value = true;
} }
}); var list = [
})); "5",
}), "10",
Container( "15",
height: 10.h, "30",
), "60",
Obx(() => Visibility( TranslationLoader.lanKeys!.custom!.tr
visible: state.isCustomLockTime.value, ];
child: Container( ShowBottomSheetTool().showSingleRowPicker(
color: Colors.white, //
padding: EdgeInsets.only( context,
left: 30.w, top: 10.w, right: 30.w, bottom: 10.w), //
child: Column( normalIndex: 0,
children: [ title: TranslationLoader.lanKeys!.time!.tr,
Row( cancelTitle: TranslationLoader.lanKeys!.cancel!.tr,
children: [ sureTitle: TranslationLoader.lanKeys!.sure!.tr,
Text( //
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.time!.tr}(S)", //
style: TextStyle(fontSize: 24.sp), //adapter: PickerAdapter(),
), data: list,
], //
), clickCallBack: (int index, var str) {
Obx(() => TextField( if(index != 5){
// state.isCustomLockTime.value = false;
maxLines: 1, state.autoLockTime.value = str.toString();
controller: state.timeController, }else{
keyboardType: TextInputType.number, state.isCustomLockTime.value = true;
autofocus: false, }
readOnly: state.isJustForShow.value == true ? true : false, logic.ifCanNext();
decoration: InputDecoration( });
// }));
contentPadding: }),
const EdgeInsets.only(top: 12.0, bottom: 8.0), Container(height: 10.h),
hintText: Obx(() => Visibility(
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.time!.tr}(S)", visible: state.isCustomLockTime.value,
hintStyle: TextStyle(fontSize: 24.sp), child: Container(
//线 color: Colors.white,
border: InputBorder.none, padding: EdgeInsets.only(
left: 30.w, top: 10.w, right: 30.w, bottom: 10.w),
child: Column(
children: [
Row(
children: [
Text(
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.time!.tr}(S)",
style: TextStyle(fontSize: 24.sp),
),
],
),
Obx(() => TextField(
//
maxLines: 1,
controller: state.timeController,
keyboardType: TextInputType.number,
autofocus: false,
readOnly: state.isJustForShow.value == true ? true : false,
onChanged: (value) {
state.autoLockTime.value = value;
logic.ifCanNext();
},
decoration: InputDecoration(
//
contentPadding:
const EdgeInsets.only(top: 12.0, bottom: 8.0),
hintText:
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.time!.tr}(S)",
hintStyle: TextStyle(fontSize: 24.sp),
//线
border: InputBorder.none,
),
)),
Container(
height: 0.5.h,
color: Colors.grey,
),
],
), ),
)), ))),
Container( ],
height: 0.5.h, ),
color: Colors.grey, ),
),
],
),
))),
Container( Container(
padding: EdgeInsets.all(30.w), padding: EdgeInsets.all(30.w),
child: Row( child: Row(
@ -169,17 +183,44 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> with Rout
trackColor: CupertinoColors.systemGrey5, trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white, thumbColor: CupertinoColors.white,
value: state.isOpen.value, value: state.isOpen.value,
onChanged: (value) { onChanged: state.isJustForShow.value == true ? null : (value){
setState(() { setState(() {
state.isOpen.value = value; state.isOpen.value = value;
if(state.isOpen.value == false){ if(state.isOpen.value == false){
state.autoLockTime.value = "0"; state.autoLockTime.value = "";
} }
logic.ifCanNext();
}); });
}, },
); );
} }
void showDeletAlertTipDialog(BuildContext 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.sendAutoLock();
},
),
],
);
},
);
}
@override @override
void didChangeDependencies() { void didChangeDependencies() {

View File

@ -11,13 +11,15 @@ class AutomaticBlockingState {
var isJustForShow = false.obs;// var isJustForShow = false.obs;//
var ifCurrentScreen = true.obs; // , var ifCurrentScreen = true.obs; // ,
var sureBtnState = 0.obs;// 0() 1() var sureBtnState = 0.obs;// 0 1
var isOpen = false.obs;// var isOpen = false.obs;//
var autoLockTime = "5".obs; var autoLockTime = "5".obs;
var isCustomLockTime = false.obs;// var isCustomLockTime = false.obs;//
final TextEditingController timeController = TextEditingController(); final TextEditingController timeController = TextEditingController();
var canNext = false.obs;//
AutomaticBlockingState() { AutomaticBlockingState() {
var map = Get.arguments; var map = Get.arguments;
lockSetInfoData.value = map["lockSetInfoData"]; lockSetInfoData.value = map["lockSetInfoData"];
@ -29,6 +31,7 @@ class AutomaticBlockingState {
if(lockBasicInfo.value.isLockOwner == 1 || lockBasicInfo.value.keyRight == 1){ if(lockBasicInfo.value.isLockOwner == 1 || lockBasicInfo.value.keyRight == 1){
isJustForShow.value = false; isJustForShow.value = false;
}else{ }else{
//
isJustForShow.value = true; isJustForShow.value = true;
} }

View File

@ -121,7 +121,12 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{
print("indexList:$indexList"); print("indexList:$indexList");
var pwd = indexList.sublist(1, 11); var pwd = indexList.sublist(1, 11);
var pwdStr = utf8String(pwd); var pwdStr = utf8String(pwd);
print("pwd:$pwd pwdStr:$pwdStr"); print("pwd:$pwd pwdStr:$pwdStr state.adminPwd.value:${state.adminPwd.value}");
// if(pwdStr == state.adminPwd.value){
// showToast("");
// return;
// }
state.adminPwd.value = pwdStr; state.adminPwd.value = pwdStr;
addLockAdminPassword(false); addLockAdminPassword(false);
} }

View File

@ -88,7 +88,7 @@ class _AdminOpenLockPasswordPageState extends State<AdminOpenLockPasswordPage> {
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return ShowTFView( return ShowTFView(
title: "管理员密码", title: "修改密码",
tipTitle: "请输入", tipTitle: "请输入",
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
inputFormatters: [ inputFormatters: [

View File

@ -75,7 +75,12 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
allHeight: 70.h, allHeight: 70.h,
isHaveLine: false), isHaveLine: false),
SizedBox(height: 10.h), SizedBox(height: 10.h),
CommonItem( Visibility(
visible: (state.lockBasicInfo.value.isLockOwner == 1 ||
state.lockBasicInfo.value.keyRight == 1)
? true
: false,
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.lockName!.tr, leftTitel: TranslationLoader.lanKeys!.lockName!.tr,
rightTitle: state.lockBasicInfo.value.lockAlias, rightTitle: state.lockBasicInfo.value.lockAlias,
isHaveLine: true, isHaveLine: true,
@ -90,7 +95,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
state.lockBasicInfo.value = data["lockBasicInfo"]; state.lockBasicInfo.value = data["lockBasicInfo"];
}); });
} }
}), })),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.lockGrouping!.tr, leftTitel: TranslationLoader.lanKeys!.lockGrouping!.tr,
rightTitle: state.lockBasicInfo.value.groupName, rightTitle: state.lockBasicInfo.value.groupName,

View File

@ -16,9 +16,12 @@ class EditLockNameLogic extends BaseGetXController{
lockId: state.lockSetInfoData.value.lockId.toString(), lockId: state.lockSetInfoData.value.lockId.toString(),
lockName:state.changeLockNameController.text); lockName:state.changeLockNameController.text);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("修改成功"); showToast("修改成功", something: (){
state.lockBasicInfo.value.lockAlias = state.changeLockNameController.text; state.lockBasicInfo.value.lockAlias = state.changeLockNameController.text;
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(3, state.lockBasicInfo.value.lockAlias!)); eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(3, state.lockBasicInfo.value.lockAlias!));
eventBus.fire(RefreshLockListInfoDataEvent());
});
Get.back(result: { Get.back(result: {
"lockBasicInfo":state.lockBasicInfo.value "lockBasicInfo":state.lockBasicInfo.value
}); });

View File

@ -23,11 +23,12 @@ class UploadElectricQuantityLogic extends BaseGetXController {
Future<void> uploadElectricQuantityRequest(String electricQuantity) async { Future<void> uploadElectricQuantityRequest(String electricQuantity) async {
KeyOperationRecordEntity entity = await ApiRepository.to.uploadElectricQuantity(electricQuantity, state.lockSetInfoData.value.lockId.toString()); KeyOperationRecordEntity entity = await ApiRepository.to.uploadElectricQuantity(electricQuantity, state.lockSetInfoData.value.lockId.toString());
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, electricQuantity));
eventBus.fire(RefreshLockListInfoDataEvent());
showToast("锁电量更新成功"); showToast("锁电量更新成功", something: (){
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, electricQuantity));
eventBus.fire(RefreshLockListInfoDataEvent());
});
} }
} }

View File

@ -41,4 +41,15 @@ class CheckInCreatCompanyLogic extends BaseGetXController{
showToast("设置成功"); showToast("设置成功");
} }
} }
void ifCanNext() {
if(state.companyNameController.text.isNotEmpty &&
state.weekDays.value.isNotEmpty &&
state.beginTimeTimestamp.value.isNotEmpty &&
state.endTimeTimestamp.value.isNotEmpty) {
state.canNext.value = true;
}else{
state.canNext.value = false;
}
}
} }

View File

@ -55,12 +55,11 @@ class _CheckInCreatCompanyPageState extends State<CheckInCreatCompanyPage> {
}); });
if(data != null) { if(data != null) {
setState(() {
state.beginTime.value = data["beginTime"]; state.beginTime.value = data["beginTime"];
state.endTime.value = data["endTime"]; state.endTime.value = data["endTime"];
state.beginTimeTimestamp.value = data["beginTimeTimestamp"]; state.beginTimeTimestamp.value = data["beginTimeTimestamp"];
state.endTimeTimestamp.value = data["endTimeTimestamp"]; state.endTimeTimestamp.value = data["endTimeTimestamp"];
}); logic.ifCanNext();
} }
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(
@ -77,26 +76,26 @@ class _CheckInCreatCompanyPageState extends State<CheckInCreatCompanyPage> {
"checkingInSetInfo": CheckingInSetInfo(), "checkingInSetInfo": CheckingInSetInfo(),
}); });
if(data != null) { if(data != null) {
setState(() {
state.isCustom.value = data["attendanceType"]; state.isCustom.value = data["attendanceType"];
state.weekDays.value = data["weekDays"]; state.weekDays.value = data["weekDays"];
state.weekDaysStr.value = state.weekDays.value.join(","); state.weekDaysStr.value = state.weekDays.value.join(",");
}); logic.ifCanNext();
} }
})), })),
SizedBox( SizedBox(
height: 30.h, height: 30.h,
), ),
SubmitBtn( Obx(() => SubmitBtn(
btnName: TranslationLoader.lanKeys!.sure!.tr, btnName: TranslationLoader.lanKeys!.sure!.tr,
borderRadius: 20.w, borderRadius: 20.w,
fontSize: 32.sp, fontSize: 32.sp,
isDelete: false, isDelete: false,
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: () { isDisabled: state.canNext.value,
onClick: state.canNext.value ? (){
logic.setCheckInCreateCompany(); logic.setCheckInCreateCompany();
}), }: null)),
], ],
), ),
); );
@ -117,8 +116,12 @@ class _CheckInCreatCompanyPageState extends State<CheckInCreatCompanyPage> {
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(30), LengthLimitingTextInputFormatter(30),
], ],
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
autofocus: false, autofocus: false,
textAlign: TextAlign.end, textAlign: TextAlign.end,
onChanged: (value) {
logic.ifCanNext();
},
decoration: InputDecoration( decoration: InputDecoration(
// //
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), // contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),

View File

@ -19,6 +19,8 @@ class CheckInCreatCompanyState{
var endTime = "".obs;// var endTime = "".obs;//
var beginTimeTimestamp = "".obs;// var beginTimeTimestamp = "".obs;//
var endTimeTimestamp = "".obs;// var endTimeTimestamp = "".obs;//
var canNext = false.obs;//
CheckInCreatCompanyState() { CheckInCreatCompanyState() {
var map = Get.arguments; var map = Get.arguments;
lockSetInfoData.value = map["lockSetInfoData"]; lockSetInfoData.value = map["lockSetInfoData"];

View File

@ -680,10 +680,11 @@ class LockSetLogic extends BaseGetXController {
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) { void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
// eventBus // eventBus
_passCurrentLockInformationEvent = eventBus.on<PassCurrentLockInformationEvent>().listen((event) { _passCurrentLockInformationEvent = eventBus.on<PassCurrentLockInformationEvent>().listen((event) {
state.lockSetInfoData.value = event.lockSetInfoData; // state.lockSetInfoData.value = event.lockSetInfoData;
state.isAttendance.value = state.lockSetInfoData.value.lockSettingInfo!.attendance!; // state.isAttendance.value = state.lockSetInfoData.value.lockSettingInfo!.attendance!;
// print("22222event.lockSetInfoData.lockSettingInfo!.autoLockSecond:${event.lockSetInfoData.lockSettingInfo!.autoLockSecond}"); // print("22222event.lockSetInfoData.lockSettingInfo!.autoLockSecond:${event.lockSetInfoData.lockSettingInfo!.autoLockSecond}");
blockSetStateCallback(); // blockSetStateCallback();
getLockSettingInfoData();
}); });
} }

View File

@ -216,8 +216,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
visible: state.lockFeature.value.autoLock == 1 ? true : false, visible: state.lockFeature.value.autoLock == 1 ? true : false,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr, leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr,
rightTitle: (state.lockSettingInfo.value.autoLock ?? 0) > 0 rightTitle: state.lockSettingInfo.value.autoLock! > 0
? "${state.lockSetInfoData.value.lockSettingInfo!.autoLockSecond ?? 0}s" ? "${state.lockSetInfoData.value.lockSettingInfo!.autoLockSecond}s"
: TranslationLoader.lanKeys!.closed!.tr, : TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
@ -285,8 +285,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
SizedBox(height: 10.h), SizedBox(height: 10.h),
// //
Obx(() => Visibility( Obx(() => Visibility(
visible: state.lockFeature.value.passageMode == 1 ? true : false, // visible: state.lockFeature.value.passageMode == 1 ? true : false,
// visible:true, visible:true,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr, leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == 1 rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == 1

View File

@ -31,6 +31,7 @@ class LockSoundSetLogic extends BaseGetXController {
state.lockSetInfoData.value.lockSettingInfo!.lockSound = state.isOpenLockSound.value == true ? 1 :0; state.lockSetInfoData.value.lockSettingInfo!.lockSound = state.isOpenLockSound.value == true ? 1 :0;
state.lockSetInfoData.value.lockSettingInfo!.lockSoundVolume = state.lockSoundLevel.value; state.lockSetInfoData.value.lockSettingInfo!.lockSoundVolume = state.lockSoundLevel.value;
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
ifCanNext();
showToast("操作成功"); showToast("操作成功");
} }
} }
@ -197,6 +198,14 @@ class LockSoundSetLogic extends BaseGetXController {
}); });
} }
void ifCanNext() {
if((state.lockSoundLevel.value != state.lockSetInfoData.value.lockSettingInfo!.lockSoundVolume!) || (state.isOpenLockSound.value != (state.lockSetInfoData.value.lockSettingInfo!.lockSound == 1 ? true : false))){
state.canNext.value = true;
}else{
state.canNext.value = false;
}
}
@override @override
void onReady() { void onReady() {
// TODO: implement onReady // TODO: implement onReady

View File

@ -73,7 +73,7 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
.lanKeys!.pleaseSeletLockVolume!.tr, .lanKeys!.pleaseSeletLockVolume!.tr,
rightTitle: "", rightTitle: "",
isHaveLine: true), isHaveLine: true),
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.low!.tr, leftTitel: TranslationLoader.lanKeys!.low!.tr,
rightTitle: "", rightTitle: "",
isHaveLine: true, isHaveLine: true,
@ -83,6 +83,7 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
setState(() { setState(() {
state.lockSoundLevel.value = 1; state.lockSoundLevel.value = 1;
}); });
logic.ifCanNext();
}, },
child: Row( child: Row(
children: [ children: [
@ -93,17 +94,18 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
), ),
], ],
), ),
)), ))),
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.lower!.tr, leftTitel: TranslationLoader.lanKeys!.lower!.tr,
rightTitle: "", rightTitle: "",
isHaveLine: true, isHaveLine: true,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: GestureDetector( rightWidget: GestureDetector(
onTap: () { onTap: () {
setState(() { // setState(() {
state.lockSoundLevel.value = 2; state.lockSoundLevel.value = 2;
}); // });
logic.ifCanNext();
}, },
child: Row( child: Row(
children: [ children: [
@ -114,17 +116,18 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
), ),
], ],
), ),
)), ))),
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.medium!.tr, leftTitel: TranslationLoader.lanKeys!.medium!.tr,
rightTitle: "", rightTitle: "",
isHaveLine: true, isHaveLine: true,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: GestureDetector( rightWidget: GestureDetector(
onTap: () { onTap: () {
setState(() { // setState(() {
state.lockSoundLevel.value = 3; state.lockSoundLevel.value = 3;
}); // });
logic.ifCanNext();
}, },
child: Row( child: Row(
children: [ children: [
@ -135,17 +138,18 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
), ),
], ],
), ),
)), ))),
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.higher!.tr, leftTitel: TranslationLoader.lanKeys!.higher!.tr,
rightTitle: "", rightTitle: "",
isHaveLine: true, isHaveLine: true,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: GestureDetector( rightWidget: GestureDetector(
onTap: () { onTap: () {
setState(() { // setState(() {
state.lockSoundLevel.value = 4; state.lockSoundLevel.value = 4;
}); // });
logic.ifCanNext();
}, },
child: Row( child: Row(
children: [ children: [
@ -156,17 +160,18 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
), ),
], ],
), ),
)), ))),
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.high!.tr, leftTitel: TranslationLoader.lanKeys!.high!.tr,
rightTitle: "", rightTitle: "",
isHaveLine: true, isHaveLine: true,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: GestureDetector( rightWidget: GestureDetector(
onTap: () { onTap: () {
setState(() { // setState(() {
state.lockSoundLevel.value = 5; state.lockSoundLevel.value = 5;
}); // });
logic.ifCanNext();
}, },
child: Row( child: Row(
children: [ children: [
@ -177,7 +182,7 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
), ),
], ],
), ),
)), ))),
], ],
), ),
)), )),
@ -185,9 +190,10 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 30.w), margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 30.w),
child: SubmitBtn( child: SubmitBtn(
btnName: TranslationLoader.lanKeys!.save!.tr, btnName: TranslationLoader.lanKeys!.save!.tr,
onClick: () { isDisabled: state.canNext.value,
onClick: state.canNext.value ? (){
logic.sendLockSound(); logic.sendLockSound();
}), }: null),
), ),
], ],
))); )));
@ -203,6 +209,7 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
setState(() { setState(() {
state.isOpenLockSound.value = value; state.isOpenLockSound.value = value;
}); });
logic.ifCanNext();
}, },
); );
} }

View File

@ -10,6 +10,7 @@ class LockSoundSetState {
var lockSoundLevel = 0.obs;// var lockSoundLevel = 0.obs;//
var ifCurrentScreen = true.obs; // , var ifCurrentScreen = true.obs; // ,
var sureBtnState = 0.obs;// 0() 1() var sureBtnState = 0.obs;// 0() 1()
var canNext = false.obs;//
LockSoundSetState() { LockSoundSetState() {
var map = Get.arguments; var map = Get.arguments;

View File

@ -47,12 +47,13 @@ class NormallyOpenModeLogic extends BaseGetXController{
passageModeConfig: passageModeConfig, passageModeConfig: passageModeConfig,
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
eventBus.fire(RefreshLockListInfoDataEvent()); showToast("操作成功", something: (){
eventBus.fire(RefreshLockListInfoDataEvent());
state.lockSetInfoData.value.lockSettingInfo!.passageMode = state.isOpenNormallyOpenMode.value == true ? 1:0; state.lockSetInfoData.value.lockSettingInfo!.passageMode = state.isOpenNormallyOpenMode.value == true ? 1:0;
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(2, state.lockSetInfoData.value.lockSettingInfo!.passageMode!.toString())); eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(2, state.lockSetInfoData.value.lockSettingInfo!.passageMode!.toString()));
showToast("操作成功"); });
} }
} }

View File

@ -186,6 +186,10 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> with RouteA
} }
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
if(state.isJustForShow.value == true){
return;
}
if (state.weekDays.value.contains(index)) { if (state.weekDays.value.contains(index)) {
state.weekDays.value.remove(index); state.weekDays.value.remove(index);
} else { } else {
@ -235,6 +239,10 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> with RouteA
rightWidget: GestureDetector( rightWidget: GestureDetector(
onTap: () { onTap: () {
// //
if(state.isJustForShow.value == true){
return;
}
if (state.isAllDay.value == 1) { if (state.isAllDay.value == 1) {
state.isAllDay.value = 0; state.isAllDay.value = 0;
} else { } else {
@ -274,6 +282,10 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> with RouteA
isHaveDirection: true, isHaveDirection: true,
isHaveLine: true, isHaveLine: true,
action: () { action: () {
if(state.isJustForShow.value == true){
return;
}
Pickers.showDatePicker(context, mode: DateMode.HM, Pickers.showDatePicker(context, mode: DateMode.HM,
onConfirm: (p) { onConfirm: (p) {
setState(() { setState(() {
@ -289,6 +301,10 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> with RouteA
rightTitle: state.endTime.value, rightTitle: state.endTime.value,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
if(state.isJustForShow.value == true){
return;
}
Pickers.showDatePicker(context, mode: DateMode.HM, Pickers.showDatePicker(context, mode: DateMode.HM,
onConfirm: (p) { onConfirm: (p) {
setState(() { setState(() {
@ -312,7 +328,7 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> with RouteA
trackColor: CupertinoColors.systemGrey5, trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white, thumbColor: CupertinoColors.white,
value: state.isOpenNormallyOpenMode.value, value: state.isOpenNormallyOpenMode.value,
onChanged: (value) { onChanged: state.isJustForShow.value == true ? null : (value) {
setState(() { setState(() {
state.isOpenNormallyOpenMode.value = value; state.isOpenNormallyOpenMode.value = value;
}); });

View File

@ -141,7 +141,7 @@ class _WirelessKeyboardPageState extends State<WirelessKeyboardPage> {
context: widgetContext, context: widgetContext,
builder: (context) { builder: (context) {
return CupertinoAlertDialog( return CupertinoAlertDialog(
title: const Text('该锁的电子钥匙都将被删除'), title: const Text('该锁的无线键盘都将被删除'),
actions: [ actions: [
CupertinoDialogAction( CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr), child: Text(TranslationLoader.lanKeys!.cancel!.tr),

View File

@ -3,7 +3,6 @@ import 'package:flutter/services.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:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:uuid/uuid.dart';
import '../../../appRouters.dart'; import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart'; import '../../../app_settings/app_colors.dart';
@ -358,8 +357,10 @@ class _LockDetailPageState extends State<LockDetailPage>
// ic卡 // ic卡
if (state.keyInfos.value.lockFeature!.icCard == 1) { if (state.keyInfos.value.lockFeature!.icCard == 1) {
showWidgetArr.add(bottomItem('images/main/icon_main_icCard.png', showWidgetArr.add(bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, () {
TranslationLoader.lanKeys!.card!.tr, () { // logic.showToast("普通用户第一次需要在锁旁边操作哦。", something: () {
// logic.showEasyLoading();
// });
Get.toNamed(Routers.cardListPage, arguments: { Get.toNamed(Routers.cardListPage, arguments: {
"lockId": widget.lockListInfoItemEntity.lockId, "lockId": widget.lockListInfoItemEntity.lockId,
}); });

View File

@ -3,6 +3,7 @@ import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyDetail/password
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart'; import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
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 'package:star_lock/tools/eventBusEventManage.dart';
class PasswordKeyDetailLogic extends BaseGetXController { class PasswordKeyDetailLogic extends BaseGetXController {
final PasswordKeyDetailState state = PasswordKeyDetailState(); final PasswordKeyDetailState state = PasswordKeyDetailState();
@ -20,21 +21,108 @@ class PasswordKeyDetailLogic extends BaseGetXController {
} }
// //
Future<void> updatePwdRequest() async { Future<void> updatePwdRequest(int changType) async {
PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey( PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey(
lockId: state.itemData.value.lockId!, lockId: state.itemData.value.lockId!,
keyboardPwdId: state.itemData.value.keyboardPwdId.toString(), keyboardPwdId: state.itemData.value.keyboardPwdId.toString(),
keyboardPwdName: state.inputNameController.text, keyboardPwdName: state.inputNameController.text,
newKeyboardPwd: state.inputPwdController.text, newKeyboardPwd: state.inputPwdController.text,
startDate: state.startDate.value, startDate: state.itemData.value.startDate!,
endDate: state.endDate.value, endDate: state.itemData.value.endDate!,
changeType: state.changeType.value, changeType: state.changeType.value,
hoursStart: state.hoursStart.value, hoursStart: state.itemData.value.hoursStart!,
hoursEnd: state.hoursEnd.value, hoursEnd: state.itemData.value.hoursEnd!,
isCoerced: state.isCoerced.value); isCoerced: state.itemData.value.isCoerced!.toString());
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("修改成功"); showToast("修改成功");
if(changType == 1){
//
state.keyboardPwdName.value = state.inputNameController.text;
}else if(changType == 2){
//
state.keyboardPwd.value = state.inputPwdController.text;
}
print("state.itemData.value.keyboardPwd:${state.itemData.value.keyboardPwd} state.itemData.value.keyboardPwdName:${state.itemData.value.keyboardPwdName}");
Get.back(); Get.back();
eventBus.fire(GetPasswordListRefreshUI());
} }
} }
//使
String getUseDateStr() {
int? getPwdType = state.itemData.value.keyboardPwdType;
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;
switch (getPwdType) {
case 1:
// 1 6使
useDateStr =
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
break;
case 2:
// 2 24使
useDateStr = '永久';
break;
case 3:
// 3 24使
useDateStr =
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
break;
case 4:
// 4 使使
useDateStr =
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
break;
case 5:
// 5
useDateStr = '周末 $starHour:00-$endHour:00';
break;
case 6:
// 6
useDateStr = '周日 $starHour:00-$endHour:00';
break;
case 7:
// 7
useDateStr = '工作日 $starHour:00-$endHour:00';
break;
case 8:
// 8
useDateStr = '周一 $starHour:00-$endHour:00';
break;
case 9:
// 9
useDateStr = '周二 $starHour:00-$endHour:00';
break;
case 10:
// 10
useDateStr = '周三 $starHour:00-$endHour:00';
break;
case 11:
// 11
useDateStr = '周四 $starHour:00-$endHour:00';
break;
case 12:
// 12
useDateStr = '周五 $starHour:00-$endHour:00';
break;
case 13:
// 13
useDateStr = '周六 $starHour:00-$endHour:00';
break;
case 14:
// 14
useDateStr = '周天 $starHour:00-$endHour:00';
break;
default:
}
return useDateStr;
}
} }

View File

@ -50,53 +50,45 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.password!.tr, leftTitel: TranslationLoader.lanKeys!.password!.tr,
rightTitle: state.inputPwdController.text.isNotEmpty rightTitle: state.keyboardPwd.value,
? state.inputPwdController.text
: state.itemData.value.keyboardPwd,
isHaveDirection: (state.itemData.value.keyboardPwdType == 1 || isHaveDirection: (state.itemData.value.keyboardPwdType == 1 ||
state.itemData.value.keyboardPwdType == 4) state.itemData.value.keyboardPwdType == 4)
? false ? false
: true, : true,
isHaveLine: true, isHaveLine: true,
action: () { action: () {
if (state.itemData.value.keyboardPwdType == 1 || if (state.itemData.value.keyboardPwdType == 1 || state.itemData.value.keyboardPwdType == 4) {
state.itemData.value.keyboardPwdType == 4) {
return; return;
} else { } else {
showCupertinoAlertDialog( showCupertinoAlertDialog(context, state.inputPwdController);
context, state.inputPwdController);
} }
}), })),
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.name!.tr, leftTitel: TranslationLoader.lanKeys!.name!.tr,
rightTitle: state.inputNameController.text.isNotEmpty rightTitle: state.keyboardPwdName.value,
? state.inputNameController.text
: state.itemData.value.keyboardPwdName,
isHaveDirection: true, isHaveDirection: true,
isHaveLine: true, isHaveLine: true,
action: () { action: () {
showCupertinoAlertDialog( showCupertinoAlertDialog(
context, state.inputNameController); context, state.inputNameController);
}), })),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, leftTitel: "有效期",
rightTitle: getUseDateStr(), rightTitle: logic.getUseDateStr(),
isHaveDirection: true, isHaveDirection: ((state.itemData.value.keyboardPwdType! > 3 &&
state.itemData.value.keyboardPwdType! < 15) || state.itemData.value.keyboardPwdType! == 1) ? false : true,
allHeight: allHeight:
state.itemData.value.keyboardPwdType == 3 ? 90.h : 65.h, state.itemData.value.keyboardPwdType == 3 ? 90.h : 65.h,
action: () { action: () {
if (state.itemData.value.keyboardPwdType! > 4 && if ((state.itemData.value.keyboardPwdType! > 3 &&
state.itemData.value.keyboardPwdType! < 15) { state.itemData.value.keyboardPwdType! < 15 ) || state.itemData.value.keyboardPwdType! == 1) {
return; return;
} }
Navigator.pushNamed( Get.toNamed(Routers.passwordKeyDetailChangeDatePage,
context, Routers.passwordKeyDetailChangeDatePage,
arguments: { arguments: {
'itemData': state.itemData.value, 'itemData': state.itemData.value,
'lockId': state.itemData.value.lockId,
'pwdId': state.itemData.value.keyboardPwdId.toString()
}); });
}), }),
Container(height: 10.h), Container(height: 10.h),
@ -204,88 +196,10 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
)); ));
} }
//使
String getUseDateStr() {
int? getPwdType = state.itemData.value.keyboardPwdType;
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;
switch (getPwdType) {
case 1:
// 1 6使
useDateStr =
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
break;
case 2:
// 2 24使
useDateStr = '永久';
break;
case 3:
// 3 24使
useDateStr =
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
break;
case 4:
// 4 使使
useDateStr =
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
break;
case 5:
// 5
useDateStr = '周末 $starHour:00-$endHour:00';
break;
case 6:
// 6
useDateStr = '周日 $starHour:00-$endHour:00';
break;
case 7:
// 7
useDateStr = '工作日 $starHour:00-$endHour:00';
break;
case 8:
// 8
useDateStr = '周一 $starHour:00-$endHour:00';
break;
case 9:
// 9
useDateStr = '周二 $starHour:00-$endHour:00';
break;
case 10:
// 10
useDateStr = '周三 $starHour:00-$endHour:00';
break;
case 11:
// 11
useDateStr = '周四 $starHour:00-$endHour:00';
break;
case 12:
// 12
useDateStr = '周五 $starHour:00-$endHour:00';
break;
case 13:
// 13
useDateStr = '周六 $starHour:00-$endHour:00';
break;
case 14:
// 14
useDateStr = '周天 $starHour:00-$endHour:00';
break;
default:
}
return useDateStr;
}
// //
String getSenderDate(PasswordKeyListItem indexEntity) { String getSenderDate(PasswordKeyListItem indexEntity) {
String senderDate = ''; String senderDate = '';
DateTime dateStr = DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
senderDate = dateStr.toLocal().toString().substring(0, 16); senderDate = dateStr.toLocal().toString().substring(0, 16);
return senderDate; return senderDate;
} }
@ -299,13 +213,15 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
title: inputController == state.inputNameController title: inputController == state.inputNameController
? "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}" ? "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}"
: "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.password!.tr}", : "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.password!.tr}",
tipTitle: tipTitle: inputController.text.isNotEmpty ? inputController.text : "请输入",
inputController.text.isNotEmpty ? inputController.text : "请输入",
controller: inputController, controller: inputController,
keyboardType: inputController == state.inputNameController
? TextInputType.text
: TextInputType.number,
sureClick: () { sureClick: () {
// //
if (inputController.text.isNotEmpty) { if (inputController.text.isNotEmpty) {
logic.updatePwdRequest(); logic.updatePwdRequest(inputController == state.inputNameController ? 1 : 2);
} }
}, },
cancelClick: () { cancelClick: () {
@ -321,7 +237,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
context: context, context: context,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadiusDirectional.circular(10)), borderRadius: BorderRadiusDirectional.circular(10)),
constraints: BoxConstraints(maxHeight: 260.h), constraints: BoxConstraints(maxHeight: 270.h),
builder: (BuildContext context) { builder: (BuildContext context) {
return Column( return Column(
children: [ children: [

View File

@ -6,16 +6,25 @@ class PasswordKeyDetailState {
final itemData = PasswordKeyListItem().obs; final itemData = PasswordKeyListItem().obs;
final TextEditingController inputPwdController = TextEditingController(); final TextEditingController inputPwdController = TextEditingController();
final TextEditingController inputNameController = TextEditingController(); final TextEditingController inputNameController = TextEditingController();
final changeType = '1' final changeType = '1'.obs; //1-APP走蓝牙修改1APP SDK蓝牙修改后调用该接口 2-WiFi锁修改WiFi锁或有连接网关2
.obs; //1-APP走蓝牙修改1APP SDK蓝牙修改后调用该接口 2-WiFi锁修改WiFi锁或有连接网关2 final keyboardPwd = ''.obs;
final isCoerced = '1'.obs; //:1;:2 final keyboardPwdName = ''.obs;
final hoursStart = 0.obs; // final hoursStart = 0.obs;
final hoursEnd = 0.obs; // final hoursEnd = 0.obs;
final startDate = 0.obs; // final startDate = 0.obs;
final endDate = 0.obs; // final endDate = 0.obs;
PasswordKeyDetailState() { PasswordKeyDetailState() {
Map map = Get.arguments; Map map = Get.arguments;
itemData.value = map["itemData"]; itemData.value = map["itemData"];
// isCoerced.value = itemData.value.isCoerced!.toString();
keyboardPwd.value = itemData.value.keyboardPwd!;
keyboardPwdName.value = itemData.value.keyboardPwdName!;
inputNameController.text = itemData.value.keyboardPwdName!;
inputPwdController.text = itemData.value.keyboardPwd!;
// startDate.value = itemData.value.startDate!;
// endDate.value = itemData.value.endDate!;
// hoursStart.value = itemData.value.hoursStart!;
// hoursEnd.value = itemData.value.hoursEnd!;
} }
} }

View File

@ -4,27 +4,30 @@ import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/pass
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';
class PasswordKeyDetailChangeDateLogic extends BaseGetXController { import '../../../../tools/eventBusEventManage.dart';
final PasswordKeyDetailChangeDateState state =
PasswordKeyDetailChangeDateState();
class PasswordKeyDetailChangeDateLogic extends BaseGetXController {
final PasswordKeyDetailChangeDateState state = PasswordKeyDetailChangeDateState();
// //
Future<void> updatePwdRequest() async { Future<void> updatePwdRequest() async {
PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey( PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey(
lockId: state.itemData.value.lockId!, lockId: state.itemData.value.lockId!,
keyboardPwdId: state.pwdId.value.toString(), keyboardPwdId: state.itemData.value.keyboardPwdId.toString(),
keyboardPwdName: state.inputNameController.text, keyboardPwdName: state.itemData.value.keyboardPwdName!,
newKeyboardPwd: state.inputPwdController.text, newKeyboardPwd: state.itemData.value.keyboardPwd!,
startDate: state.startDate.value, startDate: state.itemData.value.startDate!,
endDate: state.endDate.value, endDate: state.itemData.value.endDate!,
changeType: state.changeType.value, changeType: '1',
hoursStart: state.hoursStart.value, hoursStart: state.itemData.value.hoursStart!,
hoursEnd: state.hoursEnd.value, hoursEnd: state.itemData.value.hoursEnd!,
isCoerced: state.isCoerced.value); isCoerced: "1");
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("修改成功", something: (){ showToast("修改成功", something: (){
eventBus.fire(GetPasswordListRefreshUI());
Get.back(); Get.back();
}); });
} }
} }
} }

View File

@ -39,9 +39,9 @@ class _PasswordKeyDetailChangeDatePage
style: TextStyle(color: Colors.white, fontSize: 24.sp), style: TextStyle(color: Colors.white, fontSize: 24.sp),
), ),
onPressed: () { onPressed: () {
if (state.lockId.value != 0 && state.pwdId.value.isNotEmpty) { // if (state.lockId.value != 0 && state.pwdId.value.isNotEmpty) {
logic.updatePwdRequest(); logic.updatePwdRequest();
} // }
}, },
), ),
], ],
@ -75,12 +75,12 @@ class _PasswordKeyDetailChangeDatePage
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDHM, Pickers.showDatePicker(context, mode: DateMode.YMDH,
onConfirm: (p) { onConfirm: (p) {
state.selectEffectiveDate.value = state.selectEffectiveDate.value =
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}'; '${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
state.effectiveDateTime = // state.effectiveDateTime = DateTime.parse(state.selectEffectiveDate.value);
DateTime.parse(state.selectEffectiveDate.value); state.itemData.value.startDate = DateTime.parse(state.selectEffectiveDate.value).millisecondsSinceEpoch; //
}); });
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(
@ -90,12 +90,12 @@ class _PasswordKeyDetailChangeDatePage
: getEndDate, : getEndDate,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDHM, Pickers.showDatePicker(context, mode: DateMode.YMDH,
onConfirm: (p) { onConfirm: (p) {
state.selectFailureDate.value = state.selectFailureDate.value =
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}'; '${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
state.failureDateTime = // state.failureDateTime = DateTime.parse(state.selectFailureDate.value);
DateTime.parse(state.selectFailureDate.value); state.itemData.value.endDate = DateTime.parse(state.selectFailureDate.value).millisecondsSinceEpoch; //
}); });
})), })),
], ],

View File

@ -4,25 +4,24 @@ import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKe
class PasswordKeyDetailChangeDateState { class PasswordKeyDetailChangeDateState {
final itemData = PasswordKeyListItem().obs; final itemData = PasswordKeyListItem().obs;
final TextEditingController inputPwdController = TextEditingController(); // final TextEditingController inputPwdController = TextEditingController();
final TextEditingController inputNameController = TextEditingController(); // final TextEditingController inputNameController = TextEditingController();
final changeType = '1' // final changeType = '1'.obs; //1-APP走蓝牙修改1APP SDK蓝牙修改后调用该接口 2-WiFi锁修改WiFi锁或有连接网关2
.obs; //1-APP走蓝牙修改1APP SDK蓝牙修改后调用该接口 2-WiFi锁修改WiFi锁或有连接网关2 // final isCoerced = '1'.obs; //:1;:2
final isCoerced = '1'.obs; //:1;:2 // final hoursStart = 0.obs;
final hoursStart = 0.obs; // final hoursEnd = 0.obs;
final hoursEnd = 0.obs; // final startDate = 0.obs;
final startDate = 0.obs; // final endDate = 0.obs;
final endDate = 0.obs; // final pwdId = ''.obs;
final pwdId = ''.obs; // final lockId = 0.obs;
final lockId = 0.obs; // final fromType = ''.obs;
final fromType = ''.obs;
final selectEffectiveDate = ''.obs; // final selectEffectiveDate = ''.obs; //
final selectFailureDate = ''.obs; // final selectFailureDate = ''.obs; //
DateTime effectiveDateTime = DateTime.now(); // DateTime effectiveDateTime = DateTime.now();
DateTime failureDateTime = DateTime.now(); // DateTime failureDateTime = DateTime.now();
final endDay = ''.obs; // final endDay = ''.obs;
final startDay = ''.obs; // final startDay = ''.obs;
final weekDays = [].obs; // final weekDays = [].obs;
PasswordKeyDetailChangeDateState() { PasswordKeyDetailChangeDateState() {
Map map = Get.arguments; Map map = Get.arguments;
@ -30,11 +29,11 @@ class PasswordKeyDetailChangeDateState {
if ((map["itemData"] != null)) { if ((map["itemData"] != null)) {
itemData.value = map["itemData"]; itemData.value = map["itemData"];
} }
if ((map["pwdId"] != null)) { // if ((map["pwdId"] != null)) {
pwdId.value = map["pwdId"]; // pwdId.value = map["pwdId"];
} // }
if ((map["lockId"] != null)) { // if ((map["lockId"] != null)) {
lockId.value = map["lockId"]; // lockId.value = map["lockId"];
} // }
} }
} }

View File

@ -79,6 +79,9 @@ class PasswordKeyListItem {
int? keyboardPwdId; int? keyboardPwdId;
int? sendDate; int? sendDate;
String? validTimeStr; String? validTimeStr;
int? isCoerced;
int? hoursStart;
int? hoursEnd;
PasswordKeyListItem( PasswordKeyListItem(
{this.apiUserId, {this.apiUserId,
@ -94,7 +97,10 @@ class PasswordKeyListItem {
this.senderUsername, this.senderUsername,
this.keyboardPwdId, this.keyboardPwdId,
this.sendDate, this.sendDate,
this.validTimeStr}); this.validTimeStr,
this.isCoerced,
this.hoursStart,
this.hoursEnd});
PasswordKeyListItem.fromJson(Map<String, dynamic> json) { PasswordKeyListItem.fromJson(Map<String, dynamic> json) {
apiUserId = json['apiUserId']; apiUserId = json['apiUserId'];
@ -111,6 +117,9 @@ class PasswordKeyListItem {
keyboardPwdId = json['keyboardPwdId']; keyboardPwdId = json['keyboardPwdId'];
sendDate = json['sendDate']; sendDate = json['sendDate'];
validTimeStr = json['validTimeStr']; validTimeStr = json['validTimeStr'];
isCoerced = json['isCoerced'];
hoursStart = json['hoursStart'];
hoursEnd = json['hoursEnd'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -129,6 +138,9 @@ class PasswordKeyListItem {
data['keyboardPwdId'] = keyboardPwdId; data['keyboardPwdId'] = keyboardPwdId;
data['sendDate'] = sendDate; data['sendDate'] = sendDate;
data['validTimeStr'] = validTimeStr; data['validTimeStr'] = validTimeStr;
data['isCoerced'] = isCoerced;
data['hoursStart'] = hoursStart;
data['hoursEnd'] = hoursEnd;
return data; return data;
} }
} }

View File

@ -1,8 +1,11 @@
import 'dart:async';
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';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../tools/eventBusEventManage.dart';
import '../passwordKey_perpetual/passwordKeyEntity.dart'; import '../passwordKey_perpetual/passwordKeyEntity.dart';
class PasswordKeyListLogic extends BaseGetXController { class PasswordKeyListLogic extends BaseGetXController {
@ -43,10 +46,105 @@ class PasswordKeyListLogic extends BaseGetXController {
} }
} }
//使
String getUseDateStr(PasswordKeyListItem indexEntity) {
int? getPwdType = indexEntity.keyboardPwdType;
String useDateStr = '';
DateTime sendDateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
DateTime startDateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
DateTime endDateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
int starHour = startDateStr.hour;
int endHour = endDateStr.hour;
// print("sendDateStr.toLocal().toString():${sendDateStr.toLocal().toString()}");
switch (getPwdType) {
case 1:
// 1 6使
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 单次';
break;
case 2:
// 2 24使
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 永久 ${indexEntity.isCustom! == 1? "自定义" : ""}';
break;
case 3:
// 3 24使
useDateStr =
'${startDateStr.toLocal().toString().substring(0, 16)} - ${endDateStr.toLocal().toString().substring(0, 16)} 限时 ${indexEntity.isCustom! == 1? "自定义" : ""}';
break;
case 4:
// 4 使使
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 清空码';
break;
case 5:
// 5
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周末$starHour:00-$endHour:00 循环';
break;
case 6:
// 6
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周日$starHour:00-$endHour:00 循环';
break;
case 7:
// 7
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 工作日$starHour:00-$endHour:00 循环';
break;
case 8:
// 8
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周一$starHour:00-$endHour:00 循环';
break;
case 9:
// 9
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周二$starHour:00-$endHour:00 循环';
break;
case 10:
// 10
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周三$starHour:00-$endHour:00 循环';
break;
case 11:
// 11
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周四$starHour:00-$endHour:00 循环';
break;
case 12:
// 12
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周五$starHour:00-$endHour:00 循环';
break;
case 13:
// 13
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周六$starHour:00-$endHour:00 循环';
break;
case 14:
// 14
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周天$starHour:00-$endHour:00 循环';
break;
default:
}
return useDateStr;
}
///
StreamSubscription? _getPasswordListRefreshUIEvent;
void _getPasswordListRefreshUIAction() {
// eventBus
_getPasswordListRefreshUIEvent = eventBus.on<GetPasswordListRefreshUI>().listen((event) {
mockNetworkDataRequest();
});
}
@override @override
void onReady() { void onReady() {
// TODO: implement onReady // TODO: implement onReady
super.onReady(); super.onReady();
_getPasswordListRefreshUIAction();
} }
@override @override
@ -58,5 +156,7 @@ class PasswordKeyListLogic extends BaseGetXController {
@override @override
void onClose() { void onClose() {
// TODO: implement onClose // TODO: implement onClose
super.onClose();
_getPasswordListRefreshUIEvent?.cancel();
} }
} }

View File

@ -129,44 +129,6 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
// _refreshController.refreshCompleted(); // _refreshController.refreshCompleted();
// } // }
Widget _searchWidget() {
return Container(
height: 60.h,
margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: TextField(
//
maxLines: 1,
// controller: _controller,
autofocus: false,
controller: state.searchController,
onSubmitted: (value) {
logic.mockNetworkDataRequest();
},
decoration: InputDecoration(
//
contentPadding: const EdgeInsets.only(
top: 18.0, left: -19.0, right: -15.0, bottom: 2),
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
//线
border: InputBorder.none,
//
icon: Padding(
padding: EdgeInsets.only(
top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
child: Image.asset(
'images/main/icon_main_search.png',
width: 40.w,
height: 40.w,
),
),
),
),
);
}
Widget _buildMainUI(itemData) { Widget _buildMainUI(itemData) {
List<PasswordKeyListItem> getItemData = itemData; List<PasswordKeyListItem> getItemData = itemData;
return ListView.separated( return ListView.separated(
@ -176,7 +138,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
String useDateStr = ''; //使 String useDateStr = ''; //使
//使 //使
useDateStr = getUseDateStr(passwordKeyListItem); useDateStr = logic.getUseDateStr(passwordKeyListItem);
if (index < getItemData.length) { if (index < getItemData.length) {
return LeftSlideActions( return LeftSlideActions(
@ -188,8 +150,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(1)), borderRadius: BorderRadius.all(Radius.circular(1)),
), ),
child: _electronicKeyItem(index, 'images/icon_password.png', child: _electronicKeyItem(index, 'images/icon_password.png', passwordKeyListItem.keyboardPwdName!, useDateStr, () {
passwordKeyListItem.keyboardPwdName!, useDateStr, () {
Navigator.pushNamed(context, Routers.passwordKeyDetailPage, Navigator.pushNamed(context, Routers.passwordKeyDetailPage,
arguments: {"itemData": passwordKeyListItem}).then((val) { arguments: {"itemData": passwordKeyListItem}).then((val) {
if (val != null) { if (val != null) {
@ -253,93 +214,6 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
}); });
} }
//使
String getUseDateStr(PasswordKeyListItem indexEntity) {
int? getPwdType = indexEntity.keyboardPwdType;
String useDateStr = '';
DateTime sendDateStr =
DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
DateTime startDateStr =
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
DateTime endDateStr =
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
int starHour = startDateStr.hour;
int endHour = endDateStr.hour;
switch (getPwdType) {
case 1:
// 1 6使
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 单次';
break;
case 2:
// 2 24使
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 永久';
break;
case 3:
// 3 24使
useDateStr =
'${startDateStr.toLocal().toString().substring(0, 16)} - ${endDateStr.toLocal().toString().substring(0, 16)} 限时';
break;
case 4:
// 4 使使
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 清空码';
break;
case 5:
// 5
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周末$starHour:00-$endHour:00 循环';
break;
case 6:
// 6
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周日$starHour:00-$endHour:00 循环';
break;
case 7:
// 7
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 工作日$starHour:00-$endHour:00 循环';
break;
case 8:
// 8
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周一$starHour:00-$endHour:00 循环';
break;
case 9:
// 9
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周二$starHour:00-$endHour:00 循环';
break;
case 10:
// 10
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周三$starHour:00-$endHour:00 循环';
break;
case 11:
// 11
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周四$starHour:00-$endHour:00 循环';
break;
case 12:
// 12
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周五$starHour:00-$endHour:00 循环';
break;
case 13:
// 13
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周六$starHour:00-$endHour:00 循环';
break;
case 14:
// 14
useDateStr =
'${sendDateStr.toLocal().toString().substring(0, 16)} 周天$starHour:00-$endHour:00 循环';
break;
default:
}
return useDateStr;
}
Widget _electronicKeyItem(int itemIndex, String lockTypeIcon, Widget _electronicKeyItem(int itemIndex, String lockTypeIcon,
String lockTypeTitle, String useDateStr, Function()? action) { String lockTypeTitle, String useDateStr, Function()? action) {
PasswordKeyListItem passwordKeyListItem = state.itemDataList[itemIndex]; PasswordKeyListItem passwordKeyListItem = state.itemDataList[itemIndex];
@ -352,17 +226,9 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
color: Colors.white, color: Colors.white,
child: Row( child: Row(
children: [ children: [
SizedBox( SizedBox(width: 30.w),
width: 30.w, Image.asset(lockTypeIcon, width: 60.w, height: 60.w,),
), SizedBox(width: 20.w,),
Image.asset(
lockTypeIcon,
width: 60.w,
height: 60.w,
),
SizedBox(
width: 20.w,
),
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -370,25 +236,20 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text(
lockTypeTitle,
style: TextStyle(
fontSize: 24.sp, color: AppColors.blackColor),
),
Expanded( Expanded(
child: SizedBox( child: Text(
width: 20.w, lockTypeTitle,
)), style: TextStyle(
passwordKeyListItem.keyboardPwdStatus == 2 fontSize: 24.sp, color: AppColors.blackColor),
? Text( ),
'已失效', ),
style: // Expanded(
TextStyle(color: Colors.red, fontSize: 20.sp), // child: SizedBox(
) // width: 20.w,
: Container(), // )),
SizedBox( SizedBox(width: 10.w),
width: 20.w, passwordKeyListItem.keyboardPwdStatus == 2 ? Text('已失效', style: TextStyle(color: Colors.red, fontSize: 20.sp),) : Container(),
) SizedBox(width: 15.w)
], ],
), ),
SizedBox(height: 5.h), SizedBox(height: 5.h),
@ -420,7 +281,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
context: widgetContext, context: widgetContext,
builder: (context) { builder: (context) {
return CupertinoAlertDialog( return CupertinoAlertDialog(
title: const Text('该锁的电子钥匙都将被删除'), title: const Text('该锁的密码都将被删除'),
actions: [ actions: [
CupertinoDialogAction( CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr), child: Text(TranslationLoader.lanKeys!.cancel!.tr),

View File

@ -21,9 +21,7 @@ class PasswordKeyManageTabbarPage extends StatefulWidget {
_PasswordKeyManageTabbarPageState(); _PasswordKeyManageTabbarPageState();
} }
class _PasswordKeyManageTabbarPageState class _PasswordKeyManageTabbarPageState extends State<PasswordKeyManageTabbarPage> with SingleTickerProviderStateMixin {
extends State<PasswordKeyManageTabbarPage>
with SingleTickerProviderStateMixin {
late TabController _tabController; late TabController _tabController;
final List<ItemView> _itemTabs = <ItemView>[ final List<ItemView> _itemTabs = <ItemView>[
@ -43,16 +41,23 @@ class _PasswordKeyManageTabbarPageState
vsync: this, vsync: this,
length: _itemTabs.length, length: _itemTabs.length,
initialIndex: widget.initialIndex); initialIndex: widget.initialIndex);
_tabController.addListener(handleTabIndex);
_tabController.addListener(() {
// print("_tabController.animation!.value:${_tabController.animation!.value} _tabController.index:${_tabController.index}");
if (_tabController.animation!.value==_tabController.index){
FocusScope.of(context).requestFocus(FocusNode());
}
});
// _tabController.addListener(handleTabIndex);
} }
int handleTabIndex() { // int handleTabIndex() {
// // //
int currentIndex = _tabController.index; // int currentIndex = _tabController.index;
// item // // item
eventBus.fire(GetPasswordTypeUpdateIndex(currentIndex)); // eventBus.fire(GetPasswordTypeUpdateIndex(currentIndex));
return currentIndex; // return currentIndex;
} // }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -68,6 +73,9 @@ class _PasswordKeyManageTabbarPageState
TabBar _tabBar() { TabBar _tabBar() {
return TabBar( return TabBar(
controller: _tabController, controller: _tabController,
onTap: (index){
FocusScope.of(context).requestFocus(FocusNode());
},
tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(), tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(),
isScrollable: true, isScrollable: true,
indicatorColor: Colors.red, indicatorColor: Colors.red,
@ -108,9 +116,8 @@ class _PasswordKeyManageTabbarPageState
return Expanded( return Expanded(
child: TabBarView( child: TabBarView(
controller: _tabController, controller: _tabController,
children: _itemTabs children: _itemTabs.map((ItemView item) => PasswordKeyPerpetualPage(
.map((ItemView item) => PasswordKeyPerpetualPage( type: item.type,
type: _tabController.index.toString(),
getKeyInfo: widget.keyInfo, getKeyInfo: widget.keyInfo,
)) ))
.toList(), .toList(),

View File

@ -19,13 +19,13 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
final PasswordKeyPerpetualState state = PasswordKeyPerpetualState(); final PasswordKeyPerpetualState state = PasswordKeyPerpetualState();
/// ///
StreamSubscription? getPasswordTypeUpdateIndexEvent; // StreamSubscription? getPasswordTypeUpdateIndexEvent;
void getPasswordTypeUpdateIndexAction() { // void getPasswordTypeUpdateIndexAction() {
getPasswordTypeUpdateIndexEvent = // getPasswordTypeUpdateIndexEvent =
eventBus.on<GetPasswordTypeUpdateIndex>().listen((event) { // eventBus.on<GetPasswordTypeUpdateIndex>().listen((event) {
state.widgetType.value = event.passwordType; // state.widgetType.value = event.passwordType;
}); // });
} // }
/** /**
1 6使 1 6使
@ -112,9 +112,13 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print('获取密码成功'); print('获取密码成功');
state.isSendSuccess.value = true; state.isSendSuccess.value = true;
state.sendSucceedType.value = state.widgetType.value;
state.nameController.text = "";
state.pwdController.text = "";
if (entity.data != null) { if (entity.data != null) {
state.getPwdStr.value = entity.data!.keyboardPwd!; state.getPwdStr.value = entity.data!.keyboardPwd!;
} }
eventBus.fire(GetPasswordListRefreshUI());
} else { } else {
showToast('${entity.errorMsg}'); showToast('${entity.errorMsg}');
} }
@ -145,13 +149,17 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
getKeyType, getKeyType,
getEffectiveDateTime, getEffectiveDateTime,
getFailureDateTime, getFailureDateTime,
'0'); '1');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print('获取密码成功'); print('获取密码成功');
state.isSendSuccess.value = true; state.isSendSuccess.value = true;
state.sendSucceedType.value = state.widgetType.value;
state.nameController.text = "";
state.pwdController.text = "";
if (entity.data != null) { if (entity.data != null) {
state.getPwdStr.value = entity.data!.keyboardPwd!; state.getPwdStr.value = entity.data!.keyboardPwd!;
} }
eventBus.fire(GetPasswordListRefreshUI());
} else { } else {
showToast('${entity.errorMsg}'); showToast('${entity.errorMsg}');
} }
@ -188,13 +196,11 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
var signKey = await Storage.getStringList(saveBlueSignKey); var signKey = await Storage.getStringList(saveBlueSignKey);
List<int> signKeyDataList = changeStringListToIntList(signKey!); List<int> signKeyDataList = changeStringListToIntList(signKey!);
print('得到的开始时间时间戳$getStartDate');
IoSenderManage.senderCustomPasswordsCommand( IoSenderManage.senderCustomPasswordsCommand(
keyID: "1", keyID: "1",
userID: await Storage.getUid(), userID: await Storage.getUid(),
pwdNo: 1, pwdNo: 1,
pwd: "123456", pwd:state.pwdController.text,
useCountLimit: 0xff, useCountLimit: 0xff,
startTime: 0x11223344, startTime: 0x11223344,
endTime: 0x11223344, endTime: 0x11223344,
@ -263,7 +269,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
super.onReady(); super.onReady();
_initReplySubscription(); _initReplySubscription();
getPasswordTypeUpdateIndexAction(); // getPasswordTypeUpdateIndexAction();
} }
@override @override

View File

@ -42,27 +42,32 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
super.initState(); super.initState();
initData(); initData();
// state.isSendSuccess.value = false;
} }
void initData() { void initData() {
if (!state.isInitialized.value) { // if (!state.isInitialized.value) {
state.isInitialized.value = true; // state.isInitialized.value = true;
state.keyInfo.value = widget.getKeyInfo; // state.keyInfo.value = widget.getKeyInfo;
} // }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
state.keyInfo.value = widget.getKeyInfo;
state.widgetType.value = int.parse(widget.type);
print("state.widgetType.value:${state.widgetType.value}");
return SingleChildScrollView( return SingleChildScrollView(
child: Obx(() => indexChangeWidget()), child: Obx(() => indexChangeWidget()),
); );
} }
Widget indexChangeWidget() { Widget indexChangeWidget() {
if (state.isSendSuccess.value == true) { if (state.isSendSuccess.value == true && state.sendSucceedType.value.toString() == widget.type) {
return sendElectronicKeySucceed(); return sendElectronicKeySucceed();
} else { } else {
switch (state.widgetType.value) { switch (int.parse(widget.type)) {
case 0: case 0:
{ {
// //
@ -132,7 +137,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
TranslationLoader.lanKeys!.name!.tr, TranslationLoader.lanKeys!.name!.tr,
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
state.nameController), state.nameController),
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip5!.tr) keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip2!.tr)
], ],
); );
} }
@ -185,24 +190,11 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
onConfirm: (p) { onConfirm: (p) {
if (state.widgetType.value == 3) { if (state.widgetType.value == 3) {
// //
state.effectiveDateTime.value = DateTime.parse( state.effectiveDateTime.value = DateTime.parse('${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}');
'${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.selectEffectiveDate.value = formatDate(
state.effectiveDateTime.value,
[yyyy, '-', mm, '-', dd, ' ', HH, ':', nn]); //
} else { } else {
state.effectiveDateTime.value = DateTime.parse( state.effectiveDateTime.value = DateTime.parse('${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}');
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}'); state.selectEffectiveDate.value = "${formatDate(state.effectiveDateTime.value, [yyyy, '-', mm, '-', dd, ' ', HH])}:00"; //
state.selectEffectiveDate.value =
"${formatDate(state.effectiveDateTime.value, [
yyyy,
'-',
mm,
'-',
dd,
' ',
HH
])}:00"; //默认为当前时间
} }
}); });
}), }),
@ -263,7 +255,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
return Column( return Column(
children: [ children: [
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.recursiveDevice!.tr, leftTitel: "有效日",
rightTitle: state.loopModeStr.value, rightTitle: state.loopModeStr.value,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
@ -393,7 +385,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
height: 20.h, height: 20.h,
), ),
SubmitBtn( SubmitBtn(
btnName: TranslationLoader.lanKeys!.getPassword!.tr, btnName: widget.type == "3" ? "设置密码":TranslationLoader.lanKeys!.getPassword!.tr,
onClick: () async { onClick: () async {
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
@ -512,7 +504,9 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
btnName: '完成', btnName: '完成',
onClick: () { onClick: () {
state.isSendSuccess.value = false; state.isSendSuccess.value = false;
Navigator.pop(context, true); state.nameController.text = "";
state.pwdController.text = "";
// Navigator.pop(context, true);
}), }),
SizedBox( SizedBox(
height: 10.h, height: 10.h,
@ -547,8 +541,10 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
maxLines: 1, maxLines: 1,
inputFormatters: <TextInputFormatter>[ inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(18), LengthLimitingTextInputFormatter(editController == state.nameController ? 18 : 9),
], ],
keyboardType: editController == state.nameController ? TextInputType.text: TextInputType.number,
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
controller: editController, controller: editController,
autofocus: false, autofocus: false,
textAlign: TextAlign.end, textAlign: TextAlign.end,

View File

@ -7,7 +7,7 @@ class PasswordKeyPerpetualState {
final TextEditingController nameController = TextEditingController(); final TextEditingController nameController = TextEditingController();
final TextEditingController pwdController = TextEditingController(); final TextEditingController pwdController = TextEditingController();
final isInitialized = false.obs; // final isInitialized = false.obs;
final isSendSuccess = false.obs; // final isSendSuccess = false.obs; //
final isPermanent = true.obs; // final isPermanent = true.obs; //
var getPwdStr = ''.obs; var getPwdStr = ''.obs;
@ -44,5 +44,6 @@ class PasswordKeyPerpetualState {
var loopModeStr = '周末'.obs; // var loopModeStr = '周末'.obs; //
final widgetType = 0.obs; final widgetType = 0.obs;
final sendSucceedType = 0.obs;
final keyInfo = LockListInfoItemEntity().obs; final keyInfo = LockListInfoItemEntity().obs;
} }

View File

@ -283,6 +283,7 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage> {
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(18), LengthLimitingTextInputFormatter(18),
], ],
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
controller: state.nameController, controller: state.nameController,
autofocus: false, autofocus: false,
textAlign: TextAlign.end, textAlign: TextAlign.end,

View File

@ -299,18 +299,24 @@ class LockFeature {
class LockSetting { class LockSetting {
int? attendance; int? attendance;
int? appUnlockOnline; int? appUnlockOnline;
int? remoteUnlock;
LockSetting({this.attendance, this.appUnlockOnline}); LockSetting({
this.attendance,
this.appUnlockOnline,
this.remoteUnlock,
});
LockSetting.fromJson(Map<String, dynamic> json) { LockSetting.fromJson(Map<String, dynamic> json) {
attendance = json['attendance']; attendance = json['attendance'];
appUnlockOnline = json['appUnlockOnline']; appUnlockOnline = json['appUnlockOnline'];
remoteUnlock = json['remoteUnlock'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{}; final Map<String, dynamic> data = <String, dynamic>{};
data['attendance'] = attendance; data['attendance'] = attendance;
data['appUnlockOnline'] = appUnlockOnline; data['appUnlockOnline'] = appUnlockOnline;
data['remoteUnlock'] = remoteUnlock;
return data; return data;
} }
} }

View File

@ -163,11 +163,26 @@ class _LockListPageState extends State<LockListPage> {
SizedBox(width: 30.w), SizedBox(width: 30.w),
], ],
), ),
SizedBox( SizedBox(height: 5.h),
height: 5.h,
),
Visibility( Visibility(
visible: keyInfo.remoteEnable == 1 ? true : false, visible: keyInfo.passageMode == 1 ? true : false,
child:Row(
children: [
SizedBox(width: 30.w),
Container(
padding: EdgeInsets.only(right: 5.w, left: 5.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.w),
color: AppColors.openPassageModeColor,
),
child: Text("常开模式开启", style: TextStyle(fontSize: 18.sp, color: AppColors.appBarIconColor)),
),
],
)),
SizedBox(height: 5.h),
Visibility(
visible: keyInfo.lockSetting!.remoteUnlock == 1 ? true : false,
child:Row( child:Row(
children: [ children: [
SizedBox(width: 30.w), SizedBox(width: 30.w),

View File

@ -37,7 +37,7 @@ class _AbountPageState extends State<AbountPage> {
), ),
SizedBox(height: 20.h), SizedBox(height: 20.h),
Text( Text(
"星锁 1.0.0.07(preRelease-20240118-1)", "星锁 1.0.0.08(preRelease-20240123)",
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor), style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
), ),
SizedBox( SizedBox(

View File

@ -71,7 +71,7 @@ abstract class Api {
final String getLockVersionInfoUrl = '/room/update'; // final String getLockVersionInfoUrl = '/room/update'; //
final String openCheckingInURL = '/attendanceCompany/isExistenceCompany'; // final String openCheckingInURL = '/attendanceCompany/isExistenceCompany'; //
final String setCheckInCreateCompanyURL = '/attendanceCompany/add'; // final String setCheckInCreateCompanyURL = '/attendanceCompany/add'; //
final String deleteCompanyURL = '/vacation/delete'; // final String deleteCompanyURL = '/attendanceCompany/delete'; //
final String getAttendanceRecordListByDateURL = final String getAttendanceRecordListByDateURL =
'/attendanceRecord/listByDate'; // - '/attendanceRecord/listByDate'; // -

View File

@ -4,6 +4,7 @@ import 'dart:async';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart'; import 'package:star_lock/appRouters.dart';
import 'package:star_lock/blue/blue_manage.dart';
import '../common/XSConstantMacro/XSConstantMacro.dart'; import '../common/XSConstantMacro/XSConstantMacro.dart';
import 'manager/client_manager.dart'; import 'manager/client_manager.dart';
@ -83,13 +84,14 @@ class BaseGetXController extends GetxController{
} }
void showBlueConnetctToast() { void showBlueConnetctToast() {
showToast("连接设备失败,请确保在设备附近,设备未被连接,设备已打开"); bool isContains = BlueManage().connectDeviceName!.contains("T9A");
showToast("连接设备失败,请确保在设备附近,设备未被连接,设备已打开${isContains == true ? "。如果是全自动锁,请使屏幕变亮" : ""}");
} }
void showToast(String status,{Function? something}) { void showToast(String status,{Function? something}) {
EasyLoading.showToast(status,duration: 1000.milliseconds); EasyLoading.showToast(status,duration: 2000.milliseconds);
if(something != null) { if(something != null) {
delay(duration: 1100.milliseconds,something: something); delay(duration: 2100.milliseconds,something: something);
} }
} }

View File

@ -79,3 +79,8 @@ class GetPasswordTypeUpdateIndex {
int passwordType; int passwordType;
GetPasswordTypeUpdateIndex(this.passwordType); GetPasswordTypeUpdateIndex(this.passwordType);
} }
///
class GetPasswordListRefreshUI {
GetPasswordListRefreshUI();
}

View File

@ -5,6 +5,7 @@ import 'package:flutter/services.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 '../app_settings/app_colors.dart';
import '../translations/trans_lib.dart'; import '../translations/trans_lib.dart';
class KeySearchWidget extends StatelessWidget { class KeySearchWidget extends StatelessWidget {
@ -50,6 +51,7 @@ class KeySearchWidget extends StatelessWidget {
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(18), LengthLimitingTextInputFormatter(18),
], ],
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
controller: editingController, controller: editingController,
autofocus: false, autofocus: false,
textAlign: TextAlign.start, textAlign: TextAlign.start,

View File

@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+8 version: 1.0.0+9
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'