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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,6 +2,7 @@
import 'dart:async';
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/tools/baseGetXController.dart';
import '../../../../blue/blue_manage.dart';
@ -46,6 +47,7 @@ class AutomaticBlockingLogic extends BaseGetXController{
showToast("操作成功", something: (){
eventBus.fire(RefreshLockListInfoDataEvent());
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
void onReady() {
// TODO: implement onReady

View File

@ -34,20 +34,25 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> with Rout
haveBack: true,
actionsList: [
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(
state.isJustForShow.value == true ? "" : TranslationLoader.lanKeys!.save!.tr,
state.canNext.value == false ? "" : TranslationLoader.lanKeys!.save!.tr,
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),
@ -55,97 +60,106 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> with Rout
children: [
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr,
rightTitle: "${state.autoLockTime}s",
isHaveLine: false,
isHaveRightWidget: true,
rightWidget:
SizedBox(width: 60.w, height: 50.h, child: _switch())),),
Container(height: 10.h,),
Builder(builder: (context) {
return Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.delayTime!.tr,
rightTitle: state.isCustomLockTime.value == true ? "自定义" : "${state.autoLockTime.value}s",
isHaveLine: false,
isHaveDirection: true,
action: () {
if(state.isJustForShow.value == true){
return;
}
var list = [
"5",
"10",
"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;
Visibility(
visible: state.isOpen.value == true ? true : false,
child: Column(
children: [
Container(height: 10.h,),
Builder(builder: (context) {
return Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.delayTime!.tr,
rightTitle: state.isCustomLockTime.value == true ? "自定义" : (state.autoLockTime.value.isNotEmpty && state.autoLockTime.value != "0") ? "${state.autoLockTime}s" : "",
isHaveLine: false,
isHaveDirection: true,
action: () {
if(state.isJustForShow.value == true){
return;
}
});
}));
}),
Container(
height: 10.h,
),
Obx(() => Visibility(
visible: state.isCustomLockTime.value,
child: Container(
color: Colors.white,
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,
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,
var list = [
"5",
"10",
"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;
}
logic.ifCanNext();
});
}));
}),
Container(height: 10.h),
Obx(() => Visibility(
visible: state.isCustomLockTime.value,
child: Container(
color: Colors.white,
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(
padding: EdgeInsets.all(30.w),
child: Row(
@ -169,17 +183,44 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> with Rout
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: state.isOpen.value,
onChanged: (value) {
onChanged: state.isJustForShow.value == true ? null : (value){
setState(() {
state.isOpen.value = value;
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
void didChangeDependencies() {

View File

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

View File

@ -121,7 +121,12 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{
print("indexList:$indexList");
var pwd = indexList.sublist(1, 11);
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;
addLockAdminPassword(false);
}

View File

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

View File

@ -75,7 +75,12 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
allHeight: 70.h,
isHaveLine: false),
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,
rightTitle: state.lockBasicInfo.value.lockAlias,
isHaveLine: true,
@ -90,7 +95,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
state.lockBasicInfo.value = data["lockBasicInfo"];
});
}
}),
})),
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.lockGrouping!.tr,
rightTitle: state.lockBasicInfo.value.groupName,

View File

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

View File

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

View File

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

View File

@ -680,10 +680,11 @@ class LockSetLogic extends BaseGetXController {
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
// eventBus
_passCurrentLockInformationEvent = eventBus.on<PassCurrentLockInformationEvent>().listen((event) {
state.lockSetInfoData.value = event.lockSetInfoData;
state.isAttendance.value = state.lockSetInfoData.value.lockSettingInfo!.attendance!;
// state.lockSetInfoData.value = event.lockSetInfoData;
// state.isAttendance.value = state.lockSetInfoData.value.lockSettingInfo!.attendance!;
// 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,
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr,
rightTitle: (state.lockSettingInfo.value.autoLock ?? 0) > 0
? "${state.lockSetInfoData.value.lockSettingInfo!.autoLockSecond ?? 0}s"
rightTitle: state.lockSettingInfo.value.autoLock! > 0
? "${state.lockSetInfoData.value.lockSettingInfo!.autoLockSecond}s"
: TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
@ -285,8 +285,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
SizedBox(height: 10.h),
//
Obx(() => Visibility(
visible: state.lockFeature.value.passageMode == 1 ? true : false,
// visible:true,
// visible: state.lockFeature.value.passageMode == 1 ? true : false,
visible:true,
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
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!.lockSoundVolume = state.lockSoundLevel.value;
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
ifCanNext();
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
void onReady() {
// TODO: implement onReady

View File

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

View File

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

View File

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

View File

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

View File

@ -141,7 +141,7 @@ class _WirelessKeyboardPageState extends State<WirelessKeyboardPage> {
context: widgetContext,
builder: (context) {
return CupertinoAlertDialog(
title: const Text('该锁的电子钥匙都将被删除'),
title: const Text('该锁的无线键盘都将被删除'),
actions: [
CupertinoDialogAction(
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:get/get.dart';
import 'package:intl/intl.dart';
import 'package:uuid/uuid.dart';
import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart';
@ -358,8 +357,10 @@ class _LockDetailPageState extends State<LockDetailPage>
// ic卡
if (state.keyInfos.value.lockFeature!.icCard == 1) {
showWidgetArr.add(bottomItem('images/main/icon_main_icCard.png',
TranslationLoader.lanKeys!.card!.tr, () {
showWidgetArr.add(bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, () {
// logic.showToast("普通用户第一次需要在锁旁边操作哦。", something: () {
// logic.showEasyLoading();
// });
Get.toNamed(Routers.cardListPage, arguments: {
"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/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/eventBusEventManage.dart';
class PasswordKeyDetailLogic extends BaseGetXController {
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(
lockId: state.itemData.value.lockId!,
keyboardPwdId: state.itemData.value.keyboardPwdId.toString(),
keyboardPwdName: state.inputNameController.text,
newKeyboardPwd: state.inputPwdController.text,
startDate: state.startDate.value,
endDate: state.endDate.value,
startDate: state.itemData.value.startDate!,
endDate: state.itemData.value.endDate!,
changeType: state.changeType.value,
hoursStart: state.hoursStart.value,
hoursEnd: state.hoursEnd.value,
isCoerced: state.isCoerced.value);
hoursStart: state.itemData.value.hoursStart!,
hoursEnd: state.itemData.value.hoursEnd!,
isCoerced: state.itemData.value.isCoerced!.toString());
if (entity.errorCode!.codeIsSuccessful) {
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();
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(
child: Column(
children: [
CommonItem(
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.password!.tr,
rightTitle: state.inputPwdController.text.isNotEmpty
? state.inputPwdController.text
: state.itemData.value.keyboardPwd,
rightTitle: state.keyboardPwd.value,
isHaveDirection: (state.itemData.value.keyboardPwdType == 1 ||
state.itemData.value.keyboardPwdType == 4)
state.itemData.value.keyboardPwdType == 4)
? false
: true,
isHaveLine: true,
action: () {
if (state.itemData.value.keyboardPwdType == 1 ||
state.itemData.value.keyboardPwdType == 4) {
if (state.itemData.value.keyboardPwdType == 1 || state.itemData.value.keyboardPwdType == 4) {
return;
} else {
showCupertinoAlertDialog(
context, state.inputPwdController);
showCupertinoAlertDialog(context, state.inputPwdController);
}
}),
CommonItem(
})),
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.name!.tr,
rightTitle: state.inputNameController.text.isNotEmpty
? state.inputNameController.text
: state.itemData.value.keyboardPwdName,
rightTitle: state.keyboardPwdName.value,
isHaveDirection: true,
isHaveLine: true,
action: () {
showCupertinoAlertDialog(
context, state.inputNameController);
}),
})),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
rightTitle: getUseDateStr(),
isHaveDirection: true,
leftTitel: "有效期",
rightTitle: logic.getUseDateStr(),
isHaveDirection: ((state.itemData.value.keyboardPwdType! > 3 &&
state.itemData.value.keyboardPwdType! < 15) || state.itemData.value.keyboardPwdType! == 1) ? false : true,
allHeight:
state.itemData.value.keyboardPwdType == 3 ? 90.h : 65.h,
action: () {
if (state.itemData.value.keyboardPwdType! > 4 &&
state.itemData.value.keyboardPwdType! < 15) {
if ((state.itemData.value.keyboardPwdType! > 3 &&
state.itemData.value.keyboardPwdType! < 15 ) || state.itemData.value.keyboardPwdType! == 1) {
return;
}
Navigator.pushNamed(
context, Routers.passwordKeyDetailChangeDatePage,
Get.toNamed(Routers.passwordKeyDetailChangeDatePage,
arguments: {
'itemData': state.itemData.value,
'lockId': state.itemData.value.lockId,
'pwdId': state.itemData.value.keyboardPwdId.toString()
});
}),
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 senderDate = '';
DateTime dateStr =
DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
senderDate = dateStr.toLocal().toString().substring(0, 16);
return senderDate;
}
@ -299,13 +213,15 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
title: inputController == state.inputNameController
? "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}"
: "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.password!.tr}",
tipTitle:
inputController.text.isNotEmpty ? inputController.text : "请输入",
tipTitle: inputController.text.isNotEmpty ? inputController.text : "请输入",
controller: inputController,
keyboardType: inputController == state.inputNameController
? TextInputType.text
: TextInputType.number,
sureClick: () {
//
if (inputController.text.isNotEmpty) {
logic.updatePwdRequest();
logic.updatePwdRequest(inputController == state.inputNameController ? 1 : 2);
}
},
cancelClick: () {
@ -321,7 +237,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadiusDirectional.circular(10)),
constraints: BoxConstraints(maxHeight: 260.h),
constraints: BoxConstraints(maxHeight: 270.h),
builder: (BuildContext context) {
return Column(
children: [

View File

@ -6,16 +6,25 @@ class PasswordKeyDetailState {
final itemData = PasswordKeyListItem().obs;
final TextEditingController inputPwdController = TextEditingController();
final TextEditingController inputNameController = TextEditingController();
final changeType = '1'
.obs; //1-APP走蓝牙修改1APP SDK蓝牙修改后调用该接口 2-WiFi锁修改WiFi锁或有连接网关2
final isCoerced = '1'.obs; //:1;:2
final hoursStart = 0.obs;
final hoursEnd = 0.obs;
final startDate = 0.obs;
final endDate = 0.obs;
final changeType = '1'.obs; //1-APP走蓝牙修改1APP SDK蓝牙修改后调用该接口 2-WiFi锁修改WiFi锁或有连接网关2
final keyboardPwd = ''.obs;
final keyboardPwdName = ''.obs;
// final hoursStart = 0.obs;
// final hoursEnd = 0.obs;
// final startDate = 0.obs;
// final endDate = 0.obs;
PasswordKeyDetailState() {
Map map = Get.arguments;
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/tools/baseGetXController.dart';
class PasswordKeyDetailChangeDateLogic extends BaseGetXController {
final PasswordKeyDetailChangeDateState state =
PasswordKeyDetailChangeDateState();
import '../../../../tools/eventBusEventManage.dart';
class PasswordKeyDetailChangeDateLogic extends BaseGetXController {
final PasswordKeyDetailChangeDateState state = PasswordKeyDetailChangeDateState();
//
Future<void> updatePwdRequest() async {
PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey(
lockId: state.itemData.value.lockId!,
keyboardPwdId: state.pwdId.value.toString(),
keyboardPwdName: state.inputNameController.text,
newKeyboardPwd: state.inputPwdController.text,
startDate: state.startDate.value,
endDate: state.endDate.value,
changeType: state.changeType.value,
hoursStart: state.hoursStart.value,
hoursEnd: state.hoursEnd.value,
isCoerced: state.isCoerced.value);
keyboardPwdId: state.itemData.value.keyboardPwdId.toString(),
keyboardPwdName: state.itemData.value.keyboardPwdName!,
newKeyboardPwd: state.itemData.value.keyboardPwd!,
startDate: state.itemData.value.startDate!,
endDate: state.itemData.value.endDate!,
changeType: '1',
hoursStart: state.itemData.value.hoursStart!,
hoursEnd: state.itemData.value.hoursEnd!,
isCoerced: "1");
if (entity.errorCode!.codeIsSuccessful) {
showToast("修改成功", something: (){
eventBus.fire(GetPasswordListRefreshUI());
Get.back();
});
}
}
}

View File

@ -39,9 +39,9 @@ class _PasswordKeyDetailChangeDatePage
style: TextStyle(color: Colors.white, fontSize: 24.sp),
),
onPressed: () {
if (state.lockId.value != 0 && state.pwdId.value.isNotEmpty) {
// if (state.lockId.value != 0 && state.pwdId.value.isNotEmpty) {
logic.updatePwdRequest();
}
// }
},
),
],
@ -75,12 +75,12 @@ class _PasswordKeyDetailChangeDatePage
isHaveLine: true,
isHaveDirection: true,
action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
Pickers.showDatePicker(context, mode: DateMode.YMDH,
onConfirm: (p) {
state.selectEffectiveDate.value =
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
state.effectiveDateTime =
DateTime.parse(state.selectEffectiveDate.value);
// state.effectiveDateTime = DateTime.parse(state.selectEffectiveDate.value);
state.itemData.value.startDate = DateTime.parse(state.selectEffectiveDate.value).millisecondsSinceEpoch; //
});
})),
Obx(() => CommonItem(
@ -90,12 +90,12 @@ class _PasswordKeyDetailChangeDatePage
: getEndDate,
isHaveDirection: true,
action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
Pickers.showDatePicker(context, mode: DateMode.YMDH,
onConfirm: (p) {
state.selectFailureDate.value =
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
state.failureDateTime =
DateTime.parse(state.selectFailureDate.value);
// state.failureDateTime = 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 {
final itemData = PasswordKeyListItem().obs;
final TextEditingController inputPwdController = TextEditingController();
final TextEditingController inputNameController = TextEditingController();
final changeType = '1'
.obs; //1-APP走蓝牙修改1APP SDK蓝牙修改后调用该接口 2-WiFi锁修改WiFi锁或有连接网关2
final isCoerced = '1'.obs; //:1;:2
final hoursStart = 0.obs;
final hoursEnd = 0.obs;
final startDate = 0.obs;
final endDate = 0.obs;
final pwdId = ''.obs;
final lockId = 0.obs;
final fromType = ''.obs;
// final TextEditingController inputPwdController = TextEditingController();
// final TextEditingController inputNameController = TextEditingController();
// final changeType = '1'.obs; //1-APP走蓝牙修改1APP SDK蓝牙修改后调用该接口 2-WiFi锁修改WiFi锁或有连接网关2
// final isCoerced = '1'.obs; //:1;:2
// final hoursStart = 0.obs;
// final hoursEnd = 0.obs;
// final startDate = 0.obs;
// final endDate = 0.obs;
// final pwdId = ''.obs;
// final lockId = 0.obs;
// final fromType = ''.obs;
final selectEffectiveDate = ''.obs; //
final selectFailureDate = ''.obs; //
DateTime effectiveDateTime = DateTime.now();
DateTime failureDateTime = DateTime.now();
final endDay = ''.obs;
final startDay = ''.obs;
final weekDays = [].obs;
// DateTime effectiveDateTime = DateTime.now();
// DateTime failureDateTime = DateTime.now();
// final endDay = ''.obs;
// final startDay = ''.obs;
// final weekDays = [].obs;
PasswordKeyDetailChangeDateState() {
Map map = Get.arguments;
@ -30,11 +29,11 @@ class PasswordKeyDetailChangeDateState {
if ((map["itemData"] != null)) {
itemData.value = map["itemData"];
}
if ((map["pwdId"] != null)) {
pwdId.value = map["pwdId"];
}
if ((map["lockId"] != null)) {
lockId.value = map["lockId"];
}
// if ((map["pwdId"] != null)) {
// pwdId.value = map["pwdId"];
// }
// if ((map["lockId"] != null)) {
// lockId.value = map["lockId"];
// }
}
}

View File

@ -79,6 +79,9 @@ class PasswordKeyListItem {
int? keyboardPwdId;
int? sendDate;
String? validTimeStr;
int? isCoerced;
int? hoursStart;
int? hoursEnd;
PasswordKeyListItem(
{this.apiUserId,
@ -94,7 +97,10 @@ class PasswordKeyListItem {
this.senderUsername,
this.keyboardPwdId,
this.sendDate,
this.validTimeStr});
this.validTimeStr,
this.isCoerced,
this.hoursStart,
this.hoursEnd});
PasswordKeyListItem.fromJson(Map<String, dynamic> json) {
apiUserId = json['apiUserId'];
@ -111,6 +117,9 @@ class PasswordKeyListItem {
keyboardPwdId = json['keyboardPwdId'];
sendDate = json['sendDate'];
validTimeStr = json['validTimeStr'];
isCoerced = json['isCoerced'];
hoursStart = json['hoursStart'];
hoursEnd = json['hoursEnd'];
}
Map<String, dynamic> toJson() {
@ -129,6 +138,9 @@ class PasswordKeyListItem {
data['keyboardPwdId'] = keyboardPwdId;
data['sendDate'] = sendDate;
data['validTimeStr'] = validTimeStr;
data['isCoerced'] = isCoerced;
data['hoursStart'] = hoursStart;
data['hoursEnd'] = hoursEnd;
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/passwordKeyList_state.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../tools/eventBusEventManage.dart';
import '../passwordKey_perpetual/passwordKeyEntity.dart';
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
void onReady() {
// TODO: implement onReady
super.onReady();
_getPasswordListRefreshUIAction();
}
@override
@ -58,5 +156,7 @@ class PasswordKeyListLogic extends BaseGetXController {
@override
void onClose() {
// TODO: implement onClose
super.onClose();
_getPasswordListRefreshUIEvent?.cancel();
}
}

View File

@ -129,44 +129,6 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
// _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) {
List<PasswordKeyListItem> getItemData = itemData;
return ListView.separated(
@ -176,7 +138,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
String useDateStr = ''; //使
//使
useDateStr = getUseDateStr(passwordKeyListItem);
useDateStr = logic.getUseDateStr(passwordKeyListItem);
if (index < getItemData.length) {
return LeftSlideActions(
@ -188,8 +150,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(1)),
),
child: _electronicKeyItem(index, 'images/icon_password.png',
passwordKeyListItem.keyboardPwdName!, useDateStr, () {
child: _electronicKeyItem(index, 'images/icon_password.png', passwordKeyListItem.keyboardPwdName!, useDateStr, () {
Navigator.pushNamed(context, Routers.passwordKeyDetailPage,
arguments: {"itemData": passwordKeyListItem}).then((val) {
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,
String lockTypeTitle, String useDateStr, Function()? action) {
PasswordKeyListItem passwordKeyListItem = state.itemDataList[itemIndex];
@ -352,17 +226,9 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
color: Colors.white,
child: Row(
children: [
SizedBox(
width: 30.w,
),
Image.asset(
lockTypeIcon,
width: 60.w,
height: 60.w,
),
SizedBox(
width: 20.w,
),
SizedBox(width: 30.w),
Image.asset(lockTypeIcon, width: 60.w, height: 60.w,),
SizedBox(width: 20.w,),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@ -370,25 +236,20 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
lockTypeTitle,
style: TextStyle(
fontSize: 24.sp, color: AppColors.blackColor),
),
Expanded(
child: SizedBox(
width: 20.w,
)),
passwordKeyListItem.keyboardPwdStatus == 2
? Text(
'已失效',
style:
TextStyle(color: Colors.red, fontSize: 20.sp),
)
: Container(),
SizedBox(
width: 20.w,
)
child: Text(
lockTypeTitle,
style: TextStyle(
fontSize: 24.sp, color: AppColors.blackColor),
),
),
// Expanded(
// child: SizedBox(
// width: 20.w,
// )),
SizedBox(width: 10.w),
passwordKeyListItem.keyboardPwdStatus == 2 ? Text('已失效', style: TextStyle(color: Colors.red, fontSize: 20.sp),) : Container(),
SizedBox(width: 15.w)
],
),
SizedBox(height: 5.h),
@ -420,7 +281,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
context: widgetContext,
builder: (context) {
return CupertinoAlertDialog(
title: const Text('该锁的电子钥匙都将被删除'),
title: const Text('该锁的密码都将被删除'),
actions: [
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr),

View File

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

View File

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

View File

@ -42,27 +42,32 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
super.initState();
initData();
// state.isSendSuccess.value = false;
}
void initData() {
if (!state.isInitialized.value) {
state.isInitialized.value = true;
state.keyInfo.value = widget.getKeyInfo;
}
// if (!state.isInitialized.value) {
// state.isInitialized.value = true;
// state.keyInfo.value = widget.getKeyInfo;
// }
}
@override
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(
child: Obx(() => indexChangeWidget()),
);
}
Widget indexChangeWidget() {
if (state.isSendSuccess.value == true) {
if (state.isSendSuccess.value == true && state.sendSucceedType.value.toString() == widget.type) {
return sendElectronicKeySucceed();
} else {
switch (state.widgetType.value) {
switch (int.parse(widget.type)) {
case 0:
{
//
@ -132,7 +137,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
TranslationLoader.lanKeys!.name!.tr,
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
state.nameController),
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip5!.tr)
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip2!.tr)
],
);
}
@ -185,24 +190,11 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
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.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]); //
} 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.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"; //
}
});
}),
@ -263,7 +255,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
return Column(
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.recursiveDevice!.tr,
leftTitel: "有效日",
rightTitle: state.loopModeStr.value,
isHaveLine: true,
isHaveDirection: true,
@ -393,7 +385,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
height: 20.h,
),
SubmitBtn(
btnName: TranslationLoader.lanKeys!.getPassword!.tr,
btnName: widget.type == "3" ? "设置密码":TranslationLoader.lanKeys!.getPassword!.tr,
onClick: () async {
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) {
@ -512,7 +504,9 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
btnName: '完成',
onClick: () {
state.isSendSuccess.value = false;
Navigator.pop(context, true);
state.nameController.text = "";
state.pwdController.text = "";
// Navigator.pop(context, true);
}),
SizedBox(
height: 10.h,
@ -547,8 +541,10 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
maxLines: 1,
inputFormatters: <TextInputFormatter>[
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,
autofocus: false,
textAlign: TextAlign.end,

View File

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

View File

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

View File

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

View File

@ -163,11 +163,26 @@ class _LockListPageState extends State<LockListPage> {
SizedBox(width: 30.w),
],
),
SizedBox(
height: 5.h,
),
SizedBox(height: 5.h),
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(
children: [
SizedBox(width: 30.w),

View File

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

View File

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

View File

@ -4,6 +4,7 @@ import 'dart:async';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/blue/blue_manage.dart';
import '../common/XSConstantMacro/XSConstantMacro.dart';
import 'manager/client_manager.dart';
@ -83,13 +84,14 @@ class BaseGetXController extends GetxController{
}
void showBlueConnetctToast() {
showToast("连接设备失败,请确保在设备附近,设备未被连接,设备已打开");
bool isContains = BlueManage().connectDeviceName!.contains("T9A");
showToast("连接设备失败,请确保在设备附近,设备未被连接,设备已打开${isContains == true ? "。如果是全自动锁,请使屏幕变亮" : ""}");
}
void showToast(String status,{Function? something}) {
EasyLoading.showToast(status,duration: 1000.milliseconds);
EasyLoading.showToast(status,duration: 2000.milliseconds);
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;
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:get/get.dart';
import '../app_settings/app_colors.dart';
import '../translations/trans_lib.dart';
class KeySearchWidget extends StatelessWidget {
@ -50,6 +51,7 @@ class KeySearchWidget extends StatelessWidget {
FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(18),
],
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
controller: editingController,
autofocus: false,
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
# 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.
version: 1.0.0+8
version: 1.0.0+9
environment:
sdk: '>=2.12.0 <3.0.0'