添加部分国际化,添加检测自定义密码名字密码是否重复

This commit is contained in:
魏少阳 2024-04-09 15:21:10 +08:00
parent 1f8b24da20
commit 9ac7a01f4b
61 changed files with 550 additions and 657 deletions

View File

@ -312,7 +312,7 @@
"lightTouchScreenTip":"Light Touch Screen Tip", "lightTouchScreenTip":"Light Touch Screen Tip",
"next":"Next", "next":"Next",
"nearbyLock":"Nearby Lock", "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", "whenAddingLockThePhoneMustBeNextToTheLock":"When adding a lock, the phone must be next to the lock",
"login":"Login", "login":"Login",
@ -538,6 +538,7 @@
"清空码": "Clear code", "清空码": "Clear code",
"循环": "Cycle", "循环": "Cycle",
"工作日": "Workday", "工作日": "Workday",
"每日": "Daily",
"周末": "Weekend", "周末": "Weekend",
"周一": "Monday", "周一": "Monday",
"周二": "Tuesday", "周二": "Tuesday",
@ -548,5 +549,69 @@
"周日": "Sunday", "周日": "Sunday",
"确定要删除吗?": "Are you sure you want to delete?", "确定要删除吗?": "Are you sure you want to delete?",
"该锁的密码都将被删除": "The password of the lock will be deleted", "该锁的密码都将被删除": "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"
} }

View File

@ -525,7 +525,7 @@
"隐私政策": "隐私政策", "隐私政策": "隐私政策",
"注册成功": "注册成功", "注册成功": "注册成功",
"你所在的": "你所在的", "你所在的": "你所在的",
"手机号": "公司已经开通了", "手机号": "手机号",
"忘记密码": "忘记密码", "忘记密码": "忘记密码",
"重置成功": "重置成功", "重置成功": "重置成功",
"确定要退出吗?": "确定要退出吗?", "确定要退出吗?": "确定要退出吗?",
@ -539,6 +539,7 @@
"清空码": "清空码", "清空码": "清空码",
"循环": "循环", "循环": "循环",
"工作日": "工作日", "工作日": "工作日",
"每日": "每日",
"周末": "周末", "周末": "周末",
"周一": "周一", "周一": "周一",
"周二": "周二", "周二": "周二",
@ -549,5 +550,69 @@
"周日": "周日", "周日": "周日",
"确定要删除吗?": "确定要删除吗?", "确定要删除吗?": "确定要删除吗?",
"该锁的密码都将被删除": "该锁的密码都将被删除", "该锁的密码都将被删除": "该锁的密码都将被删除",
"已过期": "已过期" "已过期": "已过期",
"该锁的电子钥匙都将被删除": "该锁的电子钥匙都将被删除",
"同时删除其发送的所有钥匙,钥匙删除后不能恢复": "同时删除其发送的所有钥匙,钥匙删除后不能恢复",
"删除钥匙会在用户APP连网后生效": "删除钥匙会在用户APP连网后生效",
"有效时间": "有效时间",
"接收者": "接收者",
"仅管理自己创建的用户": "仅管理自己创建的用户",
"远程开锁": "远程开锁",
"请输入钥匙名称": "请输入钥匙名称",
"修改成功": "修改成功",
"冻结": "冻结",
"取消冻结": "取消冻结",
"授权": "授权",
"取消授权": "取消授权",
"同时解冻其发送的钥匙": "同时解冻其发送的钥匙",
"取消冻结会在用户APP连网后生效": "取消冻结会在用户APP连网后生效",
"同时冻结其发送的钥匙": "同时冻结其发送的钥匙",
"冻结会在用户APP连网后生效": "冻结会在用户APP连网后生效",
"取消授权会在用户APP连网后生效": "取消授权会在用户APP连网后生效",
"授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码": "授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码",
"失效时间需大于生效时间": "失效时间需大于生效时间",
"生效时间需大于当前时间": "生效时间需大于当前时间",
"失效日期要大于生效日期": "失效日期要大于生效日期",
"失效时间要大于生效时间": "失效时间要大于生效时间",
"修改有效期": "修改有效期",
"生效日期": "生效日期",
"失效日期": "失效日期",
"开锁": "开锁",
"开锁成功": "开锁成功",
"请选择锁": "请选择锁",
"请选择接收者": "请选择接收者",
"请选择有效期": "请选择有效期",
"请选择发送方式": "请选择发送方式",
"请选择结束时间": "请选择结束时间",
"完成": "完成",
"有效日": "有效日",
"发送成功": "发送成功",
"请选择开始时间": "请选择开始时间",
"选择用户": "选择用户",
"已选中": "已选中",
"确定": "确定",
"请选择要发送的锁": "请选择要发送的锁",
"人脸实名认证指的是用户在使用手机APP开锁时需要先进行本人人脸验证验证通过才能开锁。": "人脸实名认证指的是用户在使用手机APP开锁时需要先进行本人人脸验证验证通过才能开锁。",
"分享": "分享",
"请输入接收者账号": "请输入接收者账号",
"接收者号码未注册,请重新发送": "接收者号码未注册,请重新发送",
"是否发送电子钥匙给未注册账号": "是否发送电子钥匙给未注册账号",
"取消": "取消",
"标记成功": "标记成功",
"微信好友": "微信好友",
"短信": "短信",
"邮件": "邮件",
"更多": "更多",
"您好,您的电子钥匙生成成功": "您好,您的电子钥匙生成成功",
"生效时间不能小于当前时间": "生效时间不能小于当前时间",
"结束时间不能小于当前时间": "结束时间不能小于当前时间",
"是否是管理员": "是否是管理员",
"已连接到锁,请将卡靠近锁的读卡区": "已连接到锁,请将卡靠近锁的读卡区",
"尝试连接设备...": "尝试连接设备...",
"地理位置": "地理位置",
"检查以确保以下地址是正确的": "检查以确保以下地址是正确的",
"地图加载中,请稍候。。": "地图加载中,请稍候。。",
"跳过": "跳过",
"还未获取到位置信息哦,请耐心等待一下!": "还未获取到位置信息哦,请耐心等待一下!",
"请填写信息": "请填写信息"
} }

View File

@ -312,7 +312,7 @@
"lightTouchScreenTip":"摸亮触摸屏,锁进入可添加状态,点击下一步", "lightTouchScreenTip":"摸亮触摸屏,锁进入可添加状态,点击下一步",
"next":"下一步", "next":"下一步",
"nearbyLock":"附近的锁", "nearbyLock":"附近的锁",
"addSuccessfullyPleaseRename":"添加成功,请重命名", "addSuccessfullyPleaseRename":"如需修改名字请重新命名,点击确定添加锁",
"whenAddingLockThePhoneMustBeNextToTheLock":"添加锁时,手机必须在锁旁边", "whenAddingLockThePhoneMustBeNextToTheLock":"添加锁时,手机必须在锁旁边",
"login":"登录", "login":"登录",
@ -526,7 +526,7 @@
"隐私政策": "隐私政策", "隐私政策": "隐私政策",
"注册成功": "注册成功", "注册成功": "注册成功",
"你所在的": "你所在的", "你所在的": "你所在的",
"手机号": "公司已经开通了", "手机号": "手机号",
"忘记密码": "忘记密码", "忘记密码": "忘记密码",
"重置成功": "重置成功", "重置成功": "重置成功",
"确定要退出吗?": "确定要退出吗?", "确定要退出吗?": "确定要退出吗?",
@ -540,6 +540,7 @@
"清空码": "清空码", "清空码": "清空码",
"循环": "循环", "循环": "循环",
"工作日": "工作日", "工作日": "工作日",
"每日": "每日",
"周末": "周末", "周末": "周末",
"周一": "周一", "周一": "周一",
"周二": "周二", "周二": "周二",
@ -550,5 +551,69 @@
"周日": "周日", "周日": "周日",
"确定要删除吗?": "确定要删除吗?", "确定要删除吗?": "确定要删除吗?",
"该锁的密码都将被删除": "该锁的密码都将被删除", "该锁的密码都将被删除": "该锁的密码都将被删除",
"已过期": "已过期" "已过期": "已过期",
"该锁的电子钥匙都将被删除": "该锁的电子钥匙都将被删除",
"同时删除其发送的所有钥匙,钥匙删除后不能恢复": "同时删除其发送的所有钥匙,钥匙删除后不能恢复",
"删除钥匙会在用户APP连网后生效": "删除钥匙会在用户APP连网后生效",
"有效时间": "有效时间",
"接收者": "接收者",
"仅管理自己创建的用户": "仅管理自己创建的用户",
"远程开锁": "远程开锁",
"请输入钥匙名称": "请输入钥匙名称",
"修改成功": "修改成功",
"冻结": "冻结",
"取消冻结": "取消冻结",
"授权": "授权",
"取消授权": "取消授权",
"同时解冻其发送的钥匙": "同时解冻其发送的钥匙",
"取消冻结会在用户APP连网后生效": "取消冻结会在用户APP连网后生效",
"同时冻结其发送的钥匙": "同时冻结其发送的钥匙",
"冻结会在用户APP连网后生效": "冻结会在用户APP连网后生效",
"取消授权会在用户APP连网后生效": "取消授权会在用户APP连网后生效",
"授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码": "授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码",
"失效时间需大于生效时间": "失效时间需大于生效时间",
"生效时间需大于当前时间": "生效时间需大于当前时间",
"失效日期要大于生效日期": "失效日期要大于生效日期",
"失效时间要大于生效时间": "失效时间要大于生效时间",
"修改有效期": "修改有效期",
"生效日期": "生效日期",
"失效日期": "失效日期",
"开锁": "开锁",
"开锁成功": "开锁成功",
"请选择锁": "请选择锁",
"请选择接收者": "请选择接收者",
"请选择有效期": "请选择有效期",
"请选择发送方式": "请选择发送方式",
"请选择结束时间": "请选择结束时间",
"完成": "完成",
"有效日": "有效日",
"发送成功": "发送成功",
"请选择开始时间": "请选择开始时间",
"选择用户": "选择用户",
"已选中": "已选中",
"确定": "确定",
"请选择要发送的锁": "请选择要发送的锁",
"人脸实名认证指的是用户在使用手机APP开锁时需要先进行本人人脸验证验证通过才能开锁。": "人脸实名认证指的是用户在使用手机APP开锁时需要先进行本人人脸验证验证通过才能开锁。",
"分享": "分享",
"请输入接收者账号": "请输入接收者账号",
"接收者号码未注册,请重新发送": "接收者号码未注册,请重新发送",
"是否发送电子钥匙给未注册账号": "是否发送电子钥匙给未注册账号",
"取消": "取消",
"标记成功": "标记成功",
"微信好友": "微信好友",
"短信": "短信",
"邮件": "邮件",
"更多": "更多",
"您好,您的电子钥匙生成成功": "您好,您的电子钥匙生成成功",
"生效时间不能小于当前时间": "生效时间不能小于当前时间",
"结束时间不能小于当前时间": "结束时间不能小于当前时间",
"是否是管理员": "是否是管理员",
"已连接到锁,请将卡靠近锁的读卡区": "已连接到锁,请将卡靠近锁的读卡区",
"尝试连接设备...": "尝试连接设备...",
"地理位置": "地理位置",
"检查以确保以下地址是正确的": "检查以确保以下地址是正确的",
"地图加载中,请稍候。。": "地图加载中,请稍候。。",
"跳过": "跳过",
"还未获取到位置信息哦,请耐心等待一下!": "还未获取到位置信息哦,请耐心等待一下!",
"请填写信息": "请填写信息"
} }

View File

@ -28,6 +28,8 @@
<true/> <true/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict> <dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key> <key>NSExceptionDomains</key>
<dict> <dict>
<key>jpush.cn</key> <key>jpush.cn</key>

