1,锁设置--开锁提醒接口字段修改

2,购买记录页面bug修改
3,添加指纹/卡/人脸模块限时类型添加时间数据不同步问题修改
This commit is contained in:
Daisy 2024-05-23 17:14:43 +08:00
parent 3feba32a08
commit ffd709a1ae
12 changed files with 121 additions and 75 deletions

View File

@ -680,7 +680,7 @@
"密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。": "After the password is generated, please use it once for activation before 23:59 on the same day, otherwise it will be invalid after 0 o'clock. After the password is activated, it can be used unlimited times within the validity period.", "密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。": "After the password is generated, please use it once for activation before 23:59 on the same day, otherwise it will be invalid after 0 o'clock. After the password is activated, it can be used unlimited times within the validity period.",
"密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。": "After the password is generated, please use it before 23:59 on the same day, otherwise it will be invalid after 0 o'clock. The clear code is used to clear all the passwords generated before 0 o'clock today.", "密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。": "After the password is generated, please use it before 23:59 on the same day, otherwise it will be invalid after 0 o'clock. The clear code is used to clear all the passwords generated before 0 o'clock today.",
"密码生成后请在当日2359前使用否则过0点后失效。": "After the password is generated, please use it before 23:59 on the same day, otherwise it will be invalid after 0 o'clock.", "密码生成后请在当日2359前使用否则过0点后失效。": "After the password is generated, please use it before 23:59 on the same day, otherwise it will be invalid after 0 o'clock.",
"清空密码底部提示": "The password is valid until 24 o 'clock on the day of emptying\nEmpty content 1: All passwords except custom generated before 0 o 'clock on the same day (passwords generated after 0 o 'clock on the same day are not affected by the empty password and can continue to be used) \nEmpty content 2: Clear passwords Clear all custom passwords (used and unused) immediately after use \nTo completely clear all passwords, use the Reset All Passwords feature", "清空密码底部提示": "The password is valid until 24 o 'clock on the day of emptying\n Empty Content 1: All passwords generated before 0:00 of the day (Passwords generated after 0:00 of the day are not affected by clearing passwords and can continue to be used) \nEmpty content 2: Clear passwords Clear all custom passwords (used and unused) immediately after use \nTo completely clear all passwords, use the Reset All Passwords feature",
"相机": "camera", "相机": "camera",
"相册": "photos", "相册": "photos",
"读写": "storage", "读写": "storage",

View File

@ -683,7 +683,7 @@
"密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。": "密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。", "密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。": "密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。",
"密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。": "密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。", "密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。": "密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。",
"密码生成后请在当日2359前使用否则过0点后失效。": "密码生成后请在当日2359前使用否则过0点后失效。", "密码生成后请在当日2359前使用否则过0点后失效。": "密码生成后请在当日2359前使用否则过0点后失效。",
"清空密码底部提示": "清空密码当日24点前有效\n清空内容1当日0点前生成的除自定义以外所有密码当日0点后生成的密码不受清空密码影响可继续使用\n清空内容2清空密码使用后立即清除所有自定义密码含使用过和未使用过的\n如需彻底清除所有密码请使用重置所有密码功能", "清空密码底部提示": "清空密码当日24点前有效\n清空内容1当日0点前生成的所有密码当日0点后生成的密码不受清空密码影响可继续使用\n清空内容2清空密码使用后立即清除所有自定义密码含使用过和未使用过的\n如需彻底清除所有密码请使用重置所有密码功能",
"密码不一致哦": "密码不一致哦", "密码不一致哦": "密码不一致哦",
"相机": "相机", "相机": "相机",
"相册": "相册", "相册": "相册",

View File

