添加部分国际化,添加检测自定义密码名字密码是否重复
This commit is contained in:
parent
1f8b24da20
commit
9ac7a01f4b
@ -312,7 +312,7 @@
|
||||
"lightTouchScreenTip":"Light Touch Screen Tip",
|
||||
"next":"Next",
|
||||
"nearbyLock":"Nearby Lock",
|
||||
"addSuccessfullyPleaseRename":"Add Successfully Please Rename",
|
||||
"addSuccessfullyPleaseRename":"If you want to change the name, please rename, click OK to add lock",
|
||||
"whenAddingLockThePhoneMustBeNextToTheLock":"When adding a lock, the phone must be next to the lock",
|
||||
|
||||
"login":"Login",
|
||||
@ -538,6 +538,7 @@
|
||||
"清空码": "Clear code",
|
||||
"循环": "Cycle",
|
||||
"工作日": "Workday",
|
||||
"每日": "Daily",
|
||||
"周末": "Weekend",
|
||||
"周一": "Monday",
|
||||
"周二": "Tuesday",
|
||||
@ -548,5 +549,69 @@
|
||||
"周日": "Sunday",
|
||||
"确定要删除吗?": "Are you sure you want to delete?",
|
||||
"该锁的密码都将被删除": "The password of the lock will be deleted",
|
||||
"已过期": "Expired"
|
||||
"已过期": "Expired",
|
||||
"该锁的电子钥匙都将被删除": "The electronic key of the lock will be deleted",
|
||||
"同时删除其发送的所有钥匙,钥匙删除后不能恢复": "Also delete all the keys sent by it, the key can not be restored after deletion",
|
||||
"删除钥匙会在用户APP连网后生效": "Deleting the key will take effect after the user APP is connected to the network",
|
||||
"有效时间": "Effective time",
|
||||
"接收者": "Receiver",
|
||||
"仅管理自己创建的用户": "Only manage users created by yourself",
|
||||
"远程开锁": "Remote unlock",
|
||||
"请输入钥匙名称": "Please enter the key name",
|
||||
"修改成功": "Modify success",
|
||||
"冻结": "Freeze",
|
||||
"取消冻结": "Unfreeze",
|
||||
"授权": "Authorization",
|
||||
"取消授权": "Cancel authorization",
|
||||
"同时解冻其发送的钥匙": "Unfreeze the keys sent by it",
|
||||
"取消冻结会在用户APP连网后生效": "Unfreezing will take effect after the user APP is connected to the network",
|
||||
"同时冻结其发送的钥匙": "Freeze the keys sent by it",
|
||||
"冻结会在用户APP连网后生效": "Freezing will take effect after the user APP is connected to the network",
|
||||
"取消授权会在用户APP连网后生效": "Canceling authorization will take effect after the user APP is connected to the network",
|
||||
"授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码": "Authorized users have most of the permissions of the administrator, such as sending keys, sending passwords",
|
||||
"失效时间需大于生效时间": "The expiration time must be greater than the effective time",
|
||||
"生效时间需大于当前时间": "The effective time must be greater than the current time",
|
||||
"失效日期要大于生效日期": "The expiration date must be greater than the effective date",
|
||||
"失效时间要大于生效时间": "The expiration time must be greater than the effective time",
|
||||
"修改有效期": "Modify the validity period",
|
||||
"生效日期": "Effective date",
|
||||
"失效日期": "Expiration date",
|
||||
"开锁": "Unlock",
|
||||
"开锁成功": "Unlock success",
|
||||
"请选择锁": "Please select the lock",
|
||||
"请选择接收者": "Please select the receiver",
|
||||
"请选择有效期": "Please select the validity period",
|
||||
"请选择发送方式": "Please select the sending method",
|
||||
"请选择结束时间": "Please select the end time",
|
||||
"完成": "Complete",
|
||||
"有效日": "Effective day",
|
||||
"发送成功": "Send success",
|
||||
"请选择开始时间": "Please select the start time",
|
||||
"选择用户": "Select user",
|
||||
"已选中": "Selected",
|
||||
"确定": "Determine",
|
||||
"请选择要发送的锁": "Please select the lock to send",
|
||||
"人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。": "Face real-name authentication refers to the user's need to verify his face before unlocking the phone APP, and the verification can be unlocked.",
|
||||
"分享": "Share",
|
||||
"请输入接收者账号": "Please enter the receiver account",
|
||||
"接收者号码未注册,请重新发送": "The receiver number is not registered, please resend",
|
||||
"是否发送电子钥匙给未注册账号": "Whether to send the electronic key to the unregistered account",
|
||||
"取消": "Cancel",
|
||||
"标记成功": "Mark success",
|
||||
"微信好友": "WeChat friends",
|
||||
"短信": "SMS",
|
||||
"邮件": "Mail",
|
||||
"更多": "More",
|
||||
"您好,您的电子钥匙生成成功": "Hello, your electronic key is generated successfully",
|
||||
"生效时间不能小于当前时间": "The effective time cannot be less than the current time",
|
||||
"结束时间不能小于当前时间": "The end time cannot be less than the current time",
|
||||
"是否是管理员": "Is it an administrator",
|
||||
"已连接到锁,请将卡靠近锁的读卡区": "Connected to the lock, please put the card close to the card reading area of the lock",
|
||||
"尝试连接设备...": "Trying to connect to the device...",
|
||||
"地理位置": "Geographical location",
|
||||
"检查以确保以下地址是正确的": "Check to make sure the following address is correct",
|
||||
"地图加载中,请稍候。。": "The map is loading, please wait...",
|
||||
"跳过": "Skip",
|
||||
"还未获取到位置信息哦,请耐心等待一下!": "The location information has not been obtained yet, please wait patiently!",
|
||||
"请填写信息": "Please fill in the information"
|
||||
}
|
||||
|
||||
@ -525,7 +525,7 @@
|
||||
"隐私政策": "隐私政策",
|
||||
"注册成功": "注册成功",
|
||||
"你所在的": "你所在的",
|
||||
"手机号": "公司已经开通了",
|
||||
"手机号": "手机号",
|
||||
"忘记密码": "忘记密码",
|
||||
"重置成功": "重置成功",
|
||||
"确定要退出吗?": "确定要退出吗?",
|
||||
@ -539,6 +539,7 @@
|
||||
"清空码": "清空码",
|
||||
"循环": "循环",
|
||||
"工作日": "工作日",
|
||||
"每日": "每日",
|
||||
"周末": "周末",
|
||||
"周一": "周一",
|
||||
"周二": "周二",
|
||||
@ -549,5 +550,69 @@
|
||||
"周日": "周日",
|
||||
"确定要删除吗?": "确定要删除吗?",
|
||||
"该锁的密码都将被删除": "该锁的密码都将被删除",
|
||||
"已过期": "已过期"
|
||||
"已过期": "已过期",
|
||||
"该锁的电子钥匙都将被删除": "该锁的电子钥匙都将被删除",
|
||||
"同时删除其发送的所有钥匙,钥匙删除后不能恢复": "同时删除其发送的所有钥匙,钥匙删除后不能恢复",
|
||||
"删除钥匙会在用户APP连网后生效": "删除钥匙会在用户APP连网后生效",
|
||||
"有效时间": "有效时间",
|
||||
"接收者": "接收者",
|
||||
"仅管理自己创建的用户": "仅管理自己创建的用户",
|
||||
"远程开锁": "远程开锁",
|
||||
"请输入钥匙名称": "请输入钥匙名称",
|
||||
"修改成功": "修改成功",
|
||||
"冻结": "冻结",
|
||||
"取消冻结": "取消冻结",
|
||||
"授权": "授权",
|
||||
"取消授权": "取消授权",
|
||||
"同时解冻其发送的钥匙": "同时解冻其发送的钥匙",
|
||||
"取消冻结会在用户APP连网后生效": "取消冻结会在用户APP连网后生效",
|
||||
"同时冻结其发送的钥匙": "同时冻结其发送的钥匙",
|
||||
"冻结会在用户APP连网后生效": "冻结会在用户APP连网后生效",
|
||||
"取消授权会在用户APP连网后生效": "取消授权会在用户APP连网后生效",
|
||||
"授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码": "授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码",
|
||||
"失效时间需大于生效时间": "失效时间需大于生效时间",
|
||||
"生效时间需大于当前时间": "生效时间需大于当前时间",
|
||||
"失效日期要大于生效日期": "失效日期要大于生效日期",
|
||||
"失效时间要大于生效时间": "失效时间要大于生效时间",
|
||||
"修改有效期": "修改有效期",
|
||||
"生效日期": "生效日期",
|
||||
"失效日期": "失效日期",
|
||||
"开锁": "开锁",
|
||||
"开锁成功": "开锁成功",
|
||||
"请选择锁": "请选择锁",
|
||||
"请选择接收者": "请选择接收者",
|
||||
"请选择有效期": "请选择有效期",
|
||||
"请选择发送方式": "请选择发送方式",
|
||||
"请选择结束时间": "请选择结束时间",
|
||||
"完成": "完成",
|
||||
"有效日": "有效日",
|
||||
"发送成功": "发送成功",
|
||||
"请选择开始时间": "请选择开始时间",
|
||||
"选择用户": "选择用户",
|
||||
"已选中": "已选中",
|
||||
"确定": "确定",
|
||||
"请选择要发送的锁": "请选择要发送的锁",
|
||||
"人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。": "人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。",
|
||||
"分享": "分享",
|
||||
"请输入接收者账号": "请输入接收者账号",
|
||||
"接收者号码未注册,请重新发送": "接收者号码未注册,请重新发送",
|
||||
"是否发送电子钥匙给未注册账号": "是否发送电子钥匙给未注册账号",
|
||||
"取消": "取消",
|
||||
"标记成功": "标记成功",
|
||||
"微信好友": "微信好友",
|
||||
"短信": "短信",
|
||||
"邮件": "邮件",
|
||||
"更多": "更多",
|
||||
"您好,您的电子钥匙生成成功": "您好,您的电子钥匙生成成功",
|
||||
"生效时间不能小于当前时间": "生效时间不能小于当前时间",
|
||||
"结束时间不能小于当前时间": "结束时间不能小于当前时间",
|
||||
"是否是管理员": "是否是管理员",
|
||||
"已连接到锁,请将卡靠近锁的读卡区": "已连接到锁,请将卡靠近锁的读卡区",
|
||||
"尝试连接设备...": "尝试连接设备...",
|
||||
"地理位置": "地理位置",
|
||||
"检查以确保以下地址是正确的": "检查以确保以下地址是正确的",
|
||||
"地图加载中,请稍候。。": "地图加载中,请稍候。。",
|
||||
"跳过": "跳过",
|
||||
"还未获取到位置信息哦,请耐心等待一下!": "还未获取到位置信息哦,请耐心等待一下!",
|
||||
"请填写信息": "请填写信息"
|
||||
}
|
||||
|
||||
@ -312,7 +312,7 @@
|
||||
"lightTouchScreenTip":"摸亮触摸屏,锁进入可添加状态,点击下一步",
|
||||
"next":"下一步",
|
||||
"nearbyLock":"附近的锁",
|
||||
"addSuccessfullyPleaseRename":"添加成功,请重命名",
|
||||
"addSuccessfullyPleaseRename":"如需修改名字请重新命名,点击确定添加锁",
|
||||
"whenAddingLockThePhoneMustBeNextToTheLock":"添加锁时,手机必须在锁旁边",
|
||||
|
||||
"login":"登录",
|
||||
@ -526,7 +526,7 @@
|
||||
"隐私政策": "隐私政策",
|
||||
"注册成功": "注册成功",
|
||||
"你所在的": "你所在的",
|
||||
"手机号": "公司已经开通了",
|
||||
"手机号": "手机号",
|
||||
"忘记密码": "忘记密码",
|
||||
"重置成功": "重置成功",
|
||||
"确定要退出吗?": "确定要退出吗?",
|
||||
@ -540,6 +540,7 @@
|
||||
"清空码": "清空码",
|
||||
"循环": "循环",
|
||||
"工作日": "工作日",
|
||||
"每日": "每日",
|
||||
"周末": "周末",
|
||||
"周一": "周一",
|
||||
"周二": "周二",
|
||||
@ -550,5 +551,69 @@
|
||||
"周日": "周日",
|
||||
"确定要删除吗?": "确定要删除吗?",
|
||||
"该锁的密码都将被删除": "该锁的密码都将被删除",
|
||||
"已过期": "已过期"
|
||||
"已过期": "已过期",
|
||||
"该锁的电子钥匙都将被删除": "该锁的电子钥匙都将被删除",
|
||||
"同时删除其发送的所有钥匙,钥匙删除后不能恢复": "同时删除其发送的所有钥匙,钥匙删除后不能恢复",
|
||||
"删除钥匙会在用户APP连网后生效": "删除钥匙会在用户APP连网后生效",
|
||||
"有效时间": "有效时间",
|
||||
"接收者": "接收者",
|
||||
"仅管理自己创建的用户": "仅管理自己创建的用户",
|
||||
"远程开锁": "远程开锁",
|
||||
"请输入钥匙名称": "请输入钥匙名称",
|
||||
"修改成功": "修改成功",
|
||||
"冻结": "冻结",
|
||||
"取消冻结": "取消冻结",
|
||||
"授权": "授权",
|
||||
"取消授权": "取消授权",
|
||||
"同时解冻其发送的钥匙": "同时解冻其发送的钥匙",
|
||||
"取消冻结会在用户APP连网后生效": "取消冻结会在用户APP连网后生效",
|
||||
"同时冻结其发送的钥匙": "同时冻结其发送的钥匙",
|
||||
"冻结会在用户APP连网后生效": "冻结会在用户APP连网后生效",
|
||||
"取消授权会在用户APP连网后生效": "取消授权会在用户APP连网后生效",
|
||||
"授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码": "授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码",
|
||||
"失效时间需大于生效时间": "失效时间需大于生效时间",
|
||||
"生效时间需大于当前时间": "生效时间需大于当前时间",
|
||||
"失效日期要大于生效日期": "失效日期要大于生效日期",
|
||||
"失效时间要大于生效时间": "失效时间要大于生效时间",
|
||||
"修改有效期": "修改有效期",
|
||||
"生效日期": "生效日期",
|
||||
"失效日期": "失效日期",
|
||||
"开锁": "开锁",
|
||||
"开锁成功": "开锁成功",
|
||||
"请选择锁": "请选择锁",
|
||||
"请选择接收者": "请选择接收者",
|
||||
"请选择有效期": "请选择有效期",
|
||||
"请选择发送方式": "请选择发送方式",
|
||||
"请选择结束时间": "请选择结束时间",
|
||||
"完成": "完成",
|
||||
"有效日": "有效日",
|
||||
"发送成功": "发送成功",
|
||||
"请选择开始时间": "请选择开始时间",
|
||||
"选择用户": "选择用户",
|
||||
"已选中": "已选中",
|
||||
"确定": "确定",
|
||||
"请选择要发送的锁": "请选择要发送的锁",
|
||||
"人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。": "人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。",
|
||||
"分享": "分享",
|
||||
"请输入接收者账号": "请输入接收者账号",
|
||||
"接收者号码未注册,请重新发送": "接收者号码未注册,请重新发送",
|
||||
"是否发送电子钥匙给未注册账号": "是否发送电子钥匙给未注册账号",
|
||||
"取消": "取消",
|
||||
"标记成功": "标记成功",
|
||||
"微信好友": "微信好友",
|
||||
"短信": "短信",
|
||||
"邮件": "邮件",
|
||||
"更多": "更多",
|
||||
"您好,您的电子钥匙生成成功": "您好,您的电子钥匙生成成功",
|
||||
"生效时间不能小于当前时间": "生效时间不能小于当前时间",
|
||||
"结束时间不能小于当前时间": "结束时间不能小于当前时间",
|
||||
"是否是管理员": "是否是管理员",
|
||||
"已连接到锁,请将卡靠近锁的读卡区": "已连接到锁,请将卡靠近锁的读卡区",
|
||||
"尝试连接设备...": "尝试连接设备...",
|
||||
"地理位置": "地理位置",
|
||||
"检查以确保以下地址是正确的": "检查以确保以下地址是正确的",
|
||||
"地图加载中,请稍候。。": "地图加载中,请稍候。。",
|
||||
"跳过": "跳过",
|
||||
"还未获取到位置信息哦,请耐心等待一下!": "还未获取到位置信息哦,请耐心等待一下!",
|
||||
"请填写信息": "请填写信息"
|
||||
}
|
||||
|
||||
@ -28,6 +28,8 @@
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
<key>NSExceptionDomains</key>
|
||||
<dict>
|
||||
<key>jpush.cn</key>
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'io_tool/io_model.dart';
|
||||
@ -79,7 +79,7 @@ class BlueManage {
|
||||
void _initGetMtuSubscription() {
|
||||
_mtuSubscription ??= bluetoothConnectDevice!.mtu.listen((value) {
|
||||
_mtuSize = value - 3;
|
||||
Get.log('mtuSize:$_mtuSize');
|
||||
Get.log('_mtuSizeValue:$value mtuSize:$_mtuSize');
|
||||
});
|
||||
}
|
||||
|
||||
@ -148,9 +148,7 @@ class BlueManage {
|
||||
writeCharacteristicWithResponse(model.data);
|
||||
} else {
|
||||
try {
|
||||
if (Platform.isAndroid) {
|
||||
await FlutterBluePlus.turnOn();
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
Get.log("Error Turning On:");
|
||||
}
|
||||
@ -205,9 +203,7 @@ class BlueManage {
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
if (Platform.isAndroid) {
|
||||
await FlutterBluePlus.turnOn();
|
||||
}
|
||||
openBlue();
|
||||
} catch (e) {
|
||||
Get.log("Error Turning On:");
|
||||
}
|
||||
@ -238,13 +234,12 @@ class BlueManage {
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
if (Platform.isAndroid) {
|
||||
await FlutterBluePlus.turnOn();
|
||||
}
|
||||
stateCallBack(BluetoothConnectionState.disconnected);
|
||||
openBlue();
|
||||
} catch (e) {
|
||||
Get.log("Error Turning On:");
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
Get.log("开始扫描 蓝牙不可用,不能进行蓝牙操作");
|
||||
}
|
||||
@ -323,7 +318,6 @@ class BlueManage {
|
||||
if (bluetoothConnectionState == BluetoothConnectionState.connected) {
|
||||
try {
|
||||
bluetoothConnectDevice!.discoverServices().then((services) {
|
||||
Get.log("333333333");
|
||||
for (BluetoothService service in services) {
|
||||
// Get.log("11111service.remoteId:${service.remoteId}"
|
||||
// " service.uuid:${service.uuid}"
|
||||
@ -336,7 +330,6 @@ class BlueManage {
|
||||
// " characteristic.secondaryServiceUuid:${characteristic.secondaryServiceUuid}"
|
||||
// " characteristic.characteristicUuid:${characteristic.characteristicUuid}");
|
||||
if (characteristic.characteristicUuid == _characteristicIdSubscription) {
|
||||
Get.log("44444444");
|
||||
_subScribeToCharacteristic(characteristic);
|
||||
Get.log('Discovering services finished');
|
||||
bluetoothConnectionState = BluetoothConnectionState.connected;
|
||||
@ -475,8 +468,7 @@ class BlueManage {
|
||||
try {
|
||||
List<int> valueList = value;
|
||||
List subData = splitList(valueList, _mtuSize!);
|
||||
Get.log(
|
||||
'writeCharacteristicWithResponse 得到的分割数据:$subData');
|
||||
Get.log('writeCharacteristicWithResponse _mtuSize:$_mtuSize 得到的分割数据:$subData');
|
||||
|
||||
for (int i = 0; i < subData.length; i++) {
|
||||
await characteristic.write(subData[i]).then((value) async {
|
||||
@ -573,6 +565,15 @@ class BlueManage {
|
||||
}
|
||||
}
|
||||
|
||||
openBlue() async {
|
||||
if (Platform.isAndroid) {
|
||||
await FlutterBluePlus.turnOn();
|
||||
}
|
||||
if (Platform.isIOS) {
|
||||
EasyLoading.showToast("请开启蓝牙", duration: 2000.milliseconds);
|
||||
}
|
||||
}
|
||||
|
||||
disposed() {
|
||||
_sendStreamSubscription?.cancel();
|
||||
_mtuSubscription!.cancel();
|
||||
|
||||
@ -47,7 +47,7 @@ class _StarLockForgetPasswordPageState
|
||||
state.countryCode.value = result['code'];
|
||||
state.countryName.value = result['countryName'];
|
||||
}
|
||||
// print("路由返回值: ${result}, countryCode:${logic.state.countryCode} ,countryId:${logic.state.countryId}");
|
||||
print("路由返回值: ${result}, countryCode:${state.countryName.value} ,state.countryName.value:${state.countryName.value}");
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 70.h,
|
||||
@ -185,7 +185,7 @@ class _StarLockForgetPasswordPageState
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.safetyVerificationPage,
|
||||
arguments: {
|
||||
"countryCode": "86",
|
||||
"countryCode": state.countryCode.value,
|
||||
"account": state.phoneStr.value
|
||||
});
|
||||
logic.state.xWidth.value =
|
||||
|
||||
@ -8,6 +8,7 @@ import 'package:star_lock/tools/xs_jPhush.dart';
|
||||
|
||||
import '../../mine/mine/starLockMine_logic.dart';
|
||||
import '../../network/api_repository.dart';
|
||||
import '../../tools/eventBusEventManage.dart';
|
||||
import '../../tools/storage.dart';
|
||||
import 'starLock_login_state.dart';
|
||||
|
||||
@ -20,6 +21,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
||||
.login("1", state.pwd.value, "+86", state.emailOrPhone.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
Storage.saveLoginData(entity.data);
|
||||
eventBus.fire(MineInfoChangeRefreshUI());
|
||||
// Get.back();
|
||||
// Get.toNamed(Routers.starLockMain);
|
||||
XSJPushProvider().initJPushService();
|
||||
|
||||
@ -285,7 +285,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
||||
height: 20.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '完成',
|
||||
btnName: '完成'.tr,
|
||||
onClick: () {
|
||||
state.isSendSuccess.value = false;
|
||||
Navigator.pop(context, true);
|
||||
|
||||
@ -398,7 +398,7 @@ class _VolumeAuthorizationLockPageState
|
||||
height: 20.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '完成',
|
||||
btnName: '完成'.tr,
|
||||
onClick: () {
|
||||
_isSendSuccess = false;
|
||||
Navigator.pop(context, true);
|
||||
|
||||
@ -31,11 +31,11 @@ class AddCardTypeLogic extends BaseGetXController{
|
||||
endTime = "0";
|
||||
|
||||
if (startDate.isEmpty) {
|
||||
showToast("请选择开始时间");
|
||||
showToast("请选择开始时间".tr);
|
||||
return;
|
||||
}
|
||||
if (endDate.isEmpty) {
|
||||
showToast("请选择结束时间");
|
||||
showToast("请选择结束时间".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -45,12 +45,12 @@ class AddCardTypeLogic extends BaseGetXController{
|
||||
// }
|
||||
|
||||
if (int.parse(startDate) >= int.parse(endDate)) {
|
||||
showToast("失效时间要大于生效时间");
|
||||
showToast("失效时间要大于生效时间".tr);
|
||||
return;
|
||||
}
|
||||
} else if (state.selectType.value == "2") {
|
||||
if (state.beginTime.value.isEmpty) {
|
||||
showToast("请选择有效期");
|
||||
showToast("请选择有效期".tr);
|
||||
return;
|
||||
}
|
||||
startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
|
||||
@ -61,7 +61,6 @@ class AddCardTypeLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
var isCoerced = state.isStressFingerprint.value == false ? "1" : "2"; // 1:非胁迫卡 2:胁迫卡
|
||||
print("addOtherType startDate:$startDate endDate:$endDate");
|
||||
Get.toNamed(Routers.addICCardPage, arguments: {
|
||||
"lockId": state.lockId.value,
|
||||
"endDate": endDate,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@ -70,7 +71,6 @@ class _AddCardPageState extends State<AddCardPage> {
|
||||
case 0:
|
||||
{
|
||||
// 永久
|
||||
// return sendElectronicKeySucceed();
|
||||
return Column(
|
||||
children: [
|
||||
perpetualKeyWidget(
|
||||
@ -214,7 +214,7 @@ class _AddCardPageState extends State<AddCardPage> {
|
||||
Obx(() => Visibility(
|
||||
visible: state.effectiveDateTime.value.isNotEmpty,
|
||||
child: CommonItem(
|
||||
leftTitel: "有效时间",
|
||||
leftTitel: "有效时间".tr,
|
||||
rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}",
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
@ -244,7 +244,7 @@ class _AddCardPageState extends State<AddCardPage> {
|
||||
return Column(
|
||||
children: [
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "是否是管理员",
|
||||
leftTitel: "是否是管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
@ -266,90 +266,20 @@ class _AddCardPageState extends State<AddCardPage> {
|
||||
if (isDemoMode == false) {
|
||||
// print("state.selectType:${state.selectType.value}");
|
||||
if (state.nameController.text.isEmpty) {
|
||||
logic.showToast("请输入姓名");
|
||||
logic.showToast("请输入姓名".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
logic.checkCardNameDuplicated(state.nameController.text);
|
||||
} else {
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
logic.showToast("演示模式".tr);
|
||||
}
|
||||
}),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
// 发送电子钥匙成功
|
||||
Widget sendElectronicKeySucceed() {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 300.h,
|
||||
width: 1.sw,
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
),
|
||||
Image.asset(
|
||||
'images/main/icon_main_addLock.png',
|
||||
width: 150.w,
|
||||
height: 150.w,
|
||||
color: AppColors.mainColor,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Text(
|
||||
"操作成功,密码为",
|
||||
style: TextStyle(
|
||||
fontSize: 32.sp,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
Text(
|
||||
"62689876",
|
||||
style: TextStyle(
|
||||
fontSize: 60.sp,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '完成',
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {}),
|
||||
SubmitBtn(
|
||||
btnName: '分享',
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {}),
|
||||
SubmitBtn(
|
||||
btnName: '标记为:已入住',
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {}),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
String getAppBarTitle(int type) {
|
||||
String title;
|
||||
switch (type) {
|
||||
|
||||
@ -50,15 +50,13 @@ class AddICCardLogic extends BaseGetXController{
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
//成功
|
||||
// state.cardNumber.value = reply.data.last.toString();
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.ifConnectScuess.value = true;
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 需要鉴权");
|
||||
//无权限
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
@ -67,7 +65,6 @@ class AddICCardLogic extends BaseGetXController{
|
||||
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
print("_replyAddFingerprintReplyToken:$token");
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
@ -75,8 +72,6 @@ class AddICCardLogic extends BaseGetXController{
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:1,
|
||||
useCountLimit:0xff,
|
||||
// startTime:0x11223344,
|
||||
// endTime:0x11223344,
|
||||
startTime:int.parse(state.startDate.value)~/1000,
|
||||
endTime:int.parse(state.endDate.value)~/1000,
|
||||
needAuthor:1,
|
||||
@ -86,32 +81,27 @@ class AddICCardLogic extends BaseGetXController{
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType!.typeValue} 权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType!.typeValue} 失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _replyAddICCardConfirmation(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("_replyAddFingerprintstatus:$status");
|
||||
Get.log("_replyAddFingerprintstatus:$status");
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
// print("添加指纹确认成功,调用添加指纹接口");
|
||||
//成功
|
||||
if(state.cardNumber.value == (reply.data[6]).toString()){
|
||||
return;
|
||||
}else{
|
||||
@ -133,23 +123,22 @@ class AddICCardLogic extends BaseGetXController{
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
//无权限
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType!.typeValue} 失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -161,9 +150,8 @@ class AddICCardLogic extends BaseGetXController{
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
// print("添加指纹确认成功,调用添加指纹接口");
|
||||
//成功
|
||||
Get.log("${reply.commandType!.typeValue} 数据解析成功");
|
||||
addICCardData();
|
||||
break;
|
||||
case 0x06:
|
||||
@ -179,7 +167,6 @@ class AddICCardLogic extends BaseGetXController{
|
||||
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
print("_replyAddICCardConfirmationReplyToken:$token");
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
IoSenderManage.senderAddStressICCardCommand(
|
||||
@ -188,8 +175,6 @@ class AddICCardLogic extends BaseGetXController{
|
||||
icCardNo:state.isAdministrator.value == "2" ? 254 : 1,
|
||||
cardType:1,
|
||||
useCountLimit:1,
|
||||
// startTime:0x11223344,
|
||||
// endTime:0x11223344,
|
||||
startTime:int.parse(state.startDate.value)~/1000,
|
||||
endTime:int.parse(state.endDate.value)~/1000,
|
||||
needAuthor:1,
|
||||
@ -200,19 +185,18 @@ class AddICCardLogic extends BaseGetXController{
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType!.typeValue} 失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -220,7 +204,6 @@ class AddICCardLogic extends BaseGetXController{
|
||||
// 添加卡片
|
||||
Future<void> senderAddICCard() async {
|
||||
showBlueConnetctToastTimer(action: (){
|
||||
print("没有任何响应");
|
||||
Get.close(1);
|
||||
});
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||
@ -234,14 +217,12 @@ class AddICCardLogic extends BaseGetXController{
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
print("openDoorTokenPubToken:$getTokenList");
|
||||
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:state.isAdministrator.value == "2" ? 254 : 1,
|
||||
useCountLimit:0xff,
|
||||
// startTime:0x11223344,
|
||||
// endTime:0x11223344,
|
||||
startTime:int.parse(state.startDate.value)~/1000,
|
||||
endTime:int.parse(state.endDate.value)~/1000,
|
||||
needAuthor:1,
|
||||
@ -274,7 +255,6 @@ class AddICCardLogic extends BaseGetXController{
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
print("openDoorTokenPubToken:$getTokenList");
|
||||
|
||||
IoSenderManage.senderAddStressICCardCommand(
|
||||
keyID:"1",
|
||||
@ -297,7 +277,6 @@ class AddICCardLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
void addICCardData() async {
|
||||
print("state.startDate.value:${state.startDate.value} state.effectiveDateTime.value:${state.effectiveDateTime.value} state.failureDateTime.value:${state.failureDateTime.value}");
|
||||
var entity = await ApiRepository.to.addICCardData(
|
||||
lockId: state.lockId.value.toString(),
|
||||
endDate: state.endDate.value,
|
||||
@ -308,8 +287,8 @@ class AddICCardLogic extends BaseGetXController{
|
||||
startDate: state.startDate.value,
|
||||
isCoerced: state.isCoerced.value.toString(),
|
||||
weekDay: state.weekDay.value,
|
||||
startTime: int.parse(state.effectiveDateTime.value),
|
||||
endTime: int.parse(state.failureDateTime.value),
|
||||
startTime: int.parse(state.effectiveDateTime.value),
|
||||
endTime: int.parse(state.failureDateTime.value),
|
||||
cardRight: state.isAdministrator.value == "2" ? 1 : 0,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
@ -324,14 +303,7 @@ class AddICCardLogic extends BaseGetXController{
|
||||
cardUserNo: state.cardNumber.value,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
// Toast.show(msg: "添加成功");
|
||||
// if(state.fromType.value == 2){
|
||||
// // 回调指纹号
|
||||
// eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(cardId));
|
||||
// }else if(state.fromType.value == 1){
|
||||
// eventBus.fire(OtherTypeRefreshListEvent());
|
||||
// }
|
||||
// Get.close(2);
|
||||
|
||||
showToast("添加成功");
|
||||
if(state.fromType.value == 2){
|
||||
// 回调指纹号
|
||||
|
||||
@ -32,8 +32,6 @@ class _AddICCardPageState extends State<AddICCardPage> with RouteAware {
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
body: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 200.h),
|
||||
Center(
|
||||
@ -63,8 +61,8 @@ class _AddICCardPageState extends State<AddICCardPage> with RouteAware {
|
||||
child: Center(
|
||||
child: Obx(() => Text(
|
||||
state.ifConnectScuess.value
|
||||
? "已连接到锁,请将卡靠近锁的读卡区"
|
||||
: "尝试连接设备...",
|
||||
? "已连接到锁,请将卡靠近锁的读卡区".tr
|
||||
: "尝试连接设备...".tr,
|
||||
style: TextStyle(color: Colors.white, fontSize: 24.sp)))),
|
||||
),
|
||||
],
|
||||
|
||||
@ -38,14 +38,6 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
barTitle: "卡详情",
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
// actionsList: [
|
||||
// TextButton(
|
||||
// child: Text(TranslationLoader.lanKeys!.share!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp),),
|
||||
// onPressed: () {
|
||||
//
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
|
||||
@ -20,7 +20,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
//修改钥匙名称请求
|
||||
Future<void> modifyKeyNameRequest() async {
|
||||
if (state.changeNameController.text.isEmpty) {
|
||||
showToast("请输入钥匙名称");
|
||||
showToast("请输入钥匙名称".tr);
|
||||
return;
|
||||
}
|
||||
KeyOperationRecordEntity entity = await ApiRepository.to
|
||||
@ -30,7 +30,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
state.itemData.value.keyName = state.changeNameController.text;
|
||||
state.keyName.value = state.itemData.value.keyName!;
|
||||
Get.back();
|
||||
showToast("修改成功", something: () {
|
||||
showToast("修改成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
});
|
||||
@ -56,7 +56,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
// }else if(updateType == 2){
|
||||
// state.isRemoteUnlock.value = !state.isRemoteUnlock.value;
|
||||
// }
|
||||
showToast("修改成功", something: () {
|
||||
showToast("修改成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
});
|
||||
@ -70,8 +70,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
includeUnderlings: includeUnderlings
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("删除电子钥匙成功");
|
||||
showToast("删除成功", something: () {
|
||||
showToast("删除成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
Get.back();
|
||||
@ -85,7 +84,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
keyId:state.itemData.value.keyId.toString(),
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("设置成功", something: () {
|
||||
showToast("设置成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
Get.back();
|
||||
@ -99,7 +98,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
keyId:state.itemData.value.keyId.toString(),
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("设置成功", something: () {
|
||||
showToast("设置成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
Get.back();
|
||||
@ -114,7 +113,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
includeUnderlings: includeUnderlings
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("设置成功", something: () {
|
||||
showToast("设置成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
Get.back();
|
||||
@ -129,7 +128,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
includeUnderlings: includeUnderlings
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("设置成功", something: () {
|
||||
showToast("设置成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
Get.back();
|
||||
@ -140,11 +139,11 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
String getKeyTypeShowDateTime(){
|
||||
String useDateStr = '';
|
||||
if(state.keyType.value == 1){
|
||||
useDateStr = "永久";
|
||||
useDateStr = "永久".tr;
|
||||
}else if(state.keyType.value == 2){
|
||||
useDateStr = "${DateTool().dateToYMDHNString(state.starDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}";
|
||||
}else if(state.keyType.value == 3){
|
||||
useDateStr = "单次";
|
||||
useDateStr = "单次".tr;
|
||||
}else if(state.keyType.value == 4){
|
||||
useDateStr = "${DateTool().dateToYMDString(state.starDate.value)}\n${DateTool().dateToYMDString(state.endDate.value)}";
|
||||
}
|
||||
@ -154,9 +153,9 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
Future openModalBottomSheet(BuildContext context) async {
|
||||
var textList = <String>[];
|
||||
if(state.keyType.value == 1 || state.keyType.value == 2){
|
||||
textList = [state.itemData.value.keyStatus == 110405 ? '取消冻结' : "冻结", state.itemData.value.keyRight == 1 ? '取消授权' : '授权'];
|
||||
textList = [state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr, state.itemData.value.keyRight == 1 ? '取消授权'.tr : '授权'.tr];
|
||||
} else if(state.keyType.value == 4){
|
||||
textList = [state.itemData.value.keyStatus == 110405 ? '取消冻结' : "冻结"];
|
||||
textList = [state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr];
|
||||
}
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
@ -173,26 +172,22 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
// 取消冻结
|
||||
if(state.itemData.value.keyRight == 1){
|
||||
// 管理员
|
||||
print("管理员 调用取消冻结");
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) {
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙'.tr, (isAllData) {
|
||||
cancelFreeze(isAllData ? 1 : 0);
|
||||
});
|
||||
}else{
|
||||
print("普通用户 调用取消冻结");
|
||||
ShowTipView().showIosTipWithContentDialog("取消冻结会在用户APP连网后生效", (){
|
||||
ShowTipView().showIosTipWithContentDialog("取消冻结会在用户APP连网后生效".tr, (){
|
||||
cancelFreeze(0);
|
||||
});
|
||||
}
|
||||
}else{
|
||||
if(state.itemData.value.keyRight == 1){
|
||||
// 管理员
|
||||
print("管理员 调用冻结");
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) {
|
||||
freezeKey(isAllData ? 1 : 0);
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时冻结其发送的钥匙'.tr, (isAllData) {
|
||||
freezeKey(isAllData ? 1 : 0);
|
||||
});
|
||||
}else{
|
||||
print("普通用户 调用冻结");
|
||||
ShowTipView().showIosTipWithContentDialog("冻结会在用户APP连网后生效", (){
|
||||
ShowTipView().showIosTipWithContentDialog("冻结会在用户APP连网后生效".tr, (){
|
||||
freezeKey(0);
|
||||
});
|
||||
}
|
||||
@ -201,13 +196,11 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
// 取消/授权管理员
|
||||
if(state.itemData.value.keyRight == 1){
|
||||
// 管理员
|
||||
print("管理员 调用取消授权管理员接口");
|
||||
ShowTipView().showIosTipWithContentDialog("取消授权会在用户APP连网后生效", (){
|
||||
ShowTipView().showIosTipWithContentDialog("取消授权会在用户APP连网后生效".tr, (){
|
||||
cancelAdministrator();
|
||||
});
|
||||
}else{
|
||||
print("普通用户 调用授权管理员接口");
|
||||
ShowTipView().showIosTipWithContentDialog("授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码", (){
|
||||
ShowTipView().showIosTipWithContentDialog("授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码".tr, (){
|
||||
setAdministrator();
|
||||
});
|
||||
}
|
||||
@ -217,82 +210,15 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
});
|
||||
}
|
||||
|
||||
// showPopMenus(BuildContext context){
|
||||
// var textList = [];
|
||||
// // keyType // 永久:1;限时2,单次3,循环:4
|
||||
// // itemData.keyRight == 1 // 1:管理员 2:普通用户
|
||||
// // indexEntity.keyStatus! 110405:已冻结 110412:已过期 110408:已删除 110410:已重置
|
||||
// if(state.keyType.value == 1 || state.keyType.value == 2){
|
||||
// textList = [{'text': state.itemData.value.keyStatus == 110405 ? '取消冻结' : "冻结"}, {'text': state.itemData.value.keyRight == 1 ? '取消授权' : '授权'}];
|
||||
// } else if(state.keyType.value == 4){
|
||||
// textList = [{'text': state.itemData.value.keyStatus == 110405 ? '取消冻结' : "冻结"}];
|
||||
// }
|
||||
// JhPopMenus.showLinePop(context, clickCallback: (index, selText) {
|
||||
// print('选中index: $index');
|
||||
// print('选中text: $selText');
|
||||
// Navigator.pop(context, true);
|
||||
// Future.delayed(const Duration(seconds: 1));
|
||||
//
|
||||
// if(index == 0){
|
||||
// if(state.itemData.value.keyStatus == 110405){
|
||||
// // 取消冻结
|
||||
// if(state.itemData.value.keyRight == 1){
|
||||
// // 管理员
|
||||
// print("管理员 调用取消冻结");
|
||||
// ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) {
|
||||
// cancelFreeze();
|
||||
// });
|
||||
// }else{
|
||||
// print("普通用户 调用取消冻结");
|
||||
// ShowTipView().showIosTipWithContentDialog("取消冻结会在用户APP连网后生效", (){
|
||||
// cancelFreeze();
|
||||
// });
|
||||
// }
|
||||
// }else{
|
||||
// if(state.itemData.value.keyRight == 1){
|
||||
// // 管理员
|
||||
// print("管理员 调用冻结");
|
||||
// // ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) {
|
||||
// // freezeKey();
|
||||
// // });
|
||||
// // showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) {
|
||||
// // freezeKey();
|
||||
// // });
|
||||
// showToast("fasdfasdfasdf");
|
||||
// }else{
|
||||
// print("普通用户 调用冻结");
|
||||
// ShowTipView().showIosTipWithContentDialog("冻结会在用户APP连网后生效", (){
|
||||
// freezeKey();
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// // 取消/授权管理员
|
||||
// if(state.itemData.value.keyRight == 1){
|
||||
// // 管理员
|
||||
// print("管理员 调用取消授权管理员接口");
|
||||
// ShowTipView().showIosTipWithContentDialog("取消授权会在用户APP连网后生效", (){
|
||||
// cancelAdministrator();
|
||||
// });
|
||||
// }else{
|
||||
// print("普通用户 调用授权管理员接口");
|
||||
// ShowTipView().showIosTipWithContentDialog("授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码", (){
|
||||
// setAdministrator();
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// }, listData: textList);
|
||||
// }
|
||||
|
||||
deletKeyLogic(){
|
||||
if(state.itemData.value.keyRight == 1){
|
||||
// 授权管理员
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复'.tr, (isAllData) {
|
||||
deleteKeyRequest(isAllData ? 1 : 0);
|
||||
});
|
||||
}else{
|
||||
// 普通用户
|
||||
ShowTipView().showIosTipWithContentDialog("删除钥匙会在用户APP连网后生效",(){
|
||||
ShowTipView().showIosTipWithContentDialog("删除钥匙会在用户APP连网后生效".tr,(){
|
||||
deleteKeyRequest(0);
|
||||
});
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
Obx(() => Visibility(
|
||||
visible: state.keyType.value == 4 ? true : false,
|
||||
child: Obx(() => CommonItem(
|
||||
leftTitel: "有效时间",
|
||||
leftTitel: "有效时间".tr,
|
||||
rightTitle: "${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}",
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
@ -146,7 +146,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
})))),
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: "接收者",
|
||||
leftTitel: "接收者".tr,
|
||||
rightTitle: state.itemData.value.username ?? ""),
|
||||
const SizedBox(height: 1),
|
||||
CommonItem(
|
||||
@ -161,7 +161,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
Visibility(
|
||||
visible: state.itemData.value.keyRight == 1 ? true:false,
|
||||
child: CommonItem(
|
||||
leftTitel: "仅管理自己创建的用户",
|
||||
leftTitel: "仅管理自己创建的用户".tr,
|
||||
rightTitle: "",
|
||||
isHaveRightWidget: true,
|
||||
isHaveLine: true,
|
||||
@ -169,10 +169,10 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
width: 60.w,
|
||||
child: _onlyManageYouCreatesUserSwitch())),
|
||||
),
|
||||
Visibility(
|
||||
visible: (state.itemData.value.keyRight == 1 && state.keyInfo.value.lockSetting!.remoteUnlock == 1) ? false:true,
|
||||
Visibility(// (state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false
|
||||
visible: state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true:false,
|
||||
child: CommonItem(
|
||||
leftTitel: "远程开锁",
|
||||
leftTitel: "远程开锁".tr,
|
||||
rightTitle: "",
|
||||
isHaveRightWidget: true,
|
||||
isHaveLine: true,
|
||||
@ -217,149 +217,6 @@ class _ElectronicKeyDetailPageState extends State<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) {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
|
||||
@ -17,12 +17,12 @@ class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
|
||||
var beginTimeTimestamp = DateTool().dateToTimestamp(state.beginTime.value, 1);
|
||||
var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 1);
|
||||
if (beginTimeTimestamp > endTimeTimestamp || beginTimeTimestamp == endTimeTimestamp) {
|
||||
showToast("失效时间需大于生效时间");
|
||||
showToast("失效时间需大于生效时间".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (endTimeTimestamp < DateTime.now().millisecondsSinceEpoch) {
|
||||
showToast("生效时间需大于当前时间");
|
||||
showToast("生效时间需大于当前时间".tr);
|
||||
return;
|
||||
}
|
||||
KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate(
|
||||
@ -38,7 +38,7 @@ class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
|
||||
remoteEnable: state.remoteEnable!.value
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("修改成功", something: () {
|
||||
showToast("修改成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
Get.back(result: {
|
||||
|
||||
@ -19,12 +19,12 @@ class ElectronicKeyPeriodValidityLogic extends BaseGetXController {
|
||||
var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 0);
|
||||
|
||||
if (starDateTimestamp >= endDateTimestamp) {
|
||||
showToast("失效日期要大于生效日期");
|
||||
showToast("失效日期要大于生效日期".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (starTimeTimestamp >= endTimeTimestamp) {
|
||||
showToast("失效时间要大于生效时间");
|
||||
showToast("失效时间要大于生效时间".tr);
|
||||
return;
|
||||
}
|
||||
KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate(
|
||||
@ -39,7 +39,7 @@ class ElectronicKeyPeriodValidityLogic extends BaseGetXController {
|
||||
isOnlyManageSelf: state.isOnlyManageSelf.value!,
|
||||
remoteEnable: state.remoteEnable.value!);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("修改成功", something: () {
|
||||
showToast("修改成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
Get.back(result: {
|
||||
|
||||
@ -29,7 +29,7 @@ class _ElectronicKeyPeriodValidityPageState extends State<ElectronicKeyPeriodVal
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: "修改有效期",
|
||||
barTitle: "修改有效期".tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: ListView(
|
||||
@ -63,7 +63,7 @@ class _ElectronicKeyPeriodValidityPageState extends State<ElectronicKeyPeriodVal
|
||||
child: Column(
|
||||
children: [
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "生效日期",
|
||||
leftTitel: "生效日期".tr,
|
||||
rightTitle: state.starDate.value,
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
@ -74,7 +74,7 @@ class _ElectronicKeyPeriodValidityPageState extends State<ElectronicKeyPeriodVal
|
||||
});
|
||||
})),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "失效日期",
|
||||
leftTitel: "失效日期".tr,
|
||||
rightTitle: state.endDate.value,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
@ -201,7 +202,7 @@ class KeyOperationRecordLogic extends BaseGetXController {
|
||||
cardId:state.cardId.value,
|
||||
fingerprintId:state.fingerprintId.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("操作记录列表成功:${entity.data?.itemList}");
|
||||
// print("操作记录列表成功:${entity.data?.itemList}");
|
||||
state.dataList.value = entity.data!.itemList!;
|
||||
}
|
||||
}
|
||||
@ -231,7 +232,7 @@ class KeyOperationRecordLogic extends BaseGetXController {
|
||||
KeyOperationRecordEntity entity =
|
||||
await ApiRepository.to.clearOperationRecord('28');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("清除数据成功");
|
||||
showToast("清除数据成功".tr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ class _KeyOperationRecordPageState extends State<KeyOperationRecordPage> {
|
||||
int? operateDate = dataItem.operateDate;
|
||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(operateDate!);
|
||||
String operateDateStr =
|
||||
'${dateStr.toLocal().toString().substring(0, 16)} 开锁';
|
||||
'${dateStr.toLocal().toString().substring(0, 16)} ${"开锁".tr}';
|
||||
|
||||
return _electronicKeyItem(operateDateStr, () {});
|
||||
},
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_state.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
@ -42,8 +43,7 @@ class ElectronicKeyListLogic extends BaseGetXController {
|
||||
ElectronicKeyListEntity entity = await ApiRepository.to
|
||||
.resetElectronicKey(state.keyInfo.value.lockId.toString(), '0');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("重置电子钥匙成功啦啦啦啦啦");
|
||||
showToast("重置成功", something: (){
|
||||
showToast("重置成功".tr, something: (){
|
||||
pageNo = 1;
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
@ -58,8 +58,7 @@ class ElectronicKeyListLogic extends BaseGetXController {
|
||||
includeUnderlings:includeUnderlings
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("删除电子钥匙成功");
|
||||
showToast("删除成功",something: (){
|
||||
showToast("删除成功".tr,something: (){
|
||||
pageNo = 1;
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
@ -69,12 +68,12 @@ class ElectronicKeyListLogic extends BaseGetXController {
|
||||
deletKeyLogic(ElectronicKeyListItem electronicKeyListItem){
|
||||
if(electronicKeyListItem.keyRight == 1){
|
||||
// 授权管理员
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复'.tr, (isAllData) {
|
||||
deleteKeyRequest(electronicKeyListItem.keyId.toString(), isAllData ? 1 : 0);
|
||||
});
|
||||
}else{
|
||||
// 普通用户
|
||||
ShowTipView().showIosTipWithContentDialog("删除钥匙会在用户APP连网后生效",(){
|
||||
ShowTipView().showIosTipWithContentDialog("删除钥匙会在用户APP连网后生效".tr,(){
|
||||
deleteKeyRequest(electronicKeyListItem.keyId.toString(), 0);
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
@ -14,6 +13,7 @@ import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../tools/EasyRefreshTool.dart';
|
||||
import '../../../../tools/keySearchWidget.dart';
|
||||
import '../../../../tools/showTipView.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
import '../../../../tools/titleAppBar.dart';
|
||||
import '../../../../translations/trans_lib.dart';
|
||||
@ -64,9 +64,11 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
// 获取是否是演示模式 演示模式不获取接口
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
_showDialog();
|
||||
ShowTipView().showIosTipWithContentDialog("该锁的电子钥匙都将被删除".tr, (){
|
||||
logic.resetElectronicKeyListRequest();
|
||||
});
|
||||
} else {
|
||||
logic.showToast("演示模式");
|
||||
logic.showToast("演示模式".tr);
|
||||
}
|
||||
},
|
||||
),
|
||||
@ -164,7 +166,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
},
|
||||
backgroundColor: Colors.red,
|
||||
foregroundColor: Colors.white,
|
||||
label: '删除',
|
||||
label: '删除'.tr,
|
||||
padding: EdgeInsets.only(left: 5.w, right: 5.w),
|
||||
),
|
||||
],
|
||||
@ -215,14 +217,14 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
'${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}';
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||
//永久
|
||||
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 永久';
|
||||
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} ${"永久".tr}';
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||
//单次
|
||||
useDateStr = "单次";
|
||||
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} 单次';
|
||||
useDateStr = "单次".tr;
|
||||
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} ${"单次".tr}';
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||
//循环
|
||||
useDateStr = '循环';
|
||||
useDateStr = '循环'.tr;
|
||||
}
|
||||
|
||||
return useDateStr;
|
||||
@ -314,31 +316,4 @@ class _ElectronicKeyListPageState extends State<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(() {});
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import '../../../../../network/api_repository.dart';
|
||||
@ -16,12 +17,12 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
|
||||
getFailureDateTime = DateTool().dateToTimestamp(state.endTime.value, 1).toString();
|
||||
}
|
||||
if(state.lockIdList.isEmpty){
|
||||
showToast("请选择锁");
|
||||
showToast("请选择锁".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if(state.receiverList.isEmpty){
|
||||
showToast("请选择接收者");
|
||||
showToast("请选择接收者".tr);
|
||||
return;
|
||||
}
|
||||
var entity = await ApiRepository.to.canSendKey(
|
||||
@ -56,11 +57,11 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
|
||||
endTime = "0";
|
||||
|
||||
if (startDate.isEmpty) {
|
||||
showToast("请选择开始时间");
|
||||
showToast("请选择开始时间".tr);
|
||||
return;
|
||||
}
|
||||
if (endDate.isEmpty) {
|
||||
showToast("请选择结束时间");
|
||||
showToast("请选择结束时间".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -70,7 +71,7 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
|
||||
// }
|
||||
|
||||
if (int.parse(startDate) >= int.parse(endDate)) {
|
||||
showToast("失效时间要大于生效时间");
|
||||
showToast("失效时间要大于生效时间".tr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -84,7 +85,7 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
|
||||
case 3:
|
||||
typeValue = XSConstantMacro.keyTypeLoop;
|
||||
if (state.beginTime.value.isEmpty) {
|
||||
showToast("请选择有效期");
|
||||
showToast("请选择有效期".tr);
|
||||
return;
|
||||
}
|
||||
startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
|
||||
@ -113,21 +114,7 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
|
||||
remoteUnlockSwitch: state.isRemoteUnlock.value ? 1 : 2,
|
||||
keyRight: 0
|
||||
);
|
||||
|
||||
// var entity = await ApiRepository.to.batchSendKey(
|
||||
// endDate:getFailureDateTime,
|
||||
// keyGroupIdList:[],
|
||||
// lockIdList:state.lockIdList,
|
||||
// createUser:state.isCreateUser.value == true ? '1' : '0',
|
||||
// isRemoteUnlock:state.isRemoteUnlock.value ? '1' : '2',
|
||||
// keyNameForAdmin:receiverUserID,
|
||||
// receiverUsername:receiverUserID,
|
||||
// startDate:getEffectiveDateTime,
|
||||
// countryCode:state.countryCode.value,
|
||||
// usernameType:'1',
|
||||
// weekDays:state.weekdaysList);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print('群发电子钥匙成功');
|
||||
state.isSendSuccess.value = true;
|
||||
resetData();
|
||||
} else {
|
||||
|
||||
@ -124,7 +124,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"发送成功",
|
||||
"发送成功".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp,
|
||||
color: Colors.black,
|
||||
@ -139,7 +139,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||
height: 20.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '完成',
|
||||
btnName: '完成'.tr,
|
||||
onClick: () {
|
||||
state.isSendSuccess.value = false;
|
||||
Get.back();
|
||||
@ -284,13 +284,13 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||
state.endTime.value = result['endDate'];
|
||||
state.effectiveDateTime.value = result['starTime'];
|
||||
state.failureDateTime.value = result['endTime'];
|
||||
Get.log('得到的有效期数据:${state.weekdaysList.value} == ${state.beginTime.value} == ${state.endTime.value}== ${state.effectiveDateTime.value} == ${state.failureDateTime.value}');
|
||||
// Get.log('得到的有效期数据:${state.weekdaysList.value} == ${state.beginTime.value} == ${state.endTime.value}== ${state.effectiveDateTime.value} == ${state.failureDateTime.value}');
|
||||
}
|
||||
})),
|
||||
Obx(() => Visibility(
|
||||
visible: state.weekdaysList.isNotEmpty ? true : false,
|
||||
child: CommonItem(
|
||||
leftTitel: "有效日",
|
||||
leftTitel: "有效日".tr,
|
||||
rightTitle: state.weekdaysList.value.join(",").toString(),
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
@ -315,7 +315,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||
Obx(() => Visibility(
|
||||
visible: state.effectiveDateTime.value.isNotEmpty,
|
||||
child: CommonItem(
|
||||
leftTitel: "有效时间",
|
||||
leftTitel: "有效时间".tr,
|
||||
rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}",
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
|
||||
@ -19,7 +19,7 @@ class MassSendElectronicKeyState{
|
||||
|
||||
var type = ''.obs;// 限时、永久、单次、循环
|
||||
var isSendSuccess = false.obs;
|
||||
var countryName = '中国'.obs;
|
||||
var countryName = '中国'.tr.obs;
|
||||
var countryCode = '86'.obs;
|
||||
var isCreateUser = false.obs; //用户未注册时传1 已注册传0
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ class _LockUserListPageState extends State<LockUserListPage> {
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColors.mainColor,
|
||||
title: Text(
|
||||
'选择用户',
|
||||
'选择用户'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 28.sp,
|
||||
@ -78,7 +78,7 @@ class _LockUserListPageState extends State<LockUserListPage> {
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'已选中:${selectUserIdList.length}',
|
||||
'${"已选中".tr}:${selectUserIdList.length}',
|
||||
style: TextStyle(color: Colors.black, fontSize: 24.sp),
|
||||
),
|
||||
Expanded(
|
||||
@ -89,7 +89,7 @@ class _LockUserListPageState extends State<LockUserListPage> {
|
||||
width: 120.w,
|
||||
height: 60.h,
|
||||
child: SubmitBtn(
|
||||
btnName: '确定',
|
||||
btnName: '确定'.tr,
|
||||
onClick: () {
|
||||
Map<String, dynamic> resultMap = {};
|
||||
resultMap['lockUserList'] = selectDataList;
|
||||
|
||||
@ -60,7 +60,7 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
|
||||
Container(
|
||||
width: ScreenUtil().screenWidth,
|
||||
margin: EdgeInsets.only(left: 20.w),
|
||||
child: Text('请选择要发送的锁',
|
||||
child: Text('请选择要发送的锁'.tr,
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor, fontSize: 22.sp)),
|
||||
),
|
||||
@ -69,7 +69,7 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
|
||||
),
|
||||
Expanded(child: _buildListView(context, lockGroupList)),
|
||||
SubmitBtn(
|
||||
btnName: '确定',
|
||||
btnName: '确定'.tr,
|
||||
onClick: () {
|
||||
// print('得到lockid为$selectLockIdList ');
|
||||
Map<String, dynamic> resultMap = {};
|
||||
@ -86,7 +86,7 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
|
||||
|
||||
//分组列表请求
|
||||
Future<List<GroupListItem>> mockNetworkDataRequest() async {
|
||||
MassSendLockGroupListEntity entity = await ApiRepository.to.lockGroupList('1');
|
||||
MassSendLockGroupListEntity entity = await ApiRepository.to.lockGroupList('2');
|
||||
List<GroupListItem> dataList = [];
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
if (entity.data != null) {
|
||||
@ -137,7 +137,6 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
|
||||
}
|
||||
}
|
||||
setState(() {});
|
||||
print('选中了么0');
|
||||
},
|
||||
typeImgList: const [],
|
||||
groupItem: itemData,
|
||||
|
||||
@ -16,7 +16,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
//发送钥匙请求
|
||||
Future<void> sendElectronicKeyRequest() async {
|
||||
if (state.emailOrPhoneController.text.isEmpty) {
|
||||
showToast("请输入接收者账号");
|
||||
showToast("请输入接收者账号".tr);
|
||||
return;
|
||||
}
|
||||
// 姓名变为非必填(同通通锁)
|
||||
@ -42,11 +42,11 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
endTime = "0";
|
||||
|
||||
if (startDate.isEmpty) {
|
||||
showToast("请选择开始时间");
|
||||
showToast("请选择开始时间".tr);
|
||||
return;
|
||||
}
|
||||
if (endDate.isEmpty) {
|
||||
showToast("请选择结束时间");
|
||||
showToast("请选择结束时间".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
// }
|
||||
|
||||
if (int.parse(startDate) >= int.parse(endDate)) {
|
||||
showToast("失效时间要大于生效时间");
|
||||
showToast("失效时间要大于生效时间".tr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -70,7 +70,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
case 3:
|
||||
typeValue = XSConstantMacro.keyTypeLoop;
|
||||
if (state.beginTime.value.isEmpty) {
|
||||
showToast("请选择有效期");
|
||||
showToast("请选择有效期".tr);
|
||||
return;
|
||||
}
|
||||
startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
|
||||
@ -107,7 +107,6 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
endTime: int.parse(endTime),
|
||||
isOnlyManageSelf: 0);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print('发送电子钥匙成功');
|
||||
state.isSendSuccess.value = true;
|
||||
state.sendSucceedType.value = int.parse(state.type.value);
|
||||
resetData();
|
||||
@ -144,7 +143,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
context: widgetContext,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text('接收者号码未注册,请重新发送'),
|
||||
title: Text('接收者号码未注册,请重新发送'.tr),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
@ -185,7 +184,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
context: widgetContext,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: Text('是否发送电子钥匙给未注册账号\n${state.emailOrPhoneController.text}'),
|
||||
title: Text('${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@ -202,7 +203,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
rightTitle: "",
|
||||
isTipsImg: true,
|
||||
tipsImgAction: () {
|
||||
ShowTipView().showSureAlertDialog("人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。");
|
||||
ShowTipView().showSureAlertDialog("人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。".tr);
|
||||
},
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
@ -244,7 +245,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
Obx(() => Visibility(
|
||||
visible: state.weekdaysList.isNotEmpty ? true : false,
|
||||
child: CommonItem(
|
||||
leftTitel: "有效日",
|
||||
leftTitel: "有效日".tr,
|
||||
rightTitle: state.weekdaysList.value.join(",").toString(),
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
@ -269,7 +270,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
Obx(() => Visibility(
|
||||
visible: state.effectiveDateTime.value.isNotEmpty,
|
||||
child: CommonItem(
|
||||
leftTitel: "有效时间",
|
||||
leftTitel: "有效时间".tr,
|
||||
rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}",
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
@ -321,7 +322,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
setState(() {});
|
||||
} else {
|
||||
//演示模式不获取接口
|
||||
logic.showToast("演示模式");
|
||||
logic.showToast("演示模式".tr);
|
||||
}
|
||||
}),
|
||||
Container(
|
||||
@ -337,7 +338,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
Navigator.pushNamed(
|
||||
context, Routers.massSendElectronicKeyManagePage);
|
||||
} else {
|
||||
logic.showToast("演示模式");
|
||||
logic.showToast("演示模式".tr);
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
@ -377,7 +378,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"发送成功",
|
||||
"发送成功".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp,
|
||||
color: Colors.black,
|
||||
@ -392,7 +393,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
height: 20.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '完成',
|
||||
btnName: '完成'.tr,
|
||||
onClick: () {
|
||||
state.isSendSuccess.value = false;
|
||||
logic.resetData();
|
||||
@ -401,7 +402,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
height: 10.h,
|
||||
),
|
||||
OutLineBtn(
|
||||
btnName: '分享',
|
||||
btnName: '分享'.tr,
|
||||
onClick: () {
|
||||
// Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
||||
_openModalBottomSheet();
|
||||
@ -444,8 +445,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
roomStatus: 1,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("标记为已入住成功啦啦啦啦啦");
|
||||
logic.showToast("标记成功");
|
||||
logic.showToast("标记成功".tr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -605,7 +605,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取消',
|
||||
'取消'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||
),
|
||||
@ -621,10 +621,10 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
List<Widget> initBottomSheetList() {
|
||||
List<Widget> widgetList = [];
|
||||
|
||||
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友', 0));
|
||||
widgetList.add(buildCenter3('images/icon_message.png', '短信', 1));
|
||||
widgetList.add(buildCenter3('images/icon_email.png', '邮件', 2));
|
||||
widgetList.add(buildCenter3('images/icon_more.png', '更多', 3));
|
||||
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友'.tr, 0));
|
||||
widgetList.add(buildCenter3('images/icon_message.png', '短信'.tr, 1));
|
||||
widgetList.add(buildCenter3('images/icon_email.png', '邮件'.tr, 2));
|
||||
widgetList.add(buildCenter3('images/icon_more.png', '更多'.tr, 3));
|
||||
|
||||
return widgetList;
|
||||
}
|
||||
@ -666,14 +666,14 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
case 0:
|
||||
//微信好友
|
||||
{
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功';
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
//短信
|
||||
{
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功';
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||
}
|
||||
break;
|
||||
@ -686,7 +686,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
case 3:
|
||||
//更多
|
||||
{
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功';
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -24,7 +24,7 @@ class SendElectronicKeyState {
|
||||
|
||||
var type = ''.obs;// 限时、永久、单次、循环
|
||||
var isSendSuccess = false.obs;
|
||||
var countryName = '中国'.obs;
|
||||
var countryName = '中国'.tr.obs;
|
||||
var countryCode = '86'.obs;
|
||||
var isCreateUser = false.obs; //用户未注册时传1 已注册传0
|
||||
|
||||
|
||||
@ -251,7 +251,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage> {
|
||||
height: 20.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '完成',
|
||||
btnName: '完成'.tr,
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||
|
||||
@ -49,7 +49,7 @@ class AddFingerprintTypeLogic extends BaseGetXController{
|
||||
}
|
||||
} else if (state.selectType.value == "2") {
|
||||
if (state.beginTime.value.isEmpty) {
|
||||
showToast("请选择有效期");
|
||||
showToast("请选择有效期".tr);
|
||||
return;
|
||||
}
|
||||
startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
|
||||
|
||||
@ -325,7 +325,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
|
||||
height: 20.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '完成',
|
||||
btnName: '完成'.tr,
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||
|
||||
@ -34,7 +34,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
void initReplySubscription() {
|
||||
state.replySubscription =
|
||||
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) {
|
||||
_replyOpenLock(reply);
|
||||
|
||||
@ -15,7 +15,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
||||
state.itemData.value.keyboardPwdId.toString(),
|
||||
1);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("删除成功", something: (){
|
||||
showToast("删除成功".tr, something: (){
|
||||
Get.back(result: "deletScuess");
|
||||
});
|
||||
}
|
||||
@ -37,7 +37,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
||||
keyboardPwdType: state.itemData.value.keyboardPwdType!);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
Get.back();
|
||||
showToast("修改成功", something: (){
|
||||
showToast("修改成功".tr, something: (){
|
||||
if(changType == 1){
|
||||
// 修改名字
|
||||
state.keyboardPwdName.value = state.inputNameController.text;
|
||||
@ -45,7 +45,6 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
||||
// 修改密码
|
||||
state.keyboardPwd.value = state.inputPwdController.text;
|
||||
}
|
||||
print("state.itemData.value.keyboardPwd:${state.itemData.value.keyboardPwd} state.itemData.value.keyboardPwdName:${state.itemData.value.keyboardPwdName}");
|
||||
eventBus.fire(GetPasswordListRefreshUI());
|
||||
});
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ class PasswordKeyListLogic extends BaseGetXController {
|
||||
break;
|
||||
case 4:
|
||||
//删除 4 在锁上使用后会删除之前在锁上使用过的密码
|
||||
useDateStr = '${startDateStr.toLocal().toString().substring(0, 16)} ${"清空码".tr}';
|
||||
useDateStr = '${endDateStr.toLocal().toString().substring(0, 16)} ${"清空码".tr}';
|
||||
break;
|
||||
case 5:
|
||||
//周未循环 5 在周未开始和结束时间指定时间段内有效
|
||||
@ -97,7 +97,7 @@ class PasswordKeyListLogic extends BaseGetXController {
|
||||
case 6:
|
||||
//每日循环 6 每天开始和结束时间指定时间段内有效
|
||||
useDateStr =
|
||||
'${endDateStr.toLocal().toString().substring(0, 16)} ${"周日".tr}$starHour:00-$endHour:00 ${"循环"}';
|
||||
'${endDateStr.toLocal().toString().substring(0, 16)} ${"每日".tr}$starHour:00-$endHour:00 ${"循环"}';
|
||||
break;
|
||||
case 7:
|
||||
//工作日循环 7 工作日开始和结束时间指定的时间段内有效
|
||||
@ -137,7 +137,7 @@ class PasswordKeyListLogic extends BaseGetXController {
|
||||
case 14:
|
||||
//周天循环 14 每周日开始和结束时间指定时间段内有效
|
||||
useDateStr =
|
||||
'${endDateStr.toLocal().toString().substring(0, 16)} ${"周天".tr}$starHour:00-$endHour:00 ${"循环".tr}';
|
||||
'${endDateStr.toLocal().toString().substring(0, 16)} ${"周日".tr}$starHour:00-$endHour:00 ${"循环".tr}';
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
@ -11,7 +11,6 @@ import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../tools/EasyRefreshTool.dart';
|
||||
import '../../../../tools/keySearchWidget.dart';
|
||||
import '../../../../tools/showIosTipView.dart';
|
||||
import '../../../../tools/showTipView.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
import '../../../../tools/titleAppBar.dart';
|
||||
@ -125,10 +124,8 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
||||
itemCount: state.itemDataList.value.length,
|
||||
itemBuilder: (c, index) {
|
||||
PasswordKeyListItem passwordKeyListItem = state.itemDataList.value[index];
|
||||
String useDateStr = ''; //使用期限
|
||||
String useDateStr = logic.getUseDateStr(passwordKeyListItem);// 使用期限
|
||||
|
||||
//使用期限
|
||||
useDateStr = logic.getUseDateStr(passwordKeyListItem);
|
||||
return Slidable(
|
||||
key:ValueKey(passwordKeyListItem.keyboardPwdId),
|
||||
endActionPane: ActionPane(
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
// ignore_for_file: slash_for_doc_comments
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
@ -22,20 +24,20 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
|
||||
/// 收到点击密码类型更新
|
||||
/**
|
||||
单次 1 只能在开始时间后6小时内使用一次
|
||||
永久 2 从开始时间开始永久有效,必需在开始时间24小时内使用一次,否则将失效
|
||||
限期 3 在开始和结束时间内有效,必需在开始时间24小时内使用一次,否则将失效
|
||||
删除 4 在锁上使用后会删除之前在锁上使用过的密码
|
||||
周未循环 5 在周未开始和结束时间指定时间段内有效
|
||||
每日循环 6 每天开始和结束时间指定时间段内有效
|
||||
工作日循环 7 工作日开始和结束时间指定的时间段内有效
|
||||
周一循环 8 每周一开始和结束时间指定时间段内有效
|
||||
周二循环 9 每周二开始和结束时间指定时间段内有效
|
||||
周三循环 10 每周三开始和结束时间指定时间段内有效
|
||||
周四循环 11 每周四开始和结束时间指定时间段内有效
|
||||
周五循环 12 每周五开始和结束时间指定时间段内有效
|
||||
周六循环 13 每周六开始和结束时间指定时间段内有效
|
||||
周天循环 14 每周日开始和结束时间指定时间段内有效
|
||||
单次 1 只能在开始时间后6小时内使用一次
|
||||
永久 2 从开始时间开始永久有效,必需在开始时间24小时内使用一次,否则将失效
|
||||
限期 3 在开始和结束时间内有效,必需在开始时间24小时内使用一次,否则将失效
|
||||
删除 4 在锁上使用后会删除之前在锁上使用过的密码
|
||||
周未循环 5 在周未开始和结束时间指定时间段内有效
|
||||
每日循环 6 每天开始和结束时间指定时间段内有效
|
||||
工作日循环 7 工作日开始和结束时间指定的时间段内有效
|
||||
周一循环 8 每周一开始和结束时间指定时间段内有效
|
||||
周二循环 9 每周二开始和结束时间指定时间段内有效
|
||||
周三循环 10 每周三开始和结束时间指定时间段内有效
|
||||
周四循环 11 每周四开始和结束时间指定时间段内有效
|
||||
周五循环 12 每周五开始和结束时间指定时间段内有效
|
||||
周六循环 13 每周六开始和结束时间指定时间段内有效
|
||||
周天循环 14 每周日开始和结束时间指定时间段内有效
|
||||
*/
|
||||
//获取密码请求
|
||||
Future<void> getKeyboardPwdRequest() async {
|
||||
@ -45,14 +47,14 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
String getKeyType = state.widgetType.value.toString();
|
||||
|
||||
if (state.nameController.text.isEmpty) {
|
||||
showToast("请输入姓名");
|
||||
showToast("请输入姓名".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
//循环密码
|
||||
if (state.widgetType.value == 4) {
|
||||
if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
|
||||
showToast("生效时间不能小于当前时间");
|
||||
showToast("生效时间不能小于当前时间".tr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -62,12 +64,12 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
} else if (state.widgetType.value == 1) {
|
||||
//限时
|
||||
if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
|
||||
showToast("生效时间不能小于当前时间");
|
||||
showToast("生效时间不能小于当前时间".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (startDate >= endDate) {
|
||||
showToast("失效时间要大于生效时间");
|
||||
showToast("失效时间要大于生效时间".tr);
|
||||
return;
|
||||
}
|
||||
getKeyType = '3';
|
||||
@ -80,7 +82,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
//循环
|
||||
//限时
|
||||
if (endDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
|
||||
showToast("结束时间不能小于当前时间");
|
||||
showToast("结束时间不能小于当前时间".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -119,7 +121,6 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
endHours: state.loopEndHours.value,
|
||||
isCoerced: 1);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print('获取密码成功');
|
||||
state.isSendSuccess.value = true;
|
||||
state.sendSucceedType.value = state.widgetType.value;
|
||||
state.pwdNameStr = state.nameController.text;
|
||||
@ -155,7 +156,6 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
getFailureDateTime,
|
||||
'1');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print('获取密码成功');
|
||||
state.isSendSuccess.value = true;
|
||||
state.sendSucceedType.value = state.widgetType.value;
|
||||
state.pwdNameStr = state.nameController.text;
|
||||
@ -170,6 +170,26 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
Future<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 StreamSubscription<Reply> _replySubscription;
|
||||
@ -220,17 +240,17 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
cancelBlueConnetctToastTimer();
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
cancelBlueConnetctToastTimer();
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
|
||||
cancelBlueConnetctToastTimer();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -243,16 +263,6 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
|
||||
// 设置自定义密码
|
||||
Future<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 endDate = DateTool().dateToTimestamp(state.endTime.value, 1);
|
||||
//非永久 须有时限
|
||||
|
||||
@ -363,7 +363,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
|
||||
if (isDemoMode == false) {
|
||||
//自定义密码
|
||||
if (state.widgetType.value == 3) {
|
||||
logic.senderCustomPasswords();
|
||||
logic.checkKeyboardpwdNameRequest();
|
||||
} else {
|
||||
logic.getKeyboardPwdRequest();
|
||||
}
|
||||
@ -417,7 +417,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
|
||||
height: 20.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '完成',
|
||||
btnName: '完成'.tr,
|
||||
onClick: () {
|
||||
state.isSendSuccess.value = false;
|
||||
state.nameController.text = "";
|
||||
@ -428,7 +428,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
|
||||
height: 10.h,
|
||||
),
|
||||
OutLineBtn(
|
||||
btnName: '分享',
|
||||
btnName: '分享'.tr,
|
||||
onClick: () {
|
||||
_openModalBottomSheet();
|
||||
},
|
||||
@ -547,7 +547,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取消',
|
||||
'取消'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||
),
|
||||
@ -563,10 +563,10 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
|
||||
List<Widget> initBottomSheetList() {
|
||||
List<Widget> widgetList = [];
|
||||
|
||||
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友', 0));
|
||||
widgetList.add(buildCenter3('images/icon_message.png', '短信', 1));
|
||||
widgetList.add(buildCenter3('images/icon_email.png', '邮件', 2));
|
||||
widgetList.add(buildCenter3('images/icon_more.png', '更多', 3));
|
||||
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友'.tr, 0));
|
||||
widgetList.add(buildCenter3('images/icon_message.png', '短信'.tr, 1));
|
||||
widgetList.add(buildCenter3('images/icon_email.png', '邮件'.tr, 2));
|
||||
widgetList.add(buildCenter3('images/icon_more.png', '更多'.tr, 3));
|
||||
|
||||
return widgetList;
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import 'package:date_format/date_format.dart';
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
||||
|
||||
@ -228,7 +228,7 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage> {
|
||||
height: 20.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '完成',
|
||||
btnName: '完成'.tr,
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||
|
||||
@ -72,7 +72,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
|
||||
}
|
||||
switch (status) {
|
||||
case PermissionStatus.denied:
|
||||
print("拒绝");
|
||||
// print("拒绝");
|
||||
break;
|
||||
case PermissionStatus.granted:
|
||||
if(Platform.isIOS){
|
||||
@ -84,16 +84,16 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
|
||||
}
|
||||
break;
|
||||
case PermissionStatus.limited:
|
||||
print("限制");
|
||||
// print("限制");
|
||||
break;
|
||||
case PermissionStatus.permanentlyDenied:
|
||||
print("永久的否认");
|
||||
// print("永久的否认");
|
||||
break;
|
||||
case PermissionStatus.provisional:
|
||||
print("临时");
|
||||
// print("临时");
|
||||
break;
|
||||
default:
|
||||
print("其他状态");
|
||||
// print("其他状态");
|
||||
// requestLocation();
|
||||
break;
|
||||
}
|
||||
@ -101,7 +101,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
|
||||
|
||||
Future<void> requestAndroidLocation() async {
|
||||
location.onLocationChanged().listen((event) {
|
||||
print("listenLocationChanged$event");
|
||||
// print("listenLocationChanged$event");
|
||||
// EasyLoading.dismiss();
|
||||
if (event.isNotEmpty) {
|
||||
setState(() {
|
||||
@ -116,7 +116,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
|
||||
location = AMapFlutterLocation()
|
||||
..setLocationOption(AMapLocationOption())
|
||||
..onLocationChanged().listen((event) {
|
||||
print("listenLocationChanged$event");
|
||||
// print("listenLocationChanged$event");
|
||||
// EasyLoading.dismiss();
|
||||
if (event.isNotEmpty) {
|
||||
setState(() {
|
||||
@ -163,7 +163,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text("地理位置", style: TextStyle(fontSize: 50.sp)),
|
||||
Text("地理位置".tr, style: TextStyle(fontSize: 50.sp)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -202,12 +202,11 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
|
||||
),
|
||||
Container(
|
||||
// color: Colors.red,
|
||||
height: 45.h,
|
||||
margin: EdgeInsets.only(left: 25.w, top: 20.h, right: 25.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text("检查以确保以下地址是正确的", style: TextStyle(fontSize: 24.sp)),
|
||||
Flexible(child: Text("检查以确保以下地址是正确的".tr, style: TextStyle(fontSize: 24.sp))),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -233,7 +232,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
|
||||
],
|
||||
) : SizedBox(
|
||||
height: 1.sw/5*4 + 65.h*2,
|
||||
child: const Center(child: Text('地图加载中,请稍候。。。')))
|
||||
child: Center(child: Text('地图加载中,请稍候。。。'.tr)))
|
||||
,
|
||||
),
|
||||
SizedBox(height:200.h),
|
||||
@ -242,7 +241,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
|
||||
children: [
|
||||
TextButton(
|
||||
child: Text(
|
||||
"跳过",
|
||||
"跳过".tr,
|
||||
style: TextStyle(color: Colors.black, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () {
|
||||
@ -263,7 +262,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
|
||||
),
|
||||
onPressed: () {
|
||||
if(addressInfo!.isEmpty){
|
||||
logic.showToast("还未获取到位置信息哦,请耐心等待一下!");
|
||||
logic.showToast("还未获取到位置信息哦,请耐心等待一下!".tr);
|
||||
return;
|
||||
}
|
||||
Get.toNamed(Routers.saveLockPage, arguments: {
|
||||
|
||||
@ -32,11 +32,17 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 80.h,),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(TranslationLoader.lanKeys!.addSuccessfullyPleaseRename!.tr, style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500),),
|
||||
],
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 50.w, right: 50.w),
|
||||
width: 1.sw,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(TranslationLoader.lanKeys!.addSuccessfullyPleaseRename!.tr, style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500))
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 80.h,),
|
||||
Container(
|
||||
@ -54,7 +60,7 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
|
||||
],
|
||||
// style:TextStyle(height: 1.1, fontSize: 36.sp, fontWeight: FontWeight.w400, color:AppColors.mainColor),
|
||||
decoration: InputDecoration(
|
||||
hintText: '请填写信息',
|
||||
hintText: '请填写信息'.tr,
|
||||
hintStyle: TextStyle(
|
||||
// height: 1.1,
|
||||
fontSize: 24.sp,
|
||||
|
||||
@ -33,6 +33,8 @@ class StarLockMineLogic extends BaseGetXController {
|
||||
state.userNickName.value = (await Storage.getNickname())!;
|
||||
state.userMobile.value = (await Storage.getMobile())! ?? '';
|
||||
state.userEmail.value = (await Storage.getEmail())!;
|
||||
state.userHeadUrl.value = (await Storage.getHeadUrl())!;
|
||||
|
||||
Get.log("userNickName:${state.userNickName.value} userMobile:${state.userMobile.value} userEmail:${state.userEmail.value}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:star_lock/flavors.dart';
|
||||
import '../../appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
import '../../baseWidget.dart';
|
||||
import '../../tools/customNetworkImage.dart';
|
||||
import '../../tools/submitBtn.dart';
|
||||
import '../../translations/trans_lib.dart';
|
||||
import 'starLockMine_logic.dart';
|
||||
@ -71,17 +72,21 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
child: Container(
|
||||
width: 105.w,
|
||||
height: 105.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(52.5.w)),
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius:
|
||||
// BorderRadius.all(Radius.circular(52.5.w)),
|
||||
// ),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(52.5.w),
|
||||
child: CustomNetworkImage(url:state.userHeadUrl.value??"", width:105.w, height:105.h),
|
||||
),
|
||||
child:
|
||||
// state.headUrl().isNotEmpty ?
|
||||
// Image(image: NetworkImage(state.loginData.value.data!.headUrl!)) :
|
||||
Image.asset(
|
||||
'images/mine/icon_mine_main_defaultAvatar.png',
|
||||
width: 60.w,
|
||||
height: 60.w)),
|
||||
// Image.asset(
|
||||
// 'images/mine/icon_mine_main_defaultAvatar.png',
|
||||
// width: 60.w,
|
||||
// height: 60.w)
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
|
||||
@ -6,6 +6,6 @@ class StarLockMineState {
|
||||
var userNickName = "".obs;
|
||||
var userMobile = "".obs;
|
||||
var userEmail = "".obs;
|
||||
|
||||
var userHeadUrl = "".obs;
|
||||
void onClose() {}
|
||||
}
|
||||
|
||||
@ -13,7 +13,6 @@ class MinePersonInfoLogic extends GetConnect {
|
||||
Future<void> getUserInfoRequest() async {
|
||||
MinePersonInfoEntity entity = await ApiRepository.to.getUserInfo("");
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print('到了这里么');
|
||||
state.mineInfoData.value = entity.data!;
|
||||
}
|
||||
}
|
||||
@ -33,9 +32,7 @@ class MinePersonInfoLogic extends GetConnect {
|
||||
}
|
||||
|
||||
// 上传头像
|
||||
void uploadFile(
|
||||
MinePersonGetUploadFileInfoEntity
|
||||
minePersonGetUploadFileInfoEntity) async {
|
||||
void uploadFile(MinePersonGetUploadFileInfoEntity minePersonGetUploadFileInfoEntity) async {
|
||||
// String json = JsonDecoder(minePersonGetUploadFileInfoEntity.data!.formData!);
|
||||
|
||||
// var formData = FormData();
|
||||
@ -45,10 +42,8 @@ class MinePersonInfoLogic extends GetConnect {
|
||||
// MultipartFile(state.image!.path, filename: 'b'),
|
||||
// ));
|
||||
|
||||
Map<String, dynamic> user =
|
||||
minePersonGetUploadFileInfoEntity.data!.formData!;
|
||||
user[minePersonGetUploadFileInfoEntity.data!.fileField!] =
|
||||
state.image!.path;
|
||||
Map<String, dynamic> user = minePersonGetUploadFileInfoEntity.data!.formData!;
|
||||
user[minePersonGetUploadFileInfoEntity.data!.fileField!] = state.image!.path;
|
||||
final form = FormData(user);
|
||||
var entity = await ApiRepository.to.uploadFile(
|
||||
url: minePersonGetUploadFileInfoEntity.data!.uploadUrl!, body: form);
|
||||
@ -93,7 +88,6 @@ class MinePersonInfoLogic extends GetConnect {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
|
||||
getUserInfoRequest();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -13,6 +13,7 @@ import 'package:star_lock/tools/custom_bottom_sheet.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../tools/commonItem.dart';
|
||||
import '../../../tools/customNetworkImage.dart';
|
||||
import '../../../tools/titleAppBar.dart';
|
||||
import '../../../translations/trans_lib.dart';
|
||||
|
||||
@ -23,8 +24,7 @@ class MinePersonInfoPage extends StatefulWidget {
|
||||
State<MinePersonInfoPage> createState() => _MinePersonInfoPageState();
|
||||
}
|
||||
|
||||
class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
||||
with WidgetsBindingObserver {
|
||||
class _MinePersonInfoPageState extends State<MinePersonInfoPage> with WidgetsBindingObserver {
|
||||
final logic = Get.put(MinePersonInfoLogic());
|
||||
final state = Get.find<MinePersonInfoLogic>().state;
|
||||
|
||||
@ -70,26 +70,33 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: ClipOval(
|
||||
child: state.image != null
|
||||
? Image.file(
|
||||
File(state.image!.path),
|
||||
width: 72.w,
|
||||
height: 72.w,
|
||||
fit: BoxFit.fill,
|
||||
)
|
||||
: Image.asset(
|
||||
'images/controls_user.png',
|
||||
width: 72.w,
|
||||
height: 72.w,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
rightWidget:
|
||||
Container(
|
||||
// color: Colors.orange,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(36.w),
|
||||
child: CustomNetworkImage(url:"https://ui-avatars.com/api/?name=%E6%98%B5&color=7F9CF5&background=EBF4FF", width:72.w, height:72.w),
|
||||
),
|
||||
),
|
||||
// ClipOval(
|
||||
// child: state.image != null
|
||||
// ? Image.file(
|
||||
// File(state.image!.path),
|
||||
// width: 72.w,
|
||||
// height: 72.w,
|
||||
// fit: BoxFit.fill,
|
||||
// )
|
||||
// : Image.asset(
|
||||
// 'images/controls_user.png',
|
||||
// width: 72.w,
|
||||
// height: 72.w,
|
||||
// fit: BoxFit.fill,
|
||||
// ),
|
||||
// ),
|
||||
action: () async {
|
||||
//安卓平台下首次进入应用需向用户告知获取权限用途弹窗
|
||||
if (Platform.isAndroid) {
|
||||
AppFirstEnterHandle()
|
||||
.getAppFirstEnter(context, isAgreeCamera);
|
||||
AppFirstEnterHandle().getAppFirstEnter(context, isAgreeCamera);
|
||||
var getFlag = await Storage.getString(isAgreeCamera);
|
||||
if (getFlag == isAgreeCamera) {
|
||||
_openModalBottomSheet();
|
||||
@ -271,8 +278,7 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
||||
Future _openModalBottomSheet() async {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadiusDirectional.circular(10)),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadiusDirectional.circular(10)),
|
||||
builder: (BuildContext context) {
|
||||
return AlertBottomWidget(
|
||||
topTitle: '',
|
||||
|
||||
@ -14,6 +14,12 @@ class AppUnlockNeedMobileNetworkingLockLogic extends BaseGetXController{
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
dataList = entity.data!.list!;
|
||||
state.lockItemList.value = dataList;
|
||||
for (int i = 0; i < dataList.length; i++) {
|
||||
var itemData = dataList[i];
|
||||
if (itemData.appUnlockOnline == 1) {
|
||||
state.selectLockIdList.add(itemData.lockId);
|
||||
}
|
||||
}
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ class AddAuthorizedAdministratorLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
if(state.lockIdList.isEmpty){
|
||||
showToast("请选择锁");
|
||||
showToast("请选择锁".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -399,7 +399,7 @@ class _AddAuthorizedAdministratorPageState extends State<AddAuthorizedAdministra
|
||||
height: 20.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '完成',
|
||||
btnName: '完成'.tr,
|
||||
onClick: () {
|
||||
state.isSendSuccess.value = false;
|
||||
Navigator.pop(context, true);
|
||||
|
||||
@ -12,7 +12,7 @@ class GroupEditLockLogic extends BaseGetXController {
|
||||
//锁分组里面添加锁
|
||||
Future<void> lockGroupAddLock(List lockIds) async {
|
||||
if(lockIds.isEmpty){
|
||||
showToast("请选择锁");
|
||||
showToast("请选择锁".tr);
|
||||
return;
|
||||
}
|
||||
var entity = await ApiRepository.to.lockGroupAddLock(
|
||||
@ -29,7 +29,7 @@ class GroupEditLockLogic extends BaseGetXController {
|
||||
//锁分组里面添加锁
|
||||
Future<void> lockGroupDeletLock(List lockIds) async {
|
||||
if(lockIds.isEmpty){
|
||||
showToast("请选择锁");
|
||||
showToast("请选择锁".tr);
|
||||
return;
|
||||
}
|
||||
var entity = await ApiRepository.to.lockGroupDeletLock(lockIds: lockIds);
|
||||
|
||||
@ -12,7 +12,7 @@ class LockGroupListLogic extends BaseGetXController {
|
||||
|
||||
//分组列表请求
|
||||
void mockNetworkDataRequest() async {
|
||||
var entity = await ApiRepository.to.lockGroupList('1');
|
||||
var entity = await ApiRepository.to.lockGroupList('0');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
if (entity.data != null) {
|
||||
state.lockNum = 0;
|
||||
|
||||
@ -146,7 +146,7 @@ class _SelectGetewayListPageState extends State<SelectGetewayListPage> {
|
||||
}
|
||||
}
|
||||
if(isCanNext == false){
|
||||
logic.showToast("请选择锁");
|
||||
logic.showToast("请选择锁".tr);
|
||||
return;
|
||||
}
|
||||
var data = await Get.toNamed(Routers.recipientInformationPage, arguments: {
|
||||
|
||||
@ -151,7 +151,7 @@ class _TransferSmartLockPageState extends State<TransferSmartLockPage> {
|
||||
}
|
||||
}
|
||||
if(isCanNext == false){
|
||||
logic.showToast("请选择锁");
|
||||
logic.showToast("请选择锁".tr);
|
||||
return;
|
||||
}
|
||||
var data = await Get.toNamed(Routers.recipientInformationPage, arguments: {
|
||||
|
||||
@ -45,6 +45,7 @@ abstract class Api {
|
||||
|
||||
final String passwordKeyGetURL = '/keyboardPwd/get'; //获取密码
|
||||
final String passwordKeyAddURL = '/keyboardPwd/add'; //自定义密码
|
||||
final String passwordKeyCheckKeyboardpwdNameURL = '/keyboardPwd/checkKeyboardpwdName'; //自定义密码校验密码跟名字是否重复
|
||||
final String updatePasswordKeyURL = '/keyboardPwd/update'; //修改密码详情
|
||||
final String clearOperationRecordURL = '/lockRecords/clear'; //清空操作记录
|
||||
final String addlockGroupURL = '/keyGroup/add'; //创建锁分组
|
||||
|
||||
@ -451,6 +451,20 @@ class ApiProvider extends BaseProvider {
|
||||
'addType': addType,
|
||||
}));
|
||||
|
||||
// 自定义密码校验名字密码是否重复
|
||||
Future<Response> checkKeyboardpwdName(
|
||||
String lockId,
|
||||
String keyboardPwdName,
|
||||
String keyboardPwd
|
||||
) =>
|
||||
post(
|
||||
passwordKeyCheckKeyboardpwdNameURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
'keyboardPwdName': keyboardPwdName,
|
||||
'keyboardPwd': keyboardPwd,
|
||||
}));
|
||||
|
||||
Future<Response> updateKeyboardPwd(
|
||||
int lockId,
|
||||
String keyboardPwdId,
|
||||
|
||||
@ -450,6 +450,18 @@ class ApiRepository {
|
||||
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(
|
||||
{required int lockId,
|
||||
|
||||
@ -175,6 +175,12 @@ class Storage {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
static Future<String?> getHeadUrl() async {
|
||||
LoginData? loginData = await getLoginData();
|
||||
String? headUrl = loginData!.headUrl;
|
||||
return headUrl;
|
||||
}
|
||||
|
||||
static Future<LoginData?> getLoginData() async {
|
||||
LoginData? loginData;
|
||||
final data = await Storage.getString(saveUserLoginData);
|
||||
|
||||
@ -27,8 +27,10 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# 1.0.22+20240403:1、打包预发布环境给欧阳测试
|
||||
# 1.0.23+20240406:1、打包预发布环境给欧阳测试
|
||||
# 1.0.24+20240407:1、打包预发布环境给欧阳测试
|
||||
# 1.0.25+2024040702:1、打包预发布环境给欧阳测试
|
||||
# 1.0.26+20240408:打包预发布环境给欧阳测试
|
||||
|
||||
version: 1.0.24+20240407
|
||||
version: 1.0.26+20240408
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user