Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock
# Conflicts: # star_lock/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart # star_lock/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart # star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart # star_lock/lib/mine/addLock/saveLock/saveLock_state.dart
This commit is contained in:
commit
76347a27ee
@ -581,7 +581,7 @@
|
||||
"您好,您的电子钥匙生成成功": "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",
|
||||
"是否为管理员": "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",
|
||||
@ -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"
|
||||
}
|
||||
|
||||
@ -605,7 +605,7 @@
|
||||
"您好,您的电子钥匙生成成功": "您好,您的电子钥匙生成成功",
|
||||
"生效时间不能小于当前时间": "生效时间不能小于当前时间",
|
||||
"结束时间不能小于当前时间": "结束时间不能小于当前时间",
|
||||
"是否是管理员": "是否是管理员",
|
||||
"是否为管理员": "是否为管理员",
|
||||
"已连接到锁,请将卡靠近锁的读卡区": "已连接到锁,请将卡靠近锁的读卡区",
|
||||
"尝试连接设备...": "尝试连接设备...",
|
||||
"地理位置": "地理位置",
|
||||
@ -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": "录像时段",
|
||||
|
||||
"密码": "密码",
|
||||
"卡": "卡",
|
||||
"指纹": "指纹",
|
||||
@ -607,7 +580,7 @@
|
||||
"您好,您的电子钥匙生成成功": "您好,您的电子钥匙生成成功",
|
||||
"生效时间不能小于当前时间": "生效时间不能小于当前时间",
|
||||
"结束时间不能小于当前时间": "结束时间不能小于当前时间",
|
||||
"是否是管理员": "是否是管理员",
|
||||
"是否为管理员": "是否为管理员",
|
||||
"已连接到锁,请将卡靠近锁的读卡区": "已连接到锁,请将卡靠近锁的读卡区",
|
||||
"尝试连接设备...": "尝试连接设备...",
|
||||
"地理位置": "地理位置",
|
||||
@ -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 @@
|
||||
"姓名": "姓名",
|
||||
"发送": "发送",
|
||||
"请确认姓名全名和身份证号码是否正确": "请确认姓名全名和身份证号码是否正确",
|
||||
"传输期间请勿离开当前页面":"传输期间请勿离开当前页面"
|
||||
"传输期间请勿离开当前页面": "传输期间请勿离开当前页面",
|
||||
"机型": "机型",
|
||||
"硬件版本": "硬件版本",
|
||||
"固件版本": "固件版本",
|
||||
"手动升级": "手动升级",
|
||||
"设备连接中...": "设备连接中...",
|
||||
"升级过程中无法开锁,请先开锁后再升级": "升级过程中无法开锁,请先开锁后再升级",
|
||||
"钥匙无效": "钥匙无效"
|
||||
|
||||
}
|
||||
|
||||
@ -2,7 +2,8 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:star_lock/debug/debug_console.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_console.dart';
|
||||
|
||||
|
||||
class AppLog {
|
||||
static bool _printLog = false;
|
||||
@ -13,6 +14,7 @@ class AppLog {
|
||||
_onlyError = onlyError ?? false;
|
||||
}
|
||||
static log(String msg,{bool? error}){
|
||||
DebugConsole.info(msg);
|
||||
if(!kDebugMode)return;
|
||||
error = error ?? false;
|
||||
// if(!_printLog)return;
|
||||
@ -20,7 +22,6 @@ class AppLog {
|
||||
if(error){
|
||||
msg = '----->>> $msg';
|
||||
}
|
||||
DebugConsole.info(msg);
|
||||
Get.log(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -3,7 +3,6 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/widget/star_input_formatter.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
@ -48,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(
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:star_lock/debug/debug_console.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
import 'app.dart';
|
||||
|
||||
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
||||
@ -259,13 +260,17 @@ class _AddCardPageState extends State<AddCardPage>
|
||||
Widget keyBottomWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "是否是管理员".tr,
|
||||
Obx(() => Visibility(
|
||||
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
SizedBox(width: 60.w, height: 50.h, child: _isAdmin())))),
|
||||
SizedBox(height: 10.h),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.stressCard!.tr,
|
||||
@ -369,7 +374,7 @@ class _AddCardPageState extends State<AddCardPage>
|
||||
);
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
// 是否为管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
@ -41,7 +40,8 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
body: ListView(
|
||||
children: [
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "${TranslationLoader.lanKeys!.card!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
||||
leftTitel:
|
||||
"${TranslationLoader.lanKeys!.card!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
||||
rightTitle: state.typeNumber.value,
|
||||
isHaveDirection: false,
|
||||
isHaveLine: true)),
|
||||
@ -65,7 +65,11 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
});
|
||||
})),
|
||||
Obx(() => Visibility(
|
||||
visible: (state.keyType.value == 4 || state.keyType.value == 2 || state.keyType.value == 1) ? true : false,
|
||||
visible: (state.keyType.value == 4 ||
|
||||
state.keyType.value == 2 ||
|
||||
state.keyType.value == 1)
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||
allHeight: 70.h,
|
||||
@ -162,13 +166,15 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
isTipsImg: false,
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isStressFingerprint()))),
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _isStressFingerprint()))),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "是否是管理员".tr,
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||
@ -217,7 +223,7 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
);
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
// 是否为管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
@ -225,9 +231,9 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isAdministrator.value,
|
||||
onChanged: (value) {
|
||||
state.isAdministrator.value = value;
|
||||
state.isDeletCard.value = false;
|
||||
logic.senderAddICCard();
|
||||
// state.isAdministrator.value = value;
|
||||
// state.isDeletCard.value = false;
|
||||
// logic.senderAddICCard();
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -282,5 +288,4 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
state.ifCurrentScreen.value = false;
|
||||
state.sureBtnState.value = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@ -14,7 +12,7 @@ class CardDetailState{
|
||||
var sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
||||
var isDeletCard = true.obs; // 是否删除卡
|
||||
var isStressCard = false.obs; // 是否胁迫
|
||||
var isAdministrator = false.obs;// 是否是管理员
|
||||
var isAdministrator = false.obs; // 是否为管理员
|
||||
|
||||
final typeNumber = "".obs; // 指纹号
|
||||
final typeName = "".obs; // 指纹名字
|
||||
@ -43,9 +41,11 @@ class CardDetailState{
|
||||
keyType.value = fingerprintItemData.value.cardType!;
|
||||
adder.value = fingerprintItemData.value.senderUsername!;
|
||||
addTime.value = fingerprintItemData.value.createDate!;
|
||||
isStressCard.value = fingerprintItemData.value.isCoerced! == 2 ? true : false;
|
||||
isStressCard.value =
|
||||
fingerprintItemData.value.isCoerced! == 2 ? true : false;
|
||||
weekDay.value = fingerprintItemData.value.weekDay!;
|
||||
isAdministrator.value = fingerprintItemData.value.cardRight! == 1 ? true : false;
|
||||
isAdministrator.value =
|
||||
fingerprintItemData.value.cardRight! == 1 ? true : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -162,19 +162,11 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware{
|
||||
child: Stack(
|
||||
children: [
|
||||
timelineData.imagesUrl!.isNotEmpty
|
||||
?
|
||||
Image.network(
|
||||
? Image.network(
|
||||
timelineData.imagesUrl!,
|
||||
width: 260.w,
|
||||
height: 260.h,
|
||||
)
|
||||
// Image(
|
||||
// image: const AssetImage(
|
||||
// 'images/main/icon_lockDetail_monitoringvoiceFrist.png'),
|
||||
// width: 240.w,
|
||||
// height: 180.h,
|
||||
// fit: BoxFit.contain,
|
||||
// )
|
||||
: Container(),
|
||||
Positioned(
|
||||
top: 150.h,
|
||||
@ -263,5 +255,4 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware{
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
state.ifCurrentScreen.value = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -139,14 +139,9 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
state.getIDCardNumber.value.isEmpty) {
|
||||
ShowCupertinoAlertView()
|
||||
.showOpenAuthWithIDCardInfoAlert((idCard, realName) {
|
||||
if (idCard.isNotEmpty && realName.isNotEmpty) {
|
||||
state.getIDCardNumber.value = idCard;
|
||||
state.getRealName.value = realName;
|
||||
state.getIDCardNumber.value = idCard ?? '';
|
||||
state.getRealName.value = realName ?? '';
|
||||
updateRealNameInfoWithAuthStatus(realNameAuthStatus);
|
||||
} else {
|
||||
showToast("请输入完整信息".tr);
|
||||
return;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
updateRealNameInfoWithAuthStatus(realNameAuthStatus);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart';
|
||||
@ -230,8 +231,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
.currentKeyInfo
|
||||
.lockSetting!
|
||||
.remoteUnlock ==
|
||||
1 &&
|
||||
state.itemData.value.keyRight != 1
|
||||
1
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
@ -332,6 +332,10 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
title: tipsTitle,
|
||||
tipTitle: "请输入".tr,
|
||||
controller: logic.getCurrentController(alertEnum),
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.deny('\n'),
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
],
|
||||
sureClick: () {
|
||||
if (alertEnum == ShowAlertEnum.name) {
|
||||
logic.modifyKeyNameRequest();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_state.dart';
|
||||
@ -144,7 +145,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
endDate: int.parse(endDate),
|
||||
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
||||
isCameraEnable: '2',
|
||||
isRemoteUnlock: state.isRemoteUnlock == true ? '1' : '2',
|
||||
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
||||
keyNameForAdmin: state.keyNameController.text,
|
||||
keyRight: '0',
|
||||
keyType: getKeyType,
|
||||
|
||||
@ -525,13 +525,13 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
: false),
|
||||
child: Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
||||
rightTitle: "",
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _remoteSwitch(true, logic)),
|
||||
action: () {}),
|
||||
action: () {})),
|
||||
Container(height: 10.h),
|
||||
],
|
||||
),
|
||||
@ -546,11 +546,11 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: isRemote
|
||||
? logic.state.isRemoteUnlock
|
||||
? logic.state.isRemoteUnlock.value
|
||||
: logic.state.isAuthentication.value,
|
||||
onChanged: (value) {
|
||||
if (isRemote) {
|
||||
logic.state.isRemoteUnlock = !logic.state.isRemoteUnlock;
|
||||
logic.state.isRemoteUnlock.value = !logic.state.isRemoteUnlock.value;
|
||||
} else {
|
||||
logic.state.isAuthentication.value =
|
||||
!logic.state.isAuthentication.value;
|
||||
|
||||
@ -13,7 +13,7 @@ class SendElectronicKeyViewState {
|
||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||
late Contact contact;
|
||||
|
||||
bool isRemoteUnlock = false; //是否允许远程开锁
|
||||
var isRemoteUnlock = false.obs; //是否允许远程开锁
|
||||
var isAuthentication = false.obs; //是否可以实名认证
|
||||
|
||||
var timeLimitBeginTime = DateTool().dateToYMDHNString(
|
||||
|
||||
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||
@ -164,8 +165,8 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
rightTitle: state.timeLimitEndTime.value,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
PDuration selectDate =
|
||||
PDuration.parse(DateTime.tryParse(state.timeLimitEndTime.value));
|
||||
PDuration selectDate = PDuration.parse(
|
||||
DateTime.tryParse(state.timeLimitEndTime.value));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
||||
state.timeLimitEndTime.value =
|
||||
@ -259,13 +260,17 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
Widget keyBottomWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: "是否是管理员".tr,
|
||||
Obx(() => Visibility(
|
||||
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))),
|
||||
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))))),
|
||||
SizedBox(height: 30.h),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||
@ -339,7 +344,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
);
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
// 是否为管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
|
||||
@ -8,10 +8,14 @@ class AddFaceTypeState {
|
||||
final selectType = "0".obs; // 0永久 1显示 2循环
|
||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
final isStressFingerprint = false.obs;
|
||||
final isAdministrator = false.obs; // 是否是管理员
|
||||
final isAdministrator = false.obs; // 是否为管理员
|
||||
|
||||
var timeLimitBeginTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;// 限时开始时间
|
||||
var timeLimitEndTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;// 限时结束时间
|
||||
var timeLimitBeginTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
.obs; // 限时开始时间
|
||||
var timeLimitEndTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
.obs; // 限时结束时间
|
||||
|
||||
var cycleBeginTime = "".obs; // 循环开始时间
|
||||
var cycleEndTime = "".obs; // 循环结束时间
|
||||
@ -28,7 +32,8 @@ class AddFaceTypeState {
|
||||
fromType.value = map["fromType"];
|
||||
// 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
if (fromType.value == 2) {
|
||||
fromTypeTwoStaffName.value = map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字
|
||||
fromTypeTwoStaffName.value =
|
||||
map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,12 +177,12 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
||||
// isHaveLine: true,
|
||||
// rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isStressFace()))),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "是否是管理员".tr,
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||
@ -205,7 +205,8 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
||||
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr,
|
||||
() async {
|
||||
state.isDeletFace.value = true;
|
||||
logic.senderAddFace();
|
||||
});
|
||||
@ -231,7 +232,7 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
||||
);
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
// 是否为管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
@ -239,9 +240,9 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isAdministrator.value,
|
||||
onChanged: (value) {
|
||||
state.isAdministrator.value = value;
|
||||
state.isDeletFace.value = false;
|
||||
logic.senderAddFace();
|
||||
// state.isAdministrator.value = value;
|
||||
// state.isDeletFace.value = false;
|
||||
// logic.senderAddFace();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class FaceDetailState {
|
||||
var sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
||||
var isDeletFace = true.obs; // 是否删除卡
|
||||
var isStressFace = false.obs; // 是否胁迫
|
||||
var isAdministrator = false.obs;// 是否是管理员
|
||||
var isAdministrator = false.obs; // 是否为管理员
|
||||
|
||||
FaceDetailState() {
|
||||
Map map = Get.arguments;
|
||||
|
||||
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
||||
@ -249,13 +250,17 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
Widget keyBottomWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "是否是管理员".tr,
|
||||
Obx(() => Visibility(
|
||||
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, height: 50.h, child: _isAdmin())))),
|
||||
SizedBox(height: 10.h),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.stressFingerprint!.tr,
|
||||
@ -424,7 +429,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
);
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
// 是否为管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@ -9,10 +8,14 @@ class AddFingerprintState{
|
||||
final selectType = "0".obs; // 0永久 1显示 2循环
|
||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
final isStressFingerprint = false.obs;
|
||||
final isAdministrator = false.obs;// 是否是管理员
|
||||
final isAdministrator = false.obs; // 是否为管理员
|
||||
|
||||
var timeLimitBeginTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;// 限时开始时间
|
||||
var timeLimitEndTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;// 限时结束时间
|
||||
var timeLimitBeginTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
.obs; // 限时开始时间
|
||||
var timeLimitEndTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
.obs; // 限时结束时间
|
||||
var cycleBeginTime = "".obs; // 循环开始时间
|
||||
var cycleEndTime = "".obs; // 循环结束时间
|
||||
var effectiveDateTime = "".obs; // 生效时间
|
||||
@ -28,7 +31,8 @@ class AddFingerprintState{
|
||||
fromType.value = map["fromType"];
|
||||
// 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
if (fromType.value == 2) {
|
||||
fromTypeTwoStaffName.value = map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字
|
||||
fromTypeTwoStaffName.value =
|
||||
map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
@ -26,7 +25,8 @@ class FingerprintDetailPage extends StatefulWidget {
|
||||
State<FingerprintDetailPage> createState() => _FingerprintDetailPageState();
|
||||
}
|
||||
|
||||
class _FingerprintDetailPageState extends State<FingerprintDetailPage> with RouteAware {
|
||||
class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
||||
with RouteAware {
|
||||
final logic = Get.put(FingerprintDetailLogic());
|
||||
final state = Get.find<FingerprintDetailLogic>().state;
|
||||
|
||||
@ -42,7 +42,8 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
body: Column(
|
||||
children: [
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
||||
leftTitel:
|
||||
"${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
||||
rightTitle: state.typeNumber.value,
|
||||
isHaveDirection: false,
|
||||
isHaveLine: true)),
|
||||
@ -64,10 +65,13 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
state.typeName.value = state.changeNameController.text;
|
||||
logic.editFingerprintsData();
|
||||
});
|
||||
|
||||
})),
|
||||
Obx(() => Visibility(
|
||||
visible: (state.keyType.value == 4 || state.keyType.value == 2 || state.keyType.value == 1) ? true : false,
|
||||
visible: (state.keyType.value == 4 ||
|
||||
state.keyType.value == 2 ||
|
||||
state.keyType.value == 1)
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||
allHeight: 70.h,
|
||||
@ -78,9 +82,12 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
action: () async {
|
||||
if (state.keyType.value == 2 || state.keyType.value == 1) {
|
||||
// 限时
|
||||
var data = await Get.toNamed(Routers.otherTypeKeyChangeDatePage, arguments: {
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeDatePage,
|
||||
arguments: {
|
||||
"pushType": 1,
|
||||
"fingerprintItemData": state.fingerprintItemData.value,
|
||||
"fingerprintItemData":
|
||||
state.fingerprintItemData.value,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
@ -91,9 +98,12 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
}
|
||||
} else if (state.keyType.value == 4) {
|
||||
// 循环
|
||||
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: {
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeValidityDatePage,
|
||||
arguments: {
|
||||
"pushType": 1,
|
||||
"fingerprintItemData": state.fingerprintItemData.value,
|
||||
"fingerprintItemData":
|
||||
state.fingerprintItemData.value,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
@ -114,9 +124,12 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: {
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeValidityDatePage,
|
||||
arguments: {
|
||||
"pushType": 1,
|
||||
"fingerprintItemData": state.fingerprintItemData.value,
|
||||
"fingerprintItemData":
|
||||
state.fingerprintItemData.value,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
@ -132,12 +145,16 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
visible: state.keyType.value == 4 ? true : false,
|
||||
child: Obx(() => CommonItem(
|
||||
leftTitel: "有效时间".tr,
|
||||
rightTitle: "${DateTool().dateToHNString(state.startDate.value)}-${DateTool().dateToHNString(state.endTime.value)}",
|
||||
rightTitle:
|
||||
"${DateTool().dateToHNString(state.startDate.value)}-${DateTool().dateToHNString(state.endTime.value)}",
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: {
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeValidityDatePage,
|
||||
arguments: {
|
||||
"pushType": 1,
|
||||
"fingerprintItemData": state.fingerprintItemData.value,
|
||||
"fingerprintItemData":
|
||||
state.fingerprintItemData.value,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
@ -154,12 +171,11 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
leftTitel: TranslationLoader.lanKeys!.additive!.tr,
|
||||
rightTitle: state.adder.value,
|
||||
isHaveLine: true,
|
||||
action: () {
|
||||
|
||||
})),
|
||||
action: () {})),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.addTime!.tr,
|
||||
rightTitle: DateTool().dateToYMDHNString(state.addTime.value.toString()),
|
||||
rightTitle: DateTool()
|
||||
.dateToYMDHNString(state.addTime.value.toString()),
|
||||
)),
|
||||
SizedBox(height: 10.h),
|
||||
Obx(() => CommonItem(
|
||||
@ -171,11 +187,12 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _isStressFingerprint()))),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "是否是管理员".tr,
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||
@ -195,10 +212,12 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
btnName: TranslationLoader.lanKeys!.delete!.tr,
|
||||
isDelete: true,
|
||||
borderRadius: 20.w,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||
margin: EdgeInsets.only(
|
||||
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr,
|
||||
() async {
|
||||
state.isDeletFingerprint.value = true;
|
||||
logic.senderAddFingerprint();
|
||||
});
|
||||
@ -225,7 +244,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
);
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
// 是否为管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
@ -233,9 +252,9 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isAdministrator.value,
|
||||
onChanged: (value) {
|
||||
state.isAdministrator.value = value;
|
||||
state.isDeletFingerprint.value = false;
|
||||
logic.senderAddFingerprint();
|
||||
// state.isAdministrator.value = value;
|
||||
// state.isDeletFingerprint.value = false;
|
||||
// logic.senderAddFingerprint();
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -290,5 +309,4 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
state.ifCurrentScreen.value = false;
|
||||
state.sureBtnState.value = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@ -25,7 +24,7 @@ class FingerprintDetailState{
|
||||
var sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
||||
var isDeletFingerprint = true.obs; // 是否删除卡
|
||||
final isStressFingerprint = false.obs;
|
||||
var isAdministrator = false.obs;// 是否是管理员
|
||||
var isAdministrator = false.obs; // 是否为管理员
|
||||
|
||||
FingerprintDetailState() {
|
||||
Map map = Get.arguments;
|
||||
@ -42,9 +41,11 @@ class FingerprintDetailState{
|
||||
keyType.value = fingerprintItemData.value.fingerprintType!;
|
||||
adder.value = fingerprintItemData.value.senderUsername!;
|
||||
addTime.value = fingerprintItemData.value.createDate!;
|
||||
isStressFingerprint.value = fingerprintItemData.value.isCoerced! == 2 ? true : false;
|
||||
isStressFingerprint.value =
|
||||
fingerprintItemData.value.isCoerced! == 2 ? true : false;
|
||||
weekDay.value = fingerprintItemData.value.weekDay!;
|
||||
isAdministrator.value = fingerprintItemData.value.fingerRight! == 1 ? true : false;
|
||||
isAdministrator.value =
|
||||
fingerprintItemData.value.fingerRight! == 1 ? true : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/iris/addIrisType/addIrisType_logic.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||
@ -249,13 +250,17 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
|
||||
Widget keyBottomWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: "是否是管理员".tr,
|
||||
Obx(() => Visibility(
|
||||
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))),
|
||||
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))))),
|
||||
SizedBox(height: 30.h),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||
@ -329,7 +334,7 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
|
||||
);
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
// 是否为管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
|
||||
@ -7,7 +7,7 @@ class AddIrisTypeState {
|
||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
var fromTypeTwoStaffName = "".obs; // 考勤添加人脸员工名字
|
||||
final isStressFingerprint = false.obs;
|
||||
final isAdministrator = false.obs; // 是否是管理员
|
||||
final isAdministrator = false.obs; // 是否为管理员
|
||||
|
||||
var beginTime = "".obs; // 开始时间
|
||||
var endTime = "".obs; // 结束时间
|
||||
@ -24,6 +24,5 @@ class AddIrisTypeState {
|
||||
// fromTypeTwoStaffName = map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字
|
||||
// // nameController.text = fromTypeTwoStaffName.value;
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,8 @@ import 'package:intl/intl.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
|
||||
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||
|
||||
import '../../../app_settings/app_settings.dart';
|
||||
import '../../../blue/blue_manage.dart';
|
||||
import '../../../blue/io_protocol/io_openLock.dart';
|
||||
@ -16,7 +18,6 @@ import '../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../blue/sender_manage.dart';
|
||||
import '../../../network/api_repository.dart';
|
||||
import '../../../permission/permission_dialog.dart';
|
||||
import '../../../tools/baseGetXController.dart';
|
||||
import '../../../tools/commonDataManage.dart';
|
||||
import '../../../tools/eventBusEventManage.dart';
|
||||
@ -32,7 +33,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 +125,6 @@ class LockDetailLogic extends BaseGetXController {
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
|
||||
break;
|
||||
case 0x16:
|
||||
// 正在开锁中...
|
||||
@ -136,8 +134,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 +361,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 +389,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 +427,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,12 +459,13 @@ 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(),
|
||||
electricQuantityStandby:
|
||||
state.electricQuantityStandby.value.toString(),
|
||||
lockId: state.keyInfos.value.lockId.toString(),
|
||||
isUnShowLoading: true
|
||||
);
|
||||
isUnShowLoading: true);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
@ -476,9 +494,9 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
// 查询锁记录最后时间
|
||||
void getLockRecordLastUploadDataTime() async {
|
||||
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to.getLockRecordLastUploadDataTime(
|
||||
lockId: state.keyInfos.value.lockId.toString()
|
||||
);
|
||||
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to
|
||||
.getLockRecordLastUploadDataTime(
|
||||
lockId: state.keyInfos.value.lockId.toString());
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.operateDate = entity.data!.operateDate! ~/ 1000;
|
||||
senderReferEventRecordTime();
|
||||
@ -487,13 +505,13 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
// 操作记录上传
|
||||
void lockRecordUploadData(List list) async {
|
||||
KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordUploadData(
|
||||
lockId: state.keyInfos.value.lockId.toString(),
|
||||
records: list
|
||||
);
|
||||
KeyOperationRecordEntity entity = await ApiRepository.to
|
||||
.lockRecordUploadData(
|
||||
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();
|
||||
@ -504,9 +522,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((_) {
|
||||
@ -516,20 +532,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 常开模式
|
||||
@ -562,7 +581,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
|
||||
@ -587,5 +607,4 @@ class LockDetailLogic extends BaseGetXController {
|
||||
await PermissionDialog.request(Permission.location);
|
||||
await PermissionDialog.requestBluetooth();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,15 +1,14 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_list_page.dart';
|
||||
import 'package:star_lock/tools/aliyunRealNameAuth/aliyunRealNameAuthHandle.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
import 'package:star_lock/tools/showTipView.dart';
|
||||
import 'package:star_lock/widget/flavors_img.dart';
|
||||
|
||||
@ -147,7 +146,9 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: Obx(() {
|
||||
return Column(
|
||||
return Stack(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 35.h,
|
||||
@ -157,14 +158,24 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
height: 35.h,
|
||||
),
|
||||
labelText('images/icon_slider_horizontal.png', '功能'.tr, () {
|
||||
Get.to(
|
||||
LockDetailListPage(title: '功能'.tr, items: getBottomWidget()));
|
||||
Get.to(LockDetailListPage(
|
||||
title: '功能'.tr, items: getBottomWidget()));
|
||||
}),
|
||||
labelText('images/icon_puzzlepiece_extension.png', '配件'.tr, () {
|
||||
Get.to(LockDetailListPage(
|
||||
title: '配件'.tr, items: getAttachmentWidget()));
|
||||
}),
|
||||
],
|
||||
),
|
||||
Visibility(
|
||||
visible: state.iSClosedUnlockSuccessfulPopup.value,
|
||||
child: Container(
|
||||
width: 1.sw,
|
||||
height: 1.sh - ScreenUtil().statusBarHeight * 2,
|
||||
color: Colors.black.withOpacity(0.3),
|
||||
child: _unlockSuccessWidget()),
|
||||
)
|
||||
],
|
||||
);
|
||||
}),
|
||||
);
|
||||
@ -182,7 +193,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.15),
|
||||
offset: Offset(0, 0),
|
||||
offset: const Offset(0, 0),
|
||||
blurRadius: 10.r,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
@ -257,7 +268,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.3),
|
||||
offset: Offset(0, 0),
|
||||
offset: const Offset(0, 0),
|
||||
blurRadius: 10.r,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
@ -449,19 +460,11 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
),
|
||||
Visibility(
|
||||
visible: state.iSClosedUnlockSuccessfulPopup.value,
|
||||
// visible: true,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
state.iSClosedUnlockSuccessfulPopup.value = false;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: 1.sw,
|
||||
height: 1.sh - ScreenUtil().statusBarHeight * 2,
|
||||
color: Colors.black.withOpacity(0.3),
|
||||
child: _unlockSuccessWidget()),
|
||||
),
|
||||
)
|
||||
]),
|
||||
],
|
||||
@ -631,6 +634,33 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
],
|
||||
),
|
||||
)),
|
||||
Positioned(
|
||||
right: 90.w,
|
||||
bottom: 1,
|
||||
child: Obx(() => Visibility(
|
||||
visible: state.keyInfos.value.lockSetting!.remoteUnlock == 1
|
||||
? true
|
||||
: false,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
ShowCupertinoAlertView()
|
||||
.isToRemoteUnLockAlert((idCard, name) {
|
||||
if (state.keyInfos.value.hasGateway != 1) {
|
||||
logic.showToast('附近没有可用网关');
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Align(
|
||||
alignment: const Alignment(0.6, 1),
|
||||
child: FlavorsImg(
|
||||
child: Image.asset(
|
||||
'images/main/icon_main_remoteUnlocking.png',
|
||||
width: 50.w,
|
||||
height: 52.w,
|
||||
),
|
||||
)),
|
||||
))),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -652,7 +682,9 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
),
|
||||
F.sw(defaultCall: () => adminInfoView(), xhjCall: () => SizedBox()),
|
||||
F.sw(
|
||||
defaultCall: () => adminInfoView(),
|
||||
xhjCall: () => const SizedBox()),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
@ -691,7 +723,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
if (add) SizedBox(width: 20.w) else SizedBox(width: 40.w),
|
||||
FlavorsImg(
|
||||
child: Image.asset(
|
||||
state.keyInfos.value.remoteEnable == 1
|
||||
state.keyInfos.value.hasGateway == 1
|
||||
? 'images/main/icon_main_remoteUnlocking.png'
|
||||
: 'images/main/icon_main_remoteUnlocking_grey.png',
|
||||
width: 24.w,
|
||||
@ -703,7 +735,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
TranslationLoader.lanKeys!.gatewayDevice!.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp,
|
||||
color: state.keyInfos.value.remoteEnable == 1
|
||||
color: state.keyInfos.value.hasGateway == 1
|
||||
? AppColors.mainColor
|
||||
: AppColors.btnDisableColor),
|
||||
),
|
||||
@ -1222,8 +1254,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
}
|
||||
|
||||
Widget _unlockSuccessWidget() {
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
return Center(
|
||||
child: Stack(
|
||||
children: [
|
||||
Image.asset(
|
||||
state.iSOpenLock.value == true
|
||||
@ -1233,8 +1265,10 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
height: 348.h,
|
||||
),
|
||||
Positioned(
|
||||
top: (1.sh - ScreenUtil().statusBarHeight * 2) / 2,
|
||||
top: 180.h,
|
||||
left: 55.w,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
state.keyInfos.value.lockAlias!,
|
||||
@ -1250,8 +1284,24 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
color: AppColors.darkGrayTextColor, fontSize: 24.sp),
|
||||
)
|
||||
],
|
||||
))
|
||||
)),
|
||||
Positioned(
|
||||
top: 288.h,
|
||||
left: 155.w,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
state.iSClosedUnlockSuccessfulPopup.value = false;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: 60.r,
|
||||
height: 60.r,
|
||||
color: Colors.transparent,
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -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';
|
||||
@ -16,10 +17,11 @@ import 'package:star_lock/blue/io_tool/io_tool.dart';
|
||||
import 'package:star_lock/blue/io_tool/manager_event_bus.dart';
|
||||
import 'package:star_lock/blue/sender_manage.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSet_logic.dart';
|
||||
import 'package:star_lock/permission/permission_dialog.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';
|
||||
|
||||
import '../../../../app_settings/app_settings.dart';
|
||||
import 'lockEscalation_state.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),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/palm/addPalmType/addPalmType_logic.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||
@ -249,13 +250,17 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
|
||||
Widget keyBottomWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: "是否是管理员".tr,
|
||||
Obx(() => Visibility(
|
||||
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))),
|
||||
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))))),
|
||||
SizedBox(height: 30.h),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||
@ -329,7 +334,7 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
|
||||
);
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
// 是否为管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
|
||||
@ -7,7 +7,7 @@ class AddPalmTypeState {
|
||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
var fromTypeTwoStaffName = "".obs; // 考勤添加人脸员工名字
|
||||
final isStressFingerprint = false.obs;
|
||||
final isAdministrator = false.obs; // 是否是管理员
|
||||
final isAdministrator = false.obs; // 是否为管理员
|
||||
|
||||
var beginTime = "".obs; // 开始时间
|
||||
var endTime = "".obs; // 结束时间
|
||||
|
||||
@ -25,7 +25,8 @@ class PasswordKeyDetailPage extends StatefulWidget {
|
||||
State<PasswordKeyDetailPage> createState() => _PasswordKeyDetailPageState();
|
||||
}
|
||||
|
||||
class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with RouteAware {
|
||||
class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
|
||||
with RouteAware {
|
||||
final logic = Get.put(PasswordKeyDetailLogic());
|
||||
final state = Get.find<PasswordKeyDetailLogic>().state;
|
||||
|
||||
@ -64,13 +65,15 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.password!.tr,
|
||||
rightTitle: state.keyboardPwd.value,
|
||||
isHaveDirection: state.itemData.value.isCustom! == 1 ? true : false,
|
||||
isHaveDirection:
|
||||
state.itemData.value.isCustom! == 1 ? true : false,
|
||||
isHaveLine: true,
|
||||
action: () {
|
||||
if (state.itemData.value.isCustom! != 1) {
|
||||
return;
|
||||
} else {
|
||||
showCupertinoAlertDialog(context, state.inputPwdController);
|
||||
showCupertinoAlertDialog(
|
||||
context, state.inputPwdController);
|
||||
}
|
||||
})),
|
||||
Obx(() => CommonItem(
|
||||
@ -86,19 +89,24 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
||||
leftTitel: "有效期",
|
||||
rightTitle: logic.getUseDateStr(),
|
||||
isHaveLine: state.isCirculation.value,
|
||||
isHaveDirection: state.itemData.value.isCustom! == 1 ? true : false,
|
||||
isHaveDirection:
|
||||
state.itemData.value.isCustom! == 1 ? true : false,
|
||||
allHeight:
|
||||
state.itemData.value.keyboardPwdType == 3 ? 90.h : 65.h,
|
||||
action: () async {
|
||||
if (state.itemData.value.isCustom! != 1) {
|
||||
return;
|
||||
}
|
||||
var backData = await Get.toNamed(Routers.passwordKeyDetailChangeDatePage, arguments: {
|
||||
var backData = await Get.toNamed(
|
||||
Routers.passwordKeyDetailChangeDatePage,
|
||||
arguments: {
|
||||
'itemData': state.itemData.value,
|
||||
});
|
||||
if (backData != null) {
|
||||
state.itemData.value.startDate = int.parse(backData["beginTimeTimestamp"])*1000;
|
||||
state.itemData.value.endDate = int.parse(backData["endTimeTimestamp"])*1000;
|
||||
state.itemData.value.startDate =
|
||||
int.parse(backData["beginTimeTimestamp"]) * 1000;
|
||||
state.itemData.value.endDate =
|
||||
int.parse(backData["endTimeTimestamp"]) * 1000;
|
||||
// 改了日期之后,永久只能改限时的
|
||||
state.itemData.value.keyboardPwdType = 3;
|
||||
setState(() {});
|
||||
@ -108,7 +116,8 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
||||
visible: state.isCirculation.value,
|
||||
child: CommonItem(
|
||||
leftTitel: "结束时间",
|
||||
rightTitle: DateTool().dateToYMDHNString(state.itemData.value.endDate.toString()),
|
||||
rightTitle: DateTool().dateToYMDHNString(
|
||||
state.itemData.value.endDate.toString()),
|
||||
isHaveLine: true),
|
||||
)),
|
||||
Container(height: 10.h),
|
||||
@ -127,11 +136,12 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
||||
child: Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: "管理员".tr,
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isAdmin())),
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _isAdmin())),
|
||||
Container(height: 10.h),
|
||||
],
|
||||
),
|
||||
@ -233,7 +243,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
||||
));
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
// 是否为管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
@ -241,9 +251,9 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isAdministrator.value,
|
||||
onChanged: (value) {
|
||||
state.isAdministrator.value = value;
|
||||
state.isDeletPasswordKey.value = false;
|
||||
logic.senderCustomPasswords();
|
||||
// state.isAdministrator.value = value;
|
||||
// state.isDeletPasswordKey.value = false;
|
||||
// logic.senderCustomPasswords();
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -251,7 +261,8 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
||||
//发送时间
|
||||
String getSenderDate(PasswordKeyListItem indexEntity) {
|
||||
String senderDate = '';
|
||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
|
||||
DateTime dateStr =
|
||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
|
||||
senderDate = dateStr.toLocal().toString().substring(0, 16);
|
||||
return senderDate;
|
||||
}
|
||||
@ -265,19 +276,24 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
||||
title: inputController == state.inputNameController
|
||||
? "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}"
|
||||
: "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.password!.tr}",
|
||||
tipTitle: inputController.text.isNotEmpty ? inputController.text : "请输入6-9位密码",
|
||||
tipTitle: inputController.text.isNotEmpty
|
||||
? inputController.text
|
||||
: "请输入6-9位密码",
|
||||
controller: inputController,
|
||||
keyboardType: inputController == state.inputNameController
|
||||
? TextInputType.text
|
||||
: TextInputType.number,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.deny('\n'),
|
||||
LengthLimitingTextInputFormatter(inputController == state.inputNameController ? 50 : 9),
|
||||
LengthLimitingTextInputFormatter(
|
||||
inputController == state.inputNameController ? 50 : 9),
|
||||
],
|
||||
sureClick: () {
|
||||
//发送编辑钥匙名称请求
|
||||
if (inputController == state.inputPwdController) {
|
||||
if (inputController.text.isEmpty || inputController.text.length < 6 || inputController.text.length > 9) {
|
||||
if (inputController.text.isEmpty ||
|
||||
inputController.text.length < 6 ||
|
||||
inputController.text.length > 9) {
|
||||
logic.showToast("请输入6-9位密码");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -335,11 +335,14 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
||||
|
||||
// 自定义是管理员密码
|
||||
Widget keyIfAdministratorWidget() {
|
||||
return Column(
|
||||
return Visibility(
|
||||
visible:
|
||||
CommonDataManage().currentKeyInfo.isLockOwner == 1 ? true : false,
|
||||
child: Column(
|
||||
children: [
|
||||
// SizedBox(height: 10.h),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "是否是管理员".tr,
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
@ -347,6 +350,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
||||
width: 60.w, height: 50.h, child: _isAdministrator()))),
|
||||
SizedBox(height: 10.h),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -629,7 +633,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
||||
);
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
// 是否为管理员
|
||||
CupertinoSwitch _isAdministrator() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
|
||||
@ -12,7 +12,7 @@ class PasswordKeyPerpetualState {
|
||||
final isPermanent = true.obs; //是否永久
|
||||
var getPwdStr = ''.obs;
|
||||
var pwdNameStr = '';
|
||||
final isAdministrator = false.obs; // 是否是管理员
|
||||
final isAdministrator = false.obs; // 是否为管理员
|
||||
|
||||
var beginTime = DateTool().getNowDateWithType(3).obs; //默认为当前时间 开始时间
|
||||
var endTime = DateTool().getNowDateWithType(3).obs; //默认为当前时间 结束时间
|
||||
|
||||
@ -130,6 +130,7 @@ class LockListInfoItemEntity {
|
||||
Bluetooth? bluetooth;
|
||||
LockFeature? lockFeature;
|
||||
LockSetting? lockSetting;
|
||||
int? hasGateway;
|
||||
|
||||
LockListInfoItemEntity(
|
||||
{this.keyId,
|
||||
@ -163,7 +164,8 @@ class LockListInfoItemEntity {
|
||||
this.isOnlyManageSelf,
|
||||
this.restoreCount,
|
||||
this.model,
|
||||
this.vendor});
|
||||
this.vendor,
|
||||
this.hasGateway});
|
||||
|
||||
LockListInfoItemEntity.fromJson(Map<String, dynamic> json) {
|
||||
keyId = json['keyId'];
|
||||
@ -204,6 +206,7 @@ class LockListInfoItemEntity {
|
||||
lockSetting = json['lockSetting'] != null
|
||||
? LockSetting.fromJson(json['lockSetting'])
|
||||
: null;
|
||||
hasGateway = json['hasGateway'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -246,6 +249,7 @@ class LockListInfoItemEntity {
|
||||
if (lockSetting != null) {
|
||||
data['lockSetting'] = lockSetting!.toJson();
|
||||
}
|
||||
data['hasGateway'] = hasGateway;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/debug/debug_tool.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
class AboutConsole extends GetxController {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:date_format/date_format.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
@ -11,14 +10,10 @@ import 'package:rxdart/rxdart.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/blue/blue_manage.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_cleanUpUsers.dart';
|
||||
import 'package:star_lock/blue/io_tool/io_tool.dart';
|
||||
import 'package:star_lock/blue/sender_data.dart';
|
||||
import 'package:star_lock/blue/sender_manage.dart';
|
||||
import 'package:star_lock/debug/log.dart';
|
||||
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/mine/about/debug/log.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
@ -4,11 +4,10 @@ import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:star_lock/mine/about/debug/controller.dart';
|
||||
import 'package:star_lock/mine/about/debug/log.dart';
|
||||
import 'package:star_lock/mine/about/debug/tile.dart';
|
||||
|
||||
import 'package:star_lock/debug/controller.dart';
|
||||
import 'package:star_lock/debug/log.dart';
|
||||
import 'package:star_lock/debug/tile.dart';
|
||||
import 'package:star_lock/debug/utils/scrollable.dart';
|
||||
|
||||
/// # Debug Console
|
||||
///
|
||||
@ -1,7 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/debug/controller.dart';
|
||||
import 'package:star_lock/debug/debug_console.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_console.dart';
|
||||
|
||||
class DeBug {
|
||||
static void log(String message, {String? tag}) {
|
||||
@ -24,7 +25,15 @@ class DeBug {
|
||||
offset.value += details.delta;
|
||||
},
|
||||
child: FloatingActionButton(
|
||||
child: Icon(Icons.bug_report),
|
||||
backgroundColor: AppColors.mainColor,
|
||||
shape: ContinuousRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||
side: BorderSide(color: Colors.white, width: 2.w),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.bug_report,
|
||||
color: Colors.white,
|
||||
),
|
||||
onPressed: () {
|
||||
if (openInfo) {
|
||||
Get.back();
|
||||
@ -1,7 +1,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:star_lock/debug/controller.dart';
|
||||
import 'package:star_lock/debug/debug_console.dart';
|
||||
import 'package:star_lock/mine/about/debug/controller.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_console.dart';
|
||||
|
||||
/// A widget that adds a floating button for debugging purposes.
|
||||
class DebugConsolePopup extends StatefulWidget {
|
||||
@ -4,8 +4,8 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/debug/debug_tool.dart';
|
||||
import 'package:star_lock/debug/log.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_tool.dart';
|
||||
import 'package:star_lock/mine/about/debug/log.dart';
|
||||
|
||||
class DebugConsoleTile extends StatefulWidget {
|
||||
final DebugConsoleLog log;
|
||||
@ -4,8 +4,8 @@ import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/mine/addLock/addLock/addLock_state.dart';
|
||||
import 'package:star_lock/permission/permission_dialog.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||
|
||||
|
||||
class AddLockLogic extends BaseGetXController {
|
||||
|
||||
@ -10,7 +10,7 @@ import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:amap_flutter_map/amap_flutter_map.dart';
|
||||
import 'package:amap_flutter_base/amap_flutter_base.dart';
|
||||
import 'package:star_lock/permission/permission_dialog.dart';
|
||||
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
|
||||
@ -14,8 +14,8 @@ import 'package:star_lock/blue/io_protocol/io_getPublicKey.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_otaUpgrade.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_processOtaUpgrade.dart';
|
||||
import 'package:star_lock/mine/addLock/nearbyLock/nearbyLock_page.dart';
|
||||
import 'package:star_lock/permission/permission_dialog.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_settings.dart';
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -7,12 +7,12 @@ 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 = {};
|
||||
@ -25,7 +25,8 @@ class SaveLockState {
|
||||
var sureBtnState = 0.obs; // 0可点击 1 不可点击
|
||||
|
||||
// 管理员密码
|
||||
// var adminPasswordTF = TextEditingController();
|
||||
var adminPasswordTF = TextEditingController();
|
||||
|
||||
var adminPassword = '';
|
||||
var lockId = 0;
|
||||
|
||||
@ -54,3 +55,4 @@ class SaveLockState {
|
||||
return number.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,17 +1,15 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:fluwx/fluwx.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart';
|
||||
import 'package:star_lock/mine/mall/lockMall_entity.dart';
|
||||
import 'package:star_lock/mine/mall/lockMall_state.dart';
|
||||
import 'package:star_lock/mine/mall/webview/webview_logic.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/pay/wx_pay_tool.dart';
|
||||
import 'package:star_lock/webview/webview_logic.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
import '../../app_settings/app_settings.dart';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/webview/webview_logic.dart';
|
||||
import 'package:star_lock/mine/mall/webview/webview_logic.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
class LockMallState {
|
||||
|
||||
@ -6,7 +6,7 @@ import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_state.dart';
|
||||
import 'package:star_lock/permission/permission_dialog.dart';
|
||||
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
import '../../../tools/eventBusEventManage.dart';
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdminListEntity.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
|
||||
import '../../../../../appRouters.dart';
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
@ -23,7 +24,8 @@ class AuthorizedAdministratorListPage extends StatefulWidget {
|
||||
_AuthorizedAdministratorListPageState();
|
||||
}
|
||||
|
||||
class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministratorListPage> {
|
||||
class _AuthorizedAdministratorListPageState
|
||||
extends State<AuthorizedAdministratorListPage> {
|
||||
final logic = Get.put(AuthorizedAdministratorListLogic());
|
||||
final state = Get.find<AuthorizedAdministratorListLogic>().state;
|
||||
|
||||
@ -60,7 +62,9 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
||||
),
|
||||
onPressed: () {
|
||||
// 处理操作按钮的点击事件
|
||||
Navigator.pushNamed(context, Routers.addAuthorizedAdministratorPage).then((value) {
|
||||
Navigator.pushNamed(
|
||||
context, Routers.addAuthorizedAdministratorPage)
|
||||
.then((value) {
|
||||
setState(() {
|
||||
logic.pageNo = 1;
|
||||
getHttpData();
|
||||
@ -87,49 +91,20 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
||||
);
|
||||
}
|
||||
|
||||
// Widget _searchWidget() {
|
||||
// return Container(
|
||||
// height: 60.h,
|
||||
// margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w),
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.white, borderRadius: BorderRadius.circular(5)),
|
||||
// child: TextField(
|
||||
// //输入框一行
|
||||
// maxLines: 1,
|
||||
// // controller: _controller,
|
||||
// autofocus: false,
|
||||
//
|
||||
// decoration: InputDecoration(
|
||||
// //输入里面输入文字内边距设置
|
||||
// contentPadding: const EdgeInsets.only(
|
||||
// top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
||||
// hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
// hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
|
||||
// //不需要输入框下划线
|
||||
// border: InputBorder.none,
|
||||
// //左边图标设置
|
||||
// icon: Padding(
|
||||
// padding: EdgeInsets.only(
|
||||
// top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
|
||||
// child: Image.asset(
|
||||
// 'images/main/icon_main_search.png',
|
||||
// width: 40.w,
|
||||
// height: 40.w,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
||||
Widget _buildMainUI() {
|
||||
return Obx(() => state.itemDataList.value.isEmpty
|
||||
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight - 190.h - 64.h)
|
||||
? NoData(
|
||||
noDataHeight: 1.sh -
|
||||
ScreenUtil().statusBarHeight -
|
||||
ScreenUtil().bottomBarHeight -
|
||||
190.h -
|
||||
64.h)
|
||||
: SlidableAutoCloseBehavior(
|
||||
child: ListView.separated(
|
||||
itemCount: state.itemDataList.value.length,
|
||||
itemBuilder: (c, index) {
|
||||
AuthorizedAdminListItem authorizedAdminListItem = state.itemDataList.value[index];
|
||||
AuthorizedAdminListItem authorizedAdminListItem =
|
||||
state.itemDataList.value[index];
|
||||
|
||||
return Slidable(
|
||||
key: ValueKey(authorizedAdminListItem.uid),
|
||||
@ -139,8 +114,12 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
||||
children: [
|
||||
SlidableAction(
|
||||
onPressed: (BuildContext context) {
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
||||
logic.deleteAdministratorRequest(authorizedAdminListItem.uid.toString(), isAllData ? 1 : 0);
|
||||
ShowTipView()
|
||||
.showDeleteAdministratorIsHaveAllDataDialog(
|
||||
'同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
||||
logic.deleteAdministratorRequest(
|
||||
authorizedAdminListItem.uid.toString(),
|
||||
isAllData ? 1 : 0);
|
||||
});
|
||||
},
|
||||
backgroundColor: Colors.red,
|
||||
@ -165,25 +144,29 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
||||
|
||||
Widget _electronicKeyItem(AuthorizedAdminListItem itemData) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, Routers.administratorDetailsPage, arguments: {'itemData': itemData}).then((value) {
|
||||
onTap: () async {
|
||||
//高级功能
|
||||
var isVip = await Storage.getBool(saveIsVip);
|
||||
if (isVip == true) {
|
||||
Get.toNamed(Routers.administratorDetailsPage,
|
||||
arguments: {'itemData': itemData})?.then((value) {
|
||||
setState(() {
|
||||
logic.pageNo = 1;
|
||||
getHttpData();
|
||||
});
|
||||
});
|
||||
} else {
|
||||
ShowCupertinoAlertView().advancedFeatureAlert();
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
height: 100.h,
|
||||
color: Colors.white,
|
||||
// margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
||||
// decoration: const BoxDecoration(
|
||||
// color: Colors.white,
|
||||
// borderRadius: BorderRadius.circular(10.w),
|
||||
// ),
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(width: 30.w,),
|
||||
SizedBox(
|
||||
width: 30.w,
|
||||
),
|
||||
Image.asset('images/controls_user.png', width: 60.w, height: 60.w),
|
||||
SizedBox(width: 20.w),
|
||||
Expanded(
|
||||
@ -193,24 +176,18 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
// Text(
|
||||
// itemData.name ?? '',
|
||||
// style: TextStyle(
|
||||
// fontSize: 24.sp, color: AppColors.blackColor),
|
||||
// ),
|
||||
SizedBox(
|
||||
width: 1.sw - 110.w - 100.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
itemData.name ?? '',
|
||||
child: Text(itemData.name ?? '',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
color: AppColors.blackColor)),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -243,5 +220,4 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireElectronicKey/expireLockList_entity.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/weChatQRCodeEntity.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/xs_jPhush.dart';
|
||||
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
||||
@ -85,7 +85,7 @@ class MineSetLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
void showQRImageAlert(String qrCodeUrl, BuildContext widgetContext) {
|
||||
AppFirstEnterHandle().showQRImageAlert(widgetContext, qrCodeUrl);
|
||||
ShowCupertinoAlertView().showQRImageAlert(widgetContext, qrCodeUrl);
|
||||
}
|
||||
|
||||
//退出登录请求
|
||||
|
||||
@ -5,12 +5,12 @@ import 'package:fluwx/fluwx.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/mine/mall/webview/webview_logic.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFeaturesWeb_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFeaturesWeb_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/pay/wx_pay_tool.dart';
|
||||
import 'package:star_lock/webview/webview_logic.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
class AdvancedFeaturesWebLogic extends BaseGetXController {
|
||||
@ -23,8 +23,8 @@ class AdvancedFeaturesWebLogic extends BaseGetXController {
|
||||
AdvancedFeaturesWebEntity entity =
|
||||
await ApiRepository.to.getServicePackageBuyUrl();
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.vipBuyUrl.value = state.isShop.value == true
|
||||
? entity.data!.shopList!
|
||||
state.vipBuyUrl.value = state.isVipShop.value == true
|
||||
? entity.data!.vipBuyUrl!
|
||||
: entity.data!.cloudauthBuyUrl!;
|
||||
state.vipBuyWebView.setNavigationDelegate(
|
||||
NavigationDelegate(
|
||||
|
||||
@ -32,8 +32,9 @@ class _AdvancedFeaturesWebPageState extends State<AdvancedFeaturesWebPage> {
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
appBar: TitleAppBar(
|
||||
barTitle:
|
||||
logic.state.isShop.value == true ? '高级功能'.tr : '实名认证'.tr,
|
||||
barTitle: logic.state.isVipShop.value == true
|
||||
? '高级功能'.tr
|
||||
: '实名认证'.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
backAction: () => logic.canGoBack(false),
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/webview/webview_logic.dart';
|
||||
import 'package:star_lock/mine/mall/webview/webview_logic.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
class AdvancedFeaturesWebState {
|
||||
@ -8,7 +8,7 @@ class AdvancedFeaturesWebState {
|
||||
var webProgress = 0.0.obs;
|
||||
bool allowReturn = true;
|
||||
late WebViewController vipBuyWebView = initWebViewController();
|
||||
var isShop = true.obs; //是否为高级功能购买页面
|
||||
var isVipShop = true.obs; //是否为高级功能购买页面
|
||||
bool canGoBack = false;
|
||||
|
||||
//初始化webView控制器
|
||||
@ -23,7 +23,7 @@ class AdvancedFeaturesWebState {
|
||||
AdvancedFeaturesWebState() {
|
||||
Map map = Get.arguments;
|
||||
if (map['isShop'] != null) {
|
||||
isShop.value = map['isShop'];
|
||||
isVipShop.value = map['isShop'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_page.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_xhj_page.dart';
|
||||
import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_tool.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/debug/debug_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../main/lockMian/lockMain/lockMain_page.dart';
|
||||
@ -31,7 +30,6 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
AppFirstEnterHandle().getAppFirstEnter(context, isAgreePrivacy);
|
||||
getAgreePrivacyShowUpdate();
|
||||
|
||||
return FutureBuilder<bool>(
|
||||
@ -48,6 +46,8 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
xhjCall: () => const StarLockMainXHJPage());
|
||||
} else {
|
||||
// 如果用户未登录,返回登录页面
|
||||
AppFirstEnterHandle().getAppFirstEnter(isAgreePrivacy);
|
||||
|
||||
return F.sw(
|
||||
defaultCall: () => const StarLockLoginPage(),
|
||||
xhjCall: () => const StarLockLoginXHJPage());
|
||||
@ -73,7 +73,7 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
Future<void> getAgreePrivacyShowUpdate() async {
|
||||
final data = await Storage.getString(isAgreePrivacy);
|
||||
if (data == isAgreePrivacy) {
|
||||
AppFirstEnterHandle().getAppFirstEnter(context, isShowUpdateVersion);
|
||||
AppFirstEnterHandle().getAppFirstEnter(isShowUpdateVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ import 'dart:io';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
@ -14,24 +13,24 @@ import 'package:star_lock/tools/storage.dart';
|
||||
import '../versionUndate/versionUndateTool.dart';
|
||||
|
||||
class AppFirstEnterHandle {
|
||||
Future getAppFirstEnter(BuildContext widgetContext, String flagStr) async {
|
||||
Future getAppFirstEnter(String flagStr) async {
|
||||
var getFlag = await Storage.getString(flagStr);
|
||||
switch (flagStr) {
|
||||
case isAgreePrivacy: // 隐私协议
|
||||
{
|
||||
if (getFlag != isAgreePrivacy) {
|
||||
showPrivacyAgreementAlert(widgetContext);
|
||||
showPrivacyAgreementAlert();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case isAgreePosition: // 位置权限
|
||||
{
|
||||
if (getFlag != isAgreePosition) showPositionAlert(widgetContext);
|
||||
if (getFlag != isAgreePosition) showPositionAlert();
|
||||
}
|
||||
break;
|
||||
case isAgreeCamera: // 相机权限
|
||||
{
|
||||
if (getFlag != isAgreeCamera) showCameraAlert(widgetContext);
|
||||
if (getFlag != isAgreeCamera) showCameraAlert();
|
||||
}
|
||||
break;
|
||||
case isShowUpdateVersion: // 版本更新
|
||||
@ -45,9 +44,9 @@ class AppFirstEnterHandle {
|
||||
}
|
||||
|
||||
//隐私协议弹窗
|
||||
void showPrivacyAgreementAlert(BuildContext widgetContext) {
|
||||
void showPrivacyAgreementAlert() {
|
||||
showCupertinoDialog(
|
||||
context: widgetContext,
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
@ -118,7 +117,7 @@ class AppFirstEnterHandle {
|
||||
onPressed: () {
|
||||
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
||||
Navigator.of(context).pop();
|
||||
getAppFirstEnter(context, isShowUpdateVersion);
|
||||
getAppFirstEnter(isShowUpdateVersion);
|
||||
},
|
||||
),
|
||||
],
|
||||
@ -188,7 +187,7 @@ class AppFirstEnterHandle {
|
||||
onPressed: () {
|
||||
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
||||
Navigator.of(context).pop();
|
||||
getAppFirstEnter(context, isShowUpdateVersion);
|
||||
getAppFirstEnter(isShowUpdateVersion);
|
||||
},
|
||||
),
|
||||
],
|
||||
@ -196,9 +195,9 @@ class AppFirstEnterHandle {
|
||||
}
|
||||
|
||||
//位置权限弹窗
|
||||
void showPositionAlert(BuildContext widgetContext) {
|
||||
void showPositionAlert() {
|
||||
showCupertinoDialog(
|
||||
context: widgetContext,
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
@ -226,9 +225,9 @@ class AppFirstEnterHandle {
|
||||
}
|
||||
|
||||
//相机权限弹窗
|
||||
void showCameraAlert(BuildContext widgetContext) {
|
||||
void showCameraAlert() {
|
||||
showCupertinoDialog(
|
||||
context: widgetContext,
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
@ -255,55 +254,6 @@ class AppFirstEnterHandle {
|
||||
);
|
||||
}
|
||||
|
||||
//微信公众号二维码弹窗
|
||||
void showQRImageAlert(BuildContext widgetContext, String qrCodeUrl) {
|
||||
showCupertinoModalPopup(
|
||||
context: widgetContext,
|
||||
builder: (context) {
|
||||
return CupertinoActionSheet(
|
||||
actions: [
|
||||
Container(
|
||||
color: Colors.white, // 设置底色为白色
|
||||
child: CupertinoActionSheetAction(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(0),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 60.h,
|
||||
),
|
||||
Image.network(
|
||||
qrCodeUrl,
|
||||
width: 400.w,
|
||||
height: 400.w,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 60.w, right: 60.w),
|
||||
child: Text(
|
||||
'开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置'.tr,
|
||||
style:
|
||||
TextStyle(fontSize: 24.sp, color: Colors.black),
|
||||
)),
|
||||
SizedBox(
|
||||
height: 60.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// _launchURL(String url) async {
|
||||
// if (await canLaunchUrl(Uri.parse(url))) {
|
||||
// await launchUrl(Uri.parse(url));
|
||||
|
||||
@ -1,13 +1,63 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
|
||||
typedef AuthInfoCallback = void Function(String idCard, String name);
|
||||
typedef AuthInfoCallback = void Function(String? idCard, String? name);
|
||||
|
||||
class ShowCupertinoAlertView {
|
||||
//微信公众号二维码弹窗
|
||||
void showQRImageAlert(BuildContext widgetContext, String qrCodeUrl) {
|
||||
showCupertinoModalPopup(
|
||||
context: widgetContext,
|
||||
builder: (context) {
|
||||
return CupertinoActionSheet(
|
||||
actions: [
|
||||
Container(
|
||||
color: Colors.white, // 设置底色为白色
|
||||
child: CupertinoActionSheetAction(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(0),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 60.h,
|
||||
),
|
||||
Image.network(
|
||||
qrCodeUrl,
|
||||
width: 400.w,
|
||||
height: 400.w,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 60.w, right: 60.w),
|
||||
child: Text(
|
||||
'开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置'.tr,
|
||||
style:
|
||||
TextStyle(fontSize: 24.sp, color: Colors.black),
|
||||
)),
|
||||
SizedBox(
|
||||
height: 60.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
//高级功能弹窗
|
||||
void advancedFeatureAlert() {
|
||||
showCupertinoDialog(
|
||||
@ -207,6 +257,10 @@ class ShowCupertinoAlertView {
|
||||
CupertinoDialogAction(
|
||||
onPressed: () {
|
||||
// 在这里处理确认按钮的逻辑
|
||||
if (idCard.isEmpty || name.isEmpty) {
|
||||
EasyLoading.showToast('请输入身份证号和真实姓名'.tr);
|
||||
return;
|
||||
}
|
||||
callback(idCard, name);
|
||||
Get.back();
|
||||
},
|
||||
@ -220,4 +274,39 @@ class ShowCupertinoAlertView {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
//是否要远程开锁弹窗
|
||||
void isToRemoteUnLockAlert(AuthInfoCallback callback) {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (BuildContext context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: Container(),
|
||||
content: Text('是否要远程开锁?'.tr),
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(color: AppColors.mainColor),
|
||||
),
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
onPressed: () {
|
||||
// 在这里处理确认按钮的逻辑
|
||||
callback(null, null);
|
||||
Get.back();
|
||||
},
|
||||
child: Text(
|
||||
'远程开锁'.tr,
|
||||
style: TextStyle(color: AppColors.mainColor),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,6 +145,12 @@ class Storage {
|
||||
static Future<void> clearAll() async {
|
||||
SharedPreferences sp = await SharedPreferences.getInstance();
|
||||
sp.clear();
|
||||
|
||||
// 重新设置需要保留的数据
|
||||
if (isAgreePrivacy != null) {
|
||||
//退出登录不清除隐私协议同意状态
|
||||
await setString(isAgreePrivacy, isAgreePrivacy);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<String?> getUid() async {
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class StarInputFormatter extends TextInputFormatter {
|
||||
@override
|
||||
TextEditingValue formatEditUpdate(
|
||||
TextEditingValue oldValue, TextEditingValue newValue) {
|
||||
// 将新输入的文本转换为星号
|
||||
return TextEditingValue(
|
||||
text: '*' * newValue.text.length,
|
||||
selection: TextSelection.collapsed(offset: newValue.text.length),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user