@ -20,14 +20,13 @@ class AddICCardState{
final startDate = "".obs; final startDate = "".obs;
final weekDay = [].obs; final weekDay = [].obs;
final fromType = 0.obs; final fromType = 0.obs;
final effectiveDateTime = "".obs;// final effectiveDateTime = "".obs; //
final failureDateTime = "".obs;// final failureDateTime = "".obs; //
final selectType = "0".obs;// 0 1 2 final selectType = "0".obs; // 0 1 2
AddICCardState() { AddICCardState() {
Map map = Get.arguments; Map map = Get.arguments;
lockId.value = map["lockId"]; lockId.value = map["lockId"];
endDate.value = "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}";
addType.value = map["addType"]; addType.value = map["addType"];
cardName.value = map["cardName"]; cardName.value = map["cardName"];
cardNumber.value = map["cardNumber"]; cardNumber.value = map["cardNumber"];
@ -40,5 +39,12 @@ class AddICCardState{
effectiveDateTime.value = map["effectiveTime"]; effectiveDateTime.value = map["effectiveTime"];
failureDateTime.value = map["failureTime"]; failureDateTime.value = map["failureTime"];
selectType.value = map["selectType"]; selectType.value = map["selectType"];
//
if (selectType.value == '2') {
endDate.value =
"${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}";
} else {
endDate.value = map["endDate"];
}
} }
} }

View File

@ -153,12 +153,15 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
})))), })))),
Container(height: 10.h), Container(height: 10.h),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.additive!.tr, leftTitel: TranslationLoader.lanKeys!.additive!.tr,
rightTitle: state.adder.value,)), isHaveLine: true,
rightTitle: state.adder.value,
)),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.addTime!.tr, leftTitel: TranslationLoader.lanKeys!.addTime!.tr,
rightTitle: DateTool().dateToYMDHNString(state.addTime.value.toString()), rightTitle: DateTool()
)), .dateToYMDHNString(state.addTime.value.toString()),
)),
SizedBox(height: 10.h), SizedBox(height: 10.h),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.stressCard!.tr, leftTitel: TranslationLoader.lanKeys!.stressCard!.tr,

View File

@ -26,14 +26,13 @@ class AddFaceState {
final startDate = "".obs; final startDate = "".obs;
final weekDay = [].obs; final weekDay = [].obs;
final fromType = 0.obs; final fromType = 0.obs;
final effectiveDateTime = "".obs;// final effectiveDateTime = "".obs; //
final failureDateTime = "".obs;// final failureDateTime = "".obs; //
final selectType = "0".obs;// 0 1 2 final selectType = "0".obs; // 0 1 2
AddFaceState() { AddFaceState() {
Map map = Get.arguments; Map map = Get.arguments;
lockId.value = map["lockId"]; lockId.value = map["lockId"];
endDate.value = "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}";
addType.value = map["addType"]; addType.value = map["addType"];
faceName.value = map["faceName"]; faceName.value = map["faceName"];
faceType.value = map["faceType"]; faceType.value = map["faceType"];
@ -48,5 +47,12 @@ class AddFaceState {
effectiveDateTime.value = map["effectiveTime"]; effectiveDateTime.value = map["effectiveTime"];
failureDateTime.value = map["failureTime"]; failureDateTime.value = map["failureTime"];
selectType.value = map["selectType"]; selectType.value = map["selectType"];
//
if (selectType.value == '2') {
endDate.value =
"${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}";
} else {
endDate.value = map["endDate"];
}
} }
} }

View File

@ -22,14 +22,13 @@ class AddFingerprintState{
final startDate = "".obs; final startDate = "".obs;
final weekDay = [].obs; final weekDay = [].obs;
final fromType = 1.obs; final fromType = 1.obs;
final effectiveDateTime = "".obs;// final effectiveDateTime = "".obs; //
final failureDateTime = "".obs;// final failureDateTime = "".obs; //
final selectType = "0".obs;// 0 1 2 final selectType = "0".obs; // 0 1 2
AddFingerprintState() { AddFingerprintState() {
Map map = Get.arguments; Map map = Get.arguments;
lockId.value = map["lockId"]; lockId.value = map["lockId"];
endDate.value = "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}";
addType.value = map["addType"]; addType.value = map["addType"];
fingerprintName.value = map["fingerprintName"]; fingerprintName.value = map["fingerprintName"];
fingerprintType.value = map["fingerprintType"]; fingerprintType.value = map["fingerprintType"];
@ -42,5 +41,12 @@ class AddFingerprintState{
effectiveDateTime.value = map["effectiveTime"]; effectiveDateTime.value = map["effectiveTime"];
failureDateTime.value = map["failureTime"]; failureDateTime.value = map["failureTime"];
selectType.value = map["selectType"]; selectType.value = map["selectType"];
//
if (selectType.value == '2') {
endDate.value =
"${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}";
} else {
endDate.value = map["endDate"];
}
} }
} }

