Merge branch 'master_hyx'
This commit is contained in:
commit
4b6ae01e9a
@ -833,5 +833,12 @@
|
||||
"姓名":"Name",
|
||||
"发送":"Send",
|
||||
"请确认姓名全名和身份证号码是否正确":"Please confirm that the full name and ID number are correct",
|
||||
"传输期间请勿离开当前页面":"Do not leave the current page during transfer"
|
||||
"传输期间请勿离开当前页面":"Do not leave the current page during transfer",
|
||||
"机型": "models",
|
||||
"硬件版本": "Hardware version",
|
||||
"固件版本": "Firmware version",
|
||||
"手动升级": "Manual upgrade",
|
||||
"设备连接中...": "Device Connecting...",
|
||||
"升级过程中无法开锁,请先开锁后再升级": "The lock cannot be unlocked during the upgrade, please unlock the lock before upgrading",
|
||||
"钥匙无效": "The key is invalid"
|
||||
}
|
||||
|
||||
@ -861,5 +861,12 @@
|
||||
"姓名":"姓名",
|
||||
"发送":"发送",
|
||||
"请确认姓名全名和身份证号码是否正确":"请确认姓名全名和身份证号码是否正确",
|
||||
"传输期间请勿离开当前页面":"传输期间请勿离开当前页面"
|
||||
"传输期间请勿离开当前页面":"传输期间请勿离开当前页面",
|
||||
"机型": "机型",
|
||||
"硬件版本": "硬件版本",
|
||||
"固件版本": "固件版本",
|
||||
"手动升级": "手动升级",
|
||||
"设备连接中...": "设备连接中...",
|
||||
"升级过程中无法开锁,请先开锁后再升级": "升级过程中无法开锁,请先开锁后再升级",
|
||||
"钥匙无效": "钥匙无效"
|
||||
}
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
"number": "号",
|
||||
"additive": "添加者",
|
||||
"addTime": "添加时间",
|
||||
|
||||
"reset": "重置",
|
||||
"sendKey": "发送钥匙",
|
||||
"timeLimit": "限时",
|
||||
@ -43,7 +42,6 @@
|
||||
"fridayShort": "五",
|
||||
"saturdayShort": "六",
|
||||
"sundayShort": "日",
|
||||
|
||||
"realNameAuthentication": "实名认证",
|
||||
"sendKeyBottomTip": "接收者在有效期内可以不限次数使用",
|
||||
"send": "发送",
|
||||
@ -120,7 +118,6 @@
|
||||
"leaveEarly": "早退",
|
||||
"noCardPunched": "未打卡",
|
||||
"holidayInfo": "假日信息",
|
||||
|
||||
"basicInformation": "基本信息",
|
||||
"wirelessKeyboard": "无线键盘",
|
||||
"doorMagnetic": "门磁",
|
||||
@ -193,7 +190,6 @@
|
||||
"upgrade": "升级",
|
||||
"leisure": "空闲",
|
||||
"checkedIn": "已入住",
|
||||
|
||||
"lanEnglish": "英文",
|
||||
"lanChinese": "中文",
|
||||
"multilingual": "多语言",
|
||||
@ -208,7 +204,6 @@
|
||||
"supportStaff": "客服",
|
||||
"set": "设置",
|
||||
"moreServices": "更多服务",
|
||||
|
||||
"moreSet": "更多设置",
|
||||
"prompTone": "提示音",
|
||||
"touchUnlock": "触摸开锁",
|
||||
@ -267,7 +262,6 @@
|
||||
"aboutToExpire": "即将到期",
|
||||
"changeName": "修改名称",
|
||||
"deAuthorize": "去授权",
|
||||
|
||||
"designation": "名称",
|
||||
"state": "状态",
|
||||
"wifiName": "WiFi名称",
|
||||
@ -297,7 +291,6 @@
|
||||
"preferredDNS": "首选DNS",
|
||||
"alternativeDNS": "备选DNS",
|
||||
"noStaticIPIsUsed": "不使用静态IP",
|
||||
|
||||
"allLock": "所有锁",
|
||||
"searchAllLockType": "搜索所有锁类型",
|
||||
"doorLock": "门锁",
|
||||
@ -314,7 +307,6 @@
|
||||
"nearbyLock": "附近的锁",
|
||||
"addSuccessfullyPleaseRename": "如需修改名字请重新命名,点击确定添加锁",
|
||||
"whenAddingLockThePhoneMustBeNextToTheLock": "添加锁时,手机必须在锁旁边",
|
||||
|
||||
"login": "登录",
|
||||
"register": "注册",
|
||||
"forgetPassword": "忘记密码",
|
||||
@ -327,20 +319,17 @@
|
||||
"countryAndRegion": "国家/地区",
|
||||
"select": "选择",
|
||||
"getVerificationCode": "获取验证码",
|
||||
|
||||
"businessCooperation": "商务合作",
|
||||
"officialWebsite": "官网",
|
||||
"computerWebVersion": "电脑网页版",
|
||||
"hotelSystem": "酒店系统",
|
||||
"manualWebVersion": "说明书网页版",
|
||||
"introduce": "介绍",
|
||||
|
||||
"note": "短信",
|
||||
"mail": "邮件",
|
||||
"advancedFunction": "高级功能",
|
||||
"pushMessage": "推送",
|
||||
"recordsRetention": "记录保存",
|
||||
|
||||
"smsBuyTip": "您可通过短信将密码、电子钥匙信息发给接收人。",
|
||||
"emailBuyTip": "您可通过邮件将密码、电子钥匙信息发给接收人。",
|
||||
"currentRemainingQuantity": "当前剩余数量",
|
||||
@ -348,14 +337,12 @@
|
||||
"customSMSTemplate": "自定义短信模版",
|
||||
"customMailTemplate": "自定义邮件模版",
|
||||
"record": "记录",
|
||||
|
||||
"buyRealNameTip": "给用户发送电子钥匙时,可以要求其开锁前先进行人脸识别,以保证是他本人在操作。人脸实名认证调用国家公安系统接口,为付费功能,请购买次数后再使用。",
|
||||
"buyRealNameSelectYouWantBuyTip": "请选择你希望的实名认证频数",
|
||||
"forTheFirstTime": "仅首次",
|
||||
"onceDay": "每日一次",
|
||||
"weekOnce": "每周一次",
|
||||
"monthOnce": "每月一次",
|
||||
|
||||
"currentState": "当前状态",
|
||||
"onTrial": "试用中",
|
||||
"haveNotOpened": "未开通",
|
||||
@ -367,7 +354,6 @@
|
||||
"tipsForBuyingAdvancedFeatures": "更多的高级功能正在开发中,如果您需要这些功能,欢迎根据锁的数量开通服务。高级功能仅能用于您自己的锁。如果您是授权管理员,请联系锁的最高管理员开通服务。",
|
||||
"freeTrial": "免费体验",
|
||||
"openNow": "立即开通",
|
||||
|
||||
"buySMS": "购买短信",
|
||||
"buyMail": "购买邮件",
|
||||
"buyRealNameAuthenticationTimes": "购买实名认证次数",
|
||||
@ -376,7 +362,6 @@
|
||||
"modeOfPayment": "支付方式",
|
||||
"alipay": "支付宝",
|
||||
"goToPay": "去支付",
|
||||
|
||||
"customTemplatesTip": "你可以自己定义模版的内容,用于发送密码或电子钥匙信息给他人",
|
||||
"haveOpened": "已开通",
|
||||
"unHaveOpenedTip1": "该功能是高级功能,请开通后再使用",
|
||||
@ -395,17 +380,14 @@
|
||||
"templateTip2": "你收到一把电子钥匙,请使用小程序开门。",
|
||||
"templateTip3": "或安装App来开门。",
|
||||
"expectedNotoCount": "预计产生短信条数",
|
||||
|
||||
"templateTip4": "提示:向其他人发送消息时,关键宇",
|
||||
"and": "和",
|
||||
"willBeReplacedWithTheActualValue": "将替换为实际值",
|
||||
"downloadLink": "下载链接",
|
||||
|
||||
"lockScreenTip": "功能开启后,需使用指纹、人脸或账号密码来打开 APP。3分钟内不需要再次验证",
|
||||
"hideInvalidUnlockPermissionsTip": "功能开启后,已失效较长时间的密码、电子钥匙、卡、指纹等开锁权限将被隐藏,不在列表里显示。",
|
||||
"appUnlockRequiresMobilePhoneAccessToTheLockTip": "对于选中的这些锁,当用户用APP开锁时,他的手机需要是连网的,否则无法开锁",
|
||||
"checkAll": "全选",
|
||||
|
||||
"wifiDistributionNetwork": "WiFi配网",
|
||||
"configuringWiFi": "配置WiFi",
|
||||
"pleaseEnterWifiName": "请输入WiFi名字",
|
||||
@ -416,7 +398,6 @@
|
||||
"effectiveDay": "有效日",
|
||||
"stressCard": "胁迫卡",
|
||||
"stressPassword": "胁迫密码",
|
||||
|
||||
"whetherTheEmployeeHasPassword": "员工是否有密码",
|
||||
"whetherTheEmployeeHasCard": "员工是否有卡",
|
||||
"whetherTheEmployeeHasFingerprint": "员工是否有指纹",
|
||||
@ -428,7 +409,6 @@
|
||||
"getFingerprint": "获取指纹",
|
||||
"safeVerify": "安全验证",
|
||||
"deleteAccountTips": "删除账号后,你的所有信息及相关记录都会从平台彻底删除,且不可恢复,是否删除?",
|
||||
|
||||
"humanFace": "人脸",
|
||||
"monitoring": "监控",
|
||||
"videoLog": "视频日志",
|
||||
@ -436,7 +416,6 @@
|
||||
"superAdmin": "超级管理员",
|
||||
"normalUser": "普通用户",
|
||||
"gatewayDevice": "网关设备",
|
||||
|
||||
"illumination": "照明",
|
||||
"doorOpener": "开门器",
|
||||
"faceUnlocks": "面容开锁",
|
||||
@ -445,7 +424,6 @@
|
||||
"motorPowerSetting": "电机功率设置",
|
||||
"bluetoothBroadcast": "蓝牙广播",
|
||||
"whetherInternetRequiredWhenUnlocking": "开锁时是否需联网",
|
||||
|
||||
"selectTheLockToJoinTheGroup": "选择要加入分组的锁",
|
||||
"lockTrCount": "锁数量",
|
||||
"xiaomiIOTPlatform": "小米IOT平台",
|
||||
@ -453,7 +431,6 @@
|
||||
"pleaseEnterAGroupName": "请输入分组名称",
|
||||
"hint": "提示",
|
||||
"areYouSureYouWantToDeleteIt": "确定要删除吗?",
|
||||
|
||||
"faceUnlocksSet": "面容开锁设置",
|
||||
"automaticBrighteningScreen": "自动亮屏",
|
||||
"sensingDistance": "感应距离",
|
||||
@ -464,23 +441,19 @@
|
||||
"closeRange": "近距离",
|
||||
"addAndUseFaceWhenUnlocking": "添加和使用面容开锁时",
|
||||
"addAndUseFaceWhenUnlockingTip": "\n1、请尽量保持单人在门前操作;\n2、请站立在门锁正前方约0.5~0.8米,面向门锁;\n3、请保持脸部无遮挡,露出五官;\n4、面容识别异常时,可触摸数字键盘任意按键,手动重启人脸识别。",
|
||||
|
||||
"second": "秒",
|
||||
"motorPowerSettingTip": "请根据门锁实际情况,请谨慎选择电机功率:",
|
||||
"miniwatt": "小功率:",
|
||||
"miniwattTip": "耗电少",
|
||||
"highPower": "大功率:",
|
||||
"highPowerTip": "如果开锁时锁舌不能正常收回,,或需要带动\n天地钩,建议选择大功率。此时耗电将会\n增加。",
|
||||
|
||||
"openingDirectionSetTip": "请谨慎选择您家的开门方向(如果选择错误,将无法正常开关门):",
|
||||
"openLeft": "左开",
|
||||
"openRight": "右开",
|
||||
"judgmentMethod": "判断方法:\n",
|
||||
"judgmentMethodContent": "人站在屋外,面向入户门。\n如果门的合页或门轴在左边,则门是左开;\n如果门的合页或门轴在右边,则门是右开。\n如果设置错误,将无法正常开关门。\n建议由安装或维修人员操作。",
|
||||
|
||||
"customMode": "自定义模式",
|
||||
"videoSlot": "录像时段",
|
||||
|
||||
"密码": "密码",
|
||||
"卡": "卡",
|
||||
"指纹": "指纹",
|
||||
@ -710,7 +683,6 @@
|
||||
"密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。": "密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。",
|
||||
"密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。": "密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。",
|
||||
"密码不一致哦": "密码不一致哦",
|
||||
|
||||
"相机": "相机",
|
||||
"相册": "相册",
|
||||
"读写": "读写",
|
||||
@ -727,10 +699,8 @@
|
||||
"请手动在系统设置中开启": "请手动在系统设置中开启",
|
||||
"权限以继续使用应用": "权限以继续使用应用。",
|
||||
"去设置": "去设置",
|
||||
|
||||
"虹膜": "虹膜",
|
||||
"手掌": "手掌",
|
||||
|
||||
"商城": "商城",
|
||||
"我的": "我的",
|
||||
"微信公众号推送": "微信公众号推送",
|
||||
@ -826,7 +796,6 @@
|
||||
"当前剩余数量": "当前剩余数量",
|
||||
"购买": "购买",
|
||||
"实名认证为付费功能,请购买后再使用": "实名认证为付费功能,请购买后再使用",
|
||||
|
||||
"退出添加": "退出添加",
|
||||
"管理员已满": "管理员已满",
|
||||
"用户已满": "用户已满",
|
||||
@ -840,12 +809,10 @@
|
||||
"密码已存在": "密码已存在",
|
||||
"请输入密码": "请输入密码",
|
||||
"暂无密码,无需重置": "暂无密码,无需重置",
|
||||
|
||||
"真实姓名": "真实姓名",
|
||||
"身份证号": "身份证号",
|
||||
"请输入真实姓名": "请输入真实姓名",
|
||||
"请输入身份证号": "请输入身份证号",
|
||||
|
||||
"点击返回设备配对": "点击返回设备配对",
|
||||
"无法连接?尝试升级": "无法连接?尝试升级",
|
||||
"固件升级提示": "固件升级提示",
|
||||
@ -864,6 +831,13 @@
|
||||
"姓名": "姓名",
|
||||
"发送": "发送",
|
||||
"请确认姓名全名和身份证号码是否正确": "请确认姓名全名和身份证号码是否正确",
|
||||
"传输期间请勿离开当前页面":"传输期间请勿离开当前页面"
|
||||
"传输期间请勿离开当前页面": "传输期间请勿离开当前页面",
|
||||
"机型": "机型",
|
||||
"硬件版本": "硬件版本",
|
||||
"固件版本": "固件版本",
|
||||
"手动升级": "手动升级",
|
||||
"设备连接中...": "设备连接中...",
|
||||
"升级过程中无法开锁,请先开锁后再升级": "升级过程中无法开锁,请先开锁后再升级",
|
||||
"钥匙无效": "钥匙无效"
|
||||
|
||||
}
|
||||
|
||||
@ -280,6 +280,17 @@ class BlueManage {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// String listStr = scanDevices
|
||||
// // .where((element) =>
|
||||
// // element.advertisementData.advName == 'TMH_dc8f928369ed')
|
||||
// .map((e) => 'advName:${e.advertisementData.advName} '
|
||||
// 'serviceUuids:${e.advertisementData.serviceUuids} '
|
||||
// '是否被重置:${e.advertisementData.serviceUuids[0].toString()[31]}')
|
||||
// .join(',')
|
||||
// .toString();
|
||||
// AppLog.log('--->扫描到的设备 ${listStr} ');
|
||||
|
||||
scanDevicesCallBack(scanDevices);
|
||||
// EventBusManager().eventBusFir(scanDevices);
|
||||
// FlutterBluePlus.stopScan();
|
||||
|
||||
@ -90,7 +90,7 @@ abstract class Reply{
|
||||
case 0x0e:
|
||||
// 钥匙已存在
|
||||
showErrorMessage("钥匙已存在");
|
||||
AppLog.log("$logTag ${commandType!.typeName} 0x0e 钥匙无效");
|
||||
AppLog.log("$logTag ${commandType!.typeName} 0x0e 钥匙已存在");
|
||||
break;
|
||||
case 0x0f:
|
||||
// 用户已存在
|
||||
@ -124,7 +124,7 @@ abstract class Reply{
|
||||
break;
|
||||
case 0xff:
|
||||
// 异常,未知错误
|
||||
AppLog.log("$logTag ${commandType!.typeName} 0xff");
|
||||
AppLog.log("$logTag ${commandType!.typeName} 0xff 异常,未知错误");
|
||||
showErrorMessage("异常,未知错误");
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -47,6 +47,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
logic.checkNext(state.emailOrPhoneController);
|
||||
state.pwdController.text = data['pwd'];
|
||||
logic.checkNext(state.pwdController);
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
@ -223,6 +223,7 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
logic.checkNext(state.emailOrPhoneController);
|
||||
state.pwdController.text = data['pwd'];
|
||||
logic.checkNext(state.pwdController);
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
||||
@ -32,7 +32,8 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
// 监听设备返回的数据
|
||||
void initReplySubscription() {
|
||||
state.replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
state.replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 开门
|
||||
if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) {
|
||||
_replyOpenLock(reply);
|
||||
@ -123,10 +124,6 @@ class LockDetailLogic extends BaseGetXController {
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
|
||||
break;
|
||||
case 0x16:
|
||||
// 正在开锁中...
|
||||
@ -136,8 +133,20 @@ class LockDetailLogic extends BaseGetXController {
|
||||
cancelBlueConnetctToastTimer();
|
||||
});
|
||||
break;
|
||||
case 0x0d:
|
||||
// 正在开锁中...
|
||||
showToast('钥匙无效'.tr);
|
||||
state.openLockBtnState.value = 0;
|
||||
state.openDoorBtnisUneable.value = false;
|
||||
state.animationController!.stop();
|
||||
cancelBlueConnetctToastTimer();
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
state.openLockBtnState.value = 0;
|
||||
state.openDoorBtnisUneable.value = false;
|
||||
state.animationController!.stop();
|
||||
cancelBlueConnetctToastTimer();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -351,7 +360,9 @@ class LockDetailLogic extends BaseGetXController {
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
BlueManage().bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!, (BluetoothConnectionState deviceConnectionState) async {
|
||||
BlueManage()
|
||||
.bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!,
|
||||
(BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
IoSenderManage.senderOpenLock(
|
||||
keyID: BlueManage().connectDeviceName,
|
||||
@ -377,13 +388,15 @@ class LockDetailLogic extends BaseGetXController {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 查询事件记录(时间查询)
|
||||
Future<void> senderReferEventRecordTime() async {
|
||||
showBlueConnetctToastTimer(isShowBlueConnetctToast: false, action: () {
|
||||
showBlueConnetctToastTimer(
|
||||
isShowBlueConnetctToast: false,
|
||||
action: () {
|
||||
BlueManage().disconnect();
|
||||
});
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
@ -413,18 +426,21 @@ class LockDetailLogic extends BaseGetXController {
|
||||
void getServerDatetime() async {
|
||||
var entity = await ApiRepository.to.getServerDatetimeData();
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.differentialTime = entity.data!.date! ~/ 1000 - DateTime.now().millisecondsSinceEpoch ~/ 1000;
|
||||
state.differentialTime = entity.data!.date! ~/ 1000 -
|
||||
DateTime.now().millisecondsSinceEpoch ~/ 1000;
|
||||
// AppLog.log("entity.data!.date! ~/ 1000:${entity.data!.date! ~/ 1000} DateTime.now().millisecondsSinceEpoch ~/ 1000:${DateTime.now().millisecondsSinceEpoch ~/ 1000} 服务器时间差:${state.differentialTime}");
|
||||
}
|
||||
}
|
||||
|
||||
int getUTCNetTime() {
|
||||
return DateTime.now().millisecondsSinceEpoch ~/ 1000 + state.differentialTime;
|
||||
return DateTime.now().millisecondsSinceEpoch ~/ 1000 +
|
||||
state.differentialTime;
|
||||
}
|
||||
|
||||
// 获取手机联网token,根据锁设置里面获取的开锁时是否联网来判断是否调用这个接口
|
||||
void getLockNetToken() async {
|
||||
LockNetTokenEntity entity = await ApiRepository.to.getLockNetToken(lockId: state.keyInfos.value.lockId.toString());
|
||||
LockNetTokenEntity entity = await ApiRepository.to
|
||||
.getLockNetToken(lockId: state.keyInfos.value.lockId.toString());
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.lockNetToken = entity.data!.token!.toString();
|
||||
AppLog.log("从服务器获取联网token:${state.lockNetToken}");
|
||||
@ -442,11 +458,12 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
//电量更新请求
|
||||
Future<void> uploadElectricQuantityRequest() async {
|
||||
KeyOperationRecordEntity entity = await ApiRepository.to.uploadElectricQuantity(
|
||||
KeyOperationRecordEntity entity = await ApiRepository.to
|
||||
.uploadElectricQuantity(
|
||||
electricQuantity: state.electricQuantity.value.toString(),
|
||||
electricQuantityStandby: state.electricQuantityStandby.value.toString(),
|
||||
lockId: state.keyInfos.value.lockId.toString()
|
||||
);
|
||||
electricQuantityStandby:
|
||||
state.electricQuantityStandby.value.toString(),
|
||||
lockId: state.keyInfos.value.lockId.toString());
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
@ -491,7 +508,8 @@ class LockDetailLogic extends BaseGetXController {
|
||||
lockId: state.keyInfos.value.lockId.toString(), records: list);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
// mockNetworkDataRequest();
|
||||
AppLog.log("state.keyInfos.value.keyType:${state.keyInfos.value.keyType}");
|
||||
AppLog.log(
|
||||
"state.keyInfos.value.keyType:${state.keyInfos.value.keyType}");
|
||||
if (state.keyInfos.value.keyType == XSConstantMacro.keyTypeOnce) {
|
||||
// 单次删除
|
||||
deletKeyData();
|
||||
@ -502,9 +520,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
// 普通用户或者授权管理员删除钥匙
|
||||
void deletKeyData() async {
|
||||
var entity = await ApiRepository.to.deleteElectronicKey(
|
||||
keyId:state.keyInfos.value.keyId.toString(),
|
||||
includeUnderlings: 0
|
||||
);
|
||||
keyId: state.keyInfos.value.keyId.toString(), includeUnderlings: 0);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
BlueManage().connectDeviceMacAddress = "";
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
@ -514,20 +530,23 @@ class LockDetailLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// 锁设置里面开启关闭考勤刷新锁详情
|
||||
void initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction() {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
state.lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent =
|
||||
eventBus.on<LockSetChangeSetRefreshLockDetailWithType>().listen((event) {
|
||||
eventBus
|
||||
.on<LockSetChangeSetRefreshLockDetailWithType>()
|
||||
.listen((event) {
|
||||
if (event.type == 0) {
|
||||
// 0考勤
|
||||
state.isAttendance.value = int.parse(event.setResult);
|
||||
state.keyInfos.value.lockSetting!.attendance = int.parse(event.setResult);
|
||||
state.keyInfos.value.lockSetting!.attendance =
|
||||
int.parse(event.setResult);
|
||||
} else if (event.type == 1) {
|
||||
// 1 开锁时是否需联网
|
||||
state.isOpenLockNeedOnline.value = int.parse(event.setResult);
|
||||
state.keyInfos.value.lockSetting!.appUnlockOnline = int.parse(event.setResult);
|
||||
state.keyInfos.value.lockSetting!.appUnlockOnline =
|
||||
int.parse(event.setResult);
|
||||
state.lockNetToken = ""; // 改变开锁时是否联网状态的时候清空token
|
||||
} else if (event.type == 2) {
|
||||
// 2 常开模式
|
||||
@ -560,7 +579,8 @@ class LockDetailLogic extends BaseGetXController {
|
||||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired ||
|
||||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted ||
|
||||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) {
|
||||
text = "${"你的钥匙".tr}${XSConstantMacro.getKeyStatusStr(state.keyInfos.value.keyStatus!)}";
|
||||
text =
|
||||
"${"你的钥匙".tr}${XSConstantMacro.getKeyStatusStr(state.keyInfos.value.keyStatus!)}";
|
||||
} else {
|
||||
text = state.isOpenPassageMode.value == 1
|
||||
? "常开模式启动!长按闭锁".tr
|
||||
@ -585,5 +605,4 @@ class LockDetailLogic extends BaseGetXController {
|
||||
await PermissionDialog.request(Permission.location);
|
||||
await PermissionDialog.requestBluetooth();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import 'dart:typed_data';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/blue/blue_manage.dart';
|
||||
@ -18,6 +19,7 @@ import 'package:star_lock/blue/sender_manage.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSet_logic.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/showTipView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||
|
||||
@ -67,7 +69,15 @@ class LockEscalationLogic extends BaseGetXController {
|
||||
}
|
||||
String md5Str = md5.convert(otaBin!).toString();
|
||||
headJson!['fwMd5'] = md5Str;
|
||||
ShowTipView().showIosTipWithContentDialog("升级过程中无法开锁,请先开锁后再升级".tr,
|
||||
() async {
|
||||
blueOTAUpgrade(headJson!, [0, 0, 0, 0]);
|
||||
EasyLoading.show(
|
||||
status: '设备连接中...'.tr, maskType: EasyLoadingMaskType.black);
|
||||
Future.delayed(const Duration(seconds: 4), () {
|
||||
EasyLoading.dismiss();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//蓝牙操作 ota 升级
|
||||
@ -217,7 +227,7 @@ class LockEscalationLogic extends BaseGetXController {
|
||||
Uint8List bin = data.sublist(binOffset.toInt(), data.length);
|
||||
//md5 校验有问题,暂时不解析
|
||||
String md5Str = md5.convert(bin).toString().toUpperCase();
|
||||
AppLog.log('---> $md5Str ${meta['fwMd5']}');
|
||||
AppLog.log('固件 md5 检验md5:$md5Str 固件信息 md5:${meta['fwMd5']}');
|
||||
if (md5Str != meta['fwMd5']) {
|
||||
showToast('文件校验失败 0x02'.tr);
|
||||
return null;
|
||||
|
||||
@ -31,21 +31,24 @@ class _LockEscalationPageState extends State<LockEscalationPage> {
|
||||
),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(30.w),
|
||||
child: Column(
|
||||
children: [
|
||||
Obx(() {
|
||||
return logic.state.otaUpdateIng.value
|
||||
? PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (didPop) async {
|
||||
if (logic.state.otaUpdateIng.value) {
|
||||
logic.closeOTADAta();
|
||||
}
|
||||
},
|
||||
child: const SizedBox(),
|
||||
)
|
||||
: const SizedBox();
|
||||
child: Obx(() {
|
||||
return updateView(logic);
|
||||
}),
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
Widget updateView(LockEscalationLogic logic) {
|
||||
if (logic.state.otaUpdateIng.value) {
|
||||
return otaUpdate(logic);
|
||||
}
|
||||
return defaultUpdate(logic);
|
||||
}
|
||||
|
||||
//升级
|
||||
Widget defaultUpdate(LockEscalationLogic logic) {
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 60.h,
|
||||
),
|
||||
@ -63,8 +66,7 @@ class _LockEscalationPageState extends State<LockEscalationPage> {
|
||||
Text(
|
||||
// TranslationLoader.lanKeys!.haveNewVersion!.tr,
|
||||
"未发现新版本",
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
@ -73,8 +75,7 @@ class _LockEscalationPageState extends State<LockEscalationPage> {
|
||||
),
|
||||
Text(
|
||||
"${TranslationLoader.lanKeys!.currentVersion!.tr}:1.0.0",
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
|
||||
style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40.h,
|
||||
@ -89,44 +90,74 @@ class _LockEscalationPageState extends State<LockEscalationPage> {
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
Obx(() {
|
||||
return !logic.state.otaUpdateIng.value
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
// Container(
|
||||
// margin: EdgeInsets.only(top: 8, bottom: 8),
|
||||
// width: Get.width,
|
||||
// child: Center(
|
||||
// child: Text(
|
||||
// // "${TranslationLoader.lanKeys!.newVersion!.tr}:1.0.1",
|
||||
// "未发现新版本",
|
||||
// style: TextStyle(
|
||||
// color: AppColors.mainColor,
|
||||
// fontSize: 18.sp),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
GestureDetector(
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
logic.otaUpdate();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'手动升级',
|
||||
'手动升级'.tr,
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 50.w, vertical: 15.h),
|
||||
);
|
||||
}
|
||||
|
||||
//ota升级
|
||||
Widget otaUpdate(LockEscalationLogic logic) {
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Text(
|
||||
'${'机型'.tr}:${logic.headJson?['platform']}-${logic.headJson?['product']}',
|
||||
style: TextStyle(
|
||||
color: AppColors.blackColor,
|
||||
fontSize: 22.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
Text(
|
||||
'${'硬件版本'.tr}:${logic.headJson?['hwVersion']}',
|
||||
style: TextStyle(
|
||||
color: AppColors.blackColor,
|
||||
fontSize: 22.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
Text(
|
||||
'${'固件版本'.tr}:${logic.headJson?['fwVersion']}',
|
||||
style: TextStyle(
|
||||
color: AppColors.blackColor,
|
||||
fontSize: 22.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Text(
|
||||
'传输期间请勿离开当前页面'.tr,
|
||||
style: TextStyle(
|
||||
color: AppColors.blackColor,
|
||||
fontSize: 20.sp,
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.h),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@ -142,25 +173,19 @@ class _LockEscalationPageState extends State<LockEscalationPage> {
|
||||
),
|
||||
Expanded(
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10.r)),
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
||||
child: LinearProgressIndicator(
|
||||
value: logic
|
||||
.state.otaProgress.value, // 50% 进度
|
||||
value: logic.state.otaProgress.value, // 50% 进度
|
||||
backgroundColor: Colors.grey[200],
|
||||
valueColor:
|
||||
AlwaysStoppedAnimation<Color>(
|
||||
AppColors.mainColor),
|
||||
AlwaysStoppedAnimation<Color>(AppColors.mainColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -27,12 +26,17 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.addLock!.tr, haveBack:true, backgroundColor: AppColors.mainColor),
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.addLock!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 80.h,),
|
||||
SizedBox(
|
||||
height: 80.h,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 50.w, right: 50.w),
|
||||
width: 1.sw,
|
||||
@ -40,17 +44,24 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(TranslationLoader.lanKeys!.addSuccessfullyPleaseRename!.tr, style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500))
|
||||
),
|
||||
child: Text(
|
||||
TranslationLoader
|
||||
.lanKeys!.addSuccessfullyPleaseRename!.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp, fontWeight: FontWeight.w500))),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 80.h,),
|
||||
SizedBox(
|
||||
height: 80.h,
|
||||
),
|
||||
Container(
|
||||
height: 80.h,
|
||||
// color: Colors.red,
|
||||
padding: EdgeInsets.only(left: 50.w, right: 50.w),
|
||||
child: TextField(
|
||||
focusNode: state.focusNode,
|
||||
autofocus: true,
|
||||
controller: state.aliNameController,
|
||||
onChanged: (v) {
|
||||
state.aliName.value = v;
|
||||
@ -66,35 +77,26 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
|
||||
// height: 1.1,
|
||||
fontSize: 24.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: const Color(0xFF999999)
|
||||
),
|
||||
color: const Color(0xFF999999)),
|
||||
border: OutlineInputBorder(
|
||||
///设置边框四个角的弧度
|
||||
borderRadius: BorderRadius.all(Radius.circular(50.h)),
|
||||
///用来配置边框的样式
|
||||
borderSide: BorderSide(
|
||||
///设置边框的颜色
|
||||
color: AppColors.mainColor,
|
||||
///设置边框的粗细
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
///用来配置输入框获取焦点时的颜色
|
||||
focusedBorder: OutlineInputBorder(
|
||||
///设置边框四个角的弧度
|
||||
borderRadius: BorderRadius.all(Radius.circular(50.h)),
|
||||
///用来配置边框的样式
|
||||
borderSide: BorderSide(
|
||||
///设置边框的颜色
|
||||
color: AppColors.mainColor,
|
||||
///设置边框的粗细
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
)
|
||||
)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 120.h,
|
||||
),
|
||||
SizedBox(height: 120.h,),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.sure!.tr,
|
||||
borderRadius: 20.w,
|
||||
@ -104,17 +106,12 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
|
||||
// top: 30.w,
|
||||
// bottom: 30.w
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 25.w,
|
||||
bottom: 25.w
|
||||
),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {
|
||||
logic.addUserConnectBlue();
|
||||
}
|
||||
),
|
||||
}),
|
||||
],
|
||||
)
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
@override
|
||||
@ -130,6 +127,7 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
/// 取消路由订阅
|
||||
state.focusNode.unfocus();
|
||||
AppRouteObserver().routeObserver.unsubscribe(this);
|
||||
super.dispose();
|
||||
BlueManage().stopScan();
|
||||
|
||||
@ -1,16 +1,15 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../blue/blue_manage.dart';
|
||||
|
||||
class SaveLockState {
|
||||
|
||||
var aliName = ''.obs;
|
||||
var pwdTimestamp = 0.obs;
|
||||
var addressInfo = {}.obs;
|
||||
|
||||
TextEditingController aliNameController = TextEditingController();
|
||||
FocusNode focusNode = FocusNode();
|
||||
|
||||
var lockUserNo = 0;
|
||||
var lockInfo = {};
|
||||
@ -24,6 +23,7 @@ class SaveLockState {
|
||||
|
||||
// 管理员密码
|
||||
var adminPasswordTF = TextEditingController();
|
||||
|
||||
var adminPassword = '';
|
||||
var lockId = 0;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user