From 9ac7a01f4bee705257a32e90d4eb2c56240f049b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Tue, 9 Apr 2024 15:21:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=83=A8=E5=88=86=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AF=86=E7=A0=81=E5=90=8D=E5=AD=97?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E6=98=AF=E5=90=A6=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/images/lan/lan_en.json | 69 +++++++- star_lock/images/lan/lan_keys.json | 69 +++++++- star_lock/images/lan/lan_zh.json | 71 +++++++- star_lock/ios/Runner/Info.plist | 2 + star_lock/lib/blue/blue_manage.dart | 33 ++-- .../starLock_forgetPassword_page.dart | 4 +- .../lib/login/login/starLock_login_logic.dart | 2 + .../authorizedAdmin/authorizedAdmin_page.dart | 2 +- .../volumeAuthorizationLock_page.dart | 2 +- .../card/addCardType/addCardType_logic.dart | 9 +- .../card/addCardType/addCardType_page.dart | 80 +-------- .../card/addICCard/addICCard_logic.dart | 86 ++++------ .../card/addICCard/addICCard_page.dart | 6 +- .../card/cardDetail/cardDetail_page.dart | 8 - .../electronicKeyDetail_logic.dart | 116 +++---------- .../electronicKeyDetail_page.dart | 155 +----------------- .../electronicKeyDetailChangeDate_logic.dart | 6 +- .../electronicKeyPeriodValidity_logic.dart | 6 +- .../electronicKeyPeriodValidity_page.dart | 6 +- .../keyOperationRecord_logic.dart | 5 +- .../keyOperationRecord_page.dart | 2 +- .../electronicKeyList_logic.dart | 11 +- .../electronicKeyList_page.dart | 45 ++--- .../massSendElectronicKey_logic.dart | 27 +-- .../massSendElectronicKey_page.dart | 10 +- .../massSendElectronicKey_state.dart | 2 +- .../lockUserList/lockUserList_page.dart | 6 +- .../massSendLockGroupList_page.dart | 7 +- .../sendElectronicKey_logic.dart | 15 +- .../sendElectronicKey_page.dart | 36 ++-- .../sendElectronicKey_state.dart | 2 +- .../face/addFaceType/addFaceType_page.dart | 2 +- .../addFingerprintType_logic.dart | 2 +- .../addFingerprintType_page.dart | 2 +- .../lockDetail/lockDetail_logic.dart | 2 +- .../passwordKeyDetail_logic.dart | 5 +- .../passwordKeyList_logic.dart | 6 +- .../passwordKeyList/passwordKeyList_page.dart | 7 +- .../passwordKey_perpetual_logic.dart | 78 +++++---- .../passwordKey_perpetual_page.dart | 16 +- .../passwordKey_perpetual_state.dart | 2 +- .../addRemoteControl_page.dart | 2 +- .../gaode/lockAddressGaoDe_page.dart | 25 ++- .../mine/addLock/saveLock/saveLock_page.dart | 18 +- .../lib/mine/mine/starLockMine_logic.dart | 2 + .../lib/mine/mine/starLockMine_page.dart | 21 ++- .../lib/mine/mine/starLockMine_state.dart | 2 +- .../minePersonInfo_logic.dart | 12 +- .../minePersonInfo_page.dart | 46 +++--- ...pUnlockNeedMobileNetworkingLock_logic.dart | 6 + .../addAuthorizedAdministrator_logic.dart | 2 +- .../addAuthorizedAdministrator_page.dart | 2 +- .../groupEditLock/groupEditLock_logic.dart | 4 +- .../lockGroupList/lockGroupList_logic.dart | 2 +- .../selectGetewayList_page.dart | 2 +- .../transferSmartLock_page.dart | 2 +- star_lock/lib/network/api.dart | 1 + star_lock/lib/network/api_provider.dart | 14 ++ star_lock/lib/network/api_repository.dart | 12 ++ star_lock/lib/tools/storage.dart | 6 + star_lock/pubspec.yaml | 4 +- 61 files changed, 550 insertions(+), 657 deletions(-) diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json index f6f54d6d..d5516ba7 100644 --- a/star_lock/images/lan/lan_en.json +++ b/star_lock/images/lan/lan_en.json @@ -312,7 +312,7 @@ "lightTouchScreenTip":"Light Touch Screen Tip", "next":"Next", "nearbyLock":"Nearby Lock", - "addSuccessfullyPleaseRename":"Add Successfully Please Rename", + "addSuccessfullyPleaseRename":"If you want to change the name, please rename, click OK to add lock", "whenAddingLockThePhoneMustBeNextToTheLock":"When adding a lock, the phone must be next to the lock", "login":"Login", @@ -538,6 +538,7 @@ "清空码": "Clear code", "循环": "Cycle", "工作日": "Workday", + "每日": "Daily", "周末": "Weekend", "周一": "Monday", "周二": "Tuesday", @@ -548,5 +549,69 @@ "周日": "Sunday", "确定要删除吗?": "Are you sure you want to delete?", "该锁的密码都将被删除": "The password of the lock will be deleted", - "已过期": "Expired" + "已过期": "Expired", + "该锁的电子钥匙都将被删除": "The electronic key of the lock will be deleted", + "同时删除其发送的所有钥匙,钥匙删除后不能恢复": "Also delete all the keys sent by it, the key can not be restored after deletion", + "删除钥匙会在用户APP连网后生效": "Deleting the key will take effect after the user APP is connected to the network", + "有效时间": "Effective time", + "接收者": "Receiver", + "仅管理自己创建的用户": "Only manage users created by yourself", + "远程开锁": "Remote unlock", + "请输入钥匙名称": "Please enter the key name", + "修改成功": "Modify success", + "冻结": "Freeze", + "取消冻结": "Unfreeze", + "授权": "Authorization", + "取消授权": "Cancel authorization", + "同时解冻其发送的钥匙": "Unfreeze the keys sent by it", + "取消冻结会在用户APP连网后生效": "Unfreezing will take effect after the user APP is connected to the network", + "同时冻结其发送的钥匙": "Freeze the keys sent by it", + "冻结会在用户APP连网后生效": "Freezing will take effect after the user APP is connected to the network", + "取消授权会在用户APP连网后生效": "Canceling authorization will take effect after the user APP is connected to the network", + "授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码": "Authorized users have most of the permissions of the administrator, such as sending keys, sending passwords", + "失效时间需大于生效时间": "The expiration time must be greater than the effective time", + "生效时间需大于当前时间": "The effective time must be greater than the current time", + "失效日期要大于生效日期": "The expiration date must be greater than the effective date", + "失效时间要大于生效时间": "The expiration time must be greater than the effective time", + "修改有效期": "Modify the validity period", + "生效日期": "Effective date", + "失效日期": "Expiration date", + "开锁": "Unlock", + "开锁成功": "Unlock success", + "请选择锁": "Please select the lock", + "请选择接收者": "Please select the receiver", + "请选择有效期": "Please select the validity period", + "请选择发送方式": "Please select the sending method", + "请选择结束时间": "Please select the end time", + "完成": "Complete", + "有效日": "Effective day", + "发送成功": "Send success", + "请选择开始时间": "Please select the start time", + "选择用户": "Select user", + "已选中": "Selected", + "确定": "Determine", + "请选择要发送的锁": "Please select the lock to send", + "人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。": "Face real-name authentication refers to the user's need to verify his face before unlocking the phone APP, and the verification can be unlocked.", + "分享": "Share", + "请输入接收者账号": "Please enter the receiver account", + "接收者号码未注册,请重新发送": "The receiver number is not registered, please resend", + "是否发送电子钥匙给未注册账号": "Whether to send the electronic key to the unregistered account", + "取消": "Cancel", + "标记成功": "Mark success", + "微信好友": "WeChat friends", + "短信": "SMS", + "邮件": "Mail", + "更多": "More", + "您好,您的电子钥匙生成成功": "Hello, your electronic key is generated successfully", + "生效时间不能小于当前时间": "The effective time cannot be less than the current time", + "结束时间不能小于当前时间": "The end time cannot be less than the current time", + "是否是管理员": "Is it an administrator", + "已连接到锁,请将卡靠近锁的读卡区": "Connected to the lock, please put the card close to the card reading area of the lock", + "尝试连接设备...": "Trying to connect to the device...", + "地理位置": "Geographical location", + "检查以确保以下地址是正确的": "Check to make sure the following address is correct", + "地图加载中,请稍候。。": "The map is loading, please wait...", + "跳过": "Skip", + "还未获取到位置信息哦,请耐心等待一下!": "The location information has not been obtained yet, please wait patiently!", + "请填写信息": "Please fill in the information" } diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json index 833d9983..b9f027fb 100644 --- a/star_lock/images/lan/lan_keys.json +++ b/star_lock/images/lan/lan_keys.json @@ -525,7 +525,7 @@ "隐私政策": "隐私政策", "注册成功": "注册成功", "你所在的": "你所在的", - "手机号": "公司已经开通了", + "手机号": "手机号", "忘记密码": "忘记密码", "重置成功": "重置成功", "确定要退出吗?": "确定要退出吗?", @@ -539,6 +539,7 @@ "清空码": "清空码", "循环": "循环", "工作日": "工作日", + "每日": "每日", "周末": "周末", "周一": "周一", "周二": "周二", @@ -549,5 +550,69 @@ "周日": "周日", "确定要删除吗?": "确定要删除吗?", "该锁的密码都将被删除": "该锁的密码都将被删除", - "已过期": "已过期" + "已过期": "已过期", + "该锁的电子钥匙都将被删除": "该锁的电子钥匙都将被删除", + "同时删除其发送的所有钥匙,钥匙删除后不能恢复": "同时删除其发送的所有钥匙,钥匙删除后不能恢复", + "删除钥匙会在用户APP连网后生效": "删除钥匙会在用户APP连网后生效", + "有效时间": "有效时间", + "接收者": "接收者", + "仅管理自己创建的用户": "仅管理自己创建的用户", + "远程开锁": "远程开锁", + "请输入钥匙名称": "请输入钥匙名称", + "修改成功": "修改成功", + "冻结": "冻结", + "取消冻结": "取消冻结", + "授权": "授权", + "取消授权": "取消授权", + "同时解冻其发送的钥匙": "同时解冻其发送的钥匙", + "取消冻结会在用户APP连网后生效": "取消冻结会在用户APP连网后生效", + "同时冻结其发送的钥匙": "同时冻结其发送的钥匙", + "冻结会在用户APP连网后生效": "冻结会在用户APP连网后生效", + "取消授权会在用户APP连网后生效": "取消授权会在用户APP连网后生效", + "授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码": "授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码", + "失效时间需大于生效时间": "失效时间需大于生效时间", + "生效时间需大于当前时间": "生效时间需大于当前时间", + "失效日期要大于生效日期": "失效日期要大于生效日期", + "失效时间要大于生效时间": "失效时间要大于生效时间", + "修改有效期": "修改有效期", + "生效日期": "生效日期", + "失效日期": "失效日期", + "开锁": "开锁", + "开锁成功": "开锁成功", + "请选择锁": "请选择锁", + "请选择接收者": "请选择接收者", + "请选择有效期": "请选择有效期", + "请选择发送方式": "请选择发送方式", + "请选择结束时间": "请选择结束时间", + "完成": "完成", + "有效日": "有效日", + "发送成功": "发送成功", + "请选择开始时间": "请选择开始时间", + "选择用户": "选择用户", + "已选中": "已选中", + "确定": "确定", + "请选择要发送的锁": "请选择要发送的锁", + "人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。": "人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。", + "分享": "分享", + "请输入接收者账号": "请输入接收者账号", + "接收者号码未注册,请重新发送": "接收者号码未注册,请重新发送", + "是否发送电子钥匙给未注册账号": "是否发送电子钥匙给未注册账号", + "取消": "取消", + "标记成功": "标记成功", + "微信好友": "微信好友", + "短信": "短信", + "邮件": "邮件", + "更多": "更多", + "您好,您的电子钥匙生成成功": "您好,您的电子钥匙生成成功", + "生效时间不能小于当前时间": "生效时间不能小于当前时间", + "结束时间不能小于当前时间": "结束时间不能小于当前时间", + "是否是管理员": "是否是管理员", + "已连接到锁,请将卡靠近锁的读卡区": "已连接到锁,请将卡靠近锁的读卡区", + "尝试连接设备...": "尝试连接设备...", + "地理位置": "地理位置", + "检查以确保以下地址是正确的": "检查以确保以下地址是正确的", + "地图加载中,请稍候。。": "地图加载中,请稍候。。", + "跳过": "跳过", + "还未获取到位置信息哦,请耐心等待一下!": "还未获取到位置信息哦,请耐心等待一下!", + "请填写信息": "请填写信息" } diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index 3343e66a..35befa6a 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -312,7 +312,7 @@ "lightTouchScreenTip":"摸亮触摸屏,锁进入可添加状态,点击下一步", "next":"下一步", "nearbyLock":"附近的锁", - "addSuccessfullyPleaseRename":"添加成功,请重命名", + "addSuccessfullyPleaseRename":"如需修改名字请重新命名,点击确定添加锁", "whenAddingLockThePhoneMustBeNextToTheLock":"添加锁时,手机必须在锁旁边", "login":"登录", @@ -526,7 +526,7 @@ "隐私政策": "隐私政策", "注册成功": "注册成功", "你所在的": "你所在的", - "手机号": "公司已经开通了", + "手机号": "手机号", "忘记密码": "忘记密码", "重置成功": "重置成功", "确定要退出吗?": "确定要退出吗?", @@ -540,6 +540,7 @@ "清空码": "清空码", "循环": "循环", "工作日": "工作日", + "每日": "每日", "周末": "周末", "周一": "周一", "周二": "周二", @@ -550,5 +551,69 @@ "周日": "周日", "确定要删除吗?": "确定要删除吗?", "该锁的密码都将被删除": "该锁的密码都将被删除", - "已过期": "已过期" + "已过期": "已过期", + "该锁的电子钥匙都将被删除": "该锁的电子钥匙都将被删除", + "同时删除其发送的所有钥匙,钥匙删除后不能恢复": "同时删除其发送的所有钥匙,钥匙删除后不能恢复", + "删除钥匙会在用户APP连网后生效": "删除钥匙会在用户APP连网后生效", + "有效时间": "有效时间", + "接收者": "接收者", + "仅管理自己创建的用户": "仅管理自己创建的用户", + "远程开锁": "远程开锁", + "请输入钥匙名称": "请输入钥匙名称", + "修改成功": "修改成功", + "冻结": "冻结", + "取消冻结": "取消冻结", + "授权": "授权", + "取消授权": "取消授权", + "同时解冻其发送的钥匙": "同时解冻其发送的钥匙", + "取消冻结会在用户APP连网后生效": "取消冻结会在用户APP连网后生效", + "同时冻结其发送的钥匙": "同时冻结其发送的钥匙", + "冻结会在用户APP连网后生效": "冻结会在用户APP连网后生效", + "取消授权会在用户APP连网后生效": "取消授权会在用户APP连网后生效", + "授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码": "授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码", + "失效时间需大于生效时间": "失效时间需大于生效时间", + "生效时间需大于当前时间": "生效时间需大于当前时间", + "失效日期要大于生效日期": "失效日期要大于生效日期", + "失效时间要大于生效时间": "失效时间要大于生效时间", + "修改有效期": "修改有效期", + "生效日期": "生效日期", + "失效日期": "失效日期", + "开锁": "开锁", + "开锁成功": "开锁成功", + "请选择锁": "请选择锁", + "请选择接收者": "请选择接收者", + "请选择有效期": "请选择有效期", + "请选择发送方式": "请选择发送方式", + "请选择结束时间": "请选择结束时间", + "完成": "完成", + "有效日": "有效日", + "发送成功": "发送成功", + "请选择开始时间": "请选择开始时间", + "选择用户": "选择用户", + "已选中": "已选中", + "确定": "确定", + "请选择要发送的锁": "请选择要发送的锁", + "人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。": "人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。", + "分享": "分享", + "请输入接收者账号": "请输入接收者账号", + "接收者号码未注册,请重新发送": "接收者号码未注册,请重新发送", + "是否发送电子钥匙给未注册账号": "是否发送电子钥匙给未注册账号", + "取消": "取消", + "标记成功": "标记成功", + "微信好友": "微信好友", + "短信": "短信", + "邮件": "邮件", + "更多": "更多", + "您好,您的电子钥匙生成成功": "您好,您的电子钥匙生成成功", + "生效时间不能小于当前时间": "生效时间不能小于当前时间", + "结束时间不能小于当前时间": "结束时间不能小于当前时间", + "是否是管理员": "是否是管理员", + "已连接到锁,请将卡靠近锁的读卡区": "已连接到锁,请将卡靠近锁的读卡区", + "尝试连接设备...": "尝试连接设备...", + "地理位置": "地理位置", + "检查以确保以下地址是正确的": "检查以确保以下地址是正确的", + "地图加载中,请稍候。。": "地图加载中,请稍候。。", + "跳过": "跳过", + "还未获取到位置信息哦,请耐心等待一下!": "还未获取到位置信息哦,请耐心等待一下!", + "请填写信息": "请填写信息" } diff --git a/star_lock/ios/Runner/Info.plist b/star_lock/ios/Runner/Info.plist index e5204edc..5e71ecba 100644 --- a/star_lock/ios/Runner/Info.plist +++ b/star_lock/ios/Runner/Info.plist @@ -28,6 +28,8 @@ NSAppTransportSecurity + NSAllowsArbitraryLoads + NSExceptionDomains jpush.cn diff --git a/star_lock/lib/blue/blue_manage.dart b/star_lock/lib/blue/blue_manage.dart index 9404e3b9..8e94c2fc 100644 --- a/star_lock/lib/blue/blue_manage.dart +++ b/star_lock/lib/blue/blue_manage.dart @@ -1,8 +1,8 @@ + import 'dart:async'; import 'dart:io'; import 'package:flutter_easyloading/flutter_easyloading.dart'; -// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart'; import 'package:get/get.dart'; import 'io_tool/io_model.dart'; @@ -79,7 +79,7 @@ class BlueManage { void _initGetMtuSubscription() { _mtuSubscription ??= bluetoothConnectDevice!.mtu.listen((value) { _mtuSize = value - 3; - Get.log('mtuSize:$_mtuSize'); + Get.log('_mtuSizeValue:$value mtuSize:$_mtuSize'); }); } @@ -148,9 +148,7 @@ class BlueManage { writeCharacteristicWithResponse(model.data); } else { try { - if (Platform.isAndroid) { - await FlutterBluePlus.turnOn(); - } + } catch (e) { Get.log("Error Turning On:"); } @@ -205,9 +203,7 @@ class BlueManage { } } else { try { - if (Platform.isAndroid) { - await FlutterBluePlus.turnOn(); - } + openBlue(); } catch (e) { Get.log("Error Turning On:"); } @@ -238,13 +234,12 @@ class BlueManage { } } else { try { - if (Platform.isAndroid) { - await FlutterBluePlus.turnOn(); - } + stateCallBack(BluetoothConnectionState.disconnected); + openBlue(); } catch (e) { Get.log("Error Turning On:"); } - }; + } } else { Get.log("开始扫描 蓝牙不可用,不能进行蓝牙操作"); } @@ -323,7 +318,6 @@ class BlueManage { if (bluetoothConnectionState == BluetoothConnectionState.connected) { try { bluetoothConnectDevice!.discoverServices().then((services) { - Get.log("333333333"); for (BluetoothService service in services) { // Get.log("11111service.remoteId:${service.remoteId}" // " service.uuid:${service.uuid}" @@ -336,7 +330,6 @@ class BlueManage { // " characteristic.secondaryServiceUuid:${characteristic.secondaryServiceUuid}" // " characteristic.characteristicUuid:${characteristic.characteristicUuid}"); if (characteristic.characteristicUuid == _characteristicIdSubscription) { - Get.log("44444444"); _subScribeToCharacteristic(characteristic); Get.log('Discovering services finished'); bluetoothConnectionState = BluetoothConnectionState.connected; @@ -475,8 +468,7 @@ class BlueManage { try { List valueList = value; List subData = splitList(valueList, _mtuSize!); - Get.log( - 'writeCharacteristicWithResponse 得到的分割数据:$subData'); + Get.log('writeCharacteristicWithResponse _mtuSize:$_mtuSize 得到的分割数据:$subData'); for (int i = 0; i < subData.length; i++) { await characteristic.write(subData[i]).then((value) async { @@ -573,6 +565,15 @@ class BlueManage { } } + openBlue() async { + if (Platform.isAndroid) { + await FlutterBluePlus.turnOn(); + } + if (Platform.isIOS) { + EasyLoading.showToast("请开启蓝牙", duration: 2000.milliseconds); + } + } + disposed() { _sendStreamSubscription?.cancel(); _mtuSubscription!.cancel(); diff --git a/star_lock/lib/login/forgetPassword/starLock_forgetPassword_page.dart b/star_lock/lib/login/forgetPassword/starLock_forgetPassword_page.dart index d50f70ce..79fbc851 100644 --- a/star_lock/lib/login/forgetPassword/starLock_forgetPassword_page.dart +++ b/star_lock/lib/login/forgetPassword/starLock_forgetPassword_page.dart @@ -47,7 +47,7 @@ class _StarLockForgetPasswordPageState state.countryCode.value = result['code']; state.countryName.value = result['countryName']; } - // print("路由返回值: ${result}, countryCode:${logic.state.countryCode} ,countryId:${logic.state.countryId}"); + print("路由返回值: ${result}, countryCode:${state.countryName.value} ,state.countryName.value:${state.countryName.value}"); }, child: SizedBox( height: 70.h, @@ -185,7 +185,7 @@ class _StarLockForgetPasswordPageState var result = await Navigator.pushNamed( context, Routers.safetyVerificationPage, arguments: { - "countryCode": "86", + "countryCode": state.countryCode.value, "account": state.phoneStr.value }); logic.state.xWidth.value = diff --git a/star_lock/lib/login/login/starLock_login_logic.dart b/star_lock/lib/login/login/starLock_login_logic.dart index c097aec3..545ae397 100644 --- a/star_lock/lib/login/login/starLock_login_logic.dart +++ b/star_lock/lib/login/login/starLock_login_logic.dart @@ -8,6 +8,7 @@ import 'package:star_lock/tools/xs_jPhush.dart'; import '../../mine/mine/starLockMine_logic.dart'; import '../../network/api_repository.dart'; +import '../../tools/eventBusEventManage.dart'; import '../../tools/storage.dart'; import 'starLock_login_state.dart'; @@ -20,6 +21,7 @@ class StarLockLoginLogic extends BaseGetXController { .login("1", state.pwd.value, "+86", state.emailOrPhone.value); if (entity.errorCode!.codeIsSuccessful) { Storage.saveLoginData(entity.data); + eventBus.fire(MineInfoChangeRefreshUI()); // Get.back(); // Get.toNamed(Routers.starLockMain); XSJPushProvider().initJPushService(); diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_page.dart index aa15fe5a..8cf069de 100644 --- a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_page.dart +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_page.dart @@ -285,7 +285,7 @@ class _AuthorizedAdminPageState extends State { height: 20.h, ), SubmitBtn( - btnName: '完成', + btnName: '完成'.tr, onClick: () { state.isSendSuccess.value = false; Navigator.pop(context, true); diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLock_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLock_page.dart index 99a6ffbe..f442ff25 100644 --- a/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLock_page.dart +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLock_page.dart @@ -398,7 +398,7 @@ class _VolumeAuthorizationLockPageState height: 20.h, ), SubmitBtn( - btnName: '完成', + btnName: '完成'.tr, onClick: () { _isSendSuccess = false; Navigator.pop(context, true); diff --git a/star_lock/lib/main/lockDetail/card/addCardType/addCardType_logic.dart b/star_lock/lib/main/lockDetail/card/addCardType/addCardType_logic.dart index f14a5d57..eb1d9080 100644 --- a/star_lock/lib/main/lockDetail/card/addCardType/addCardType_logic.dart +++ b/star_lock/lib/main/lockDetail/card/addCardType/addCardType_logic.dart @@ -31,11 +31,11 @@ class AddCardTypeLogic extends BaseGetXController{ endTime = "0"; if (startDate.isEmpty) { - showToast("请选择开始时间"); + showToast("请选择开始时间".tr); return; } if (endDate.isEmpty) { - showToast("请选择结束时间"); + showToast("请选择结束时间".tr); return; } @@ -45,12 +45,12 @@ class AddCardTypeLogic extends BaseGetXController{ // } if (int.parse(startDate) >= int.parse(endDate)) { - showToast("失效时间要大于生效时间"); + showToast("失效时间要大于生效时间".tr); return; } } else if (state.selectType.value == "2") { if (state.beginTime.value.isEmpty) { - showToast("请选择有效期"); + showToast("请选择有效期".tr); return; } startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString(); @@ -61,7 +61,6 @@ class AddCardTypeLogic extends BaseGetXController{ } var isCoerced = state.isStressFingerprint.value == false ? "1" : "2"; // 1:非胁迫卡 2:胁迫卡 - print("addOtherType startDate:$startDate endDate:$endDate"); Get.toNamed(Routers.addICCardPage, arguments: { "lockId": state.lockId.value, "endDate": endDate, diff --git a/star_lock/lib/main/lockDetail/card/addCardType/addCardType_page.dart b/star_lock/lib/main/lockDetail/card/addCardType/addCardType_page.dart index cd1a39a1..3c6c2829 100644 --- a/star_lock/lib/main/lockDetail/card/addCardType/addCardType_page.dart +++ b/star_lock/lib/main/lockDetail/card/addCardType/addCardType_page.dart @@ -1,3 +1,4 @@ + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -70,7 +71,6 @@ class _AddCardPageState extends State { case 0: { // 永久 - // return sendElectronicKeySucceed(); return Column( children: [ perpetualKeyWidget( @@ -214,7 +214,7 @@ class _AddCardPageState extends State { Obx(() => Visibility( visible: state.effectiveDateTime.value.isNotEmpty, child: CommonItem( - leftTitel: "有效时间", + leftTitel: "有效时间".tr, rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}", isHaveDirection: true, action: () async { @@ -244,7 +244,7 @@ class _AddCardPageState extends State { return Column( children: [ Obx(() => CommonItem( - leftTitel: "是否是管理员", + leftTitel: "是否是管理员".tr, rightTitle: "", isTipsImg: false, isHaveRightWidget: true, @@ -266,90 +266,20 @@ class _AddCardPageState extends State { if (isDemoMode == false) { // print("state.selectType:${state.selectType.value}"); if (state.nameController.text.isEmpty) { - logic.showToast("请输入姓名"); + logic.showToast("请输入姓名".tr); return; } logic.checkCardNameDuplicated(state.nameController.text); } else { // Get.toNamed(Routers.selectLockTypePage); - logic.showToast("演示模式"); + logic.showToast("演示模式".tr); } }), ], ); } - // 发送电子钥匙成功 - Widget sendElectronicKeySucceed() { - return Column( - children: [ - Container( - height: 300.h, - width: 1.sw, - color: Colors.white, - child: Column( - children: [ - SizedBox( - height: 30.h, - ), - Image.asset( - 'images/main/icon_main_addLock.png', - width: 150.w, - height: 150.w, - color: AppColors.mainColor, - ), - SizedBox( - height: 20.h, - ), - Text( - "操作成功,密码为", - style: TextStyle( - fontSize: 32.sp, - color: Colors.black, - fontWeight: FontWeight.w500), - ), - SizedBox( - height: 10.h, - ), - Text( - "62689876", - style: TextStyle( - fontSize: 60.sp, - color: Colors.black, - fontWeight: FontWeight.w500), - ), - ], - ), - ), - SizedBox( - height: 20.h, - ), - SubmitBtn( - btnName: '完成', - fontSize: 28.sp, - borderRadius: 20.w, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), - padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: () {}), - SubmitBtn( - btnName: '分享', - fontSize: 28.sp, - borderRadius: 20.w, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), - padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: () {}), - SubmitBtn( - btnName: '标记为:已入住', - fontSize: 28.sp, - borderRadius: 20.w, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), - padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: () {}), - ], - ); - } - String getAppBarTitle(int type) { String title; switch (type) { diff --git a/star_lock/lib/main/lockDetail/card/addICCard/addICCard_logic.dart b/star_lock/lib/main/lockDetail/card/addICCard/addICCard_logic.dart index e0ac9969..450d3ac1 100644 --- a/star_lock/lib/main/lockDetail/card/addICCard/addICCard_logic.dart +++ b/star_lock/lib/main/lockDetail/card/addICCard/addICCard_logic.dart @@ -50,15 +50,13 @@ class AddICCardLogic extends BaseGetXController{ switch(status){ case 0x00: - //成功 - print("${reply.commandType!.typeValue} 数据解析成功"); + //成功 // state.cardNumber.value = reply.data.last.toString(); cancelBlueConnetctToastTimer(); state.ifConnectScuess.value = true; break; case 0x06: - //无权限 - print("${reply.commandType!.typeValue} 需要鉴权"); + //无权限 var privateKey = await Storage.getStringList(saveBluePrivateKey); List getPrivateKeyList = changeStringListToIntList(privateKey!); @@ -67,7 +65,6 @@ class AddICCardLogic extends BaseGetXController{ var token = reply.data.sublist(5, 9); var saveStrList = changeIntListToStringList(token); - print("_replyAddFingerprintReplyToken:$token"); Storage.setStringList(saveBlueToken, saveStrList); IoSenderManage.senderAddFingerprintCommand( @@ -75,8 +72,6 @@ class AddICCardLogic extends BaseGetXController{ userID:await Storage.getUid(), fingerNo:1, useCountLimit:0xff, - // startTime:0x11223344, - // endTime:0x11223344, startTime:int.parse(state.startDate.value)~/1000, endTime:int.parse(state.endDate.value)~/1000, needAuthor:1, @@ -86,32 +81,27 @@ class AddICCardLogic extends BaseGetXController{ ); break; case 0x07: - //无权限 - print("${reply.commandType!.typeValue} 用户无权限"); - + //无权限 + Get.log("${reply.commandType!.typeValue} 用户无权限"); break; case 0x09: - // 权限校验错误 - print("${reply.commandType!.typeValue} 权限校验错误"); - + // 权限校验错误 + Get.log("${reply.commandType!.typeValue} 权限校验错误"); break; default: - //失败 - print("${reply.commandType!.typeValue} 失败"); - + //失败 + Get.log("${reply.commandType!.typeValue} 失败"); break; } } Future _replyAddICCardConfirmation(Reply reply) async { int status = reply.data[2]; - print("_replyAddFingerprintstatus:$status"); + Get.log("_replyAddFingerprintstatus:$status"); switch(status){ case 0x00: - //成功 - print("${reply.commandType!.typeValue} 数据解析成功"); - // print("添加指纹确认成功,调用添加指纹接口"); + //成功 if(state.cardNumber.value == (reply.data[6]).toString()){ return; }else{ @@ -133,23 +123,22 @@ class AddICCardLogic extends BaseGetXController{ } break; case 0x06: - //无权限 + //无权限 break; case 0x07: - //无权限 - print("${reply.commandType!.typeValue} 用户无权限"); + //无权限 + Get.log("${reply.commandType!.typeValue} 用户无权限"); break; case 0x09: - // 权限校验错误 - print("${reply.commandType!.typeValue} 权限校验错误"); + // 权限校验错误 + Get.log("${reply.commandType!.typeValue} 权限校验错误"); break; default: - //失败 - print("${reply.commandType!.typeValue} 失败"); - + //失败 + Get.log("${reply.commandType!.typeValue} 失败"); break; } } @@ -161,9 +150,8 @@ class AddICCardLogic extends BaseGetXController{ switch(status){ case 0x00: - //成功 - print("${reply.commandType!.typeValue} 数据解析成功"); - // print("添加指纹确认成功,调用添加指纹接口"); + //成功 + Get.log("${reply.commandType!.typeValue} 数据解析成功"); addICCardData(); break; case 0x06: @@ -179,7 +167,6 @@ class AddICCardLogic extends BaseGetXController{ var token = reply.data.sublist(5, 9); var saveStrList = changeIntListToStringList(token); - print("_replyAddICCardConfirmationReplyToken:$token"); Storage.setStringList(saveBlueToken, saveStrList); IoSenderManage.senderAddStressICCardCommand( @@ -188,8 +175,6 @@ class AddICCardLogic extends BaseGetXController{ icCardNo:state.isAdministrator.value == "2" ? 254 : 1, cardType:1, useCountLimit:1, - // startTime:0x11223344, - // endTime:0x11223344, startTime:int.parse(state.startDate.value)~/1000, endTime:int.parse(state.endDate.value)~/1000, needAuthor:1, @@ -200,19 +185,18 @@ class AddICCardLogic extends BaseGetXController{ ); break; case 0x07: - //无权限 - print("${reply.commandType!.typeValue} 用户无权限"); + //无权限 + Get.log("${reply.commandType!.typeValue} 用户无权限"); break; case 0x09: - // 权限校验错误 - print("${reply.commandType!.typeValue} 权限校验错误"); + // 权限校验错误 + Get.log("${reply.commandType!.typeValue} 权限校验错误"); break; default: - //失败 - print("${reply.commandType!.typeValue} 失败"); - + //失败 + Get.log("${reply.commandType!.typeValue} 失败"); break; } } @@ -220,7 +204,6 @@ class AddICCardLogic extends BaseGetXController{ // 添加卡片 Future senderAddICCard() async { showBlueConnetctToastTimer(action: (){ - print("没有任何响应"); Get.close(1); }); BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async { @@ -234,14 +217,12 @@ class AddICCardLogic extends BaseGetXController{ var token = await Storage.getStringList(saveBlueToken); List getTokenList = changeStringListToIntList(token!); - print("openDoorTokenPubToken:$getTokenList"); + IoSenderManage.senderAddICCardCommand( keyID:"1", userID:await Storage.getUid(), cardNo:state.isAdministrator.value == "2" ? 254 : 1, useCountLimit:0xff, - // startTime:0x11223344, - // endTime:0x11223344, startTime:int.parse(state.startDate.value)~/1000, endTime:int.parse(state.endDate.value)~/1000, needAuthor:1, @@ -274,7 +255,6 @@ class AddICCardLogic extends BaseGetXController{ var token = await Storage.getStringList(saveBlueToken); List getTokenList = changeStringListToIntList(token!); - print("openDoorTokenPubToken:$getTokenList"); IoSenderManage.senderAddStressICCardCommand( keyID:"1", @@ -297,7 +277,6 @@ class AddICCardLogic extends BaseGetXController{ } void addICCardData() async { - print("state.startDate.value:${state.startDate.value} state.effectiveDateTime.value:${state.effectiveDateTime.value} state.failureDateTime.value:${state.failureDateTime.value}"); var entity = await ApiRepository.to.addICCardData( lockId: state.lockId.value.toString(), endDate: state.endDate.value, @@ -308,8 +287,8 @@ class AddICCardLogic extends BaseGetXController{ startDate: state.startDate.value, isCoerced: state.isCoerced.value.toString(), weekDay: state.weekDay.value, - startTime: int.parse(state.effectiveDateTime.value), - endTime: int.parse(state.failureDateTime.value), + startTime: int.parse(state.effectiveDateTime.value), + endTime: int.parse(state.failureDateTime.value), cardRight: state.isAdministrator.value == "2" ? 1 : 0, ); if (entity.errorCode!.codeIsSuccessful) { @@ -324,14 +303,7 @@ class AddICCardLogic extends BaseGetXController{ cardUserNo: state.cardNumber.value, ); if(entity.errorCode!.codeIsSuccessful){ - // Toast.show(msg: "添加成功"); - // if(state.fromType.value == 2){ - // // 回调指纹号 - // eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(cardId)); - // }else if(state.fromType.value == 1){ - // eventBus.fire(OtherTypeRefreshListEvent()); - // } - // Get.close(2); + showToast("添加成功"); if(state.fromType.value == 2){ // 回调指纹号 diff --git a/star_lock/lib/main/lockDetail/card/addICCard/addICCard_page.dart b/star_lock/lib/main/lockDetail/card/addICCard/addICCard_page.dart index 17fa4ef4..8bba0d84 100644 --- a/star_lock/lib/main/lockDetail/card/addICCard/addICCard_page.dart +++ b/star_lock/lib/main/lockDetail/card/addICCard/addICCard_page.dart @@ -32,8 +32,6 @@ class _AddICCardPageState extends State with RouteAware { backgroundColor: AppColors.mainColor, ), body: ListView( - // crossAxisAlignment: CrossAxisAlignment.center, - // mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox(height: 200.h), Center( @@ -63,8 +61,8 @@ class _AddICCardPageState extends State with RouteAware { child: Center( child: Obx(() => Text( state.ifConnectScuess.value - ? "已连接到锁,请将卡靠近锁的读卡区" - : "尝试连接设备...", + ? "已连接到锁,请将卡靠近锁的读卡区".tr + : "尝试连接设备...".tr, style: TextStyle(color: Colors.white, fontSize: 24.sp)))), ), ], diff --git a/star_lock/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart b/star_lock/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart index 43e77dc0..11d834a5 100644 --- a/star_lock/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart +++ b/star_lock/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart @@ -38,14 +38,6 @@ class _CardDetailPageState extends State with RouteAware { barTitle: "卡详情", haveBack: true, backgroundColor: AppColors.mainColor, - // actionsList: [ - // TextButton( - // child: Text(TranslationLoader.lanKeys!.share!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp),), - // onPressed: () { - // - // }, - // ), - // ], ), body: ListView( children: [ diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart index de207dc2..0138fb4b 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart @@ -20,7 +20,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController { //修改钥匙名称请求 Future modifyKeyNameRequest() async { if (state.changeNameController.text.isEmpty) { - showToast("请输入钥匙名称"); + showToast("请输入钥匙名称".tr); return; } KeyOperationRecordEntity entity = await ApiRepository.to @@ -30,7 +30,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController { state.itemData.value.keyName = state.changeNameController.text; state.keyName.value = state.itemData.value.keyName!; Get.back(); - showToast("修改成功", something: () { + showToast("修改成功".tr, something: () { eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI()); }); @@ -56,7 +56,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController { // }else if(updateType == 2){ // state.isRemoteUnlock.value = !state.isRemoteUnlock.value; // } - showToast("修改成功", something: () { + showToast("修改成功".tr, something: () { eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI()); }); @@ -70,8 +70,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController { includeUnderlings: includeUnderlings ); if (entity.errorCode!.codeIsSuccessful) { - print("删除电子钥匙成功"); - showToast("删除成功", something: () { + showToast("删除成功".tr, something: () { eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI()); Get.back(); @@ -85,7 +84,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController { keyId:state.itemData.value.keyId.toString(), ); if (entity.errorCode!.codeIsSuccessful) { - showToast("设置成功", something: () { + showToast("设置成功".tr, something: () { eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI()); Get.back(); @@ -99,7 +98,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController { keyId:state.itemData.value.keyId.toString(), ); if (entity.errorCode!.codeIsSuccessful) { - showToast("设置成功", something: () { + showToast("设置成功".tr, something: () { eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI()); Get.back(); @@ -114,7 +113,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController { includeUnderlings: includeUnderlings ); if (entity.errorCode!.codeIsSuccessful) { - showToast("设置成功", something: () { + showToast("设置成功".tr, something: () { eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI()); Get.back(); @@ -129,7 +128,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController { includeUnderlings: includeUnderlings ); if (entity.errorCode!.codeIsSuccessful) { - showToast("设置成功", something: () { + showToast("设置成功".tr, something: () { eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI()); Get.back(); @@ -140,11 +139,11 @@ class ElectronicKeyDetailLogic extends BaseGetXController { String getKeyTypeShowDateTime(){ String useDateStr = ''; if(state.keyType.value == 1){ - useDateStr = "永久"; + useDateStr = "永久".tr; }else if(state.keyType.value == 2){ useDateStr = "${DateTool().dateToYMDHNString(state.starDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}"; }else if(state.keyType.value == 3){ - useDateStr = "单次"; + useDateStr = "单次".tr; }else if(state.keyType.value == 4){ useDateStr = "${DateTool().dateToYMDString(state.starDate.value)}\n${DateTool().dateToYMDString(state.endDate.value)}"; } @@ -154,9 +153,9 @@ class ElectronicKeyDetailLogic extends BaseGetXController { Future openModalBottomSheet(BuildContext context) async { var textList = []; if(state.keyType.value == 1 || state.keyType.value == 2){ - textList = [state.itemData.value.keyStatus == 110405 ? '取消冻结' : "冻结", state.itemData.value.keyRight == 1 ? '取消授权' : '授权']; + textList = [state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr, state.itemData.value.keyRight == 1 ? '取消授权'.tr : '授权'.tr]; } else if(state.keyType.value == 4){ - textList = [state.itemData.value.keyStatus == 110405 ? '取消冻结' : "冻结"]; + textList = [state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr]; } showModalBottomSheet( context: context, @@ -173,26 +172,22 @@ class ElectronicKeyDetailLogic extends BaseGetXController { // 取消冻结 if(state.itemData.value.keyRight == 1){ // 管理员 - print("管理员 调用取消冻结"); - ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) { + ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙'.tr, (isAllData) { cancelFreeze(isAllData ? 1 : 0); }); }else{ - print("普通用户 调用取消冻结"); - ShowTipView().showIosTipWithContentDialog("取消冻结会在用户APP连网后生效", (){ + ShowTipView().showIosTipWithContentDialog("取消冻结会在用户APP连网后生效".tr, (){ cancelFreeze(0); }); } }else{ if(state.itemData.value.keyRight == 1){ // 管理员 - print("管理员 调用冻结"); - ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) { - freezeKey(isAllData ? 1 : 0); + ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时冻结其发送的钥匙'.tr, (isAllData) { + freezeKey(isAllData ? 1 : 0); }); }else{ - print("普通用户 调用冻结"); - ShowTipView().showIosTipWithContentDialog("冻结会在用户APP连网后生效", (){ + ShowTipView().showIosTipWithContentDialog("冻结会在用户APP连网后生效".tr, (){ freezeKey(0); }); } @@ -201,13 +196,11 @@ class ElectronicKeyDetailLogic extends BaseGetXController { // 取消/授权管理员 if(state.itemData.value.keyRight == 1){ // 管理员 - print("管理员 调用取消授权管理员接口"); - ShowTipView().showIosTipWithContentDialog("取消授权会在用户APP连网后生效", (){ + ShowTipView().showIosTipWithContentDialog("取消授权会在用户APP连网后生效".tr, (){ cancelAdministrator(); }); }else{ - print("普通用户 调用授权管理员接口"); - ShowTipView().showIosTipWithContentDialog("授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码", (){ + ShowTipView().showIosTipWithContentDialog("授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码".tr, (){ setAdministrator(); }); } @@ -217,82 +210,15 @@ class ElectronicKeyDetailLogic extends BaseGetXController { }); } - // showPopMenus(BuildContext context){ - // var textList = []; - // // keyType // 永久:1;限时2,单次3,循环:4 - // // itemData.keyRight == 1 // 1:管理员 2:普通用户 - // // indexEntity.keyStatus! 110405:已冻结 110412:已过期 110408:已删除 110410:已重置 - // if(state.keyType.value == 1 || state.keyType.value == 2){ - // textList = [{'text': state.itemData.value.keyStatus == 110405 ? '取消冻结' : "冻结"}, {'text': state.itemData.value.keyRight == 1 ? '取消授权' : '授权'}]; - // } else if(state.keyType.value == 4){ - // textList = [{'text': state.itemData.value.keyStatus == 110405 ? '取消冻结' : "冻结"}]; - // } - // JhPopMenus.showLinePop(context, clickCallback: (index, selText) { - // print('选中index: $index'); - // print('选中text: $selText'); - // Navigator.pop(context, true); - // Future.delayed(const Duration(seconds: 1)); - // - // if(index == 0){ - // if(state.itemData.value.keyStatus == 110405){ - // // 取消冻结 - // if(state.itemData.value.keyRight == 1){ - // // 管理员 - // print("管理员 调用取消冻结"); - // ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) { - // cancelFreeze(); - // }); - // }else{ - // print("普通用户 调用取消冻结"); - // ShowTipView().showIosTipWithContentDialog("取消冻结会在用户APP连网后生效", (){ - // cancelFreeze(); - // }); - // } - // }else{ - // if(state.itemData.value.keyRight == 1){ - // // 管理员 - // print("管理员 调用冻结"); - // // ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) { - // // freezeKey(); - // // }); - // // showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) { - // // freezeKey(); - // // }); - // showToast("fasdfasdfasdf"); - // }else{ - // print("普通用户 调用冻结"); - // ShowTipView().showIosTipWithContentDialog("冻结会在用户APP连网后生效", (){ - // freezeKey(); - // }); - // } - // } - // }else{ - // // 取消/授权管理员 - // if(state.itemData.value.keyRight == 1){ - // // 管理员 - // print("管理员 调用取消授权管理员接口"); - // ShowTipView().showIosTipWithContentDialog("取消授权会在用户APP连网后生效", (){ - // cancelAdministrator(); - // }); - // }else{ - // print("普通用户 调用授权管理员接口"); - // ShowTipView().showIosTipWithContentDialog("授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码", (){ - // setAdministrator(); - // }); - // } - // } - // }, listData: textList); - // } - deletKeyLogic(){ if(state.itemData.value.keyRight == 1){ // 授权管理员 - ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) { + ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复'.tr, (isAllData) { deleteKeyRequest(isAllData ? 1 : 0); }); }else{ // 普通用户 - ShowTipView().showIosTipWithContentDialog("删除钥匙会在用户APP连网后生效",(){ + ShowTipView().showIosTipWithContentDialog("删除钥匙会在用户APP连网后生效".tr,(){ deleteKeyRequest(0); }); } diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart index b38e9a3e..ee378e5e 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart @@ -126,7 +126,7 @@ class _ElectronicKeyDetailPageState extends State { Obx(() => Visibility( visible: state.keyType.value == 4 ? true : false, child: Obx(() => CommonItem( - leftTitel: "有效时间", + leftTitel: "有效时间".tr, rightTitle: "${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}", isHaveDirection: true, action: () async { @@ -146,7 +146,7 @@ class _ElectronicKeyDetailPageState extends State { })))), Container(height: 10.h), CommonItem( - leftTitel: "接收者", + leftTitel: "接收者".tr, rightTitle: state.itemData.value.username ?? ""), const SizedBox(height: 1), CommonItem( @@ -161,7 +161,7 @@ class _ElectronicKeyDetailPageState extends State { Visibility( visible: state.itemData.value.keyRight == 1 ? true:false, child: CommonItem( - leftTitel: "仅管理自己创建的用户", + leftTitel: "仅管理自己创建的用户".tr, rightTitle: "", isHaveRightWidget: true, isHaveLine: true, @@ -169,10 +169,10 @@ class _ElectronicKeyDetailPageState extends State { width: 60.w, child: _onlyManageYouCreatesUserSwitch())), ), - Visibility( - visible: (state.itemData.value.keyRight == 1 && state.keyInfo.value.lockSetting!.remoteUnlock == 1) ? false:true, + Visibility(// (state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false + visible: state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true:false, child: CommonItem( - leftTitel: "远程开锁", + leftTitel: "远程开锁".tr, rightTitle: "", isHaveRightWidget: true, isHaveLine: true, @@ -217,149 +217,6 @@ class _ElectronicKeyDetailPageState extends State { ); } -//根据类型获取限时有效期样式 -// Widget getPeriodValidityWidget() { -// int? dateType = state.keyType.value; -// Get.log('dateType:$dateType'); -// if (dateType == XSConstantMacro.keyTypeLong) { -// return getLongTypeDateWidget(); -// } else if (dateType == XSConstantMacro.keyTypeTime) { -// return getTimeLimitTypeDateWidget(); -// } else if (dateType == XSConstantMacro.keyTypeOnce) { -// return getOnceTypeDateWidget(); -// } else if (dateType == XSConstantMacro.keyTypeLoop) { -// return getLoopTypeDateWidget(); -// } -// return Container(); -// } -// -// //永久钥匙 -// Widget getLongTypeDateWidget() { -// return CommonItem( -// leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, -// rightTitle: '永久', -// isHaveDirection: true, -// action: () { -// Navigator.pushNamed(context, Routers.electronicKeyDetailChangeDate, -// arguments: {"itemData": state.itemData.value}); -// }); -// } -// -// //限时钥匙 -// Widget getTimeLimitTypeDateWidget() { -// return CommonItem( -// leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, -// allHeight: 90.h, -// rightTitle: '${state.beginTime.value}\n${state.endTime.value}', -// isHaveDirection: true, -// action: () async { -// var data = await Get.toNamed(Routers.electronicKeyDetailChangeDate, -// arguments: {"itemData": state.itemData.value}); -// if (data != null) { -// -// // print("state.beginTime.value:${state.beginTime.value}" -// // "state.endTime.value:${state.endTime.value}" -// // "state.beginTimeTimestamp.value:${state.beginTimeTimestamp.value}" -// // "state.endTimeTimestamp.value:${state.endTimeTimestamp.value}"); -// setState(() { -// state.beginTimeTimestamp.value = data["beginTimeTimestamp"]; -// state.endTimeTimestamp.value = data["endTimeTimestamp"]; -// state.beginTime.value = DateTool() -// .dateToYMDHNString((state.beginTimeTimestamp.value*1000).toString()); -// state.endTime.value = DateTool() -// .dateToYMDHNString((state.endTimeTimestamp.value*1000).toString()); -// state.keyType.value = 2; -// Get.log("2222222222222"); -// }); -// Get.log("1111111111111"); -// } -// }); -// } -// -// //单次钥匙 -// Widget getOnceTypeDateWidget() { -// return CommonItem( -// leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, -// rightTitle: '单次', -// isHaveDirection: false, -// ); -// } -// -// //循环钥匙 -// Widget getLoopTypeDateWidget() { -// DateTime startDateStr = -// DateTime.fromMillisecondsSinceEpoch(state.itemData.value.startDate!); -// DateTime endDateStr = -// DateTime.fromMillisecondsSinceEpoch(state.itemData.value.endDate!); -// String useDateStr = -// '${startDateStr.toLocal().toString().substring(0, 16)} \n ${endDateStr.toLocal().toString().substring(0, 16)}'; -// -// List getEffectiveDateList = []; -// List weekDaysList = state.itemData.value.weekDays!; -// if (weekDaysList.isNotEmpty) { -// String effectiveDateStr = ''; -// for (int i = 0; i < weekDaysList.length; i++) { -// if (weekDaysList[i] == 1) { -// effectiveDateStr = '一'; -// getEffectiveDateList.add(effectiveDateStr); -// } else if (weekDaysList[i] == 2) { -// effectiveDateStr = '二'; -// getEffectiveDateList.add(effectiveDateStr); -// } else if (weekDaysList[i] == 3) { -// effectiveDateStr = '三'; -// getEffectiveDateList.add(effectiveDateStr); -// } else if (weekDaysList[i] == 4) { -// effectiveDateStr = '四'; -// getEffectiveDateList.add(effectiveDateStr); -// } else if (weekDaysList[i] == 5) { -// effectiveDateStr = '五'; -// getEffectiveDateList.add(effectiveDateStr); -// } else if (weekDaysList[i] == 6) { -// effectiveDateStr = '六'; -// getEffectiveDateList.add(effectiveDateStr); -// } else if (weekDaysList[i] == 7) { -// effectiveDateStr = '日'; -// getEffectiveDateList.add(effectiveDateStr); -// } -// } -// } -// -// return Column( -// children: [ -// CommonItem( -// leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, -// allHeight: 90.h, -// rightTitle: useDateStr, -// isHaveDirection: true, -// isHaveLine: true, -// action: () { -// Get.toNamed(Routers.electronicKeyPeriodValidityPage, arguments: { -// "itemData": state.itemData.value, -// "keyType": 1 -// }); -// }), -// CommonItem( -// leftTitel: '有效日', -// rightTitle: getEffectiveDateList.map((e) => e.toString()).join(','), -// isHaveDirection: true, -// isHaveLine: true, -// action: () { -// Navigator.pushNamed( -// context, Routers.electronicKeyPeriodValidityPage); -// }), -// ], -// ); -// } -// -// //发送时间 -// String getSenderDate(ElectronicKeyListItem indexEntity) { -// String senderDate = ''; -// DateTime dateStr = -// DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!); -// senderDate = dateStr.toLocal().toString().substring(0, 16); -// return senderDate; -// } - CupertinoSwitch _switch(isOn) { return CupertinoSwitch( activeColor: CupertinoColors.activeBlue, diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_logic.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_logic.dart index 5105b34e..77a8f5e0 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_logic.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_logic.dart @@ -17,12 +17,12 @@ class ElectronicKeyDetailChangeDateLogic extends BaseGetXController { var beginTimeTimestamp = DateTool().dateToTimestamp(state.beginTime.value, 1); var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 1); if (beginTimeTimestamp > endTimeTimestamp || beginTimeTimestamp == endTimeTimestamp) { - showToast("失效时间需大于生效时间"); + showToast("失效时间需大于生效时间".tr); return; } if (endTimeTimestamp < DateTime.now().millisecondsSinceEpoch) { - showToast("生效时间需大于当前时间"); + showToast("生效时间需大于当前时间".tr); return; } KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate( @@ -38,7 +38,7 @@ class ElectronicKeyDetailChangeDateLogic extends BaseGetXController { remoteEnable: state.remoteEnable!.value ); if (entity.errorCode!.codeIsSuccessful) { - showToast("修改成功", something: () { + showToast("修改成功".tr, something: () { eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI()); Get.back(result: { diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyPeriodValidity/electronicKeyPeriodValidity_logic.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyPeriodValidity/electronicKeyPeriodValidity_logic.dart index ec39acd2..765a1b91 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyPeriodValidity/electronicKeyPeriodValidity_logic.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyPeriodValidity/electronicKeyPeriodValidity_logic.dart @@ -19,12 +19,12 @@ class ElectronicKeyPeriodValidityLogic extends BaseGetXController { var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 0); if (starDateTimestamp >= endDateTimestamp) { - showToast("失效日期要大于生效日期"); + showToast("失效日期要大于生效日期".tr); return; } if (starTimeTimestamp >= endTimeTimestamp) { - showToast("失效时间要大于生效时间"); + showToast("失效时间要大于生效时间".tr); return; } KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate( @@ -39,7 +39,7 @@ class ElectronicKeyPeriodValidityLogic extends BaseGetXController { isOnlyManageSelf: state.isOnlyManageSelf.value!, remoteEnable: state.remoteEnable.value!); if (entity.errorCode!.codeIsSuccessful) { - showToast("修改成功", something: () { + showToast("修改成功".tr, something: () { eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI()); Get.back(result: { diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyPeriodValidity/electronicKeyPeriodValidity_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyPeriodValidity/electronicKeyPeriodValidity_page.dart index 6c9e89ff..96ca4eed 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyPeriodValidity/electronicKeyPeriodValidity_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyPeriodValidity/electronicKeyPeriodValidity_page.dart @@ -29,7 +29,7 @@ class _ElectronicKeyPeriodValidityPageState extends State CommonItem( - leftTitel: "生效日期", + leftTitel: "生效日期".tr, rightTitle: state.starDate.value, isHaveDirection: true, isHaveLine: true, @@ -74,7 +74,7 @@ class _ElectronicKeyPeriodValidityPageState extends State CommonItem( - leftTitel: "失效日期", + leftTitel: "失效日期".tr, rightTitle: state.endDate.value, isHaveDirection: true, action: () { diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_logic.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_logic.dart index 48b88260..c9e3da2c 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_logic.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_logic.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_state.dart'; import 'package:star_lock/network/api_repository.dart'; @@ -201,7 +202,7 @@ class KeyOperationRecordLogic extends BaseGetXController { cardId:state.cardId.value, fingerprintId:state.fingerprintId.value); if (entity.errorCode!.codeIsSuccessful) { - print("操作记录列表成功:${entity.data?.itemList}"); + // print("操作记录列表成功:${entity.data?.itemList}"); state.dataList.value = entity.data!.itemList!; } } @@ -231,7 +232,7 @@ class KeyOperationRecordLogic extends BaseGetXController { KeyOperationRecordEntity entity = await ApiRepository.to.clearOperationRecord('28'); if (entity.errorCode!.codeIsSuccessful) { - showToast("清除数据成功"); + showToast("清除数据成功".tr); } } diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_page.dart index 09ef5302..7767d455 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_page.dart @@ -42,7 +42,7 @@ class _KeyOperationRecordPageState extends State { int? operateDate = dataItem.operateDate; DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(operateDate!); String operateDateStr = - '${dateStr.toLocal().toString().substring(0, 16)} 开锁'; + '${dateStr.toLocal().toString().substring(0, 16)} ${"开锁".tr}'; return _electronicKeyItem(operateDateStr, () {}); }, diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_logic.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_logic.dart index 5dc7c44f..947f7a2d 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_logic.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_logic.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_state.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart'; import 'package:star_lock/network/api_repository.dart'; @@ -42,8 +43,7 @@ class ElectronicKeyListLogic extends BaseGetXController { ElectronicKeyListEntity entity = await ApiRepository.to .resetElectronicKey(state.keyInfo.value.lockId.toString(), '0'); if (entity.errorCode!.codeIsSuccessful) { - print("重置电子钥匙成功啦啦啦啦啦"); - showToast("重置成功", something: (){ + showToast("重置成功".tr, something: (){ pageNo = 1; mockNetworkDataRequest(); }); @@ -58,8 +58,7 @@ class ElectronicKeyListLogic extends BaseGetXController { includeUnderlings:includeUnderlings ); if (entity.errorCode!.codeIsSuccessful) { - print("删除电子钥匙成功"); - showToast("删除成功",something: (){ + showToast("删除成功".tr,something: (){ pageNo = 1; mockNetworkDataRequest(); }); @@ -69,12 +68,12 @@ class ElectronicKeyListLogic extends BaseGetXController { deletKeyLogic(ElectronicKeyListItem electronicKeyListItem){ if(electronicKeyListItem.keyRight == 1){ // 授权管理员 - ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) { + ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复'.tr, (isAllData) { deleteKeyRequest(electronicKeyListItem.keyId.toString(), isAllData ? 1 : 0); }); }else{ // 普通用户 - ShowTipView().showIosTipWithContentDialog("删除钥匙会在用户APP连网后生效",(){ + ShowTipView().showIosTipWithContentDialog("删除钥匙会在用户APP连网后生效".tr,(){ deleteKeyRequest(electronicKeyListItem.keyId.toString(), 0); }); } diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart index 939a9ef7..9d263a66 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart @@ -1,5 +1,4 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; @@ -14,6 +13,7 @@ import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; import '../../../../tools/EasyRefreshTool.dart'; import '../../../../tools/keySearchWidget.dart'; +import '../../../../tools/showTipView.dart'; import '../../../../tools/submitBtn.dart'; import '../../../../tools/titleAppBar.dart'; import '../../../../translations/trans_lib.dart'; @@ -64,9 +64,11 @@ class _ElectronicKeyListPageState extends State { // 获取是否是演示模式 演示模式不获取接口 var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { - _showDialog(); + ShowTipView().showIosTipWithContentDialog("该锁的电子钥匙都将被删除".tr, (){ + logic.resetElectronicKeyListRequest(); + }); } else { - logic.showToast("演示模式"); + logic.showToast("演示模式".tr); } }, ), @@ -164,7 +166,7 @@ class _ElectronicKeyListPageState extends State { }, backgroundColor: Colors.red, foregroundColor: Colors.white, - label: '删除', + label: '删除'.tr, padding: EdgeInsets.only(left: 5.w, right: 5.w), ), ], @@ -215,14 +217,14 @@ class _ElectronicKeyListPageState extends State { '${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}'; } else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) { //永久 - useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 永久'; + useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} ${"永久".tr}'; } else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) { //单次 - useDateStr = "单次"; - useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 单次'; + useDateStr = "单次".tr; + useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} ${"单次".tr}'; } else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) { //循环 - useDateStr = '循环'; + useDateStr = '循环'.tr; } return useDateStr; @@ -314,31 +316,4 @@ class _ElectronicKeyListPageState extends State { ); } -//是否重置弹窗 - void _showDialog() { - showCupertinoDialog( - context: Get.context!, - builder: (context) { - return CupertinoAlertDialog( - title: const Text('该锁的电子钥匙都将被删除'), - actions: [ - CupertinoDialogAction( - child: Text(TranslationLoader.lanKeys!.cancel!.tr), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - CupertinoDialogAction( - child: Text(TranslationLoader.lanKeys!.reset!.tr), - onPressed: () { - Navigator.of(context).pop(); - logic.resetElectronicKeyListRequest(); - setState(() {}); - }, - ), - ], - ); - }, - ); - } } diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_logic.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_logic.dart index e59aa43a..36f15fbe 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_logic.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_logic.dart @@ -1,4 +1,5 @@ +import 'package:get/get.dart'; import 'package:star_lock/tools/baseGetXController.dart'; import '../../../../../common/XSConstantMacro/XSConstantMacro.dart'; import '../../../../../network/api_repository.dart'; @@ -16,12 +17,12 @@ class MassSendElectronicKeyLogic extends BaseGetXController{ getFailureDateTime = DateTool().dateToTimestamp(state.endTime.value, 1).toString(); } if(state.lockIdList.isEmpty){ - showToast("请选择锁"); + showToast("请选择锁".tr); return; } if(state.receiverList.isEmpty){ - showToast("请选择接收者"); + showToast("请选择接收者".tr); return; } var entity = await ApiRepository.to.canSendKey( @@ -56,11 +57,11 @@ class MassSendElectronicKeyLogic extends BaseGetXController{ endTime = "0"; if (startDate.isEmpty) { - showToast("请选择开始时间"); + showToast("请选择开始时间".tr); return; } if (endDate.isEmpty) { - showToast("请选择结束时间"); + showToast("请选择结束时间".tr); return; } @@ -70,7 +71,7 @@ class MassSendElectronicKeyLogic extends BaseGetXController{ // } if (int.parse(startDate) >= int.parse(endDate)) { - showToast("失效时间要大于生效时间"); + showToast("失效时间要大于生效时间".tr); return; } } @@ -84,7 +85,7 @@ class MassSendElectronicKeyLogic extends BaseGetXController{ case 3: typeValue = XSConstantMacro.keyTypeLoop; if (state.beginTime.value.isEmpty) { - showToast("请选择有效期"); + showToast("请选择有效期".tr); return; } startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString(); @@ -113,21 +114,7 @@ class MassSendElectronicKeyLogic extends BaseGetXController{ remoteUnlockSwitch: state.isRemoteUnlock.value ? 1 : 2, keyRight: 0 ); - - // var entity = await ApiRepository.to.batchSendKey( - // endDate:getFailureDateTime, - // keyGroupIdList:[], - // lockIdList:state.lockIdList, - // createUser:state.isCreateUser.value == true ? '1' : '0', - // isRemoteUnlock:state.isRemoteUnlock.value ? '1' : '2', - // keyNameForAdmin:receiverUserID, - // receiverUsername:receiverUserID, - // startDate:getEffectiveDateTime, - // countryCode:state.countryCode.value, - // usernameType:'1', - // weekDays:state.weekdaysList); if (entity.errorCode!.codeIsSuccessful) { - print('群发电子钥匙成功'); state.isSendSuccess.value = true; resetData(); } else { diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_page.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_page.dart index 74c36aef..9cee46ed 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_page.dart @@ -124,7 +124,7 @@ class _MassSendElectronicKeyPageState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - "发送成功", + "发送成功".tr, style: TextStyle( fontSize: 26.sp, color: Colors.black, @@ -139,7 +139,7 @@ class _MassSendElectronicKeyPageState extends State { height: 20.h, ), SubmitBtn( - btnName: '完成', + btnName: '完成'.tr, onClick: () { state.isSendSuccess.value = false; Get.back(); @@ -284,13 +284,13 @@ class _MassSendElectronicKeyPageState extends State { state.endTime.value = result['endDate']; state.effectiveDateTime.value = result['starTime']; state.failureDateTime.value = result['endTime']; - Get.log('得到的有效期数据:${state.weekdaysList.value} == ${state.beginTime.value} == ${state.endTime.value}== ${state.effectiveDateTime.value} == ${state.failureDateTime.value}'); + // Get.log('得到的有效期数据:${state.weekdaysList.value} == ${state.beginTime.value} == ${state.endTime.value}== ${state.effectiveDateTime.value} == ${state.failureDateTime.value}'); } })), Obx(() => Visibility( visible: state.weekdaysList.isNotEmpty ? true : false, child: CommonItem( - leftTitel: "有效日", + leftTitel: "有效日".tr, rightTitle: state.weekdaysList.value.join(",").toString(), isHaveDirection: true, isHaveLine: true, @@ -315,7 +315,7 @@ class _MassSendElectronicKeyPageState extends State { Obx(() => Visibility( visible: state.effectiveDateTime.value.isNotEmpty, child: CommonItem( - leftTitel: "有效时间", + leftTitel: "有效时间".tr, rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}", isHaveDirection: true, action: () async { diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_state.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_state.dart index 79bd005a..ab972b16 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_state.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_state.dart @@ -19,7 +19,7 @@ class MassSendElectronicKeyState{ var type = ''.obs;// 限时、永久、单次、循环 var isSendSuccess = false.obs; - var countryName = '中国'.obs; + var countryName = '中国'.tr.obs; var countryCode = '86'.obs; var isCreateUser = false.obs; //用户未注册时传1 已注册传0 diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart index 6c54b520..39297a7f 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart @@ -35,7 +35,7 @@ class _LockUserListPageState extends State { appBar: AppBar( backgroundColor: AppColors.mainColor, title: Text( - '选择用户', + '选择用户'.tr, style: TextStyle( color: Colors.white, fontSize: 28.sp, @@ -78,7 +78,7 @@ class _LockUserListPageState extends State { child: Row( children: [ Text( - '已选中:${selectUserIdList.length}', + '${"已选中".tr}:${selectUserIdList.length}', style: TextStyle(color: Colors.black, fontSize: 24.sp), ), Expanded( @@ -89,7 +89,7 @@ class _LockUserListPageState extends State { width: 120.w, height: 60.h, child: SubmitBtn( - btnName: '确定', + btnName: '确定'.tr, onClick: () { Map resultMap = {}; resultMap['lockUserList'] = selectDataList; diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart index c0fa0216..86737ab9 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart @@ -60,7 +60,7 @@ class _MassSendLockGroupListPageState extends State { Container( width: ScreenUtil().screenWidth, margin: EdgeInsets.only(left: 20.w), - child: Text('请选择要发送的锁', + child: Text('请选择要发送的锁'.tr, style: TextStyle( color: AppColors.darkGrayTextColor, fontSize: 22.sp)), ), @@ -69,7 +69,7 @@ class _MassSendLockGroupListPageState extends State { ), Expanded(child: _buildListView(context, lockGroupList)), SubmitBtn( - btnName: '确定', + btnName: '确定'.tr, onClick: () { // print('得到lockid为$selectLockIdList '); Map resultMap = {}; @@ -86,7 +86,7 @@ class _MassSendLockGroupListPageState extends State { //分组列表请求 Future> mockNetworkDataRequest() async { - MassSendLockGroupListEntity entity = await ApiRepository.to.lockGroupList('1'); + MassSendLockGroupListEntity entity = await ApiRepository.to.lockGroupList('2'); List dataList = []; if (entity.errorCode!.codeIsSuccessful) { if (entity.data != null) { @@ -137,7 +137,6 @@ class _MassSendLockGroupListPageState extends State { } } setState(() {}); - print('选中了么0'); }, typeImgList: const [], groupItem: itemData, diff --git a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_logic.dart b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_logic.dart index 1b408983..099d362d 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_logic.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_logic.dart @@ -16,7 +16,7 @@ class SendElectronicKeyLogic extends BaseGetXController { //发送钥匙请求 Future sendElectronicKeyRequest() async { if (state.emailOrPhoneController.text.isEmpty) { - showToast("请输入接收者账号"); + showToast("请输入接收者账号".tr); return; } // 姓名变为非必填(同通通锁) @@ -42,11 +42,11 @@ class SendElectronicKeyLogic extends BaseGetXController { endTime = "0"; if (startDate.isEmpty) { - showToast("请选择开始时间"); + showToast("请选择开始时间".tr); return; } if (endDate.isEmpty) { - showToast("请选择结束时间"); + showToast("请选择结束时间".tr); return; } @@ -56,7 +56,7 @@ class SendElectronicKeyLogic extends BaseGetXController { // } if (int.parse(startDate) >= int.parse(endDate)) { - showToast("失效时间要大于生效时间"); + showToast("失效时间要大于生效时间".tr); return; } } @@ -70,7 +70,7 @@ class SendElectronicKeyLogic extends BaseGetXController { case 3: typeValue = XSConstantMacro.keyTypeLoop; if (state.beginTime.value.isEmpty) { - showToast("请选择有效期"); + showToast("请选择有效期".tr); return; } startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString(); @@ -107,7 +107,6 @@ class SendElectronicKeyLogic extends BaseGetXController { endTime: int.parse(endTime), isOnlyManageSelf: 0); if (entity.errorCode!.codeIsSuccessful) { - print('发送电子钥匙成功'); state.isSendSuccess.value = true; state.sendSucceedType.value = int.parse(state.type.value); resetData(); @@ -144,7 +143,7 @@ class SendElectronicKeyLogic extends BaseGetXController { context: widgetContext, builder: (context) { return CupertinoAlertDialog( - title: const Text('接收者号码未注册,请重新发送'), + title: Text('接收者号码未注册,请重新发送'.tr), actions: [ CupertinoDialogAction( child: Text( @@ -185,7 +184,7 @@ class SendElectronicKeyLogic extends BaseGetXController { context: widgetContext, builder: (context) { return CupertinoAlertDialog( - title: Text('是否发送电子钥匙给未注册账号\n${state.emailOrPhoneController.text}'), + title: Text('${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}'), actions: [ CupertinoDialogAction( child: Text( diff --git a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_page.dart b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_page.dart index d21d111e..165ac986 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_page.dart @@ -1,3 +1,4 @@ + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -202,7 +203,7 @@ class _SendElectronicKeyPageState extends State { rightTitle: "", isTipsImg: true, tipsImgAction: () { - ShowTipView().showSureAlertDialog("人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。"); + ShowTipView().showSureAlertDialog("人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。".tr); }, isHaveRightWidget: true, rightWidget: SizedBox( @@ -244,7 +245,7 @@ class _SendElectronicKeyPageState extends State { Obx(() => Visibility( visible: state.weekdaysList.isNotEmpty ? true : false, child: CommonItem( - leftTitel: "有效日", + leftTitel: "有效日".tr, rightTitle: state.weekdaysList.value.join(",").toString(), isHaveDirection: true, isHaveLine: true, @@ -269,7 +270,7 @@ class _SendElectronicKeyPageState extends State { Obx(() => Visibility( visible: state.effectiveDateTime.value.isNotEmpty, child: CommonItem( - leftTitel: "有效时间", + leftTitel: "有效时间".tr, rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}", isHaveDirection: true, action: () async { @@ -321,7 +322,7 @@ class _SendElectronicKeyPageState extends State { setState(() {}); } else { //演示模式不获取接口 - logic.showToast("演示模式"); + logic.showToast("演示模式".tr); } }), Container( @@ -337,7 +338,7 @@ class _SendElectronicKeyPageState extends State { Navigator.pushNamed( context, Routers.massSendElectronicKeyManagePage); } else { - logic.showToast("演示模式"); + logic.showToast("演示模式".tr); } }, child: Text( @@ -377,7 +378,7 @@ class _SendElectronicKeyPageState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - "发送成功", + "发送成功".tr, style: TextStyle( fontSize: 26.sp, color: Colors.black, @@ -392,7 +393,7 @@ class _SendElectronicKeyPageState extends State { height: 20.h, ), SubmitBtn( - btnName: '完成', + btnName: '完成'.tr, onClick: () { state.isSendSuccess.value = false; logic.resetData(); @@ -401,7 +402,7 @@ class _SendElectronicKeyPageState extends State { height: 10.h, ), OutLineBtn( - btnName: '分享', + btnName: '分享'.tr, onClick: () { // Navigator.pushNamed(context, Routers.sendEmailNotificationPage); _openModalBottomSheet(); @@ -444,8 +445,7 @@ class _SendElectronicKeyPageState extends State { roomStatus: 1, ); if (entity.errorCode!.codeIsSuccessful) { - print("标记为已入住成功啦啦啦啦啦"); - logic.showToast("标记成功"); + logic.showToast("标记成功".tr); } } @@ -605,7 +605,7 @@ class _SendElectronicKeyPageState extends State { overlayColor: MaterialStateProperty.all(Colors.white)), child: Text( - '取消', + '取消'.tr, style: TextStyle( color: Colors.black, fontSize: ScreenUtil().setSp(24)), ), @@ -621,10 +621,10 @@ class _SendElectronicKeyPageState extends State { List initBottomSheetList() { List widgetList = []; - widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友', 0)); - widgetList.add(buildCenter3('images/icon_message.png', '短信', 1)); - widgetList.add(buildCenter3('images/icon_email.png', '邮件', 2)); - widgetList.add(buildCenter3('images/icon_more.png', '更多', 3)); + widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友'.tr, 0)); + widgetList.add(buildCenter3('images/icon_message.png', '短信'.tr, 1)); + widgetList.add(buildCenter3('images/icon_email.png', '邮件'.tr, 2)); + widgetList.add(buildCenter3('images/icon_more.png', '更多'.tr, 3)); return widgetList; } @@ -666,14 +666,14 @@ class _SendElectronicKeyPageState extends State { case 0: //微信好友 { - String pwdShareStr = '您好,您的电子钥匙生成成功'; + String pwdShareStr = '您好,您的电子钥匙生成成功'.tr; NativeInteractionTool().loadNativeShare(shareText: pwdShareStr); } break; case 1: //短信 { - String pwdShareStr = '您好,您的电子钥匙生成成功'; + String pwdShareStr = '您好,您的电子钥匙生成成功'.tr; NativeInteractionTool().loadNativeShare(shareText: pwdShareStr); } break; @@ -686,7 +686,7 @@ class _SendElectronicKeyPageState extends State { case 3: //更多 { - String pwdShareStr = '您好,您的电子钥匙生成成功'; + String pwdShareStr = '您好,您的电子钥匙生成成功'.tr; NativeInteractionTool().loadNativeShare(shareText: pwdShareStr); } break; diff --git a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart index a82df4b3..6529eb78 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart @@ -24,7 +24,7 @@ class SendElectronicKeyState { var type = ''.obs;// 限时、永久、单次、循环 var isSendSuccess = false.obs; - var countryName = '中国'.obs; + var countryName = '中国'.tr.obs; var countryCode = '86'.obs; var isCreateUser = false.obs; //用户未注册时传1 已注册传0 diff --git a/star_lock/lib/main/lockDetail/face/addFaceType/addFaceType_page.dart b/star_lock/lib/main/lockDetail/face/addFaceType/addFaceType_page.dart index 4d40d918..712113bb 100644 --- a/star_lock/lib/main/lockDetail/face/addFaceType/addFaceType_page.dart +++ b/star_lock/lib/main/lockDetail/face/addFaceType/addFaceType_page.dart @@ -251,7 +251,7 @@ class _AddFaceTypePageState extends State { height: 20.h, ), SubmitBtn( - btnName: '完成', + btnName: '完成'.tr, fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), diff --git a/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintType_logic.dart b/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintType_logic.dart index 50c547ec..414d13ed 100644 --- a/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintType_logic.dart +++ b/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintType_logic.dart @@ -49,7 +49,7 @@ class AddFingerprintTypeLogic extends BaseGetXController{ } } else if (state.selectType.value == "2") { if (state.beginTime.value.isEmpty) { - showToast("请选择有效期"); + showToast("请选择有效期".tr); return; } startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString(); diff --git a/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintType_page.dart b/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintType_page.dart index 1a091575..9c72df19 100644 --- a/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintType_page.dart +++ b/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintType_page.dart @@ -325,7 +325,7 @@ class _AddFingerprintTypePageState extends State { height: 20.h, ), SubmitBtn( - btnName: '完成', + btnName: '完成'.tr, fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index 992889d3..45b5a1d6 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -34,7 +34,7 @@ class LockDetailLogic extends BaseGetXController { void initReplySubscription() { state.replySubscription = EventBusManager().eventBus!.on().listen((reply) async { - // Get.log("锁详情收到了蓝牙解析消息 reply:${reply.commandType}"); + Get.log("锁详情收到了蓝牙解析消息 reply:${reply.commandType}"); // 开门 if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) { _replyOpenLock(reply); diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart index eb53a760..5264a042 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart @@ -15,7 +15,7 @@ class PasswordKeyDetailLogic extends BaseGetXController { state.itemData.value.keyboardPwdId.toString(), 1); if (entity.errorCode!.codeIsSuccessful) { - showToast("删除成功", something: (){ + showToast("删除成功".tr, something: (){ Get.back(result: "deletScuess"); }); } @@ -37,7 +37,7 @@ class PasswordKeyDetailLogic extends BaseGetXController { keyboardPwdType: state.itemData.value.keyboardPwdType!); if (entity.errorCode!.codeIsSuccessful) { Get.back(); - showToast("修改成功", something: (){ + showToast("修改成功".tr, something: (){ if(changType == 1){ // 修改名字 state.keyboardPwdName.value = state.inputNameController.text; @@ -45,7 +45,6 @@ class PasswordKeyDetailLogic extends BaseGetXController { // 修改密码 state.keyboardPwd.value = state.inputPwdController.text; } - print("state.itemData.value.keyboardPwd:${state.itemData.value.keyboardPwd} state.itemData.value.keyboardPwdName:${state.itemData.value.keyboardPwdName}"); eventBus.fire(GetPasswordListRefreshUI()); }); } diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_logic.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_logic.dart index ca72942e..5afc02c4 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_logic.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_logic.dart @@ -87,7 +87,7 @@ class PasswordKeyListLogic extends BaseGetXController { break; case 4: //删除 4 在锁上使用后会删除之前在锁上使用过的密码 - useDateStr = '${startDateStr.toLocal().toString().substring(0, 16)} ${"清空码".tr}'; + useDateStr = '${endDateStr.toLocal().toString().substring(0, 16)} ${"清空码".tr}'; break; case 5: //周未循环 5 在周未开始和结束时间指定时间段内有效 @@ -97,7 +97,7 @@ class PasswordKeyListLogic extends BaseGetXController { case 6: //每日循环 6 每天开始和结束时间指定时间段内有效 useDateStr = - '${endDateStr.toLocal().toString().substring(0, 16)} ${"周日".tr}$starHour:00-$endHour:00 ${"循环"}'; + '${endDateStr.toLocal().toString().substring(0, 16)} ${"每日".tr}$starHour:00-$endHour:00 ${"循环"}'; break; case 7: //工作日循环 7 工作日开始和结束时间指定的时间段内有效 @@ -137,7 +137,7 @@ class PasswordKeyListLogic extends BaseGetXController { case 14: //周天循环 14 每周日开始和结束时间指定时间段内有效 useDateStr = - '${endDateStr.toLocal().toString().substring(0, 16)} ${"周天".tr}$starHour:00-$endHour:00 ${"循环".tr}'; + '${endDateStr.toLocal().toString().substring(0, 16)} ${"周日".tr}$starHour:00-$endHour:00 ${"循环".tr}'; break; default: diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart index a05c49bf..6acb4273 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart @@ -1,4 +1,4 @@ -import 'package:flutter/cupertino.dart'; + import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; @@ -11,7 +11,6 @@ import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; import '../../../../tools/EasyRefreshTool.dart'; import '../../../../tools/keySearchWidget.dart'; -import '../../../../tools/showIosTipView.dart'; import '../../../../tools/showTipView.dart'; import '../../../../tools/submitBtn.dart'; import '../../../../tools/titleAppBar.dart'; @@ -125,10 +124,8 @@ class _PasswordKeyListPageState extends State { itemCount: state.itemDataList.value.length, itemBuilder: (c, index) { PasswordKeyListItem passwordKeyListItem = state.itemDataList.value[index]; - String useDateStr = ''; //使用期限 + String useDateStr = logic.getUseDateStr(passwordKeyListItem);// 使用期限 - //使用期限 - useDateStr = logic.getUseDateStr(passwordKeyListItem); return Slidable( key:ValueKey(passwordKeyListItem.keyboardPwdId), endActionPane: ActionPane( diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart index 58625660..5cc56fcb 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart @@ -1,3 +1,5 @@ +// ignore_for_file: slash_for_doc_comments + import 'dart:async'; import 'package:flutter_blue_plus/flutter_blue_plus.dart'; @@ -22,20 +24,20 @@ class PasswordKeyPerpetualLogic extends BaseGetXController { /// 收到点击密码类型更新 /** -单次 1 只能在开始时间后6小时内使用一次 -永久 2 从开始时间开始永久有效,必需在开始时间24小时内使用一次,否则将失效 -限期 3 在开始和结束时间内有效,必需在开始时间24小时内使用一次,否则将失效 -删除 4 在锁上使用后会删除之前在锁上使用过的密码 -周未循环 5 在周未开始和结束时间指定时间段内有效 -每日循环 6 每天开始和结束时间指定时间段内有效 -工作日循环 7 工作日开始和结束时间指定的时间段内有效 -周一循环 8 每周一开始和结束时间指定时间段内有效 -周二循环 9 每周二开始和结束时间指定时间段内有效 -周三循环 10 每周三开始和结束时间指定时间段内有效 -周四循环 11 每周四开始和结束时间指定时间段内有效 -周五循环 12 每周五开始和结束时间指定时间段内有效 -周六循环 13 每周六开始和结束时间指定时间段内有效 -周天循环 14 每周日开始和结束时间指定时间段内有效 + 单次 1 只能在开始时间后6小时内使用一次 + 永久 2 从开始时间开始永久有效,必需在开始时间24小时内使用一次,否则将失效 + 限期 3 在开始和结束时间内有效,必需在开始时间24小时内使用一次,否则将失效 + 删除 4 在锁上使用后会删除之前在锁上使用过的密码 + 周未循环 5 在周未开始和结束时间指定时间段内有效 + 每日循环 6 每天开始和结束时间指定时间段内有效 + 工作日循环 7 工作日开始和结束时间指定的时间段内有效 + 周一循环 8 每周一开始和结束时间指定时间段内有效 + 周二循环 9 每周二开始和结束时间指定时间段内有效 + 周三循环 10 每周三开始和结束时间指定时间段内有效 + 周四循环 11 每周四开始和结束时间指定时间段内有效 + 周五循环 12 每周五开始和结束时间指定时间段内有效 + 周六循环 13 每周六开始和结束时间指定时间段内有效 + 周天循环 14 每周日开始和结束时间指定时间段内有效 */ //获取密码请求 Future getKeyboardPwdRequest() async { @@ -45,14 +47,14 @@ class PasswordKeyPerpetualLogic extends BaseGetXController { String getKeyType = state.widgetType.value.toString(); if (state.nameController.text.isEmpty) { - showToast("请输入姓名"); + showToast("请输入姓名".tr); return; } //循环密码 if (state.widgetType.value == 4) { if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) { - showToast("生效时间不能小于当前时间"); + showToast("生效时间不能小于当前时间".tr); return; } } @@ -62,12 +64,12 @@ class PasswordKeyPerpetualLogic extends BaseGetXController { } else if (state.widgetType.value == 1) { //限时 if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) { - showToast("生效时间不能小于当前时间"); + showToast("生效时间不能小于当前时间".tr); return; } if (startDate >= endDate) { - showToast("失效时间要大于生效时间"); + showToast("失效时间要大于生效时间".tr); return; } getKeyType = '3'; @@ -80,7 +82,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController { //循环 //限时 if (endDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) { - showToast("结束时间不能小于当前时间"); + showToast("结束时间不能小于当前时间".tr); return; } @@ -119,7 +121,6 @@ class PasswordKeyPerpetualLogic extends BaseGetXController { endHours: state.loopEndHours.value, isCoerced: 1); if (entity.errorCode!.codeIsSuccessful) { - print('获取密码成功'); state.isSendSuccess.value = true; state.sendSucceedType.value = state.widgetType.value; state.pwdNameStr = state.nameController.text; @@ -155,7 +156,6 @@ class PasswordKeyPerpetualLogic extends BaseGetXController { getFailureDateTime, '1'); if (entity.errorCode!.codeIsSuccessful) { - print('获取密码成功'); state.isSendSuccess.value = true; state.sendSucceedType.value = state.widgetType.value; state.pwdNameStr = state.nameController.text; @@ -170,6 +170,26 @@ class PasswordKeyPerpetualLogic extends BaseGetXController { } } + Future checkKeyboardpwdNameRequest() async { + if (state.nameController.text.isEmpty) { + showToast("请输入姓名"); + return; + } + if (state.pwdController.text.isEmpty) { + showToast("请输入密码"); + return; + } + var entity = await ApiRepository.to.checkKeyboardpwdName( + lockId:state.keyInfo.value.lockId.toString(), + keyboardPwdName:state.nameController.text, + keyboardPwd:state.pwdController.text,); + if (entity.errorCode!.codeIsSuccessful) { + senderCustomPasswords(); + } else { + showToast('${entity.errorMsg}'); + } + } + // late DateTime getStartDateTime; // 监听设备返回的数据 late StreamSubscription _replySubscription; @@ -220,17 +240,17 @@ class PasswordKeyPerpetualLogic extends BaseGetXController { case 0x07: //无权限 print("${reply.commandType!.typeValue} 用户无权限"); - + cancelBlueConnetctToastTimer(); break; case 0x09: // 权限校验错误 print("${reply.commandType!.typeValue} 权限校验错误"); - + cancelBlueConnetctToastTimer(); break; default: //失败 print("${reply.commandType!.typeValue} 失败"); - + cancelBlueConnetctToastTimer(); break; } } @@ -243,16 +263,6 @@ class PasswordKeyPerpetualLogic extends BaseGetXController { // 设置自定义密码 Future senderCustomPasswords() async { - - if (state.nameController.text.isEmpty) { - showToast("请输入姓名"); - return; - } - if (state.pwdController.text.isEmpty) { - showToast("请输入密码"); - return; - } - var startDate = DateTool().dateToTimestamp(state.beginTime.value, 1); var endDate = DateTool().dateToTimestamp(state.endTime.value, 1); //非永久 须有时限 diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart index 5701396d..0672d6c0 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart @@ -363,7 +363,7 @@ class _PasswordKeyPerpetualPageState extends State wit if (isDemoMode == false) { //自定义密码 if (state.widgetType.value == 3) { - logic.senderCustomPasswords(); + logic.checkKeyboardpwdNameRequest(); } else { logic.getKeyboardPwdRequest(); } @@ -417,7 +417,7 @@ class _PasswordKeyPerpetualPageState extends State wit height: 20.h, ), SubmitBtn( - btnName: '完成', + btnName: '完成'.tr, onClick: () { state.isSendSuccess.value = false; state.nameController.text = ""; @@ -428,7 +428,7 @@ class _PasswordKeyPerpetualPageState extends State wit height: 10.h, ), OutLineBtn( - btnName: '分享', + btnName: '分享'.tr, onClick: () { _openModalBottomSheet(); }, @@ -547,7 +547,7 @@ class _PasswordKeyPerpetualPageState extends State wit overlayColor: MaterialStateProperty.all(Colors.white)), child: Text( - '取消', + '取消'.tr, style: TextStyle( color: Colors.black, fontSize: ScreenUtil().setSp(24)), ), @@ -563,10 +563,10 @@ class _PasswordKeyPerpetualPageState extends State wit List initBottomSheetList() { List widgetList = []; - widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友', 0)); - widgetList.add(buildCenter3('images/icon_message.png', '短信', 1)); - widgetList.add(buildCenter3('images/icon_email.png', '邮件', 2)); - widgetList.add(buildCenter3('images/icon_more.png', '更多', 3)); + widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友'.tr, 0)); + widgetList.add(buildCenter3('images/icon_message.png', '短信'.tr, 1)); + widgetList.add(buildCenter3('images/icon_email.png', '邮件'.tr, 2)); + widgetList.add(buildCenter3('images/icon_more.png', '更多'.tr, 3)); return widgetList; } diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_state.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_state.dart index 162d4dd7..8bc4ef9d 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_state.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_state.dart @@ -1,4 +1,4 @@ -import 'package:date_format/date_format.dart'; + import 'package:flutter/widgets.dart'; import 'package:get/get.dart'; import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart'; diff --git a/star_lock/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControl_page.dart b/star_lock/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControl_page.dart index bd02330e..e9b094ae 100644 --- a/star_lock/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControl_page.dart +++ b/star_lock/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControl_page.dart @@ -228,7 +228,7 @@ class _AddRemoteControlPageState extends State { height: 20.h, ), SubmitBtn( - btnName: '完成', + btnName: '完成'.tr, fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), diff --git a/star_lock/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart b/star_lock/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart index 91f1caa9..53374cd5 100644 --- a/star_lock/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart +++ b/star_lock/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart @@ -72,7 +72,7 @@ class _LockAddressGaoDePageState extends State with RouteA } switch (status) { case PermissionStatus.denied: - print("拒绝"); + // print("拒绝"); break; case PermissionStatus.granted: if(Platform.isIOS){ @@ -84,16 +84,16 @@ class _LockAddressGaoDePageState extends State with RouteA } break; case PermissionStatus.limited: - print("限制"); + // print("限制"); break; case PermissionStatus.permanentlyDenied: - print("永久的否认"); + // print("永久的否认"); break; case PermissionStatus.provisional: - print("临时"); + // print("临时"); break; default: - print("其他状态"); + // print("其他状态"); // requestLocation(); break; } @@ -101,7 +101,7 @@ class _LockAddressGaoDePageState extends State with RouteA Future requestAndroidLocation() async { location.onLocationChanged().listen((event) { - print("listenLocationChanged$event"); + // print("listenLocationChanged$event"); // EasyLoading.dismiss(); if (event.isNotEmpty) { setState(() { @@ -116,7 +116,7 @@ class _LockAddressGaoDePageState extends State with RouteA location = AMapFlutterLocation() ..setLocationOption(AMapLocationOption()) ..onLocationChanged().listen((event) { - print("listenLocationChanged$event"); + // print("listenLocationChanged$event"); // EasyLoading.dismiss(); if (event.isNotEmpty) { setState(() { @@ -163,7 +163,7 @@ class _LockAddressGaoDePageState extends State with RouteA child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Text("地理位置", style: TextStyle(fontSize: 50.sp)), + Text("地理位置".tr, style: TextStyle(fontSize: 50.sp)), ], ), ), @@ -202,12 +202,11 @@ class _LockAddressGaoDePageState extends State with RouteA ), Container( // color: Colors.red, - height: 45.h, margin: EdgeInsets.only(left: 25.w, top: 20.h, right: 25.w), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Text("检查以确保以下地址是正确的", style: TextStyle(fontSize: 24.sp)), + Flexible(child: Text("检查以确保以下地址是正确的".tr, style: TextStyle(fontSize: 24.sp))), ], ), ), @@ -233,7 +232,7 @@ class _LockAddressGaoDePageState extends State with RouteA ], ) : SizedBox( height: 1.sw/5*4 + 65.h*2, - child: const Center(child: Text('地图加载中,请稍候。。。'))) + child: Center(child: Text('地图加载中,请稍候。。。'.tr))) , ), SizedBox(height:200.h), @@ -242,7 +241,7 @@ class _LockAddressGaoDePageState extends State with RouteA children: [ TextButton( child: Text( - "跳过", + "跳过".tr, style: TextStyle(color: Colors.black, fontSize: 24.sp), ), onPressed: () { @@ -263,7 +262,7 @@ class _LockAddressGaoDePageState extends State with RouteA ), onPressed: () { if(addressInfo!.isEmpty){ - logic.showToast("还未获取到位置信息哦,请耐心等待一下!"); + logic.showToast("还未获取到位置信息哦,请耐心等待一下!".tr); return; } Get.toNamed(Routers.saveLockPage, arguments: { diff --git a/star_lock/lib/mine/addLock/saveLock/saveLock_page.dart b/star_lock/lib/mine/addLock/saveLock/saveLock_page.dart index c5ea46d5..c1eafee8 100644 --- a/star_lock/lib/mine/addLock/saveLock/saveLock_page.dart +++ b/star_lock/lib/mine/addLock/saveLock/saveLock_page.dart @@ -32,11 +32,17 @@ class _SaveLockPageState extends State with RouteAware { // crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox(height: 80.h,), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text(TranslationLoader.lanKeys!.addSuccessfullyPleaseRename!.tr, style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500),), - ], + Container( + margin: EdgeInsets.only(left: 50.w, right: 50.w), + width: 1.sw, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Flexible( + child: Text(TranslationLoader.lanKeys!.addSuccessfullyPleaseRename!.tr, style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500)) + ), + ], + ), ), SizedBox(height: 80.h,), Container( @@ -54,7 +60,7 @@ class _SaveLockPageState extends State with RouteAware { ], // style:TextStyle(height: 1.1, fontSize: 36.sp, fontWeight: FontWeight.w400, color:AppColors.mainColor), decoration: InputDecoration( - hintText: '请填写信息', + hintText: '请填写信息'.tr, hintStyle: TextStyle( // height: 1.1, fontSize: 24.sp, diff --git a/star_lock/lib/mine/mine/starLockMine_logic.dart b/star_lock/lib/mine/mine/starLockMine_logic.dart index 4d7336bd..65af7e7c 100644 --- a/star_lock/lib/mine/mine/starLockMine_logic.dart +++ b/star_lock/lib/mine/mine/starLockMine_logic.dart @@ -33,6 +33,8 @@ class StarLockMineLogic extends BaseGetXController { state.userNickName.value = (await Storage.getNickname())!; state.userMobile.value = (await Storage.getMobile())! ?? ''; state.userEmail.value = (await Storage.getEmail())!; + state.userHeadUrl.value = (await Storage.getHeadUrl())!; + Get.log("userNickName:${state.userNickName.value} userMobile:${state.userMobile.value} userEmail:${state.userEmail.value}"); } } diff --git a/star_lock/lib/mine/mine/starLockMine_page.dart b/star_lock/lib/mine/mine/starLockMine_page.dart index a15d77e8..2a413fc7 100644 --- a/star_lock/lib/mine/mine/starLockMine_page.dart +++ b/star_lock/lib/mine/mine/starLockMine_page.dart @@ -6,6 +6,7 @@ import 'package:star_lock/flavors.dart'; import '../../appRouters.dart'; import '../../app_settings/app_colors.dart'; import '../../baseWidget.dart'; +import '../../tools/customNetworkImage.dart'; import '../../tools/submitBtn.dart'; import '../../translations/trans_lib.dart'; import 'starLockMine_logic.dart'; @@ -71,17 +72,21 @@ class StarLockMinePageState extends State with BaseWidget { child: Container( width: 105.w, height: 105.w, - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(52.5.w)), + // decoration: BoxDecoration( + // borderRadius: + // BorderRadius.all(Radius.circular(52.5.w)), + // ), + child: ClipRRect( + borderRadius: BorderRadius.circular(52.5.w), + child: CustomNetworkImage(url:state.userHeadUrl.value??"", width:105.w, height:105.h), ), - child: // state.headUrl().isNotEmpty ? // Image(image: NetworkImage(state.loginData.value.data!.headUrl!)) : - Image.asset( - 'images/mine/icon_mine_main_defaultAvatar.png', - width: 60.w, - height: 60.w)), + // Image.asset( + // 'images/mine/icon_mine_main_defaultAvatar.png', + // width: 60.w, + // height: 60.w) + ), ), SizedBox( height: 20.h, diff --git a/star_lock/lib/mine/mine/starLockMine_state.dart b/star_lock/lib/mine/mine/starLockMine_state.dart index 3acfa16c..684fca50 100644 --- a/star_lock/lib/mine/mine/starLockMine_state.dart +++ b/star_lock/lib/mine/mine/starLockMine_state.dart @@ -6,6 +6,6 @@ class StarLockMineState { var userNickName = "".obs; var userMobile = "".obs; var userEmail = "".obs; - + var userHeadUrl = "".obs; void onClose() {} } diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart index 48ac85f3..167d7fd2 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart @@ -13,7 +13,6 @@ class MinePersonInfoLogic extends GetConnect { Future getUserInfoRequest() async { MinePersonInfoEntity entity = await ApiRepository.to.getUserInfo(""); if (entity.errorCode!.codeIsSuccessful) { - print('到了这里么'); state.mineInfoData.value = entity.data!; } } @@ -33,9 +32,7 @@ class MinePersonInfoLogic extends GetConnect { } // 上传头像 - void uploadFile( - MinePersonGetUploadFileInfoEntity - minePersonGetUploadFileInfoEntity) async { + void uploadFile(MinePersonGetUploadFileInfoEntity minePersonGetUploadFileInfoEntity) async { // String json = JsonDecoder(minePersonGetUploadFileInfoEntity.data!.formData!); // var formData = FormData(); @@ -45,10 +42,8 @@ class MinePersonInfoLogic extends GetConnect { // MultipartFile(state.image!.path, filename: 'b'), // )); - Map user = - minePersonGetUploadFileInfoEntity.data!.formData!; - user[minePersonGetUploadFileInfoEntity.data!.fileField!] = - state.image!.path; + Map user = minePersonGetUploadFileInfoEntity.data!.formData!; + user[minePersonGetUploadFileInfoEntity.data!.fileField!] = state.image!.path; final form = FormData(user); var entity = await ApiRepository.to.uploadFile( url: minePersonGetUploadFileInfoEntity.data!.uploadUrl!, body: form); @@ -93,7 +88,6 @@ class MinePersonInfoLogic extends GetConnect { // TODO: implement onInit super.onInit(); - getUserInfoRequest(); } @override diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart index ed5db138..47c12a11 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart @@ -13,6 +13,7 @@ import 'package:star_lock/tools/custom_bottom_sheet.dart'; import 'package:star_lock/tools/storage.dart'; import '../../../appRouters.dart'; import '../../../tools/commonItem.dart'; +import '../../../tools/customNetworkImage.dart'; import '../../../tools/titleAppBar.dart'; import '../../../translations/trans_lib.dart'; @@ -23,8 +24,7 @@ class MinePersonInfoPage extends StatefulWidget { State createState() => _MinePersonInfoPageState(); } -class _MinePersonInfoPageState extends State - with WidgetsBindingObserver { +class _MinePersonInfoPageState extends State with WidgetsBindingObserver { final logic = Get.put(MinePersonInfoLogic()); final state = Get.find().state; @@ -70,26 +70,33 @@ class _MinePersonInfoPageState extends State isHaveLine: true, isHaveDirection: true, isHaveRightWidget: true, - rightWidget: ClipOval( - child: state.image != null - ? Image.file( - File(state.image!.path), - width: 72.w, - height: 72.w, - fit: BoxFit.fill, - ) - : Image.asset( - 'images/controls_user.png', - width: 72.w, - height: 72.w, - fit: BoxFit.fill, - ), + rightWidget: + Container( + // color: Colors.orange, + child: ClipRRect( + borderRadius: BorderRadius.circular(36.w), + child: CustomNetworkImage(url:"https://ui-avatars.com/api/?name=%E6%98%B5&color=7F9CF5&background=EBF4FF", width:72.w, height:72.w), + ), ), + // ClipOval( + // child: state.image != null + // ? Image.file( + // File(state.image!.path), + // width: 72.w, + // height: 72.w, + // fit: BoxFit.fill, + // ) + // : Image.asset( + // 'images/controls_user.png', + // width: 72.w, + // height: 72.w, + // fit: BoxFit.fill, + // ), + // ), action: () async { //安卓平台下首次进入应用需向用户告知获取权限用途弹窗 if (Platform.isAndroid) { - AppFirstEnterHandle() - .getAppFirstEnter(context, isAgreeCamera); + AppFirstEnterHandle().getAppFirstEnter(context, isAgreeCamera); var getFlag = await Storage.getString(isAgreeCamera); if (getFlag == isAgreeCamera) { _openModalBottomSheet(); @@ -271,8 +278,7 @@ class _MinePersonInfoPageState extends State Future _openModalBottomSheet() async { showModalBottomSheet( context: context, - shape: RoundedRectangleBorder( - borderRadius: BorderRadiusDirectional.circular(10)), + shape: RoundedRectangleBorder(borderRadius: BorderRadiusDirectional.circular(10)), builder: (BuildContext context) { return AlertBottomWidget( topTitle: '', diff --git a/star_lock/lib/mine/mineSet/appUnlockNeedMobileNetworkingLock/appUnlockNeedMobileNetworkingLock_logic.dart b/star_lock/lib/mine/mineSet/appUnlockNeedMobileNetworkingLock/appUnlockNeedMobileNetworkingLock_logic.dart index a79021d6..faf9f7be 100644 --- a/star_lock/lib/mine/mineSet/appUnlockNeedMobileNetworkingLock/appUnlockNeedMobileNetworkingLock_logic.dart +++ b/star_lock/lib/mine/mineSet/appUnlockNeedMobileNetworkingLock/appUnlockNeedMobileNetworkingLock_logic.dart @@ -14,6 +14,12 @@ class AppUnlockNeedMobileNetworkingLockLogic extends BaseGetXController{ if (entity.errorCode!.codeIsSuccessful) { dataList = entity.data!.list!; state.lockItemList.value = dataList; + for (int i = 0; i < dataList.length; i++) { + var itemData = dataList[i]; + if (itemData.appUnlockOnline == 1) { + state.selectLockIdList.add(itemData.lockId); + } + } } return dataList; } diff --git a/star_lock/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_logic.dart b/star_lock/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_logic.dart index 3dcefc4e..1d81ccca 100644 --- a/star_lock/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_logic.dart +++ b/star_lock/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_logic.dart @@ -24,7 +24,7 @@ class AddAuthorizedAdministratorLogic extends BaseGetXController { } if(state.lockIdList.isEmpty){ - showToast("请选择锁"); + showToast("请选择锁".tr); return; } diff --git a/star_lock/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_page.dart b/star_lock/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_page.dart index aea0a6b0..34b9f72f 100644 --- a/star_lock/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_page.dart +++ b/star_lock/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_page.dart @@ -399,7 +399,7 @@ class _AddAuthorizedAdministratorPageState extends State lockGroupAddLock(List lockIds) async { if(lockIds.isEmpty){ - showToast("请选择锁"); + showToast("请选择锁".tr); return; } var entity = await ApiRepository.to.lockGroupAddLock( @@ -29,7 +29,7 @@ class GroupEditLockLogic extends BaseGetXController { //锁分组里面添加锁 Future lockGroupDeletLock(List lockIds) async { if(lockIds.isEmpty){ - showToast("请选择锁"); + showToast("请选择锁".tr); return; } var entity = await ApiRepository.to.lockGroupDeletLock(lockIds: lockIds); diff --git a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_logic.dart b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_logic.dart index 44645d57..5c35a561 100644 --- a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_logic.dart +++ b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_logic.dart @@ -12,7 +12,7 @@ class LockGroupListLogic extends BaseGetXController { //分组列表请求 void mockNetworkDataRequest() async { - var entity = await ApiRepository.to.lockGroupList('1'); + var entity = await ApiRepository.to.lockGroupList('0'); if (entity.errorCode!.codeIsSuccessful) { if (entity.data != null) { state.lockNum = 0; diff --git a/star_lock/lib/mine/mineSet/transferGateway/selectGetewayList_page.dart b/star_lock/lib/mine/mineSet/transferGateway/selectGetewayList_page.dart index 6bc1cf3d..57cc2e9b 100644 --- a/star_lock/lib/mine/mineSet/transferGateway/selectGetewayList_page.dart +++ b/star_lock/lib/mine/mineSet/transferGateway/selectGetewayList_page.dart @@ -146,7 +146,7 @@ class _SelectGetewayListPageState extends State { } } if(isCanNext == false){ - logic.showToast("请选择锁"); + logic.showToast("请选择锁".tr); return; } var data = await Get.toNamed(Routers.recipientInformationPage, arguments: { diff --git a/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart b/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart index 3f9fd145..850598fd 100644 --- a/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart +++ b/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart @@ -151,7 +151,7 @@ class _TransferSmartLockPageState extends State { } } if(isCanNext == false){ - logic.showToast("请选择锁"); + logic.showToast("请选择锁".tr); return; } var data = await Get.toNamed(Routers.recipientInformationPage, arguments: { diff --git a/star_lock/lib/network/api.dart b/star_lock/lib/network/api.dart index 11a71eac..f37a093d 100644 --- a/star_lock/lib/network/api.dart +++ b/star_lock/lib/network/api.dart @@ -45,6 +45,7 @@ abstract class Api { final String passwordKeyGetURL = '/keyboardPwd/get'; //获取密码 final String passwordKeyAddURL = '/keyboardPwd/add'; //自定义密码 + final String passwordKeyCheckKeyboardpwdNameURL = '/keyboardPwd/checkKeyboardpwdName'; //自定义密码校验密码跟名字是否重复 final String updatePasswordKeyURL = '/keyboardPwd/update'; //修改密码详情 final String clearOperationRecordURL = '/lockRecords/clear'; //清空操作记录 final String addlockGroupURL = '/keyGroup/add'; //创建锁分组 diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index eaf7c499..920b6913 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -451,6 +451,20 @@ class ApiProvider extends BaseProvider { 'addType': addType, })); + // 自定义密码校验名字密码是否重复 + Future checkKeyboardpwdName( + String lockId, + String keyboardPwdName, + String keyboardPwd + ) => + post( + passwordKeyCheckKeyboardpwdNameURL.toUrl, + jsonEncode({ + 'lockId': lockId, + 'keyboardPwdName': keyboardPwdName, + 'keyboardPwd': keyboardPwd, + })); + Future updateKeyboardPwd( int lockId, String keyboardPwdId, diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index b96dcbbb..a645f9b0 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -450,6 +450,18 @@ class ApiRepository { return PasswordKeyEntity.fromJson(res.body); } + //自定义密码校验密码名称或密码是否已存在 + Future checkKeyboardpwdName( + { + required String lockId, + required String keyboardPwdName, + required String keyboardPwd + }) async { + final res = await apiProvider.checkKeyboardpwdName(lockId, keyboardPwdName, + keyboardPwd); + return PasswordKeyEntity.fromJson(res.body); + } + //修改密码 Future updatePasswordKey( {required int lockId, diff --git a/star_lock/lib/tools/storage.dart b/star_lock/lib/tools/storage.dart index daaf3551..84061fda 100644 --- a/star_lock/lib/tools/storage.dart +++ b/star_lock/lib/tools/storage.dart @@ -175,6 +175,12 @@ class Storage { return nickname; } + static Future getHeadUrl() async { + LoginData? loginData = await getLoginData(); + String? headUrl = loginData!.headUrl; + return headUrl; + } + static Future getLoginData() async { LoginData? loginData; final data = await Storage.getString(saveUserLoginData); diff --git a/star_lock/pubspec.yaml b/star_lock/pubspec.yaml index dd9e26fa..d78e0377 100644 --- a/star_lock/pubspec.yaml +++ b/star_lock/pubspec.yaml @@ -27,8 +27,10 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.22+20240403:1、打包预发布环境给欧阳测试 # 1.0.23+20240406:1、打包预发布环境给欧阳测试 # 1.0.24+20240407:1、打包预发布环境给欧阳测试 +# 1.0.25+2024040702:1、打包预发布环境给欧阳测试 +# 1.0.26+20240408:打包预发布环境给欧阳测试 -version: 1.0.24+20240407 +version: 1.0.26+20240408 environment: sdk: '>=2.12.0 <3.0.0'