View File

@ -1,4 +1,3 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/scheduler.dart'; import 'package:flutter/scheduler.dart';
@ -24,7 +23,8 @@ import 'lockSetInfo_entity.dart';
import 'lockSet_state.dart'; import 'lockSet_state.dart';
typedef BlockSetStateCallback = void Function(); typedef BlockSetStateCallback = void Function();
typedef BlockSetCheckInCallback = void Function(CheckingInInfoDataEntity checkingInInfoDataEntity); typedef BlockSetCheckInCallback = void Function(
CheckingInInfoDataEntity checkingInInfoDataEntity);
class LockSetLogic extends BaseGetXController { class LockSetLogic extends BaseGetXController {
final LockSetState state = LockSetState(); final LockSetState state = LockSetState();
@ -40,12 +40,14 @@ class LockSetLogic extends BaseGetXController {
// } // }
// //
if (reply is FactoryDataResetReply && (state.ifCurrentScreen.value == true)) { if (reply is FactoryDataResetReply &&
(state.ifCurrentScreen.value == true)) {
_replyFactoryDataResetKey(reply); _replyFactoryDataResetKey(reply);
} }
// () // ()
if ((reply is SetSupportFunctionsNoParametersReply) && (state.ifCurrentScreen.value == true)) { if ((reply is SetSupportFunctionsNoParametersReply) &&
(state.ifCurrentScreen.value == true)) {
_replySetSupportFunctionsWithParameters(reply); _replySetSupportFunctionsWithParameters(reply);
} }
@ -124,7 +126,7 @@ class LockSetLogic extends BaseGetXController {
IoSenderManage.senderFactoryDataReset( IoSenderManage.senderFactoryDataReset(
lockID: BlueManage().connectDeviceName, lockID: BlueManage().connectDeviceName,
userID: await Storage.getUid(), userID: await Storage.getUid(),
keyID: "1", keyID: '1',
needAuthor: 1, needAuthor: 1,
publicKey: publicKeyDataList, publicKey: publicKeyDataList,
privateKey: getPrivateKeyList, privateKey: getPrivateKeyList,
@ -241,11 +243,14 @@ class LockSetLogic extends BaseGetXController {
// //
Future<void> factoryDataResetAction() async { Future<void> factoryDataResetAction() async {
showEasyLoading(); showEasyLoading();
showBlueConnetctToastTimer(isShowBlueConnetctToast: false, action: (){ showBlueConnetctToastTimer(
dismissEasyLoading(); isShowBlueConnetctToast: false,
showDeletAlertTipDialog(); action: () {
}); dismissEasyLoading();
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async { showDeletAlertTipDialog();
});
BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState connectionState) async {
if (connectionState == BluetoothConnectionState.connected) { if (connectionState == BluetoothConnectionState.connected) {
var privateKey = await Storage.getStringList(saveBluePrivateKey); var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
@ -259,7 +264,7 @@ class LockSetLogic extends BaseGetXController {
IoSenderManage.senderFactoryDataReset( IoSenderManage.senderFactoryDataReset(
lockID: BlueManage().connectDeviceName, lockID: BlueManage().connectDeviceName,
userID: await Storage.getUid(), userID: await Storage.getUid(),
keyID: "1", keyID: '1',
needAuthor: 1, needAuthor: 1,
publicKey: publicKeyDataList, publicKey: publicKeyDataList,
privateKey: getPrivateKeyList, privateKey: getPrivateKeyList,
@ -267,7 +272,7 @@ class LockSetLogic extends BaseGetXController {
} else if (connectionState == BluetoothConnectionState.disconnected) { } else if (connectionState == BluetoothConnectionState.disconnected) {
dismissEasyLoading(); dismissEasyLoading();
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
if(state.ifCurrentScreen.value == true){ if (state.ifCurrentScreen.value == true) {
showDeletAlertTipDialog(); showDeletAlertTipDialog();
} }
} }
@ -303,10 +308,11 @@ class LockSetLogic extends BaseGetXController {
// () // ()
Future<void> sendBurglarAlarm(int type) async { Future<void> sendBurglarAlarm(int type) async {
showEasyLoading(); showEasyLoading();
showBlueConnetctToastTimer(action: (){ showBlueConnetctToastTimer(action: () {
dismissEasyLoading(); dismissEasyLoading();
}); });
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async { BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState connectionState) async {
if (connectionState == BluetoothConnectionState.connected) { if (connectionState == BluetoothConnectionState.connected) {
var privateKey = await Storage.getStringList(saveBluePrivateKey); var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
@ -345,7 +351,7 @@ class LockSetLogic extends BaseGetXController {
} else if (connectionState == BluetoothConnectionState.disconnected) { } else if (connectionState == BluetoothConnectionState.disconnected) {
dismissEasyLoading(); dismissEasyLoading();
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
if(state.ifCurrentScreen.value == true){ if (state.ifCurrentScreen.value == true) {
showBlueConnetctToast(); showBlueConnetctToast();
} }
} }
@ -360,23 +366,28 @@ class LockSetLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.lockSetInfoData.value = entity.data!; state.lockSetInfoData.value = entity.data!;
CommonDataManage().currentLockSetInfoData = entity.data!; CommonDataManage().currentLockSetInfoData = entity.data!;
state.lockSettingInfo.value = state.lockSetInfoData.value.lockSettingInfo!; state.lockSettingInfo.value =
state.lockSetInfoData.value.lockSettingInfo!;
state.lockFeature.value = state.lockSetInfoData.value.lockFeature!; state.lockFeature.value = state.lockSetInfoData.value.lockFeature!;
state.lockStatus.value = state.lockSetInfoData.value.lockStatus!; state.lockStatus.value = state.lockSetInfoData.value.lockStatus!;
state.lockBasicInfo.value = state.lockSetInfoData.value.lockBasicInfo!; state.lockBasicInfo.value = state.lockSetInfoData.value.lockBasicInfo!;
state.isAttendance.value = state.lockSettingInfo.value.attendance!; state.isAttendance.value = state.lockSettingInfo.value.attendance!;
state.isOpenLockNeedOnline.value = state.lockSettingInfo.value.appUnlockOnline!; state.isOpenLockNeedOnline.value =
state.lockSettingInfo.value.appUnlockOnline!;
state.isOpenBlueBroadcast.value = state.lockSettingInfo.value.bluetoothBroadcast!; state.isOpenBlueBroadcast.value =
state.isOpenExceptionWarnings.value = state.lockSettingInfo.value.bluetoothBroadcast!; state.lockSettingInfo.value.bluetoothBroadcast!;
state.isOpenExceptionWarnings.value =
state.lockSettingInfo.value.bluetoothBroadcast!;
} }
return entity; return entity;
} }
// //
void openCheckingInData(BlockSetCheckInCallback blockSetCheckInCallback) async { void openCheckingInData(
BlockSetCheckInCallback blockSetCheckInCallback) async {
var entity = await ApiRepository.to.openCheckingInData( var entity = await ApiRepository.to.openCheckingInData(
lockId: state.lockSetInfoData.value.lockId.toString(), lockId: state.lockSetInfoData.value.lockId.toString(),
); );
@ -394,23 +405,26 @@ class LockSetLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.isAttendance.value = (state.isAttendance.value == 1 ? 0 : 1); state.isAttendance.value = (state.isAttendance.value == 1 ? 0 : 1);
state.lockSettingInfo.value.attendance = state.isAttendance.value; state.lockSettingInfo.value.attendance = state.isAttendance.value;
showToast("设置成功".tr, something: (){ showToast('设置成功'.tr, something: () {
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, state.lockSettingInfo.value.attendance!.toString())); eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(
0, state.lockSettingInfo.value.attendance!.toString()));
}); });
} }
} }
// //
void setLockPickingReminder() async { Future<void> setLockPickingReminder() async {
var entity = await ApiRepository.to.setLockPickingReminderData( var entity = await ApiRepository.to.setLockPickingReminderData(
lockId: state.lockSetInfoData.value.lockId!, lockId: state.lockSetInfoData.value.lockId!,
unlockReminderPush: state.isLockPickingReminder.value == 1 ? 0 : 1, unlockReminder: state.isLockPickingReminder.value == 1 ? 0 : 1,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.isLockPickingReminder.value = (state.isLockPickingReminder.value == 1 ? 0 : 1); state.isLockPickingReminder.value =
state.lockSettingInfo.value.unlockReminderPush = state.isLockPickingReminder.value; (state.isLockPickingReminder.value == 1 ? 0 : 1);
showToast("设置成功".tr, something: (){ state.lockSettingInfo.value.unlockReminderPush =
state.isLockPickingReminder.value;
showToast('设置成功'.tr, something: () {
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
}); });
} }
@ -423,11 +437,14 @@ class LockSetLogic extends BaseGetXController {
appUnlockOnline: state.isOpenLockNeedOnline.value == 1 ? 0 : 1, appUnlockOnline: state.isOpenLockNeedOnline.value == 1 ? 0 : 1,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.isOpenLockNeedOnline.value = (state.isOpenLockNeedOnline.value == 1 ? 0 : 1); state.isOpenLockNeedOnline.value =
state.lockSettingInfo.value.appUnlockOnline = state.isOpenLockNeedOnline.value; (state.isOpenLockNeedOnline.value == 1 ? 0 : 1);
state.lockSettingInfo.value.appUnlockOnline =
state.isOpenLockNeedOnline.value;
showToast("设置成功".tr,something: (){ showToast('设置成功'.tr, something: () {
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(1, state.lockSettingInfo.value.appUnlockOnline!.toString())); eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(
1, state.lockSettingInfo.value.appUnlockOnline!.toString()));
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
}); });
} }
@ -437,37 +454,42 @@ class LockSetLogic extends BaseGetXController {
StreamSubscription? _passCurrentLockInformationEvent; StreamSubscription? _passCurrentLockInformationEvent;
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) { void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
// eventBus // eventBus
_passCurrentLockInformationEvent = eventBus.on<PassCurrentLockInformationEvent>().listen((event) { _passCurrentLockInformationEvent =
eventBus.on<PassCurrentLockInformationEvent>().listen((event) {
getLockSettingInfoData(); getLockSettingInfoData();
}); });
} }
void showDeletAlertTipDialog({String? showContent = ""}) { void showDeletAlertTipDialog({String? showContent = ''}) {
var content = showContent!.isEmpty ? "${"删除设备失败,请确保在设备附近,设备未被连接,设备已打开".tr}${BlueManage().connectDeviceName!.contains("T9A") == true ? "。如果是全自动锁,请使屏幕变亮".tr : ""}" : showContent; var content = showContent!.isEmpty
? "${"删除设备失败,请确保在设备附近,设备未被连接,设备已打开".tr}${BlueManage().connectDeviceName!.contains("T9A") == true ? "。如果是全自动锁,请使屏幕变亮".tr : ""}"
: showContent;
ShowTipView().showSureAlertDialog(content); ShowTipView().showSureAlertDialog(content);
} }
///
/// deleyLockLogicOfRoles() {
deleyLockLogicOfRoles(){
if (state.lockBasicInfo.value.isLockOwner == 1) { if (state.lockBasicInfo.value.isLockOwner == 1) {
// //
ShowTipView().showIosTipWithContentDialog("删除锁后,所有信息都会一起删除,确定删除锁吗?".tr, (){ ShowTipView().showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr,
() {
// //
ShowTipView().showTFViewAlertDialog(state.passwordTF, "请输入登录密码".tr, "请输入登录密码".tr, (){ ShowTipView().showTFViewAlertDialog(
state.passwordTF, '请输入登录密码'.tr, '请输入登录密码'.tr, () {
checkLoginPassword(); checkLoginPassword();
}); });
}); });
} else if (state.lockBasicInfo.value.keyRight == 1){ } else if (state.lockBasicInfo.value.keyRight == 1) {
// //
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog("同时删除其发送的所有钥匙,钥匙删除后不能恢复".tr, (a){ ShowTipView().showDeleteAdministratorIsHaveAllDataDialog(
'同时删除其发送的所有钥匙,钥匙删除后不能恢复'.tr, (a) {
// //
state.deleteAdministratorIsHaveAllData.value = a; state.deleteAdministratorIsHaveAllData.value = a;
deletKeyData(); deletKeyData();
}); });
} else{ } else {
// //
ShowTipView().showIosTipWithContentDialog("是否删除钥匙?".tr, (){ ShowTipView().showIosTipWithContentDialog('是否删除钥匙?'.tr, () {
deletKeyData(); deletKeyData();
}); });
} }

View File

@ -496,7 +496,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr, leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr,
rightTitle: "", rightTitle: "",
isHaveLine: false, isHaveLine: true,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: _lockRemindSwitch())), rightWidget: _lockRemindSwitch())),
), ),
@ -661,7 +661,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
activeColor: CupertinoColors.activeBlue, activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5, trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white, thumbColor: CupertinoColors.white,
value: (state.isLockPickingReminder.value) == 1 ? true : false, value: state.isLockPickingReminder.value == 1 ? true : false,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
logic.setLockPickingReminder(); logic.setLockPickingReminder();

View File

@ -73,6 +73,7 @@ class RecordItem {
String? createdAt; String? createdAt;
String? updatedAt; String? updatedAt;
String? useDate; String? useDate;
String? buyDate;
RecordItem( RecordItem(
{this.id, {this.id,
@ -88,7 +89,8 @@ class RecordItem {
this.amount, this.amount,
this.createdAt, this.createdAt,
this.updatedAt, this.updatedAt,
this.useDate}); this.useDate,
this.buyDate});
RecordItem.fromJson(Map<String, dynamic> json) { RecordItem.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@ -105,6 +107,7 @@ class RecordItem {
createdAt = json['created_at']; createdAt = json['created_at'];
updatedAt = json['updated_at']; updatedAt = json['updated_at'];
useDate = json['useDate']; useDate = json['useDate'];
buyDate = json['buyDate'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -123,6 +126,7 @@ class RecordItem {
data['created_at'] = createdAt; data['created_at'] = createdAt;
data['updated_at'] = updatedAt; data['updated_at'] = updatedAt;
data['useDate'] = useDate; data['useDate'] = useDate;
data['buyDate'] = buyDate;
return data; return data;
} }
} }

View File

@ -107,7 +107,7 @@ class _PurchaseRecords extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
Text( Text(
itemData.createdAt?.substring(0, 10) ?? '', itemData.buyDate ?? '',
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: AppColors.blackColor, color: AppColors.blackColor,

View File

@ -891,13 +891,12 @@ class ApiProvider extends BaseProvider {
isUnShowLoading: true); isUnShowLoading: true);
// //
Future<Response> setLockPickingReminderData( Future<Response> setLockPickingReminderData(int lockId, int unlockReminder) =>
int lockId, int unlockReminderPush) =>
post( post(
updateLockSettingUrl.toUrl, updateLockSettingUrl.toUrl,
jsonEncode({ jsonEncode({
'lockId': lockId, 'lockId': lockId,
'unlockReminderPush': unlockReminderPush, 'unlockReminder': unlockReminder,
})); }));
// //

View File

@ -1095,10 +1095,10 @@ class ApiRepository {
// //
Future<LoginEntity> setLockPickingReminderData({ Future<LoginEntity> setLockPickingReminderData({
required int lockId, required int lockId,
required int unlockReminderPush, required int unlockReminder,
}) async { }) async {
final res = await apiProvider.setLockPickingReminderData( final res =
lockId, unlockReminderPush); await apiProvider.setLockPickingReminderData(lockId, unlockReminder);
return LoginEntity.fromJson(res.body); return LoginEntity.fromJson(res.body);
} }