View File

@ -1,8 +1,8 @@
import 'dart:async'; import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'io_tool/io_model.dart'; import 'io_tool/io_model.dart';
@ -79,7 +79,7 @@ class BlueManage {
void _initGetMtuSubscription() { void _initGetMtuSubscription() {
_mtuSubscription ??= bluetoothConnectDevice!.mtu.listen((value) { _mtuSubscription ??= bluetoothConnectDevice!.mtu.listen((value) {
_mtuSize = value - 3; _mtuSize = value - 3;
Get.log('mtuSize:$_mtuSize'); Get.log('_mtuSizeValue:$value mtuSize:$_mtuSize');
}); });
} }
@ -148,9 +148,7 @@ class BlueManage {
writeCharacteristicWithResponse(model.data); writeCharacteristicWithResponse(model.data);
} else { } else {
try { try {
if (Platform.isAndroid) {
await FlutterBluePlus.turnOn();
}
} catch (e) { } catch (e) {
Get.log("Error Turning On:"); Get.log("Error Turning On:");
} }
@ -205,9 +203,7 @@ class BlueManage {
} }
} else { } else {
try { try {
if (Platform.isAndroid) { openBlue();
await FlutterBluePlus.turnOn();
}
} catch (e) { } catch (e) {
Get.log("Error Turning On:"); Get.log("Error Turning On:");
} }
@ -238,13 +234,12 @@ class BlueManage {
} }
} else { } else {
try { try {
if (Platform.isAndroid) { stateCallBack(BluetoothConnectionState.disconnected);
await FlutterBluePlus.turnOn(); openBlue();
}
} catch (e) { } catch (e) {
Get.log("Error Turning On:"); Get.log("Error Turning On:");
} }
}; }
} else { } else {
Get.log("开始扫描 蓝牙不可用,不能进行蓝牙操作"); Get.log("开始扫描 蓝牙不可用,不能进行蓝牙操作");
} }
@ -323,7 +318,6 @@ class BlueManage {
if (bluetoothConnectionState == BluetoothConnectionState.connected) { if (bluetoothConnectionState == BluetoothConnectionState.connected) {
try { try {
bluetoothConnectDevice!.discoverServices().then((services) { bluetoothConnectDevice!.discoverServices().then((services) {
Get.log("333333333");
for (BluetoothService service in services) { for (BluetoothService service in services) {
// Get.log("11111service.remoteId:${service.remoteId}" // Get.log("11111service.remoteId:${service.remoteId}"
// " service.uuid:${service.uuid}" // " service.uuid:${service.uuid}"
@ -336,7 +330,6 @@ class BlueManage {
// " characteristic.secondaryServiceUuid:${characteristic.secondaryServiceUuid}" // " characteristic.secondaryServiceUuid:${characteristic.secondaryServiceUuid}"
// " characteristic.characteristicUuid:${characteristic.characteristicUuid}"); // " characteristic.characteristicUuid:${characteristic.characteristicUuid}");
if (characteristic.characteristicUuid == _characteristicIdSubscription) { if (characteristic.characteristicUuid == _characteristicIdSubscription) {
Get.log("44444444");
_subScribeToCharacteristic(characteristic); _subScribeToCharacteristic(characteristic);
Get.log('Discovering services finished'); Get.log('Discovering services finished');
bluetoothConnectionState = BluetoothConnectionState.connected; bluetoothConnectionState = BluetoothConnectionState.connected;
@ -475,8 +468,7 @@ class BlueManage {
try { try {
List<int> valueList = value; List<int> valueList = value;
List subData = splitList(valueList, _mtuSize!); List subData = splitList(valueList, _mtuSize!);
Get.log( Get.log('writeCharacteristicWithResponse _mtuSize:$_mtuSize 得到的分割数据:$subData');
'writeCharacteristicWithResponse 得到的分割数据:$subData');
for (int i = 0; i < subData.length; i++) { for (int i = 0; i < subData.length; i++) {
await characteristic.write(subData[i]).then((value) async { 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() { disposed() {
_sendStreamSubscription?.cancel(); _sendStreamSubscription?.cancel();
_mtuSubscription!.cancel(); _mtuSubscription!.cancel();

View File

@ -47,7 +47,7 @@ class _StarLockForgetPasswordPageState
state.countryCode.value = result['code']; state.countryCode.value = result['code'];
state.countryName.value = result['countryName']; 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( child: SizedBox(
height: 70.h, height: 70.h,
@ -185,7 +185,7 @@ class _StarLockForgetPasswordPageState
var result = await Navigator.pushNamed( var result = await Navigator.pushNamed(
context, Routers.safetyVerificationPage, context, Routers.safetyVerificationPage,
arguments: { arguments: {
"countryCode": "86", "countryCode": state.countryCode.value,
"account": state.phoneStr.value "account": state.phoneStr.value
}); });
logic.state.xWidth.value = logic.state.xWidth.value =

View File

@ -8,6 +8,7 @@ import 'package:star_lock/tools/xs_jPhush.dart';
import '../../mine/mine/starLockMine_logic.dart'; import '../../mine/mine/starLockMine_logic.dart';
import '../../network/api_repository.dart'; import '../../network/api_repository.dart';
import '../../tools/eventBusEventManage.dart';
import '../../tools/storage.dart'; import '../../tools/storage.dart';
import 'starLock_login_state.dart'; import 'starLock_login_state.dart';
@ -20,6 +21,7 @@ class StarLockLoginLogic extends BaseGetXController {
.login("1", state.pwd.value, "+86", state.emailOrPhone.value); .login("1", state.pwd.value, "+86", state.emailOrPhone.value);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
Storage.saveLoginData(entity.data); Storage.saveLoginData(entity.data);
eventBus.fire(MineInfoChangeRefreshUI());
// Get.back(); // Get.back();
// Get.toNamed(Routers.starLockMain); // Get.toNamed(Routers.starLockMain);
XSJPushProvider().initJPushService(); XSJPushProvider().initJPushService();

View File

@ -285,7 +285,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
height: 20.h, height: 20.h,
), ),
SubmitBtn( SubmitBtn(
btnName: '完成', btnName: '完成'.tr,
onClick: () { onClick: () {
state.isSendSuccess.value = false; state.isSendSuccess.value = false;
Navigator.pop(context, true); Navigator.pop(context, true);

View File

@ -398,7 +398,7 @@ class _VolumeAuthorizationLockPageState
height: 20.h, height: 20.h,
), ),
SubmitBtn( SubmitBtn(
btnName: '完成', btnName: '完成'.tr,
onClick: () { onClick: () {
_isSendSuccess = false; _isSendSuccess = false;
Navigator.pop(context, true); Navigator.pop(context, true);

View File

@ -31,11 +31,11 @@ class AddCardTypeLogic extends BaseGetXController{
endTime = "0"; endTime = "0";
if (startDate.isEmpty) { if (startDate.isEmpty) {
showToast("请选择开始时间"); showToast("请选择开始时间".tr);
return; return;
} }
if (endDate.isEmpty) { if (endDate.isEmpty) {
showToast("请选择结束时间"); showToast("请选择结束时间".tr);
return; return;
} }
@ -45,12 +45,12 @@ class AddCardTypeLogic extends BaseGetXController{
// } // }
if (int.parse(startDate) >= int.parse(endDate)) { if (int.parse(startDate) >= int.parse(endDate)) {
showToast("失效时间要大于生效时间"); showToast("失效时间要大于生效时间".tr);
return; return;
} }
} else if (state.selectType.value == "2") { } else if (state.selectType.value == "2") {
if (state.beginTime.value.isEmpty) { if (state.beginTime.value.isEmpty) {
showToast("请选择有效期"); showToast("请选择有效期".tr);
return; return;
} }
startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString(); 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: var isCoerced = state.isStressFingerprint.value == false ? "1" : "2"; // 1: 2:
print("addOtherType startDate:$startDate endDate:$endDate");
Get.toNamed(Routers.addICCardPage, arguments: { Get.toNamed(Routers.addICCardPage, arguments: {
"lockId": state.lockId.value, "lockId": state.lockId.value,
"endDate": endDate, "endDate": endDate,

View File

@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -70,7 +71,6 @@ class _AddCardPageState extends State<AddCardPage> {
case 0: case 0:
{ {
// //
// return sendElectronicKeySucceed();
return Column( return Column(
children: [ children: [
perpetualKeyWidget( perpetualKeyWidget(
@ -214,7 +214,7 @@ class _AddCardPageState extends State<AddCardPage> {
Obx(() => Visibility( Obx(() => Visibility(
visible: state.effectiveDateTime.value.isNotEmpty, visible: state.effectiveDateTime.value.isNotEmpty,
child: CommonItem( child: CommonItem(
leftTitel: "有效时间", leftTitel: "有效时间".tr,
rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}", rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}",
isHaveDirection: true, isHaveDirection: true,
action: () async { action: () async {
@ -244,7 +244,7 @@ class _AddCardPageState extends State<AddCardPage> {
return Column( return Column(
children: [ children: [
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: "是否是管理员", leftTitel: "是否是管理员".tr,
rightTitle: "", rightTitle: "",
isTipsImg: false, isTipsImg: false,
isHaveRightWidget: true, isHaveRightWidget: true,
@ -266,90 +266,20 @@ class _AddCardPageState extends State<AddCardPage> {
if (isDemoMode == false) { if (isDemoMode == false) {
// print("state.selectType:${state.selectType.value}"); // print("state.selectType:${state.selectType.value}");
if (state.nameController.text.isEmpty) { if (state.nameController.text.isEmpty) {
logic.showToast("请输入姓名"); logic.showToast("请输入姓名".tr);
return; return;
} }
logic.checkCardNameDuplicated(state.nameController.text); logic.checkCardNameDuplicated(state.nameController.text);
} else { } else {
// Get.toNamed(Routers.selectLockTypePage); // 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 getAppBarTitle(int type) {
String title; String title;
switch (type) { switch (type) {

View File

@ -50,15 +50,13 @@ class AddICCardLogic extends BaseGetXController{
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功");
// state.cardNumber.value = reply.data.last.toString(); // state.cardNumber.value = reply.data.last.toString();
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
state.ifConnectScuess.value = true; state.ifConnectScuess.value = true;
break; break;
case 0x06: case 0x06:
// //
print("${reply.commandType!.typeValue} 需要鉴权");
var privateKey = await Storage.getStringList(saveBluePrivateKey); var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
@ -67,7 +65,6 @@ class AddICCardLogic extends BaseGetXController{
var token = reply.data.sublist(5, 9); var token = reply.data.sublist(5, 9);
var saveStrList = changeIntListToStringList(token); var saveStrList = changeIntListToStringList(token);
print("_replyAddFingerprintReplyToken:$token");
Storage.setStringList(saveBlueToken, saveStrList); Storage.setStringList(saveBlueToken, saveStrList);
IoSenderManage.senderAddFingerprintCommand( IoSenderManage.senderAddFingerprintCommand(
@ -75,8 +72,6 @@ class AddICCardLogic extends BaseGetXController{
userID:await Storage.getUid(), userID:await Storage.getUid(),
fingerNo:1, fingerNo:1,
useCountLimit:0xff, useCountLimit:0xff,
// startTime:0x11223344,
// endTime:0x11223344,
startTime:int.parse(state.startDate.value)~/1000, startTime:int.parse(state.startDate.value)~/1000,
endTime:int.parse(state.endDate.value)~/1000, endTime:int.parse(state.endDate.value)~/1000,
needAuthor:1, needAuthor:1,
@ -86,32 +81,27 @@ class AddICCardLogic extends BaseGetXController{
); );
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType!.typeValue} 用户无权限"); Get.log("${reply.commandType!.typeValue} 用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType!.typeValue} 权限校验错误"); Get.log("${reply.commandType!.typeValue} 权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType!.typeValue} 失败"); Get.log("${reply.commandType!.typeValue} 失败");
break; break;
} }
} }
Future<void> _replyAddICCardConfirmation(Reply reply) async { Future<void> _replyAddICCardConfirmation(Reply reply) async {
int status = reply.data[2]; int status = reply.data[2];
print("_replyAddFingerprintstatus:$status"); Get.log("_replyAddFingerprintstatus:$status");
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功");
// print("添加指纹确认成功,调用添加指纹接口");
if(state.cardNumber.value == (reply.data[6]).toString()){ if(state.cardNumber.value == (reply.data[6]).toString()){
return; return;
}else{ }else{
@ -133,23 +123,22 @@ class AddICCardLogic extends BaseGetXController{
} }
break; break;
case 0x06: case 0x06:
// //
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType!.typeValue} 用户无权限"); Get.log("${reply.commandType!.typeValue} 用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType!.typeValue} 权限校验错误"); Get.log("${reply.commandType!.typeValue} 权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType!.typeValue} 失败"); Get.log("${reply.commandType!.typeValue} 失败");
break; break;
} }
} }
@ -161,9 +150,8 @@ class AddICCardLogic extends BaseGetXController{
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功"); Get.log("${reply.commandType!.typeValue} 数据解析成功");
// print("添加指纹确认成功,调用添加指纹接口");
addICCardData(); addICCardData();
break; break;
case 0x06: case 0x06:
@ -179,7 +167,6 @@ class AddICCardLogic extends BaseGetXController{
var token = reply.data.sublist(5, 9); var token = reply.data.sublist(5, 9);
var saveStrList = changeIntListToStringList(token); var saveStrList = changeIntListToStringList(token);
print("_replyAddICCardConfirmationReplyToken:$token");
Storage.setStringList(saveBlueToken, saveStrList); Storage.setStringList(saveBlueToken, saveStrList);
IoSenderManage.senderAddStressICCardCommand( IoSenderManage.senderAddStressICCardCommand(
@ -188,8 +175,6 @@ class AddICCardLogic extends BaseGetXController{
icCardNo:state.isAdministrator.value == "2" ? 254 : 1, icCardNo:state.isAdministrator.value == "2" ? 254 : 1,
cardType:1, cardType:1,
useCountLimit:1, useCountLimit:1,
// startTime:0x11223344,
// endTime:0x11223344,
startTime:int.parse(state.startDate.value)~/1000, startTime:int.parse(state.startDate.value)~/1000,
endTime:int.parse(state.endDate.value)~/1000, endTime:int.parse(state.endDate.value)~/1000,
needAuthor:1, needAuthor:1,
@ -200,19 +185,18 @@ class AddICCardLogic extends BaseGetXController{
); );
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType!.typeValue} 用户无权限"); Get.log("${reply.commandType!.typeValue} 用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType!.typeValue} 权限校验错误"); Get.log("${reply.commandType!.typeValue} 权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType!.typeValue} 失败"); Get.log("${reply.commandType!.typeValue} 失败");
break; break;
} }
} }
@ -220,7 +204,6 @@ class AddICCardLogic extends BaseGetXController{
// //
Future<void> senderAddICCard() async { Future<void> senderAddICCard() async {
showBlueConnetctToastTimer(action: (){ showBlueConnetctToastTimer(action: (){
print("没有任何响应");
Get.close(1); Get.close(1);
}); });
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async { BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
@ -234,14 +217,12 @@ class AddICCardLogic extends BaseGetXController{
var token = await Storage.getStringList(saveBlueToken); var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!); List<int> getTokenList = changeStringListToIntList(token!);
print("openDoorTokenPubToken:$getTokenList");
IoSenderManage.senderAddICCardCommand( IoSenderManage.senderAddICCardCommand(
keyID:"1", keyID:"1",
userID:await Storage.getUid(), userID:await Storage.getUid(),
cardNo:state.isAdministrator.value == "2" ? 254 : 1, cardNo:state.isAdministrator.value == "2" ? 254 : 1,
useCountLimit:0xff, useCountLimit:0xff,
// startTime:0x11223344,
// endTime:0x11223344,
startTime:int.parse(state.startDate.value)~/1000, startTime:int.parse(state.startDate.value)~/1000,
endTime:int.parse(state.endDate.value)~/1000, endTime:int.parse(state.endDate.value)~/1000,
needAuthor:1, needAuthor:1,
@ -274,7 +255,6 @@ class AddICCardLogic extends BaseGetXController{
var token = await Storage.getStringList(saveBlueToken); var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!); List<int> getTokenList = changeStringListToIntList(token!);
print("openDoorTokenPubToken:$getTokenList");
IoSenderManage.senderAddStressICCardCommand( IoSenderManage.senderAddStressICCardCommand(
keyID:"1", keyID:"1",
@ -297,7 +277,6 @@ class AddICCardLogic extends BaseGetXController{
} }
void addICCardData() async { 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( var entity = await ApiRepository.to.addICCardData(
lockId: state.lockId.value.toString(), lockId: state.lockId.value.toString(),
endDate: state.endDate.value, endDate: state.endDate.value,
@ -308,8 +287,8 @@ class AddICCardLogic extends BaseGetXController{
startDate: state.startDate.value, startDate: state.startDate.value,
isCoerced: state.isCoerced.value.toString(), isCoerced: state.isCoerced.value.toString(),
weekDay: state.weekDay.value, weekDay: state.weekDay.value,
startTime: int.parse(state.effectiveDateTime.value), startTime: int.parse(state.effectiveDateTime.value),
endTime: int.parse(state.failureDateTime.value), endTime: int.parse(state.failureDateTime.value),
cardRight: state.isAdministrator.value == "2" ? 1 : 0, cardRight: state.isAdministrator.value == "2" ? 1 : 0,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
@ -324,14 +303,7 @@ class AddICCardLogic extends BaseGetXController{
cardUserNo: state.cardNumber.value, cardUserNo: state.cardNumber.value,
); );
if(entity.errorCode!.codeIsSuccessful){ 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("添加成功"); showToast("添加成功");
if(state.fromType.value == 2){ if(state.fromType.value == 2){
// //

View File

@ -32,8 +32,6 @@ class _AddICCardPageState extends State<AddICCardPage> with RouteAware {
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
), ),
body: ListView( body: ListView(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SizedBox(height: 200.h), SizedBox(height: 200.h),
Center( Center(
@ -63,8 +61,8 @@ class _AddICCardPageState extends State<AddICCardPage> with RouteAware {
child: Center( child: Center(
child: Obx(() => Text( child: Obx(() => Text(
state.ifConnectScuess.value state.ifConnectScuess.value
? "已连接到锁,请将卡靠近锁的读卡区" ? "已连接到锁,请将卡靠近锁的读卡区".tr
: "尝试连接设备...", : "尝试连接设备...".tr,
style: TextStyle(color: Colors.white, fontSize: 24.sp)))), style: TextStyle(color: Colors.white, fontSize: 24.sp)))),
), ),
], ],

View File

@ -38,14 +38,6 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
barTitle: "卡详情", barTitle: "卡详情",
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
// actionsList: [
// TextButton(
// child: Text(TranslationLoader.lanKeys!.share!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp),),
// onPressed: () {
//
// },
// ),
// ],
), ),
body: ListView( body: ListView(
children: [ children: [

View File

@ -20,7 +20,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
// //
Future<void> modifyKeyNameRequest() async { Future<void> modifyKeyNameRequest() async {
if (state.changeNameController.text.isEmpty) { if (state.changeNameController.text.isEmpty) {
showToast("请输入钥匙名称"); showToast("请输入钥匙名称".tr);
return; return;
} }
KeyOperationRecordEntity entity = await ApiRepository.to KeyOperationRecordEntity entity = await ApiRepository.to
@ -30,7 +30,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
state.itemData.value.keyName = state.changeNameController.text; state.itemData.value.keyName = state.changeNameController.text;
state.keyName.value = state.itemData.value.keyName!; state.keyName.value = state.itemData.value.keyName!;
Get.back(); Get.back();
showToast("修改成功", something: () { showToast("修改成功".tr, something: () {
eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(ElectronicKeyListRefreshUI());
eventBus.fire(AuthorizedAdminPageRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI());
}); });
@ -56,7 +56,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
// }else if(updateType == 2){ // }else if(updateType == 2){
// state.isRemoteUnlock.value = !state.isRemoteUnlock.value; // state.isRemoteUnlock.value = !state.isRemoteUnlock.value;
// } // }
showToast("修改成功", something: () { showToast("修改成功".tr, something: () {
eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(ElectronicKeyListRefreshUI());
eventBus.fire(AuthorizedAdminPageRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI());
}); });
@ -70,8 +70,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
includeUnderlings: includeUnderlings includeUnderlings: includeUnderlings
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print("删除电子钥匙成功"); showToast("删除成功".tr, something: () {
showToast("删除成功", something: () {
eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(ElectronicKeyListRefreshUI());
eventBus.fire(AuthorizedAdminPageRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI());
Get.back(); Get.back();
@ -85,7 +84,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
keyId:state.itemData.value.keyId.toString(), keyId:state.itemData.value.keyId.toString(),
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("设置成功", something: () { showToast("设置成功".tr, something: () {
eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(ElectronicKeyListRefreshUI());
eventBus.fire(AuthorizedAdminPageRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI());
Get.back(); Get.back();
@ -99,7 +98,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
keyId:state.itemData.value.keyId.toString(), keyId:state.itemData.value.keyId.toString(),
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("设置成功", something: () { showToast("设置成功".tr, something: () {
eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(ElectronicKeyListRefreshUI());
eventBus.fire(AuthorizedAdminPageRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI());
Get.back(); Get.back();
@ -114,7 +113,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
includeUnderlings: includeUnderlings includeUnderlings: includeUnderlings
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("设置成功", something: () { showToast("设置成功".tr, something: () {
eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(ElectronicKeyListRefreshUI());
eventBus.fire(AuthorizedAdminPageRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI());
Get.back(); Get.back();
@ -129,7 +128,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
includeUnderlings: includeUnderlings includeUnderlings: includeUnderlings
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("设置成功", something: () { showToast("设置成功".tr, something: () {
eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(ElectronicKeyListRefreshUI());
eventBus.fire(AuthorizedAdminPageRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI());
Get.back(); Get.back();
@ -140,11 +139,11 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
String getKeyTypeShowDateTime(){ String getKeyTypeShowDateTime(){
String useDateStr = ''; String useDateStr = '';
if(state.keyType.value == 1){ if(state.keyType.value == 1){
useDateStr = "永久"; useDateStr = "永久".tr;
}else if(state.keyType.value == 2){ }else if(state.keyType.value == 2){
useDateStr = "${DateTool().dateToYMDHNString(state.starDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}"; useDateStr = "${DateTool().dateToYMDHNString(state.starDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}";
}else if(state.keyType.value == 3){ }else if(state.keyType.value == 3){
useDateStr = "单次"; useDateStr = "单次".tr;
}else if(state.keyType.value == 4){ }else if(state.keyType.value == 4){
useDateStr = "${DateTool().dateToYMDString(state.starDate.value)}\n${DateTool().dateToYMDString(state.endDate.value)}"; 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 { Future openModalBottomSheet(BuildContext context) async {
var textList = <String>[]; var textList = <String>[];
if(state.keyType.value == 1 || state.keyType.value == 2){ 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){ } else if(state.keyType.value == 4){
textList = [state.itemData.value.keyStatus == 110405 ? '取消冻结' : "冻结"]; textList = [state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr];
} }
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
@ -173,26 +172,22 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
// //
if(state.itemData.value.keyRight == 1){ if(state.itemData.value.keyRight == 1){
// //
print("管理员 调用取消冻结"); ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙'.tr, (isAllData) {
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) {
cancelFreeze(isAllData ? 1 : 0); cancelFreeze(isAllData ? 1 : 0);
}); });
}else{ }else{
print("普通用户 调用取消冻结"); ShowTipView().showIosTipWithContentDialog("取消冻结会在用户APP连网后生效".tr, (){
ShowTipView().showIosTipWithContentDialog("取消冻结会在用户APP连网后生效", (){
cancelFreeze(0); cancelFreeze(0);
}); });
} }
}else{ }else{
if(state.itemData.value.keyRight == 1){ if(state.itemData.value.keyRight == 1){
// //
print("管理员 调用冻结"); ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时冻结其发送的钥匙'.tr, (isAllData) {
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) { freezeKey(isAllData ? 1 : 0);
freezeKey(isAllData ? 1 : 0);
}); });
}else{ }else{
print("普通用户 调用冻结"); ShowTipView().showIosTipWithContentDialog("冻结会在用户APP连网后生效".tr, (){
ShowTipView().showIosTipWithContentDialog("冻结会在用户APP连网后生效", (){
freezeKey(0); freezeKey(0);
}); });
} }
@ -201,13 +196,11 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
// / // /
if(state.itemData.value.keyRight == 1){ if(state.itemData.value.keyRight == 1){
// //
print("管理员 调用取消授权管理员接口"); ShowTipView().showIosTipWithContentDialog("取消授权会在用户APP连网后生效".tr, (){
ShowTipView().showIosTipWithContentDialog("取消授权会在用户APP连网后生效", (){
cancelAdministrator(); cancelAdministrator();
}); });
}else{ }else{
print("普通用户 调用授权管理员接口"); ShowTipView().showIosTipWithContentDialog("授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码".tr, (){
ShowTipView().showIosTipWithContentDialog("授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码", (){
setAdministrator(); setAdministrator();
}); });
} }
@ -217,82 +210,15 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
}); });
} }
// showPopMenus(BuildContext context){
// var textList = [];
// // keyType // :1;23: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(){ deletKeyLogic(){
if(state.itemData.value.keyRight == 1){ if(state.itemData.value.keyRight == 1){
// //
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) { ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复'.tr, (isAllData) {
deleteKeyRequest(isAllData ? 1 : 0); deleteKeyRequest(isAllData ? 1 : 0);
}); });
}else{ }else{
// //
ShowTipView().showIosTipWithContentDialog("删除钥匙会在用户APP连网后生效",(){ ShowTipView().showIosTipWithContentDialog("删除钥匙会在用户APP连网后生效".tr,(){
deleteKeyRequest(0); deleteKeyRequest(0);
}); });
} }

View File

@ -126,7 +126,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
Obx(() => Visibility( Obx(() => Visibility(
visible: state.keyType.value == 4 ? true : false, visible: state.keyType.value == 4 ? true : false,
child: Obx(() => CommonItem( child: Obx(() => CommonItem(
leftTitel: "有效时间", leftTitel: "有效时间".tr,
rightTitle: "${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}", rightTitle: "${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}",
isHaveDirection: true, isHaveDirection: true,
action: () async { action: () async {
@ -146,7 +146,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
})))), })))),
Container(height: 10.h), Container(height: 10.h),
CommonItem( CommonItem(
leftTitel: "接收者", leftTitel: "接收者".tr,
rightTitle: state.itemData.value.username ?? ""), rightTitle: state.itemData.value.username ?? ""),
const SizedBox(height: 1), const SizedBox(height: 1),
CommonItem( CommonItem(
@ -161,7 +161,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
Visibility( Visibility(
visible: state.itemData.value.keyRight == 1 ? true:false, visible: state.itemData.value.keyRight == 1 ? true:false,
child: CommonItem( child: CommonItem(
leftTitel: "仅管理自己创建的用户", leftTitel: "仅管理自己创建的用户".tr,
rightTitle: "", rightTitle: "",
isHaveRightWidget: true, isHaveRightWidget: true,
isHaveLine: true, isHaveLine: true,
@ -169,10 +169,10 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
width: 60.w, width: 60.w,
child: _onlyManageYouCreatesUserSwitch())), child: _onlyManageYouCreatesUserSwitch())),
), ),
Visibility( Visibility(// (state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false
visible: (state.itemData.value.keyRight == 1 && state.keyInfo.value.lockSetting!.remoteUnlock == 1) ? false:true, visible: state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true:false,
child: CommonItem( child: CommonItem(
leftTitel: "远程开锁", leftTitel: "远程开锁".tr,
rightTitle: "", rightTitle: "",
isHaveRightWidget: true, isHaveRightWidget: true,
isHaveLine: true, isHaveLine: true,
@ -217,149 +217,6 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
); );
} }
//
// 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) { CupertinoSwitch _switch(isOn) {
return CupertinoSwitch( return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue, activeColor: CupertinoColors.activeBlue,

View File

@ -17,12 +17,12 @@ class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
var beginTimeTimestamp = DateTool().dateToTimestamp(state.beginTime.value, 1); var beginTimeTimestamp = DateTool().dateToTimestamp(state.beginTime.value, 1);
var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 1); var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 1);
if (beginTimeTimestamp > endTimeTimestamp || beginTimeTimestamp == endTimeTimestamp) { if (beginTimeTimestamp > endTimeTimestamp || beginTimeTimestamp == endTimeTimestamp) {
showToast("失效时间需大于生效时间"); showToast("失效时间需大于生效时间".tr);
return; return;
} }
if (endTimeTimestamp < DateTime.now().millisecondsSinceEpoch) { if (endTimeTimestamp < DateTime.now().millisecondsSinceEpoch) {
showToast("生效时间需大于当前时间"); showToast("生效时间需大于当前时间".tr);
return; return;
} }
KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate( KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate(
@ -38,7 +38,7 @@ class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
remoteEnable: state.remoteEnable!.value remoteEnable: state.remoteEnable!.value
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("修改成功", something: () { showToast("修改成功".tr, something: () {
eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(ElectronicKeyListRefreshUI());
eventBus.fire(AuthorizedAdminPageRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI());
Get.back(result: { Get.back(result: {

View File

@ -19,12 +19,12 @@ class ElectronicKeyPeriodValidityLogic extends BaseGetXController {
var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 0); var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 0);
if (starDateTimestamp >= endDateTimestamp) { if (starDateTimestamp >= endDateTimestamp) {
showToast("失效日期要大于生效日期"); showToast("失效日期要大于生效日期".tr);
return; return;
} }
if (starTimeTimestamp >= endTimeTimestamp) { if (starTimeTimestamp >= endTimeTimestamp) {
showToast("失效时间要大于生效时间"); showToast("失效时间要大于生效时间".tr);
return; return;
} }
KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate( KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate(
@ -39,7 +39,7 @@ class ElectronicKeyPeriodValidityLogic extends BaseGetXController {
isOnlyManageSelf: state.isOnlyManageSelf.value!, isOnlyManageSelf: state.isOnlyManageSelf.value!,
remoteEnable: state.remoteEnable.value!); remoteEnable: state.remoteEnable.value!);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("修改成功", something: () { showToast("修改成功".tr, something: () {
eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(ElectronicKeyListRefreshUI());
eventBus.fire(AuthorizedAdminPageRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI());
Get.back(result: { Get.back(result: {

View File

@ -29,7 +29,7 @@ class _ElectronicKeyPeriodValidityPageState extends State<ElectronicKeyPeriodVal
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: "修改有效期", barTitle: "修改有效期".tr,
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: ListView( body: ListView(
@ -63,7 +63,7 @@ class _ElectronicKeyPeriodValidityPageState extends State<ElectronicKeyPeriodVal
child: Column( child: Column(
children: [ children: [
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: "生效日期", leftTitel: "生效日期".tr,
rightTitle: state.starDate.value, rightTitle: state.starDate.value,
isHaveDirection: true, isHaveDirection: true,
isHaveLine: true, isHaveLine: true,
@ -74,7 +74,7 @@ class _ElectronicKeyPeriodValidityPageState extends State<ElectronicKeyPeriodVal
}); });
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: "失效日期", leftTitel: "失效日期".tr,
rightTitle: state.endDate.value, rightTitle: state.endDate.value,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {

View File

@ -2,6 +2,7 @@ import 'dart:async';
import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_easyloading/flutter_easyloading.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_entity.dart';
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_state.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_state.dart';
import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/network/api_repository.dart';
@ -201,7 +202,7 @@ class KeyOperationRecordLogic extends BaseGetXController {
cardId:state.cardId.value, cardId:state.cardId.value,
fingerprintId:state.fingerprintId.value); fingerprintId:state.fingerprintId.value);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print("操作记录列表成功:${entity.data?.itemList}"); // print("操作记录列表成功:${entity.data?.itemList}");
state.dataList.value = entity.data!.itemList!; state.dataList.value = entity.data!.itemList!;
} }
} }
@ -231,7 +232,7 @@ class KeyOperationRecordLogic extends BaseGetXController {
KeyOperationRecordEntity entity = KeyOperationRecordEntity entity =
await ApiRepository.to.clearOperationRecord('28'); await ApiRepository.to.clearOperationRecord('28');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("清除数据成功"); showToast("清除数据成功".tr);
} }
} }

View File

@ -42,7 +42,7 @@ class _KeyOperationRecordPageState extends State<KeyOperationRecordPage> {
int? operateDate = dataItem.operateDate; int? operateDate = dataItem.operateDate;
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(operateDate!); DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(operateDate!);
String operateDateStr = String operateDateStr =
'${dateStr.toLocal().toString().substring(0, 16)} 开锁'; '${dateStr.toLocal().toString().substring(0, 16)} ${"开锁".tr}';
return _electronicKeyItem(operateDateStr, () {}); return _electronicKeyItem(operateDateStr, () {});
}, },

View File

@ -1,5 +1,6 @@
import 'dart:async'; 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/electronicKeyList_state.dart';
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/network/api_repository.dart';
@ -42,8 +43,7 @@ class ElectronicKeyListLogic extends BaseGetXController {
ElectronicKeyListEntity entity = await ApiRepository.to ElectronicKeyListEntity entity = await ApiRepository.to
.resetElectronicKey(state.keyInfo.value.lockId.toString(), '0'); .resetElectronicKey(state.keyInfo.value.lockId.toString(), '0');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print("重置电子钥匙成功啦啦啦啦啦"); showToast("重置成功".tr, something: (){
showToast("重置成功", something: (){
pageNo = 1; pageNo = 1;
mockNetworkDataRequest(); mockNetworkDataRequest();
}); });
@ -58,8 +58,7 @@ class ElectronicKeyListLogic extends BaseGetXController {
includeUnderlings:includeUnderlings includeUnderlings:includeUnderlings
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print("删除电子钥匙成功"); showToast("删除成功".tr,something: (){
showToast("删除成功",something: (){
pageNo = 1; pageNo = 1;
mockNetworkDataRequest(); mockNetworkDataRequest();
}); });
@ -69,12 +68,12 @@ class ElectronicKeyListLogic extends BaseGetXController {
deletKeyLogic(ElectronicKeyListItem electronicKeyListItem){ deletKeyLogic(ElectronicKeyListItem electronicKeyListItem){
if(electronicKeyListItem.keyRight == 1){ if(electronicKeyListItem.keyRight == 1){
// //
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) { ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复'.tr, (isAllData) {
deleteKeyRequest(electronicKeyListItem.keyId.toString(), isAllData ? 1 : 0); deleteKeyRequest(electronicKeyListItem.keyId.toString(), isAllData ? 1 : 0);
}); });
}else{ }else{
// //
ShowTipView().showIosTipWithContentDialog("删除钥匙会在用户APP连网后生效",(){ ShowTipView().showIosTipWithContentDialog("删除钥匙会在用户APP连网后生效".tr,(){
deleteKeyRequest(electronicKeyListItem.keyId.toString(), 0); deleteKeyRequest(electronicKeyListItem.keyId.toString(), 0);
}); });
} }

View File

@ -1,5 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:flutter_slidable/flutter_slidable.dart';
@ -14,6 +13,7 @@ import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../app_settings/app_colors.dart';
import '../../../../tools/EasyRefreshTool.dart'; import '../../../../tools/EasyRefreshTool.dart';
import '../../../../tools/keySearchWidget.dart'; import '../../../../tools/keySearchWidget.dart';
import '../../../../tools/showTipView.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../translations/trans_lib.dart';
@ -64,9 +64,11 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
// //
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
_showDialog(); ShowTipView().showIosTipWithContentDialog("该锁的电子钥匙都将被删除".tr, (){
logic.resetElectronicKeyListRequest();
});
} else { } else {
logic.showToast("演示模式"); logic.showToast("演示模式".tr);
} }
}, },
), ),
@ -164,7 +166,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
}, },
backgroundColor: Colors.red, backgroundColor: Colors.red,
foregroundColor: Colors.white, foregroundColor: Colors.white,
label: '删除', label: '删除'.tr,
padding: EdgeInsets.only(left: 5.w, right: 5.w), padding: EdgeInsets.only(left: 5.w, right: 5.w),
), ),
], ],
@ -215,14 +217,14 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
'${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}'; '${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}';
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) { } 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) { } else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
// //
useDateStr = "单次"; useDateStr = "单次".tr;
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 单次'; useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} ${"单次".tr}';
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) { } else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
// //
useDateStr = '循环'; useDateStr = '循环'.tr;
} }
return useDateStr; return useDateStr;
@ -314,31 +316,4 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
); );
} }
//
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(() {});
},
),
],
);
},
);
}
} }

View File

@ -1,4 +1,5 @@
import 'package:get/get.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../../common/XSConstantMacro/XSConstantMacro.dart'; import '../../../../../common/XSConstantMacro/XSConstantMacro.dart';
import '../../../../../network/api_repository.dart'; import '../../../../../network/api_repository.dart';
@ -16,12 +17,12 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
getFailureDateTime = DateTool().dateToTimestamp(state.endTime.value, 1).toString(); getFailureDateTime = DateTool().dateToTimestamp(state.endTime.value, 1).toString();
} }
if(state.lockIdList.isEmpty){ if(state.lockIdList.isEmpty){
showToast("请选择锁"); showToast("请选择锁".tr);
return; return;
} }
if(state.receiverList.isEmpty){ if(state.receiverList.isEmpty){
showToast("请选择接收者"); showToast("请选择接收者".tr);
return; return;
} }
var entity = await ApiRepository.to.canSendKey( var entity = await ApiRepository.to.canSendKey(
@ -56,11 +57,11 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
endTime = "0"; endTime = "0";
if (startDate.isEmpty) { if (startDate.isEmpty) {
showToast("请选择开始时间"); showToast("请选择开始时间".tr);
return; return;
} }
if (endDate.isEmpty) { if (endDate.isEmpty) {
showToast("请选择结束时间"); showToast("请选择结束时间".tr);
return; return;
} }
@ -70,7 +71,7 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
// } // }
if (int.parse(startDate) >= int.parse(endDate)) { if (int.parse(startDate) >= int.parse(endDate)) {
showToast("失效时间要大于生效时间"); showToast("失效时间要大于生效时间".tr);
return; return;
} }
} }
@ -84,7 +85,7 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
case 3: case 3:
typeValue = XSConstantMacro.keyTypeLoop; typeValue = XSConstantMacro.keyTypeLoop;
if (state.beginTime.value.isEmpty) { if (state.beginTime.value.isEmpty) {
showToast("请选择有效期"); showToast("请选择有效期".tr);
return; return;
} }
startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString(); startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
@ -113,21 +114,7 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
remoteUnlockSwitch: state.isRemoteUnlock.value ? 1 : 2, remoteUnlockSwitch: state.isRemoteUnlock.value ? 1 : 2,
keyRight: 0 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) { if (entity.errorCode!.codeIsSuccessful) {
print('群发电子钥匙成功');
state.isSendSuccess.value = true; state.isSendSuccess.value = true;
resetData(); resetData();
} else { } else {

View File

@ -124,7 +124,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
"发送成功", "发送成功".tr,
style: TextStyle( style: TextStyle(
fontSize: 26.sp, fontSize: 26.sp,
color: Colors.black, color: Colors.black,
@ -139,7 +139,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
height: 20.h, height: 20.h,
), ),
SubmitBtn( SubmitBtn(
btnName: '完成', btnName: '完成'.tr,
onClick: () { onClick: () {
state.isSendSuccess.value = false; state.isSendSuccess.value = false;
Get.back(); Get.back();
@ -284,13 +284,13 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
state.endTime.value = result['endDate']; state.endTime.value = result['endDate'];
state.effectiveDateTime.value = result['starTime']; state.effectiveDateTime.value = result['starTime'];
state.failureDateTime.value = result['endTime']; 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( Obx(() => Visibility(
visible: state.weekdaysList.isNotEmpty ? true : false, visible: state.weekdaysList.isNotEmpty ? true : false,
child: CommonItem( child: CommonItem(
leftTitel: "有效日", leftTitel: "有效日".tr,
rightTitle: state.weekdaysList.value.join(",").toString(), rightTitle: state.weekdaysList.value.join(",").toString(),
isHaveDirection: true, isHaveDirection: true,
isHaveLine: true, isHaveLine: true,
@ -315,7 +315,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
Obx(() => Visibility( Obx(() => Visibility(
visible: state.effectiveDateTime.value.isNotEmpty, visible: state.effectiveDateTime.value.isNotEmpty,
child: CommonItem( child: CommonItem(
leftTitel: "有效时间", leftTitel: "有效时间".tr,
rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}", rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}",
isHaveDirection: true, isHaveDirection: true,
action: () async { action: () async {

View File

@ -19,7 +19,7 @@ class MassSendElectronicKeyState{
var type = ''.obs;// var type = ''.obs;//
var isSendSuccess = false.obs; var isSendSuccess = false.obs;
var countryName = '中国'.obs; var countryName = '中国'.tr.obs;
var countryCode = '86'.obs; var countryCode = '86'.obs;
var isCreateUser = false.obs; //1 0 var isCreateUser = false.obs; //1 0

View File

@ -35,7 +35,7 @@ class _LockUserListPageState extends State<LockUserListPage> {
appBar: AppBar( appBar: AppBar(
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
title: Text( title: Text(
'选择用户', '选择用户'.tr,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 28.sp, fontSize: 28.sp,
@ -78,7 +78,7 @@ class _LockUserListPageState extends State<LockUserListPage> {
child: Row( child: Row(
children: [ children: [
Text( Text(
'已选中${selectUserIdList.length}', '${"已选中".tr}${selectUserIdList.length}',
style: TextStyle(color: Colors.black, fontSize: 24.sp), style: TextStyle(color: Colors.black, fontSize: 24.sp),
), ),
Expanded( Expanded(
@ -89,7 +89,7 @@ class _LockUserListPageState extends State<LockUserListPage> {
width: 120.w, width: 120.w,
height: 60.h, height: 60.h,
child: SubmitBtn( child: SubmitBtn(
btnName: '确定', btnName: '确定'.tr,
onClick: () { onClick: () {
Map<String, dynamic> resultMap = {}; Map<String, dynamic> resultMap = {};
resultMap['lockUserList'] = selectDataList; resultMap['lockUserList'] = selectDataList;

View File

@ -60,7 +60,7 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
Container( Container(
width: ScreenUtil().screenWidth, width: ScreenUtil().screenWidth,
margin: EdgeInsets.only(left: 20.w), margin: EdgeInsets.only(left: 20.w),
child: Text('请选择要发送的锁', child: Text('请选择要发送的锁'.tr,
style: TextStyle( style: TextStyle(
color: AppColors.darkGrayTextColor, fontSize: 22.sp)), color: AppColors.darkGrayTextColor, fontSize: 22.sp)),
), ),
@ -69,7 +69,7 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
), ),
Expanded(child: _buildListView(context, lockGroupList)), Expanded(child: _buildListView(context, lockGroupList)),
SubmitBtn( SubmitBtn(
btnName: '确定', btnName: '确定'.tr,
onClick: () { onClick: () {
// print('得到lockid为$selectLockIdList '); // print('得到lockid为$selectLockIdList ');
Map<String, dynamic> resultMap = {}; Map<String, dynamic> resultMap = {};
@ -86,7 +86,7 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
// //
Future<List<GroupListItem>> mockNetworkDataRequest() async { Future<List<GroupListItem>> mockNetworkDataRequest() async {
MassSendLockGroupListEntity entity = await ApiRepository.to.lockGroupList('1'); MassSendLockGroupListEntity entity = await ApiRepository.to.lockGroupList('2');
List<GroupListItem> dataList = []; List<GroupListItem> dataList = [];
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
if (entity.data != null) { if (entity.data != null) {
@ -137,7 +137,6 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
} }
} }
setState(() {}); setState(() {});
print('选中了么0');
}, },
typeImgList: const [], typeImgList: const [],
groupItem: itemData, groupItem: itemData,

View File

@ -16,7 +16,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
// //
Future<void> sendElectronicKeyRequest() async { Future<void> sendElectronicKeyRequest() async {
if (state.emailOrPhoneController.text.isEmpty) { if (state.emailOrPhoneController.text.isEmpty) {
showToast("请输入接收者账号"); showToast("请输入接收者账号".tr);
return; return;
} }
// //
@ -42,11 +42,11 @@ class SendElectronicKeyLogic extends BaseGetXController {
endTime = "0"; endTime = "0";
if (startDate.isEmpty) { if (startDate.isEmpty) {
showToast("请选择开始时间"); showToast("请选择开始时间".tr);
return; return;
} }
if (endDate.isEmpty) { if (endDate.isEmpty) {
showToast("请选择结束时间"); showToast("请选择结束时间".tr);
return; return;
} }
@ -56,7 +56,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
// } // }
if (int.parse(startDate) >= int.parse(endDate)) { if (int.parse(startDate) >= int.parse(endDate)) {
showToast("失效时间要大于生效时间"); showToast("失效时间要大于生效时间".tr);
return; return;
} }
} }
@ -70,7 +70,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
case 3: case 3:
typeValue = XSConstantMacro.keyTypeLoop; typeValue = XSConstantMacro.keyTypeLoop;
if (state.beginTime.value.isEmpty) { if (state.beginTime.value.isEmpty) {
showToast("请选择有效期"); showToast("请选择有效期".tr);
return; return;
} }
startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString(); startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
@ -107,7 +107,6 @@ class SendElectronicKeyLogic extends BaseGetXController {
endTime: int.parse(endTime), endTime: int.parse(endTime),
isOnlyManageSelf: 0); isOnlyManageSelf: 0);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print('发送电子钥匙成功');
state.isSendSuccess.value = true; state.isSendSuccess.value = true;
state.sendSucceedType.value = int.parse(state.type.value); state.sendSucceedType.value = int.parse(state.type.value);
resetData(); resetData();
@ -144,7 +143,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
context: widgetContext, context: widgetContext,
builder: (context) { builder: (context) {
return CupertinoAlertDialog( return CupertinoAlertDialog(
title: const Text('接收者号码未注册,请重新发送'), title: Text('接收者号码未注册,请重新发送'.tr),
actions: [ actions: [
CupertinoDialogAction( CupertinoDialogAction(
child: Text( child: Text(
@ -185,7 +184,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
context: widgetContext, context: widgetContext,
builder: (context) { builder: (context) {
return CupertinoAlertDialog( return CupertinoAlertDialog(
title: Text('是否发送电子钥匙给未注册账号\n${state.emailOrPhoneController.text}'), title: Text('${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}'),
actions: [ actions: [
CupertinoDialogAction( CupertinoDialogAction(
child: Text( child: Text(

View File

@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -202,7 +203,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
rightTitle: "", rightTitle: "",
isTipsImg: true, isTipsImg: true,
tipsImgAction: () { tipsImgAction: () {
ShowTipView().showSureAlertDialog("人脸实名认证指的是用户在使用手机APP开锁时需要先进行本人人脸验证验证通过才能开锁。"); ShowTipView().showSureAlertDialog("人脸实名认证指的是用户在使用手机APP开锁时需要先进行本人人脸验证验证通过才能开锁。".tr);
}, },
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: SizedBox( rightWidget: SizedBox(
@ -244,7 +245,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
Obx(() => Visibility( Obx(() => Visibility(
visible: state.weekdaysList.isNotEmpty ? true : false, visible: state.weekdaysList.isNotEmpty ? true : false,
child: CommonItem( child: CommonItem(
leftTitel: "有效日", leftTitel: "有效日".tr,
rightTitle: state.weekdaysList.value.join(",").toString(), rightTitle: state.weekdaysList.value.join(",").toString(),
isHaveDirection: true, isHaveDirection: true,
isHaveLine: true, isHaveLine: true,
@ -269,7 +270,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
Obx(() => Visibility( Obx(() => Visibility(
visible: state.effectiveDateTime.value.isNotEmpty, visible: state.effectiveDateTime.value.isNotEmpty,
child: CommonItem( child: CommonItem(
leftTitel: "有效时间", leftTitel: "有效时间".tr,
rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}", rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}",
isHaveDirection: true, isHaveDirection: true,
action: () async { action: () async {
@ -321,7 +322,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
setState(() {}); setState(() {});
} else { } else {
// //
logic.showToast("演示模式"); logic.showToast("演示模式".tr);
} }
}), }),
Container( Container(
@ -337,7 +338,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
Navigator.pushNamed( Navigator.pushNamed(
context, Routers.massSendElectronicKeyManagePage); context, Routers.massSendElectronicKeyManagePage);
} else { } else {
logic.showToast("演示模式"); logic.showToast("演示模式".tr);
} }
}, },
child: Text( child: Text(
@ -377,7 +378,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
"发送成功", "发送成功".tr,
style: TextStyle( style: TextStyle(
fontSize: 26.sp, fontSize: 26.sp,
color: Colors.black, color: Colors.black,
@ -392,7 +393,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
height: 20.h, height: 20.h,
), ),
SubmitBtn( SubmitBtn(
btnName: '完成', btnName: '完成'.tr,
onClick: () { onClick: () {
state.isSendSuccess.value = false; state.isSendSuccess.value = false;
logic.resetData(); logic.resetData();
@ -401,7 +402,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
height: 10.h, height: 10.h,
), ),
OutLineBtn( OutLineBtn(
btnName: '分享', btnName: '分享'.tr,
onClick: () { onClick: () {
// Navigator.pushNamed(context, Routers.sendEmailNotificationPage); // Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
_openModalBottomSheet(); _openModalBottomSheet();
@ -444,8 +445,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
roomStatus: 1, roomStatus: 1,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print("标记为已入住成功啦啦啦啦啦"); logic.showToast("标记成功".tr);
logic.showToast("标记成功");
} }
} }
@ -605,7 +605,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
overlayColor: overlayColor:
MaterialStateProperty.all<Color>(Colors.white)), MaterialStateProperty.all<Color>(Colors.white)),
child: Text( child: Text(
'取消', '取消'.tr,
style: TextStyle( style: TextStyle(
color: Colors.black, fontSize: ScreenUtil().setSp(24)), color: Colors.black, fontSize: ScreenUtil().setSp(24)),
), ),
@ -621,10 +621,10 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
List<Widget> initBottomSheetList() { List<Widget> initBottomSheetList() {
List<Widget> widgetList = []; List<Widget> widgetList = [];
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友', 0)); widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友'.tr, 0));
widgetList.add(buildCenter3('images/icon_message.png', '短信', 1)); widgetList.add(buildCenter3('images/icon_message.png', '短信'.tr, 1));
widgetList.add(buildCenter3('images/icon_email.png', '邮件', 2)); widgetList.add(buildCenter3('images/icon_email.png', '邮件'.tr, 2));
widgetList.add(buildCenter3('images/icon_more.png', '更多', 3)); widgetList.add(buildCenter3('images/icon_more.png', '更多'.tr, 3));
return widgetList; return widgetList;
} }
@ -666,14 +666,14 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
case 0: case 0:
// //
{ {
String pwdShareStr = '您好,您的电子钥匙生成成功'; String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr); NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
} }
break; break;
case 1: case 1:
// //
{ {
String pwdShareStr = '您好,您的电子钥匙生成成功'; String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr); NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
} }
break; break;
@ -686,7 +686,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
case 3: case 3:
// //
{ {
String pwdShareStr = '您好,您的电子钥匙生成成功'; String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr); NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
} }
break; break;

View File

@ -24,7 +24,7 @@ class SendElectronicKeyState {
var type = ''.obs;// var type = ''.obs;//
var isSendSuccess = false.obs; var isSendSuccess = false.obs;
var countryName = '中国'.obs; var countryName = '中国'.tr.obs;
var countryCode = '86'.obs; var countryCode = '86'.obs;
var isCreateUser = false.obs; //1 0 var isCreateUser = false.obs; //1 0

View File

@ -251,7 +251,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage> {
height: 20.h, height: 20.h,
), ),
SubmitBtn( SubmitBtn(
btnName: '完成', btnName: '完成'.tr,
fontSize: 28.sp, fontSize: 28.sp,
borderRadius: 20.w, borderRadius: 20.w,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),

View File

@ -49,7 +49,7 @@ class AddFingerprintTypeLogic extends BaseGetXController{
} }
} else if (state.selectType.value == "2") { } else if (state.selectType.value == "2") {
if (state.beginTime.value.isEmpty) { if (state.beginTime.value.isEmpty) {
showToast("请选择有效期"); showToast("请选择有效期".tr);
return; return;
} }
startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString(); startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString();

View File

@ -325,7 +325,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
height: 20.h, height: 20.h,
), ),
SubmitBtn( SubmitBtn(
btnName: '完成', btnName: '完成'.tr,
fontSize: 28.sp, fontSize: 28.sp,
borderRadius: 20.w, borderRadius: 20.w,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),

View File

@ -34,7 +34,7 @@ class LockDetailLogic extends BaseGetXController {
void initReplySubscription() { void initReplySubscription() {
state.replySubscription = state.replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((reply) async { EventBusManager().eventBus!.on<Reply>().listen((reply) async {
// Get.log("锁详情收到了蓝牙解析消息 reply:${reply.commandType}"); Get.log("锁详情收到了蓝牙解析消息 reply:${reply.commandType}");
// //
if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) { if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) {
_replyOpenLock(reply); _replyOpenLock(reply);

View File

@ -15,7 +15,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
state.itemData.value.keyboardPwdId.toString(), state.itemData.value.keyboardPwdId.toString(),
1); 1);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("删除成功", something: (){ showToast("删除成功".tr, something: (){
Get.back(result: "deletScuess"); Get.back(result: "deletScuess");
}); });
} }
@ -37,7 +37,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
keyboardPwdType: state.itemData.value.keyboardPwdType!); keyboardPwdType: state.itemData.value.keyboardPwdType!);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
Get.back(); Get.back();
showToast("修改成功", something: (){ showToast("修改成功".tr, something: (){
if(changType == 1){ if(changType == 1){
// //
state.keyboardPwdName.value = state.inputNameController.text; state.keyboardPwdName.value = state.inputNameController.text;
@ -45,7 +45,6 @@ class PasswordKeyDetailLogic extends BaseGetXController {
// //
state.keyboardPwd.value = state.inputPwdController.text; 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()); eventBus.fire(GetPasswordListRefreshUI());
}); });
} }

View File

@ -87,7 +87,7 @@ class PasswordKeyListLogic extends BaseGetXController {
break; break;
case 4: case 4:
// 4 使使 // 4 使使
useDateStr = '${startDateStr.toLocal().toString().substring(0, 16)} ${"清空码".tr}'; useDateStr = '${endDateStr.toLocal().toString().substring(0, 16)} ${"清空码".tr}';
break; break;
case 5: case 5:
// 5 // 5
@ -97,7 +97,7 @@ class PasswordKeyListLogic extends BaseGetXController {
case 6: case 6:
// 6 // 6
useDateStr = useDateStr =
'${endDateStr.toLocal().toString().substring(0, 16)} ${"".tr}$starHour:00-$endHour:00 ${"循环"}'; '${endDateStr.toLocal().toString().substring(0, 16)} ${"".tr}$starHour:00-$endHour:00 ${"循环"}';
break; break;
case 7: case 7:
// 7 // 7
@ -137,7 +137,7 @@ class PasswordKeyListLogic extends BaseGetXController {
case 14: case 14:
// 14 // 14
useDateStr = 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; break;
default: default:

View File

@ -1,4 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:flutter_slidable/flutter_slidable.dart';
@ -11,7 +11,6 @@ import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../app_settings/app_colors.dart';
import '../../../../tools/EasyRefreshTool.dart'; import '../../../../tools/EasyRefreshTool.dart';
import '../../../../tools/keySearchWidget.dart'; import '../../../../tools/keySearchWidget.dart';
import '../../../../tools/showIosTipView.dart';
import '../../../../tools/showTipView.dart'; import '../../../../tools/showTipView.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
@ -125,10 +124,8 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
itemCount: state.itemDataList.value.length, itemCount: state.itemDataList.value.length,
itemBuilder: (c, index) { itemBuilder: (c, index) {
PasswordKeyListItem passwordKeyListItem = state.itemDataList.value[index]; PasswordKeyListItem passwordKeyListItem = state.itemDataList.value[index];
String useDateStr = ''; //使 String useDateStr = logic.getUseDateStr(passwordKeyListItem);// 使
//使
useDateStr = logic.getUseDateStr(passwordKeyListItem);
return Slidable( return Slidable(
key:ValueKey(passwordKeyListItem.keyboardPwdId), key:ValueKey(passwordKeyListItem.keyboardPwdId),
endActionPane: ActionPane( endActionPane: ActionPane(

View File

@ -1,3 +1,5 @@
// ignore_for_file: slash_for_doc_comments
import 'dart:async'; import 'dart:async';
import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:flutter_blue_plus/flutter_blue_plus.dart';
@ -22,20 +24,20 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
/// ///
/** /**
1 6使 1 6使
2 24使 2 24使
3 24使 3 24使
4 使使 4 使使
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
*/ */
// //
Future<void> getKeyboardPwdRequest() async { Future<void> getKeyboardPwdRequest() async {
@ -45,14 +47,14 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
String getKeyType = state.widgetType.value.toString(); String getKeyType = state.widgetType.value.toString();
if (state.nameController.text.isEmpty) { if (state.nameController.text.isEmpty) {
showToast("请输入姓名"); showToast("请输入姓名".tr);
return; return;
} }
// //
if (state.widgetType.value == 4) { if (state.widgetType.value == 4) {
if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) { if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
showToast("生效时间不能小于当前时间"); showToast("生效时间不能小于当前时间".tr);
return; return;
} }
} }
@ -62,12 +64,12 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
} else if (state.widgetType.value == 1) { } else if (state.widgetType.value == 1) {
// //
if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) { if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
showToast("生效时间不能小于当前时间"); showToast("生效时间不能小于当前时间".tr);
return; return;
} }
if (startDate >= endDate) { if (startDate >= endDate) {
showToast("失效时间要大于生效时间"); showToast("失效时间要大于生效时间".tr);
return; return;
} }
getKeyType = '3'; getKeyType = '3';
@ -80,7 +82,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
// //
// //
if (endDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) { if (endDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
showToast("结束时间不能小于当前时间"); showToast("结束时间不能小于当前时间".tr);
return; return;
} }
@ -119,7 +121,6 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
endHours: state.loopEndHours.value, endHours: state.loopEndHours.value,
isCoerced: 1); isCoerced: 1);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print('获取密码成功');
state.isSendSuccess.value = true; state.isSendSuccess.value = true;
state.sendSucceedType.value = state.widgetType.value; state.sendSucceedType.value = state.widgetType.value;
state.pwdNameStr = state.nameController.text; state.pwdNameStr = state.nameController.text;
@ -155,7 +156,6 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
getFailureDateTime, getFailureDateTime,
'1'); '1');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print('获取密码成功');
state.isSendSuccess.value = true; state.isSendSuccess.value = true;
state.sendSucceedType.value = state.widgetType.value; state.sendSucceedType.value = state.widgetType.value;
state.pwdNameStr = state.nameController.text; state.pwdNameStr = state.nameController.text;
@ -170,6 +170,26 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
} }
} }
Future<void> 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 DateTime getStartDateTime;
// //
late StreamSubscription<Reply> _replySubscription; late StreamSubscription<Reply> _replySubscription;
@ -220,17 +240,17 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
case 0x07: case 0x07:
// //
print("${reply.commandType!.typeValue} 用户无权限"); print("${reply.commandType!.typeValue} 用户无权限");
cancelBlueConnetctToastTimer();
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType!.typeValue} 权限校验错误"); print("${reply.commandType!.typeValue} 权限校验错误");
cancelBlueConnetctToastTimer();
break; break;
default: default:
// //
print("${reply.commandType!.typeValue} 失败"); print("${reply.commandType!.typeValue} 失败");
cancelBlueConnetctToastTimer();
break; break;
} }
} }
@ -243,16 +263,6 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
// //
Future<void> senderCustomPasswords() async { Future<void> 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 startDate = DateTool().dateToTimestamp(state.beginTime.value, 1);
var endDate = DateTool().dateToTimestamp(state.endTime.value, 1); var endDate = DateTool().dateToTimestamp(state.endTime.value, 1);
// //

View File

@ -363,7 +363,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
if (isDemoMode == false) { if (isDemoMode == false) {
// //
if (state.widgetType.value == 3) { if (state.widgetType.value == 3) {
logic.senderCustomPasswords(); logic.checkKeyboardpwdNameRequest();
} else { } else {
logic.getKeyboardPwdRequest(); logic.getKeyboardPwdRequest();
} }
@ -417,7 +417,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
height: 20.h, height: 20.h,
), ),
SubmitBtn( SubmitBtn(
btnName: '完成', btnName: '完成'.tr,
onClick: () { onClick: () {
state.isSendSuccess.value = false; state.isSendSuccess.value = false;
state.nameController.text = ""; state.nameController.text = "";
@ -428,7 +428,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
height: 10.h, height: 10.h,
), ),
OutLineBtn( OutLineBtn(
btnName: '分享', btnName: '分享'.tr,
onClick: () { onClick: () {
_openModalBottomSheet(); _openModalBottomSheet();
}, },
@ -547,7 +547,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
overlayColor: overlayColor:
MaterialStateProperty.all<Color>(Colors.white)), MaterialStateProperty.all<Color>(Colors.white)),
child: Text( child: Text(
'取消', '取消'.tr,
style: TextStyle( style: TextStyle(
color: Colors.black, fontSize: ScreenUtil().setSp(24)), color: Colors.black, fontSize: ScreenUtil().setSp(24)),
), ),
@ -563,10 +563,10 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
List<Widget> initBottomSheetList() { List<Widget> initBottomSheetList() {
List<Widget> widgetList = []; List<Widget> widgetList = [];
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友', 0)); widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友'.tr, 0));
widgetList.add(buildCenter3('images/icon_message.png', '短信', 1)); widgetList.add(buildCenter3('images/icon_message.png', '短信'.tr, 1));
widgetList.add(buildCenter3('images/icon_email.png', '邮件', 2)); widgetList.add(buildCenter3('images/icon_email.png', '邮件'.tr, 2));
widgetList.add(buildCenter3('images/icon_more.png', '更多', 3)); widgetList.add(buildCenter3('images/icon_more.png', '更多'.tr, 3));
return widgetList; return widgetList;
} }

View File

@ -1,4 +1,4 @@
import 'package:date_format/date_format.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart'; import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';

View File

@ -228,7 +228,7 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage> {
height: 20.h, height: 20.h,
), ),
SubmitBtn( SubmitBtn(
btnName: '完成', btnName: '完成'.tr,
fontSize: 28.sp, fontSize: 28.sp,
borderRadius: 20.w, borderRadius: 20.w,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),

View File

@ -72,7 +72,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
} }
switch (status) { switch (status) {
case PermissionStatus.denied: case PermissionStatus.denied:
print("拒绝"); // print("拒绝");
break; break;
case PermissionStatus.granted: case PermissionStatus.granted:
if(Platform.isIOS){ if(Platform.isIOS){
@ -84,16 +84,16 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
} }
break; break;
case PermissionStatus.limited: case PermissionStatus.limited:
print("限制"); // print("限制");
break; break;
case PermissionStatus.permanentlyDenied: case PermissionStatus.permanentlyDenied:
print("永久的否认"); // print("永久的否认");
break; break;
case PermissionStatus.provisional: case PermissionStatus.provisional:
print("临时"); // print("临时");
break; break;
default: default:
print("其他状态"); // print("其他状态");
// requestLocation(); // requestLocation();
break; break;
} }
@ -101,7 +101,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
Future<void> requestAndroidLocation() async { Future<void> requestAndroidLocation() async {
location.onLocationChanged().listen((event) { location.onLocationChanged().listen((event) {
print("listenLocationChanged$event"); // print("listenLocationChanged$event");
// EasyLoading.dismiss(); // EasyLoading.dismiss();
if (event.isNotEmpty) { if (event.isNotEmpty) {
setState(() { setState(() {
@ -116,7 +116,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
location = AMapFlutterLocation() location = AMapFlutterLocation()
..setLocationOption(AMapLocationOption()) ..setLocationOption(AMapLocationOption())
..onLocationChanged().listen((event) { ..onLocationChanged().listen((event) {
print("listenLocationChanged$event"); // print("listenLocationChanged$event");
// EasyLoading.dismiss(); // EasyLoading.dismiss();
if (event.isNotEmpty) { if (event.isNotEmpty) {
setState(() { setState(() {
@ -163,7 +163,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text("地理位置", style: TextStyle(fontSize: 50.sp)), Text("地理位置".tr, style: TextStyle(fontSize: 50.sp)),
], ],
), ),
), ),
@ -202,12 +202,11 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
), ),
Container( Container(
// color: Colors.red, // color: Colors.red,
height: 45.h,
margin: EdgeInsets.only(left: 25.w, top: 20.h, right: 25.w), margin: EdgeInsets.only(left: 25.w, top: 20.h, right: 25.w),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text("检查以确保以下地址是正确的", style: TextStyle(fontSize: 24.sp)), Flexible(child: Text("检查以确保以下地址是正确的".tr, style: TextStyle(fontSize: 24.sp))),
], ],
), ),
), ),
@ -233,7 +232,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
], ],
) : SizedBox( ) : SizedBox(
height: 1.sw/5*4 + 65.h*2, height: 1.sw/5*4 + 65.h*2,
child: const Center(child: Text('地图加载中,请稍候。。。'))) child: Center(child: Text('地图加载中,请稍候。。。'.tr)))
, ,
), ),
SizedBox(height:200.h), SizedBox(height:200.h),
@ -242,7 +241,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
children: [ children: [
TextButton( TextButton(
child: Text( child: Text(
"跳过", "跳过".tr,
style: TextStyle(color: Colors.black, fontSize: 24.sp), style: TextStyle(color: Colors.black, fontSize: 24.sp),
), ),
onPressed: () { onPressed: () {
@ -263,7 +262,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
), ),
onPressed: () { onPressed: () {
if(addressInfo!.isEmpty){ if(addressInfo!.isEmpty){
logic.showToast("还未获取到位置信息哦,请耐心等待一下!"); logic.showToast("还未获取到位置信息哦,请耐心等待一下!".tr);
return; return;
} }
Get.toNamed(Routers.saveLockPage, arguments: { Get.toNamed(Routers.saveLockPage, arguments: {

View File

@ -32,11 +32,17 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
// crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox(height: 80.h,), SizedBox(height: 80.h,),
Row( Container(
mainAxisAlignment: MainAxisAlignment.center, margin: EdgeInsets.only(left: 50.w, right: 50.w),
children: [ width: 1.sw,
Text(TranslationLoader.lanKeys!.addSuccessfullyPleaseRename!.tr, style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500),), 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,), SizedBox(height: 80.h,),
Container( Container(
@ -54,7 +60,7 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
], ],
// style:TextStyle(height: 1.1, fontSize: 36.sp, fontWeight: FontWeight.w400, color:AppColors.mainColor), // style:TextStyle(height: 1.1, fontSize: 36.sp, fontWeight: FontWeight.w400, color:AppColors.mainColor),
decoration: InputDecoration( decoration: InputDecoration(
hintText: '请填写信息', hintText: '请填写信息'.tr,
hintStyle: TextStyle( hintStyle: TextStyle(
// height: 1.1, // height: 1.1,
fontSize: 24.sp, fontSize: 24.sp,

View File

@ -33,6 +33,8 @@ class StarLockMineLogic extends BaseGetXController {
state.userNickName.value = (await Storage.getNickname())!; state.userNickName.value = (await Storage.getNickname())!;
state.userMobile.value = (await Storage.getMobile())! ?? ''; state.userMobile.value = (await Storage.getMobile())! ?? '';
state.userEmail.value = (await Storage.getEmail())!; 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}"); Get.log("userNickName:${state.userNickName.value} userMobile:${state.userMobile.value} userEmail:${state.userEmail.value}");
} }
} }

View File

@ -6,6 +6,7 @@ import 'package:star_lock/flavors.dart';
import '../../appRouters.dart'; import '../../appRouters.dart';
import '../../app_settings/app_colors.dart'; import '../../app_settings/app_colors.dart';
import '../../baseWidget.dart'; import '../../baseWidget.dart';
import '../../tools/customNetworkImage.dart';
import '../../tools/submitBtn.dart'; import '../../tools/submitBtn.dart';
import '../../translations/trans_lib.dart'; import '../../translations/trans_lib.dart';
import 'starLockMine_logic.dart'; import 'starLockMine_logic.dart';
@ -71,17 +72,21 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
child: Container( child: Container(
width: 105.w, width: 105.w,
height: 105.w, height: 105.w,
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: // borderRadius:
BorderRadius.all(Radius.circular(52.5.w)), // 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 ? // state.headUrl().isNotEmpty ?
// Image(image: NetworkImage(state.loginData.value.data!.headUrl!)) : // Image(image: NetworkImage(state.loginData.value.data!.headUrl!)) :
Image.asset( // Image.asset(
'images/mine/icon_mine_main_defaultAvatar.png', // 'images/mine/icon_mine_main_defaultAvatar.png',
width: 60.w, // width: 60.w,
height: 60.w)), // height: 60.w)
),
), ),
SizedBox( SizedBox(
height: 20.h, height: 20.h,

View File

@ -6,6 +6,6 @@ class StarLockMineState {
var userNickName = "".obs; var userNickName = "".obs;
var userMobile = "".obs; var userMobile = "".obs;
var userEmail = "".obs; var userEmail = "".obs;
var userHeadUrl = "".obs;
void onClose() {} void onClose() {}
} }

View File

@ -13,7 +13,6 @@ class MinePersonInfoLogic extends GetConnect {
Future<void> getUserInfoRequest() async { Future<void> getUserInfoRequest() async {
MinePersonInfoEntity entity = await ApiRepository.to.getUserInfo(""); MinePersonInfoEntity entity = await ApiRepository.to.getUserInfo("");
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print('到了这里么');
state.mineInfoData.value = entity.data!; state.mineInfoData.value = entity.data!;
} }
} }
@ -33,9 +32,7 @@ class MinePersonInfoLogic extends GetConnect {
} }
// //
void uploadFile( void uploadFile(MinePersonGetUploadFileInfoEntity minePersonGetUploadFileInfoEntity) async {
MinePersonGetUploadFileInfoEntity
minePersonGetUploadFileInfoEntity) async {
// String json = JsonDecoder(minePersonGetUploadFileInfoEntity.data!.formData!); // String json = JsonDecoder(minePersonGetUploadFileInfoEntity.data!.formData!);
// var formData = FormData(); // var formData = FormData();
@ -45,10 +42,8 @@ class MinePersonInfoLogic extends GetConnect {
// MultipartFile(state.image!.path, filename: 'b'), // MultipartFile(state.image!.path, filename: 'b'),
// )); // ));
Map<String, dynamic> user = Map<String, dynamic> user = minePersonGetUploadFileInfoEntity.data!.formData!;
minePersonGetUploadFileInfoEntity.data!.formData!; user[minePersonGetUploadFileInfoEntity.data!.fileField!] = state.image!.path;
user[minePersonGetUploadFileInfoEntity.data!.fileField!] =
state.image!.path;
final form = FormData(user); final form = FormData(user);
var entity = await ApiRepository.to.uploadFile( var entity = await ApiRepository.to.uploadFile(
url: minePersonGetUploadFileInfoEntity.data!.uploadUrl!, body: form); url: minePersonGetUploadFileInfoEntity.data!.uploadUrl!, body: form);
@ -93,7 +88,6 @@ class MinePersonInfoLogic extends GetConnect {
// TODO: implement onInit // TODO: implement onInit
super.onInit(); super.onInit();
getUserInfoRequest();
} }
@override @override

View File

@ -13,6 +13,7 @@ import 'package:star_lock/tools/custom_bottom_sheet.dart';
import 'package:star_lock/tools/storage.dart'; import 'package:star_lock/tools/storage.dart';
import '../../../appRouters.dart'; import '../../../appRouters.dart';
import '../../../tools/commonItem.dart'; import '../../../tools/commonItem.dart';
import '../../../tools/customNetworkImage.dart';
import '../../../tools/titleAppBar.dart'; import '../../../tools/titleAppBar.dart';
import '../../../translations/trans_lib.dart'; import '../../../translations/trans_lib.dart';
@ -23,8 +24,7 @@ class MinePersonInfoPage extends StatefulWidget {
State<MinePersonInfoPage> createState() => _MinePersonInfoPageState(); State<MinePersonInfoPage> createState() => _MinePersonInfoPageState();
} }
class _MinePersonInfoPageState extends State<MinePersonInfoPage> class _MinePersonInfoPageState extends State<MinePersonInfoPage> with WidgetsBindingObserver {
with WidgetsBindingObserver {
final logic = Get.put(MinePersonInfoLogic()); final logic = Get.put(MinePersonInfoLogic());
final state = Get.find<MinePersonInfoLogic>().state; final state = Get.find<MinePersonInfoLogic>().state;
@ -70,26 +70,33 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: ClipOval( rightWidget:
child: state.image != null Container(
? Image.file( // color: Colors.orange,
File(state.image!.path), child: ClipRRect(
width: 72.w, borderRadius: BorderRadius.circular(36.w),
height: 72.w, child: CustomNetworkImage(url:"https://ui-avatars.com/api/?name=%E6%98%B5&color=7F9CF5&background=EBF4FF", width:72.w, height:72.w),
fit: BoxFit.fill, ),
)
: Image.asset(
'images/controls_user.png',
width: 72.w,
height: 72.w,
fit: BoxFit.fill,
),
), ),
// 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 { action: () async {
// //
if (Platform.isAndroid) { if (Platform.isAndroid) {
AppFirstEnterHandle() AppFirstEnterHandle().getAppFirstEnter(context, isAgreeCamera);
.getAppFirstEnter(context, isAgreeCamera);
var getFlag = await Storage.getString(isAgreeCamera); var getFlag = await Storage.getString(isAgreeCamera);
if (getFlag == isAgreeCamera) { if (getFlag == isAgreeCamera) {
_openModalBottomSheet(); _openModalBottomSheet();
@ -271,8 +278,7 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
Future _openModalBottomSheet() async { Future _openModalBottomSheet() async {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(borderRadius: BorderRadiusDirectional.circular(10)),
borderRadius: BorderRadiusDirectional.circular(10)),
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertBottomWidget( return AlertBottomWidget(
topTitle: '', topTitle: '',

View File

@ -14,6 +14,12 @@ class AppUnlockNeedMobileNetworkingLockLogic extends BaseGetXController{
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
dataList = entity.data!.list!; dataList = entity.data!.list!;
state.lockItemList.value = dataList; 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; return dataList;
} }

View File

@ -24,7 +24,7 @@ class AddAuthorizedAdministratorLogic extends BaseGetXController {
} }
if(state.lockIdList.isEmpty){ if(state.lockIdList.isEmpty){
showToast("请选择锁"); showToast("请选择锁".tr);
return; return;
} }

View File

@ -399,7 +399,7 @@ class _AddAuthorizedAdministratorPageState extends State<AddAuthorizedAdministra
height: 20.h, height: 20.h,
), ),
SubmitBtn( SubmitBtn(
btnName: '完成', btnName: '完成'.tr,
onClick: () { onClick: () {
state.isSendSuccess.value = false; state.isSendSuccess.value = false;
Navigator.pop(context, true); Navigator.pop(context, true);

View File

@ -12,7 +12,7 @@ class GroupEditLockLogic extends BaseGetXController {
// //
Future<void> lockGroupAddLock(List lockIds) async { Future<void> lockGroupAddLock(List lockIds) async {
if(lockIds.isEmpty){ if(lockIds.isEmpty){
showToast("请选择锁"); showToast("请选择锁".tr);
return; return;
} }
var entity = await ApiRepository.to.lockGroupAddLock( var entity = await ApiRepository.to.lockGroupAddLock(
@ -29,7 +29,7 @@ class GroupEditLockLogic extends BaseGetXController {
// //
Future<void> lockGroupDeletLock(List lockIds) async { Future<void> lockGroupDeletLock(List lockIds) async {
if(lockIds.isEmpty){ if(lockIds.isEmpty){
showToast("请选择锁"); showToast("请选择锁".tr);
return; return;
} }
var entity = await ApiRepository.to.lockGroupDeletLock(lockIds: lockIds); var entity = await ApiRepository.to.lockGroupDeletLock(lockIds: lockIds);

View File

@ -12,7 +12,7 @@ class LockGroupListLogic extends BaseGetXController {
// //
void mockNetworkDataRequest() async { void mockNetworkDataRequest() async {
var entity = await ApiRepository.to.lockGroupList('1'); var entity = await ApiRepository.to.lockGroupList('0');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
if (entity.data != null) { if (entity.data != null) {
state.lockNum = 0; state.lockNum = 0;

View File

@ -146,7 +146,7 @@ class _SelectGetewayListPageState extends State<SelectGetewayListPage> {
} }
} }
if(isCanNext == false){ if(isCanNext == false){
logic.showToast("请选择锁"); logic.showToast("请选择锁".tr);
return; return;
} }
var data = await Get.toNamed(Routers.recipientInformationPage, arguments: { var data = await Get.toNamed(Routers.recipientInformationPage, arguments: {

View File

@ -151,7 +151,7 @@ class _TransferSmartLockPageState extends State<TransferSmartLockPage> {
} }
} }
if(isCanNext == false){ if(isCanNext == false){
logic.showToast("请选择锁"); logic.showToast("请选择锁".tr);
return; return;
} }
var data = await Get.toNamed(Routers.recipientInformationPage, arguments: { var data = await Get.toNamed(Routers.recipientInformationPage, arguments: {

View File

@ -45,6 +45,7 @@ abstract class Api {
final String passwordKeyGetURL = '/keyboardPwd/get'; // final String passwordKeyGetURL = '/keyboardPwd/get'; //
final String passwordKeyAddURL = '/keyboardPwd/add'; // final String passwordKeyAddURL = '/keyboardPwd/add'; //
final String passwordKeyCheckKeyboardpwdNameURL = '/keyboardPwd/checkKeyboardpwdName'; //
final String updatePasswordKeyURL = '/keyboardPwd/update'; // final String updatePasswordKeyURL = '/keyboardPwd/update'; //
final String clearOperationRecordURL = '/lockRecords/clear'; // final String clearOperationRecordURL = '/lockRecords/clear'; //
final String addlockGroupURL = '/keyGroup/add'; // final String addlockGroupURL = '/keyGroup/add'; //

View File

@ -451,6 +451,20 @@ class ApiProvider extends BaseProvider {
'addType': addType, 'addType': addType,
})); }));
//
Future<Response> checkKeyboardpwdName(
String lockId,
String keyboardPwdName,
String keyboardPwd
) =>
post(
passwordKeyCheckKeyboardpwdNameURL.toUrl,
jsonEncode({
'lockId': lockId,
'keyboardPwdName': keyboardPwdName,
'keyboardPwd': keyboardPwd,
}));
Future<Response> updateKeyboardPwd( Future<Response> updateKeyboardPwd(
int lockId, int lockId,
String keyboardPwdId, String keyboardPwdId,

View File

@ -450,6 +450,18 @@ class ApiRepository {
return PasswordKeyEntity.fromJson(res.body); return PasswordKeyEntity.fromJson(res.body);
} }
//
Future<PasswordKeyEntity> 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<PasswordKeyEntity> updatePasswordKey( Future<PasswordKeyEntity> updatePasswordKey(
{required int lockId, {required int lockId,

View File

@ -175,6 +175,12 @@ class Storage {
return nickname; return nickname;
} }
static Future<String?> getHeadUrl() async {
LoginData? loginData = await getLoginData();
String? headUrl = loginData!.headUrl;
return headUrl;
}
static Future<LoginData?> getLoginData() async { static Future<LoginData?> getLoginData() async {
LoginData? loginData; LoginData? loginData;
final data = await Storage.getString(saveUserLoginData); final data = await Storage.getString(saveUserLoginData);

View File

@ -27,8 +27,10 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 1.0.22+202404031、打包预发布环境给欧阳测试 # 1.0.22+202404031、打包预发布环境给欧阳测试
# 1.0.23+202404061、打包预发布环境给欧阳测试 # 1.0.23+202404061、打包预发布环境给欧阳测试
# 1.0.24+202404071、打包预发布环境给欧阳测试 # 1.0.24+202404071、打包预发布环境给欧阳测试
# 1.0.25+20240407021、打包预发布环境给欧阳测试
# 1.0.26+20240408打包预发布环境给欧阳测试
version: 1.0.24+20240407 version: 1.0.26+20240408
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'