From ffd709a1aeb28adfb66c3712ceec8acce535cc78 Mon Sep 17 00:00:00 2001 From: Daisy <> Date: Thu, 23 May 2024 17:14:43 +0800 Subject: [PATCH] =?UTF-8?q?1=EF=BC=8C=E9=94=81=E8=AE=BE=E7=BD=AE--?= =?UTF-8?q?=E5=BC=80=E9=94=81=E6=8F=90=E9=86=92=E6=8E=A5=E5=8F=A3=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=BF=AE=E6=94=B9=202=EF=BC=8C=E8=B4=AD=E4=B9=B0?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E9=A1=B5=E9=9D=A2bug=E4=BF=AE=E6=94=B9=203?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=8C=87=E7=BA=B9/=E5=8D=A1/?= =?UTF-8?q?=E4=BA=BA=E8=84=B8=E6=A8=A1=E5=9D=97=E9=99=90=E6=97=B6=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=B7=BB=E5=8A=A0=E6=97=B6=E9=97=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E5=90=8C=E6=AD=A5=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- images/lan/lan_en.json | 2 +- images/lan/lan_zh.json | 2 +- .../card/addICCard/addICCard_state.dart | 16 ++- .../card/cardDetail/cardDetail_page.dart | 13 ++- .../face/addFace/addFace_state.dart | 14 ++- .../addFingerprint/addFingerprint_state.dart | 16 ++- .../lockSet/lockSet/lockSet_logic.dart | 110 +++++++++++------- .../lockSet/lockSet/lockSet_page.dart | 4 +- .../advancedFunctionRecord_entity.dart | 6 +- .../value_added_services_record_page.dart | 2 +- lib/network/api_provider.dart | 5 +- lib/network/api_repository.dart | 6 +- 12 files changed, 121 insertions(+), 75 deletions(-) diff --git a/images/lan/lan_en.json b/images/lan/lan_en.json index 630c677c..09fb7bec 100755 --- a/images/lan/lan_en.json +++ b/images/lan/lan_en.json @@ -680,7 +680,7 @@ "密码生成后,请在当日23:59前使用一次进行激活,否则过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.", "密码生成后,请在当日23:59前使用,否则过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.", "密码生成后,请在当日23:59前使用,否则过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", "相册": "photos", "读写": "storage", diff --git a/images/lan/lan_zh.json b/images/lan/lan_zh.json index b83194c6..c8671034 100755 --- a/images/lan/lan_zh.json +++ b/images/lan/lan_zh.json @@ -683,7 +683,7 @@ "密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。": "密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。", "密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。": "密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。", "密码生成后,请在当日23:59前使用,否则过0点后失效。": "密码生成后,请在当日23:59前使用,否则过0点后失效。", - "清空密码底部提示": "清空密码当日24点前有效\n清空内容1:当日0点前生成的除自定义以外所有密码(当日0点后生成的密码,不受清空密码影响,可继续使用)\n清空内容2:清空密码使用后,立即清除所有自定义密码(含使用过和未使用过的)\n如需彻底清除所有密码,请使用重置所有密码功能", + "清空密码底部提示": "清空密码当日24点前有效\n清空内容1:当日0点前生成的所有密码(当日0点后生成的密码,不受清空密码影响,可继续使用)\n清空内容2:清空密码使用后,立即清除所有自定义密码(含使用过和未使用过的)\n如需彻底清除所有密码,请使用重置所有密码功能", "密码不一致哦": "密码不一致哦", "相机": "相机", "相册": "相册", diff --git a/lib/main/lockDetail/card/addICCard/addICCard_state.dart b/lib/main/lockDetail/card/addICCard/addICCard_state.dart index fd7f9a67..7129795f 100755 --- a/lib/main/lockDetail/card/addICCard/addICCard_state.dart +++ b/lib/main/lockDetail/card/addICCard/addICCard_state.dart @@ -20,14 +20,13 @@ class AddICCardState{ final startDate = "".obs; final weekDay = [].obs; final fromType = 0.obs; - final effectiveDateTime = "".obs;// 生效时间 - final failureDateTime = "".obs;// 失效时间 - final selectType = "0".obs;// 0永久 1显示 2循环 + final effectiveDateTime = "".obs; // 生效时间 + final failureDateTime = "".obs; // 失效时间 + final selectType = "0".obs; // 0永久 1显示 2循环 AddICCardState() { Map map = Get.arguments; lockId.value = map["lockId"]; - endDate.value = "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}"; addType.value = map["addType"]; cardName.value = map["cardName"]; cardNumber.value = map["cardNumber"]; @@ -40,5 +39,12 @@ class AddICCardState{ effectiveDateTime.value = map["effectiveTime"]; failureDateTime.value = map["failureTime"]; selectType.value = map["selectType"]; + //循环类型下,结束时间加一天 + if (selectType.value == '2') { + endDate.value = + "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}"; + } else { + endDate.value = map["endDate"]; + } } -} \ No newline at end of file +} diff --git a/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart b/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart index f5676497..d669b4b8 100755 --- a/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart +++ b/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart @@ -153,12 +153,15 @@ class _CardDetailPageState extends State with RouteAware { })))), Container(height: 10.h), Obx(() => CommonItem( - leftTitel: TranslationLoader.lanKeys!.additive!.tr, - rightTitle: state.adder.value,)), + leftTitel: TranslationLoader.lanKeys!.additive!.tr, + isHaveLine: true, + rightTitle: state.adder.value, + )), Obx(() => CommonItem( - leftTitel: TranslationLoader.lanKeys!.addTime!.tr, - rightTitle: DateTool().dateToYMDHNString(state.addTime.value.toString()), - )), + leftTitel: TranslationLoader.lanKeys!.addTime!.tr, + rightTitle: DateTool() + .dateToYMDHNString(state.addTime.value.toString()), + )), SizedBox(height: 10.h), Obx(() => CommonItem( leftTitel: TranslationLoader.lanKeys!.stressCard!.tr, diff --git a/lib/main/lockDetail/face/addFace/addFace_state.dart b/lib/main/lockDetail/face/addFace/addFace_state.dart index 7cd2938a..dc8b6632 100755 --- a/lib/main/lockDetail/face/addFace/addFace_state.dart +++ b/lib/main/lockDetail/face/addFace/addFace_state.dart @@ -26,14 +26,13 @@ class AddFaceState { final startDate = "".obs; final weekDay = [].obs; final fromType = 0.obs; - final effectiveDateTime = "".obs;// 生效时间 - final failureDateTime = "".obs;// 失效时间 - final selectType = "0".obs;// 0永久 1显示 2循环 + final effectiveDateTime = "".obs; // 生效时间 + final failureDateTime = "".obs; // 失效时间 + final selectType = "0".obs; // 0永久 1显示 2循环 AddFaceState() { Map map = Get.arguments; lockId.value = map["lockId"]; - endDate.value = "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}"; addType.value = map["addType"]; faceName.value = map["faceName"]; faceType.value = map["faceType"]; @@ -48,5 +47,12 @@ class AddFaceState { effectiveDateTime.value = map["effectiveTime"]; failureDateTime.value = map["failureTime"]; selectType.value = map["selectType"]; + //循环类型下,结束时间加一天 + if (selectType.value == '2') { + endDate.value = + "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}"; + } else { + endDate.value = map["endDate"]; + } } } diff --git a/lib/main/lockDetail/fingerprint/addFingerprint/addFingerprint_state.dart b/lib/main/lockDetail/fingerprint/addFingerprint/addFingerprint_state.dart index 55fe1bf0..5579e8c2 100755 --- a/lib/main/lockDetail/fingerprint/addFingerprint/addFingerprint_state.dart +++ b/lib/main/lockDetail/fingerprint/addFingerprint/addFingerprint_state.dart @@ -22,14 +22,13 @@ class AddFingerprintState{ final startDate = "".obs; final weekDay = [].obs; final fromType = 1.obs; - final effectiveDateTime = "".obs;// 生效时间 - final failureDateTime = "".obs;// 失效时间 - final selectType = "0".obs;// 0永久 1显示 2循环 + final effectiveDateTime = "".obs; // 生效时间 + final failureDateTime = "".obs; // 失效时间 + final selectType = "0".obs; // 0永久 1显示 2循环 AddFingerprintState() { Map map = Get.arguments; lockId.value = map["lockId"]; - endDate.value = "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}"; addType.value = map["addType"]; fingerprintName.value = map["fingerprintName"]; fingerprintType.value = map["fingerprintType"]; @@ -42,5 +41,12 @@ class AddFingerprintState{ effectiveDateTime.value = map["effectiveTime"]; failureDateTime.value = map["failureTime"]; selectType.value = map["selectType"]; + //循环类型下,结束时间加一天 + if (selectType.value == '2') { + endDate.value = + "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}"; + } else { + endDate.value = map["endDate"]; + } } -} \ No newline at end of file +} diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSet_logic.dart b/lib/main/lockDetail/lockSet/lockSet/lockSet_logic.dart index e0b17943..b90056e3 100755 --- a/lib/main/lockDetail/lockSet/lockSet/lockSet_logic.dart +++ b/lib/main/lockDetail/lockSet/lockSet/lockSet_logic.dart @@ -1,4 +1,3 @@ - import 'dart:async'; import 'package:flutter/scheduler.dart'; @@ -24,7 +23,8 @@ import 'lockSetInfo_entity.dart'; import 'lockSet_state.dart'; typedef BlockSetStateCallback = void Function(); -typedef BlockSetCheckInCallback = void Function(CheckingInInfoDataEntity checkingInInfoDataEntity); +typedef BlockSetCheckInCallback = void Function( + CheckingInInfoDataEntity checkingInInfoDataEntity); class LockSetLogic extends BaseGetXController { 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); } // 设置支持功能(不带参数) - if ((reply is SetSupportFunctionsNoParametersReply) && (state.ifCurrentScreen.value == true)) { + if ((reply is SetSupportFunctionsNoParametersReply) && + (state.ifCurrentScreen.value == true)) { _replySetSupportFunctionsWithParameters(reply); } @@ -124,7 +126,7 @@ class LockSetLogic extends BaseGetXController { IoSenderManage.senderFactoryDataReset( lockID: BlueManage().connectDeviceName, userID: await Storage.getUid(), - keyID: "1", + keyID: '1', needAuthor: 1, publicKey: publicKeyDataList, privateKey: getPrivateKeyList, @@ -241,11 +243,14 @@ class LockSetLogic extends BaseGetXController { // 恢复出厂设置 Future factoryDataResetAction() async { showEasyLoading(); - showBlueConnetctToastTimer(isShowBlueConnetctToast: false, action: (){ - dismissEasyLoading(); - showDeletAlertTipDialog(); - }); - BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async { + showBlueConnetctToastTimer( + isShowBlueConnetctToast: false, + action: () { + dismissEasyLoading(); + showDeletAlertTipDialog(); + }); + BlueManage().blueSendData(BlueManage().connectDeviceName, + (BluetoothConnectionState connectionState) async { if (connectionState == BluetoothConnectionState.connected) { var privateKey = await Storage.getStringList(saveBluePrivateKey); List getPrivateKeyList = changeStringListToIntList(privateKey!); @@ -259,7 +264,7 @@ class LockSetLogic extends BaseGetXController { IoSenderManage.senderFactoryDataReset( lockID: BlueManage().connectDeviceName, userID: await Storage.getUid(), - keyID: "1", + keyID: '1', needAuthor: 1, publicKey: publicKeyDataList, privateKey: getPrivateKeyList, @@ -267,7 +272,7 @@ class LockSetLogic extends BaseGetXController { } else if (connectionState == BluetoothConnectionState.disconnected) { dismissEasyLoading(); cancelBlueConnetctToastTimer(); - if(state.ifCurrentScreen.value == true){ + if (state.ifCurrentScreen.value == true) { showDeletAlertTipDialog(); } } @@ -303,10 +308,11 @@ class LockSetLogic extends BaseGetXController { // 设置支持功能(带参数) Future sendBurglarAlarm(int type) async { showEasyLoading(); - showBlueConnetctToastTimer(action: (){ + showBlueConnetctToastTimer(action: () { dismissEasyLoading(); }); - BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async { + BlueManage().blueSendData(BlueManage().connectDeviceName, + (BluetoothConnectionState connectionState) async { if (connectionState == BluetoothConnectionState.connected) { var privateKey = await Storage.getStringList(saveBluePrivateKey); List getPrivateKeyList = changeStringListToIntList(privateKey!); @@ -345,7 +351,7 @@ class LockSetLogic extends BaseGetXController { } else if (connectionState == BluetoothConnectionState.disconnected) { dismissEasyLoading(); cancelBlueConnetctToastTimer(); - if(state.ifCurrentScreen.value == true){ + if (state.ifCurrentScreen.value == true) { showBlueConnetctToast(); } } @@ -360,23 +366,28 @@ class LockSetLogic extends BaseGetXController { if (entity.errorCode!.codeIsSuccessful) { state.lockSetInfoData.value = 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.lockStatus.value = state.lockSetInfoData.value.lockStatus!; state.lockBasicInfo.value = state.lockSetInfoData.value.lockBasicInfo!; 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.isOpenExceptionWarnings.value = state.lockSettingInfo.value.bluetoothBroadcast!; + state.isOpenBlueBroadcast.value = + state.lockSettingInfo.value.bluetoothBroadcast!; + state.isOpenExceptionWarnings.value = + state.lockSettingInfo.value.bluetoothBroadcast!; } return entity; } // 开启考勤获取是否有公司 - void openCheckingInData(BlockSetCheckInCallback blockSetCheckInCallback) async { + void openCheckingInData( + BlockSetCheckInCallback blockSetCheckInCallback) async { var entity = await ApiRepository.to.openCheckingInData( lockId: state.lockSetInfoData.value.lockId.toString(), ); @@ -394,23 +405,26 @@ class LockSetLogic extends BaseGetXController { if (entity.errorCode!.codeIsSuccessful) { state.isAttendance.value = (state.isAttendance.value == 1 ? 0 : 1); state.lockSettingInfo.value.attendance = state.isAttendance.value; - showToast("设置成功".tr, something: (){ + showToast('设置成功'.tr, something: () { 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 setLockPickingReminder() async { var entity = await ApiRepository.to.setLockPickingReminderData( lockId: state.lockSetInfoData.value.lockId!, - unlockReminderPush: state.isLockPickingReminder.value == 1 ? 0 : 1, + unlockReminder: state.isLockPickingReminder.value == 1 ? 0 : 1, ); if (entity.errorCode!.codeIsSuccessful) { - state.isLockPickingReminder.value = (state.isLockPickingReminder.value == 1 ? 0 : 1); - state.lockSettingInfo.value.unlockReminderPush = state.isLockPickingReminder.value; - showToast("设置成功".tr, something: (){ + state.isLockPickingReminder.value = + (state.isLockPickingReminder.value == 1 ? 0 : 1); + state.lockSettingInfo.value.unlockReminderPush = + state.isLockPickingReminder.value; + showToast('设置成功'.tr, something: () { eventBus.fire(RefreshLockListInfoDataEvent()); }); } @@ -423,11 +437,14 @@ class LockSetLogic extends BaseGetXController { appUnlockOnline: state.isOpenLockNeedOnline.value == 1 ? 0 : 1, ); if (entity.errorCode!.codeIsSuccessful) { - state.isOpenLockNeedOnline.value = (state.isOpenLockNeedOnline.value == 1 ? 0 : 1); - state.lockSettingInfo.value.appUnlockOnline = state.isOpenLockNeedOnline.value; + state.isOpenLockNeedOnline.value = + (state.isOpenLockNeedOnline.value == 1 ? 0 : 1); + state.lockSettingInfo.value.appUnlockOnline = + state.isOpenLockNeedOnline.value; - showToast("设置成功".tr,something: (){ - eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(1, state.lockSettingInfo.value.appUnlockOnline!.toString())); + showToast('设置成功'.tr, something: () { + eventBus.fire(LockSetChangeSetRefreshLockDetailWithType( + 1, state.lockSettingInfo.value.appUnlockOnline!.toString())); eventBus.fire(RefreshLockListInfoDataEvent()); }); } @@ -437,37 +454,42 @@ class LockSetLogic extends BaseGetXController { StreamSubscription? _passCurrentLockInformationEvent; void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) { // 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus - _passCurrentLockInformationEvent = eventBus.on().listen((event) { + _passCurrentLockInformationEvent = + eventBus.on().listen((event) { getLockSettingInfoData(); }); } - void showDeletAlertTipDialog({String? showContent = ""}) { - var content = showContent!.isEmpty ? "${"删除设备失败,请确保在设备附近,设备未被连接,设备已打开".tr}${BlueManage().connectDeviceName!.contains("T9A") == true ? "。如果是全自动锁,请使屏幕变亮".tr : ""}" : showContent; + void showDeletAlertTipDialog({String? showContent = ''}) { + var content = showContent!.isEmpty + ? "${"删除设备失败,请确保在设备附近,设备未被连接,设备已打开".tr}${BlueManage().connectDeviceName!.contains("T9A") == true ? "。如果是全自动锁,请使屏幕变亮".tr : ""}" + : showContent; ShowTipView().showSureAlertDialog(content); } - -/// 以下为删除逻辑 - deleyLockLogicOfRoles(){ + /// 以下为删除逻辑 + deleyLockLogicOfRoles() { 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(); }); }); - } 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; deletKeyData(); }); - } else{ + } else { // 普通用户直接删除 - ShowTipView().showIosTipWithContentDialog("是否删除钥匙?".tr, (){ + ShowTipView().showIosTipWithContentDialog('是否删除钥匙?'.tr, () { deletKeyData(); }); } diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart index 9632b5e3..1734eaef 100755 --- a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart +++ b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart @@ -496,7 +496,7 @@ class _LockSetPageState extends State with RouteAware { child: CommonItem( leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr, rightTitle: "", - isHaveLine: false, + isHaveLine: true, isHaveRightWidget: true, rightWidget: _lockRemindSwitch())), ), @@ -661,7 +661,7 @@ class _LockSetPageState extends State with RouteAware { activeColor: CupertinoColors.activeBlue, trackColor: CupertinoColors.systemGrey5, thumbColor: CupertinoColors.white, - value: (state.isLockPickingReminder.value) == 1 ? true : false, + value: state.isLockPickingReminder.value == 1 ? true : false, onChanged: (value) { setState(() { logic.setLockPickingReminder(); diff --git a/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart b/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart index 72e4de70..5d36ca71 100755 --- a/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart +++ b/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart @@ -73,6 +73,7 @@ class RecordItem { String? createdAt; String? updatedAt; String? useDate; + String? buyDate; RecordItem( {this.id, @@ -88,7 +89,8 @@ class RecordItem { this.amount, this.createdAt, this.updatedAt, - this.useDate}); + this.useDate, + this.buyDate}); RecordItem.fromJson(Map json) { id = json['id']; @@ -105,6 +107,7 @@ class RecordItem { createdAt = json['created_at']; updatedAt = json['updated_at']; useDate = json['useDate']; + buyDate = json['buyDate']; } Map toJson() { @@ -123,6 +126,7 @@ class RecordItem { data['created_at'] = createdAt; data['updated_at'] = updatedAt; data['useDate'] = useDate; + data['buyDate'] = buyDate; return data; } } diff --git a/lib/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_page.dart b/lib/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_page.dart index b8aba35b..f7e7eadf 100755 --- a/lib/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_page.dart +++ b/lib/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_page.dart @@ -107,7 +107,7 @@ class _PurchaseRecords extends StatelessWidget { Row( children: [ Text( - itemData.createdAt?.substring(0, 10) ?? '', + itemData.buyDate ?? '', style: TextStyle( fontSize: 24.sp, color: AppColors.blackColor, diff --git a/lib/network/api_provider.dart b/lib/network/api_provider.dart index 499b1acc..f0c72cb6 100755 --- a/lib/network/api_provider.dart +++ b/lib/network/api_provider.dart @@ -891,13 +891,12 @@ class ApiProvider extends BaseProvider { isUnShowLoading: true); // 获取开锁提醒 - Future setLockPickingReminderData( - int lockId, int unlockReminderPush) => + Future setLockPickingReminderData(int lockId, int unlockReminder) => post( updateLockSettingUrl.toUrl, jsonEncode({ 'lockId': lockId, - 'unlockReminderPush': unlockReminderPush, + 'unlockReminder': unlockReminder, })); // 获取员工列表 diff --git a/lib/network/api_repository.dart b/lib/network/api_repository.dart index 7b3aabf4..226548e5 100755 --- a/lib/network/api_repository.dart +++ b/lib/network/api_repository.dart @@ -1095,10 +1095,10 @@ class ApiRepository { // 设置锁开锁提醒 Future setLockPickingReminderData({ required int lockId, - required int unlockReminderPush, + required int unlockReminder, }) async { - final res = await apiProvider.setLockPickingReminderData( - lockId, unlockReminderPush); + final res = + await apiProvider.setLockPickingReminderData(lockId, unlockReminder); return LoginEntity.fromJson(res.body); }