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",
|
"您好,您的电子钥匙生成成功": "Hello, your electronic key is generated successfully",
|
||||||
"生效时间不能小于当前时间": "The effective time cannot be less than the current time",
|
"生效时间不能小于当前时间": "The effective time cannot be less than the current time",
|
||||||
"结束时间不能小于当前时间": "The end 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",
|
"已连接到锁,请将卡靠近锁的读卡区": "Connected to the lock, please put the card close to the card reading area of the lock",
|
||||||
"尝试连接设备...": "Trying to connect to the device...",
|
"尝试连接设备...": "Trying to connect to the device...",
|
||||||
"地理位置": "Geographical location",
|
"地理位置": "Geographical location",
|
||||||
@ -833,5 +833,12 @@
|
|||||||
"姓名":"Name",
|
"姓名":"Name",
|
||||||
"发送":"Send",
|
"发送":"Send",
|
||||||
"请确认姓名全名和身份证号码是否正确":"Please confirm that the full name and ID number are correct",
|
"请确认姓名全名和身份证号码是否正确":"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 @@
|
|||||||
"姓名":"姓名",
|
"姓名":"姓名",
|
||||||
"发送":"发送",
|
"发送":"发送",
|
||||||
"请确认姓名全名和身份证号码是否正确":"请确认姓名全名和身份证号码是否正确",
|
"请确认姓名全名和身份证号码是否正确":"请确认姓名全名和身份证号码是否正确",
|
||||||
"传输期间请勿离开当前页面":"传输期间请勿离开当前页面"
|
"传输期间请勿离开当前页面":"传输期间请勿离开当前页面",
|
||||||
|
"机型": "机型",
|
||||||
|
"硬件版本": "硬件版本",
|
||||||
|
"固件版本": "固件版本",
|
||||||
|
"手动升级": "手动升级",
|
||||||
|
"设备连接中...": "设备连接中...",
|
||||||
|
"升级过程中无法开锁,请先开锁后再升级": "升级过程中无法开锁,请先开锁后再升级",
|
||||||
|
"钥匙无效": "钥匙无效"
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,8 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:star_lock/debug/debug_console.dart';
|
import 'package:star_lock/mine/about/debug/debug_console.dart';
|
||||||
|
|
||||||
|
|
||||||
class AppLog {
|
class AppLog {
|
||||||
static bool _printLog = false;
|
static bool _printLog = false;
|
||||||
@ -13,6 +14,7 @@ class AppLog {
|
|||||||
_onlyError = onlyError ?? false;
|
_onlyError = onlyError ?? false;
|
||||||
}
|
}
|
||||||
static log(String msg,{bool? error}){
|
static log(String msg,{bool? error}){
|
||||||
|
DebugConsole.info(msg);
|
||||||
if(!kDebugMode)return;
|
if(!kDebugMode)return;
|
||||||
error = error ?? false;
|
error = error ?? false;
|
||||||
// if(!_printLog)return;
|
// if(!_printLog)return;
|
||||||
@ -20,7 +22,6 @@ class AppLog {
|
|||||||
if(error){
|
if(error){
|
||||||
msg = '----->>> $msg';
|
msg = '----->>> $msg';
|
||||||
}
|
}
|
||||||
DebugConsole.info(msg);
|
|
||||||
Get.log(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);
|
scanDevicesCallBack(scanDevices);
|
||||||
// EventBusManager().eventBusFir(scanDevices);
|
// EventBusManager().eventBusFir(scanDevices);
|
||||||
// FlutterBluePlus.stopScan();
|
// FlutterBluePlus.stopScan();
|
||||||
@ -364,7 +375,7 @@ class BlueManage {
|
|||||||
(d.device.platformName == deviceName) ||
|
(d.device.platformName == deviceName) ||
|
||||||
(d.advertisementData.advName == deviceName));
|
(d.advertisementData.advName == deviceName));
|
||||||
|
|
||||||
ScanResult? scanResult;//使用局部变量防止出现缓存
|
ScanResult? scanResult; //使用局部变量防止出现缓存
|
||||||
if (knownDeviceIndex >= 0) {
|
if (knownDeviceIndex >= 0) {
|
||||||
// 存在的时候赋值
|
// 存在的时候赋值
|
||||||
connectDeviceMacAddress =
|
connectDeviceMacAddress =
|
||||||
@ -381,7 +392,7 @@ class BlueManage {
|
|||||||
}
|
}
|
||||||
// AppLog.log("1 connectDeviceId:$connectDeviceMacAddress connectDeviceName:$connectDeviceName");
|
// AppLog.log("1 connectDeviceId:$connectDeviceMacAddress connectDeviceName:$connectDeviceName");
|
||||||
// stopScan();
|
// stopScan();
|
||||||
if (scanResult == null ||connectDeviceMacAddress.isEmpty) {
|
if (scanResult == null || connectDeviceMacAddress.isEmpty) {
|
||||||
// connectStateCallBack(BluetoothConnectionState.disconnected!);
|
// connectStateCallBack(BluetoothConnectionState.disconnected!);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -90,7 +90,7 @@ abstract class Reply{
|
|||||||
case 0x0e:
|
case 0x0e:
|
||||||
// 钥匙已存在
|
// 钥匙已存在
|
||||||
showErrorMessage("钥匙已存在");
|
showErrorMessage("钥匙已存在");
|
||||||
AppLog.log("$logTag ${commandType!.typeName} 0x0e 钥匙无效");
|
AppLog.log("$logTag ${commandType!.typeName} 0x0e 钥匙已存在");
|
||||||
break;
|
break;
|
||||||
case 0x0f:
|
case 0x0f:
|
||||||
// 用户已存在
|
// 用户已存在
|
||||||
@ -124,7 +124,7 @@ abstract class Reply{
|
|||||||
break;
|
break;
|
||||||
case 0xff:
|
case 0xff:
|
||||||
// 异常,未知错误
|
// 异常,未知错误
|
||||||
AppLog.log("$logTag ${commandType!.typeName} 0xff");
|
AppLog.log("$logTag ${commandType!.typeName} 0xff 异常,未知错误");
|
||||||
showErrorMessage("异常,未知错误");
|
showErrorMessage("异常,未知错误");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/flavors.dart';
|
import 'package:star_lock/flavors.dart';
|
||||||
import 'package:star_lock/widget/star_input_formatter.dart';
|
|
||||||
|
|
||||||
import '../../appRouters.dart';
|
import '../../appRouters.dart';
|
||||||
import '../../app_settings/app_colors.dart';
|
import '../../app_settings/app_colors.dart';
|
||||||
@ -48,6 +47,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
|||||||
logic.checkNext(state.emailOrPhoneController);
|
logic.checkNext(state.emailOrPhoneController);
|
||||||
state.pwdController.text = data['pwd'];
|
state.pwdController.text = data['pwd'];
|
||||||
logic.checkNext(state.pwdController);
|
logic.checkNext(state.pwdController);
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -223,6 +223,7 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
|||||||
logic.checkNext(state.emailOrPhoneController);
|
logic.checkNext(state.emailOrPhoneController);
|
||||||
state.pwdController.text = data['pwd'];
|
state.pwdController.text = data['pwd'];
|
||||||
logic.checkNext(state.pwdController);
|
logic.checkNext(state.pwdController);
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:star_lock/debug/debug_console.dart';
|
|
||||||
import 'package:star_lock/flavors.dart';
|
import 'package:star_lock/flavors.dart';
|
||||||
import 'package:star_lock/translations/trans_lib.dart';
|
import 'package:star_lock/translations/trans_lib.dart';
|
||||||
import 'app.dart';
|
import 'app.dart';
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.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/pickers.dart';
|
||||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||||
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
||||||
@ -259,13 +260,17 @@ class _AddCardPageState extends State<AddCardPage>
|
|||||||
Widget keyBottomWidget() {
|
Widget keyBottomWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
Obx(() => Visibility(
|
||||||
leftTitel: "是否是管理员".tr,
|
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
|
||||||
rightTitle: "",
|
? true
|
||||||
isTipsImg: false,
|
: false,
|
||||||
isHaveRightWidget: true,
|
child: CommonItem(
|
||||||
rightWidget:
|
leftTitel: "是否为管理员".tr,
|
||||||
SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
|
rightTitle: "",
|
||||||
|
isTipsImg: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget:
|
||||||
|
SizedBox(width: 60.w, height: 50.h, child: _isAdmin())))),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.stressCard!.tr,
|
leftTitel: TranslationLoader.lanKeys!.stressCard!.tr,
|
||||||
@ -369,7 +374,7 @@ class _AddCardPageState extends State<AddCardPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否是管理员
|
// 是否为管理员
|
||||||
CupertinoSwitch _isAdmin() {
|
CupertinoSwitch _isAdmin() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
@ -41,7 +40,8 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
|||||||
body: ListView(
|
body: ListView(
|
||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: "${TranslationLoader.lanKeys!.card!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
leftTitel:
|
||||||
|
"${TranslationLoader.lanKeys!.card!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
||||||
rightTitle: state.typeNumber.value,
|
rightTitle: state.typeNumber.value,
|
||||||
isHaveDirection: false,
|
isHaveDirection: false,
|
||||||
isHaveLine: true)),
|
isHaveLine: true)),
|
||||||
@ -54,8 +54,8 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
|||||||
ShowTipView().showTFViewAlertDialog(
|
ShowTipView().showTFViewAlertDialog(
|
||||||
state.changeNameController,
|
state.changeNameController,
|
||||||
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
|
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
|
||||||
"", (){
|
"", () {
|
||||||
if(state.changeNameController.text.isEmpty){
|
if (state.changeNameController.text.isEmpty) {
|
||||||
logic.showToast("请输入姓名".tr);
|
logic.showToast("请输入姓名".tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -65,7 +65,11 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
|||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
Obx(() => Visibility(
|
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(
|
child: CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
allHeight: 70.h,
|
allHeight: 70.h,
|
||||||
@ -162,13 +166,15 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
|||||||
isTipsImg: false,
|
isTipsImg: false,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: 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(
|
Obx(() => CommonItem(
|
||||||
leftTitel: "是否是管理员".tr,
|
leftTitel: "是否为管理员".tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isTipsImg: false,
|
isTipsImg: false,
|
||||||
isHaveRightWidget: true,
|
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),
|
Container(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||||
@ -217,7 +223,7 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否是管理员
|
// 是否为管理员
|
||||||
CupertinoSwitch _isAdmin() {
|
CupertinoSwitch _isAdmin() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
@ -225,9 +231,9 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
|||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: state.isAdministrator.value,
|
value: state.isAdministrator.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
state.isAdministrator.value = value;
|
// state.isAdministrator.value = value;
|
||||||
state.isDeletCard.value = false;
|
// state.isDeletCard.value = false;
|
||||||
logic.senderAddICCard();
|
// logic.senderAddICCard();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -282,5 +288,4 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
|||||||
state.ifCurrentScreen.value = false;
|
state.ifCurrentScreen.value = false;
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,32 +1,30 @@
|
|||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
import '../../fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
||||||
|
|
||||||
class CardDetailState{
|
class CardDetailState {
|
||||||
final fingerprintItemData = FingerprintItemData().obs;
|
final fingerprintItemData = FingerprintItemData().obs;
|
||||||
|
|
||||||
final TextEditingController changeNameController = TextEditingController();
|
final TextEditingController changeNameController = TextEditingController();
|
||||||
|
|
||||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||||
var sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
var sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
||||||
var isDeletCard = true.obs;// 是否删除卡
|
var isDeletCard = true.obs; // 是否删除卡
|
||||||
var isStressCard = false.obs;// 是否胁迫
|
var isStressCard = false.obs; // 是否胁迫
|
||||||
var isAdministrator = false.obs;// 是否是管理员
|
var isAdministrator = false.obs; // 是否为管理员
|
||||||
|
|
||||||
final typeNumber = "".obs;// 指纹号
|
final typeNumber = "".obs; // 指纹号
|
||||||
final typeName = "".obs;// 指纹名字
|
final typeName = "".obs; // 指纹名字
|
||||||
var startDate = "".obs;// 开始时间
|
var startDate = "".obs; // 开始时间
|
||||||
var endDate = "".obs;// 结束时间
|
var endDate = "".obs; // 结束时间
|
||||||
var starTime = "".obs;// 生效时间
|
var starTime = "".obs; // 生效时间
|
||||||
var endTime = "".obs;// 失效时间
|
var endTime = "".obs; // 失效时间
|
||||||
final keyType = 0.obs;// 永久:1;限时2,单次3,循环:4
|
final keyType = 0.obs; // 永久:1;限时2,单次3,循环:4
|
||||||
var weekDay = [].obs;// 有效日
|
var weekDay = [].obs; // 有效日
|
||||||
var adder = "".obs;// 添加者
|
var adder = "".obs; // 添加者
|
||||||
var addTime = 0.obs;// 添加时间
|
var addTime = 0.obs; // 添加时间
|
||||||
var keyId = 0.obs;// 卡id
|
var keyId = 0.obs; // 卡id
|
||||||
|
|
||||||
CardDetailState() {
|
CardDetailState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
@ -43,9 +41,11 @@ class CardDetailState{
|
|||||||
keyType.value = fingerprintItemData.value.cardType!;
|
keyType.value = fingerprintItemData.value.cardType!;
|
||||||
adder.value = fingerprintItemData.value.senderUsername!;
|
adder.value = fingerprintItemData.value.senderUsername!;
|
||||||
addTime.value = fingerprintItemData.value.createDate!;
|
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!;
|
weekDay.value = fingerprintItemData.value.weekDay!;
|
||||||
isAdministrator.value = fingerprintItemData.value.cardRight! == 1 ? true : false;
|
isAdministrator.value =
|
||||||
|
fingerprintItemData.value.cardRight! == 1 ? true : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ class DoorLockLogPage extends StatefulWidget {
|
|||||||
State<DoorLockLogPage> createState() => _DoorLockLogPageState();
|
State<DoorLockLogPage> createState() => _DoorLockLogPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware{
|
class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
||||||
final logic = Get.put(DoorLockLogLogic());
|
final logic = Get.put(DoorLockLogLogic());
|
||||||
final state = Get.find<DoorLockLogLogic>().state;
|
final state = Get.find<DoorLockLogLogic>().state;
|
||||||
|
|
||||||
@ -162,19 +162,11 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware{
|
|||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
timelineData.imagesUrl!.isNotEmpty
|
timelineData.imagesUrl!.isNotEmpty
|
||||||
?
|
? Image.network(
|
||||||
Image.network(
|
timelineData.imagesUrl!,
|
||||||
timelineData.imagesUrl!,
|
width: 260.w,
|
||||||
width: 260.w,
|
height: 260.h,
|
||||||
height: 260.h,
|
)
|
||||||
)
|
|
||||||
// Image(
|
|
||||||
// image: const AssetImage(
|
|
||||||
// 'images/main/icon_lockDetail_monitoringvoiceFrist.png'),
|
|
||||||
// width: 240.w,
|
|
||||||
// height: 180.h,
|
|
||||||
// fit: BoxFit.contain,
|
|
||||||
// )
|
|
||||||
: Container(),
|
: Container(),
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 150.h,
|
top: 150.h,
|
||||||
@ -263,5 +255,4 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware{
|
|||||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||||
state.ifCurrentScreen.value = false;
|
state.ifCurrentScreen.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,14 +139,9 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
|||||||
state.getIDCardNumber.value.isEmpty) {
|
state.getIDCardNumber.value.isEmpty) {
|
||||||
ShowCupertinoAlertView()
|
ShowCupertinoAlertView()
|
||||||
.showOpenAuthWithIDCardInfoAlert((idCard, realName) {
|
.showOpenAuthWithIDCardInfoAlert((idCard, realName) {
|
||||||
if (idCard.isNotEmpty && realName.isNotEmpty) {
|
state.getIDCardNumber.value = idCard ?? '';
|
||||||
state.getIDCardNumber.value = idCard;
|
state.getRealName.value = realName ?? '';
|
||||||
state.getRealName.value = realName;
|
updateRealNameInfoWithAuthStatus(realNameAuthStatus);
|
||||||
updateRealNameInfoWithAuthStatus(realNameAuthStatus);
|
|
||||||
} else {
|
|
||||||
showToast("请输入完整信息".tr);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
updateRealNameInfoWithAuthStatus(realNameAuthStatus);
|
updateRealNameInfoWithAuthStatus(realNameAuthStatus);
|
||||||
@ -234,11 +229,11 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
Future openModalBottomSheet(BuildContext context) async {
|
Future openModalBottomSheet(BuildContext context) async {
|
||||||
var textList = <String>[];
|
var textList = <String>[];
|
||||||
if(CommonDataManage().currentKeyInfo.keyRight == 1){
|
if (CommonDataManage().currentKeyInfo.keyRight == 1) {
|
||||||
textList = [
|
textList = [
|
||||||
state.itemData.value.keyStatus == XSConstantMacro.keyStatusFrozen ? '取消冻结'.tr : "冻结".tr
|
state.itemData.value.keyStatus == XSConstantMacro.keyStatusFrozen ? '取消冻结'.tr : "冻结".tr
|
||||||
];
|
];
|
||||||
}else if(CommonDataManage().currentKeyInfo.isLockOwner == 1){
|
} else if (CommonDataManage().currentKeyInfo.isLockOwner == 1) {
|
||||||
if (state.keyType.value == 1 || state.keyType.value == 2) {
|
if (state.keyType.value == 1 || state.keyType.value == 2) {
|
||||||
textList = [
|
textList = [
|
||||||
state.itemData.value.keyStatus == XSConstantMacro.keyStatusFrozen ? '取消冻结'.tr : "冻结".tr,
|
state.itemData.value.keyStatus == XSConstantMacro.keyStatusFrozen ? '取消冻结'.tr : "冻结".tr,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart';
|
||||||
@ -227,11 +228,10 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
() => Visibility(
|
() => Visibility(
|
||||||
// (state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false
|
// (state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false
|
||||||
visible: CommonDataManage()
|
visible: CommonDataManage()
|
||||||
.currentKeyInfo
|
.currentKeyInfo
|
||||||
.lockSetting!
|
.lockSetting!
|
||||||
.remoteUnlock ==
|
.remoteUnlock ==
|
||||||
1 &&
|
1
|
||||||
state.itemData.value.keyRight != 1
|
|
||||||
? true
|
? true
|
||||||
: false,
|
: false,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
@ -332,6 +332,10 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
title: tipsTitle,
|
title: tipsTitle,
|
||||||
tipTitle: "请输入".tr,
|
tipTitle: "请输入".tr,
|
||||||
controller: logic.getCurrentController(alertEnum),
|
controller: logic.getCurrentController(alertEnum),
|
||||||
|
inputFormatters: <TextInputFormatter>[
|
||||||
|
FilteringTextInputFormatter.deny('\n'),
|
||||||
|
LengthLimitingTextInputFormatter(50),
|
||||||
|
],
|
||||||
sureClick: () {
|
sureClick: () {
|
||||||
if (alertEnum == ShowAlertEnum.name) {
|
if (alertEnum == ShowAlertEnum.name) {
|
||||||
logic.modifyKeyNameRequest();
|
logic.modifyKeyNameRequest();
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:get_storage/get_storage.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_state.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),
|
endDate: int.parse(endDate),
|
||||||
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
||||||
isCameraEnable: '2',
|
isCameraEnable: '2',
|
||||||
isRemoteUnlock: state.isRemoteUnlock == true ? '1' : '2',
|
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
||||||
keyNameForAdmin: state.keyNameController.text,
|
keyNameForAdmin: state.keyNameController.text,
|
||||||
keyRight: '0',
|
keyRight: '0',
|
||||||
keyType: getKeyType,
|
keyType: getKeyType,
|
||||||
|
|||||||
@ -525,13 +525,13 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
: false),
|
: false),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: SizedBox(
|
rightWidget: SizedBox(
|
||||||
width: 60.w, height: 50.h, child: _remoteSwitch(true, logic)),
|
width: 60.w, height: 50.h, child: _remoteSwitch(true, logic)),
|
||||||
action: () {}),
|
action: () {})),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -546,11 +546,11 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: isRemote
|
value: isRemote
|
||||||
? logic.state.isRemoteUnlock
|
? logic.state.isRemoteUnlock.value
|
||||||
: logic.state.isAuthentication.value,
|
: logic.state.isAuthentication.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
if (isRemote) {
|
if (isRemote) {
|
||||||
logic.state.isRemoteUnlock = !logic.state.isRemoteUnlock;
|
logic.state.isRemoteUnlock.value = !logic.state.isRemoteUnlock.value;
|
||||||
} else {
|
} else {
|
||||||
logic.state.isAuthentication.value =
|
logic.state.isAuthentication.value =
|
||||||
!logic.state.isAuthentication.value;
|
!logic.state.isAuthentication.value;
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class SendElectronicKeyViewState {
|
|||||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||||
late Contact contact;
|
late Contact contact;
|
||||||
|
|
||||||
bool isRemoteUnlock = false; //是否允许远程开锁
|
var isRemoteUnlock = false.obs; //是否允许远程开锁
|
||||||
var isAuthentication = false.obs; //是否可以实名认证
|
var isAuthentication = false.obs; //是否可以实名认证
|
||||||
|
|
||||||
var timeLimitBeginTime = DateTool().dateToYMDHNString(
|
var timeLimitBeginTime = DateTool().dateToYMDHNString(
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.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/dateTool.dart';
|
||||||
import 'package:star_lock/tools/pickers/pickers.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/date_mode.dart';
|
||||||
@ -164,8 +165,8 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
|||||||
rightTitle: state.timeLimitEndTime.value,
|
rightTitle: state.timeLimitEndTime.value,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
PDuration selectDate =
|
PDuration selectDate = PDuration.parse(
|
||||||
PDuration.parse(DateTime.tryParse(state.timeLimitEndTime.value));
|
DateTime.tryParse(state.timeLimitEndTime.value));
|
||||||
Pickers.showDatePicker(context,
|
Pickers.showDatePicker(context,
|
||||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
||||||
state.timeLimitEndTime.value =
|
state.timeLimitEndTime.value =
|
||||||
@ -259,13 +260,17 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
|||||||
Widget keyBottomWidget() {
|
Widget keyBottomWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
Obx(() => Visibility(
|
||||||
leftTitel: "是否是管理员".tr,
|
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
|
||||||
rightTitle: "",
|
? true
|
||||||
isTipsImg: false,
|
: false,
|
||||||
isHaveRightWidget: true,
|
child: CommonItem(
|
||||||
rightWidget: SizedBox(
|
leftTitel: "是否为管理员".tr,
|
||||||
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))),
|
rightTitle: "",
|
||||||
|
isTipsImg: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: SizedBox(
|
||||||
|
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))))),
|
||||||
SizedBox(height: 30.h),
|
SizedBox(height: 30.h),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||||
@ -339,7 +344,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否是管理员
|
// 是否为管理员
|
||||||
CupertinoSwitch _isAdmin() {
|
CupertinoSwitch _isAdmin() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
|||||||
@ -8,15 +8,19 @@ class AddFaceTypeState {
|
|||||||
final selectType = "0".obs; // 0永久 1显示 2循环
|
final selectType = "0".obs; // 0永久 1显示 2循环
|
||||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||||
final isStressFingerprint = false.obs;
|
final isStressFingerprint = false.obs;
|
||||||
final isAdministrator = false.obs; // 是否是管理员
|
final isAdministrator = false.obs; // 是否为管理员
|
||||||
|
|
||||||
var timeLimitBeginTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;// 限时开始时间
|
var timeLimitBeginTime = DateTool()
|
||||||
var timeLimitEndTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;// 限时结束时间
|
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||||
|
.obs; // 限时开始时间
|
||||||
|
var timeLimitEndTime = DateTool()
|
||||||
|
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||||
|
.obs; // 限时结束时间
|
||||||
|
|
||||||
var cycleBeginTime = "".obs;// 循环开始时间
|
var cycleBeginTime = "".obs; // 循环开始时间
|
||||||
var cycleEndTime = "".obs;// 循环结束时间
|
var cycleEndTime = "".obs; // 循环结束时间
|
||||||
var effectiveDateTime = "".obs;// 生效时间
|
var effectiveDateTime = "".obs; // 生效时间
|
||||||
var failureDateTime = "".obs;// 失效时间
|
var failureDateTime = "".obs; // 失效时间
|
||||||
var weekdaysList = [].obs;
|
var weekdaysList = [].obs;
|
||||||
var fromTypeTwoStaffName = "".obs; // 从添加员工进入 传入员工名字
|
var fromTypeTwoStaffName = "".obs; // 从添加员工进入 传入员工名字
|
||||||
|
|
||||||
@ -27,8 +31,9 @@ class AddFaceTypeState {
|
|||||||
lockId.value = map["lockId"];
|
lockId.value = map["lockId"];
|
||||||
fromType.value = map["fromType"];
|
fromType.value = map["fromType"];
|
||||||
// 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
// 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||||
if(fromType.value == 2){
|
if (fromType.value == 2) {
|
||||||
fromTypeTwoStaffName.value = map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字
|
fromTypeTwoStaffName.value =
|
||||||
|
map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,8 +52,8 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
|||||||
ShowTipView().showTFViewAlertDialog(
|
ShowTipView().showTFViewAlertDialog(
|
||||||
state.changeNameController,
|
state.changeNameController,
|
||||||
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
|
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
|
||||||
"", (){
|
"", () {
|
||||||
if(state.changeNameController.text.isEmpty){
|
if (state.changeNameController.text.isEmpty) {
|
||||||
logic.showToast("请输入姓名".tr);
|
logic.showToast("请输入姓名".tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -177,12 +177,12 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
|||||||
// isHaveLine: true,
|
// isHaveLine: true,
|
||||||
// rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isStressFace()))),
|
// rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isStressFace()))),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: "是否是管理员".tr,
|
leftTitel: "是否为管理员".tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isTipsImg: false,
|
isTipsImg: false,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: SizedBox(
|
rightWidget:
|
||||||
width: 60.w, height: 50.h, child: _isAdmin()))),
|
SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
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),
|
left: 30.w, right: 30.w, 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: () {
|
onClick: () {
|
||||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr,
|
||||||
|
() async {
|
||||||
state.isDeletFace.value = true;
|
state.isDeletFace.value = true;
|
||||||
logic.senderAddFace();
|
logic.senderAddFace();
|
||||||
});
|
});
|
||||||
@ -231,7 +232,7 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否是管理员
|
// 是否为管理员
|
||||||
CupertinoSwitch _isAdmin() {
|
CupertinoSwitch _isAdmin() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
@ -239,9 +240,9 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
|||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: state.isAdministrator.value,
|
value: state.isAdministrator.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
state.isAdministrator.value = value;
|
// state.isAdministrator.value = value;
|
||||||
state.isDeletFace.value = false;
|
// state.isDeletFace.value = false;
|
||||||
logic.senderAddFace();
|
// logic.senderAddFace();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,9 +21,9 @@ class FaceDetailState {
|
|||||||
|
|
||||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||||
var sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
var sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
||||||
var isDeletFace = true.obs;// 是否删除卡
|
var isDeletFace = true.obs; // 是否删除卡
|
||||||
var isStressFace = false.obs;// 是否胁迫
|
var isStressFace = false.obs; // 是否胁迫
|
||||||
var isAdministrator = false.obs;// 是否是管理员
|
var isAdministrator = false.obs; // 是否为管理员
|
||||||
|
|
||||||
FaceDetailState() {
|
FaceDetailState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.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/pickers.dart';
|
||||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||||
import 'package:star_lock/tools/pickers/time_picker/model/pduration.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() {
|
Widget keyBottomWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
Obx(() => Visibility(
|
||||||
leftTitel: "是否是管理员".tr,
|
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
|
||||||
rightTitle: "",
|
? true
|
||||||
isTipsImg: false,
|
: false,
|
||||||
isHaveRightWidget: true,
|
child: CommonItem(
|
||||||
rightWidget: SizedBox(
|
leftTitel: "是否为管理员".tr,
|
||||||
width: 60.w, height: 50.h, child: _isAdmin()))),
|
rightTitle: "",
|
||||||
|
isTipsImg: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget:
|
||||||
|
SizedBox(width: 60.w, height: 50.h, child: _isAdmin())))),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.stressFingerprint!.tr,
|
leftTitel: TranslationLoader.lanKeys!.stressFingerprint!.tr,
|
||||||
@ -424,7 +429,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否是管理员
|
// 是否为管理员
|
||||||
CupertinoSwitch _isAdmin() {
|
CupertinoSwitch _isAdmin() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
|||||||
@ -1,22 +1,25 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../../../tools/dateTool.dart';
|
import '../../../../tools/dateTool.dart';
|
||||||
|
|
||||||
class AddFingerprintState{
|
class AddFingerprintState {
|
||||||
final lockId = 0.obs;
|
final lockId = 0.obs;
|
||||||
final selectType = "0".obs;// 0永久 1显示 2循环
|
final selectType = "0".obs; // 0永久 1显示 2循环
|
||||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||||
final isStressFingerprint = false.obs;
|
final isStressFingerprint = false.obs;
|
||||||
final isAdministrator = false.obs;// 是否是管理员
|
final isAdministrator = false.obs; // 是否为管理员
|
||||||
|
|
||||||
var timeLimitBeginTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;// 限时开始时间
|
var timeLimitBeginTime = DateTool()
|
||||||
var timeLimitEndTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;// 限时结束时间
|
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||||
var cycleBeginTime = "".obs;// 循环开始时间
|
.obs; // 限时开始时间
|
||||||
var cycleEndTime = "".obs;// 循环结束时间
|
var timeLimitEndTime = DateTool()
|
||||||
var effectiveDateTime = "".obs;// 生效时间
|
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||||
var failureDateTime = "".obs;// 失效时间
|
.obs; // 限时结束时间
|
||||||
|
var cycleBeginTime = "".obs; // 循环开始时间
|
||||||
|
var cycleEndTime = "".obs; // 循环结束时间
|
||||||
|
var effectiveDateTime = "".obs; // 生效时间
|
||||||
|
var failureDateTime = "".obs; // 失效时间
|
||||||
var weekdaysList = [].obs;
|
var weekdaysList = [].obs;
|
||||||
var fromTypeTwoStaffName = "".obs; // 从添加员工进入 传入员工名字
|
var fromTypeTwoStaffName = "".obs; // 从添加员工进入 传入员工名字
|
||||||
|
|
||||||
@ -27,8 +30,9 @@ class AddFingerprintState{
|
|||||||
lockId.value = map["lockId"];
|
lockId.value = map["lockId"];
|
||||||
fromType.value = map["fromType"];
|
fromType.value = map["fromType"];
|
||||||
// 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
// 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||||
if(fromType.value == 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/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
@ -26,7 +25,8 @@ class FingerprintDetailPage extends StatefulWidget {
|
|||||||
State<FingerprintDetailPage> createState() => _FingerprintDetailPageState();
|
State<FingerprintDetailPage> createState() => _FingerprintDetailPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _FingerprintDetailPageState extends State<FingerprintDetailPage> with RouteAware {
|
class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
||||||
|
with RouteAware {
|
||||||
final logic = Get.put(FingerprintDetailLogic());
|
final logic = Get.put(FingerprintDetailLogic());
|
||||||
final state = Get.find<FingerprintDetailLogic>().state;
|
final state = Get.find<FingerprintDetailLogic>().state;
|
||||||
|
|
||||||
@ -42,7 +42,8 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: "${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
leftTitel:
|
||||||
|
"${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
||||||
rightTitle: state.typeNumber.value,
|
rightTitle: state.typeNumber.value,
|
||||||
isHaveDirection: false,
|
isHaveDirection: false,
|
||||||
isHaveLine: true)),
|
isHaveLine: true)),
|
||||||
@ -55,8 +56,8 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
ShowTipView().showTFViewAlertDialog(
|
ShowTipView().showTFViewAlertDialog(
|
||||||
state.changeNameController,
|
state.changeNameController,
|
||||||
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
|
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
|
||||||
"", (){
|
"", () {
|
||||||
if(state.changeNameController.text.isEmpty){
|
if (state.changeNameController.text.isEmpty) {
|
||||||
logic.showToast("请输入姓名".tr);
|
logic.showToast("请输入姓名".tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -64,10 +65,13 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
state.typeName.value = state.changeNameController.text;
|
state.typeName.value = state.changeNameController.text;
|
||||||
logic.editFingerprintsData();
|
logic.editFingerprintsData();
|
||||||
});
|
});
|
||||||
|
|
||||||
})),
|
})),
|
||||||
Obx(() => Visibility(
|
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(
|
child: CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
allHeight: 70.h,
|
allHeight: 70.h,
|
||||||
@ -76,26 +80,32 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
if(state.keyType.value == 2 || state.keyType.value == 1){
|
if (state.keyType.value == 2 || state.keyType.value == 1) {
|
||||||
// 限时
|
// 限时
|
||||||
var data = await Get.toNamed(Routers.otherTypeKeyChangeDatePage, arguments: {
|
var data = await Get.toNamed(
|
||||||
"pushType": 1,
|
Routers.otherTypeKeyChangeDatePage,
|
||||||
"fingerprintItemData": state.fingerprintItemData.value,
|
arguments: {
|
||||||
});
|
"pushType": 1,
|
||||||
if(data != null) {
|
"fingerprintItemData":
|
||||||
|
state.fingerprintItemData.value,
|
||||||
|
});
|
||||||
|
if (data != null) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.starDate.value = data["beginTimeTimestamp"];
|
state.starDate.value = data["beginTimeTimestamp"];
|
||||||
state.endDate.value = data["endTimeTimestamp"];
|
state.endDate.value = data["endTimeTimestamp"];
|
||||||
state.keyType.value = 2;
|
state.keyType.value = 2;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}else if(state.keyType.value == 4){
|
} else if (state.keyType.value == 4) {
|
||||||
// 循环
|
// 循环
|
||||||
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: {
|
var data = await Get.toNamed(
|
||||||
"pushType": 1,
|
Routers.otherTypeKeyChangeValidityDatePage,
|
||||||
"fingerprintItemData": state.fingerprintItemData.value,
|
arguments: {
|
||||||
});
|
"pushType": 1,
|
||||||
if(data != null) {
|
"fingerprintItemData":
|
||||||
|
state.fingerprintItemData.value,
|
||||||
|
});
|
||||||
|
if (data != null) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.starDate.value = data["starDate"];
|
state.starDate.value = data["starDate"];
|
||||||
state.endDate.value = data["endDate"];
|
state.endDate.value = data["endDate"];
|
||||||
@ -114,11 +124,14 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: {
|
var data = await Get.toNamed(
|
||||||
"pushType": 1,
|
Routers.otherTypeKeyChangeValidityDatePage,
|
||||||
"fingerprintItemData": state.fingerprintItemData.value,
|
arguments: {
|
||||||
});
|
"pushType": 1,
|
||||||
if(data != null) {
|
"fingerprintItemData":
|
||||||
|
state.fingerprintItemData.value,
|
||||||
|
});
|
||||||
|
if (data != null) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.starDate.value = data["starDate"];
|
state.starDate.value = data["starDate"];
|
||||||
state.endDate.value = data["endDate"];
|
state.endDate.value = data["endDate"];
|
||||||
@ -132,14 +145,18 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
visible: state.keyType.value == 4 ? true : false,
|
visible: state.keyType.value == 4 ? true : false,
|
||||||
child: Obx(() => CommonItem(
|
child: Obx(() => CommonItem(
|
||||||
leftTitel: "有效时间".tr,
|
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,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: {
|
var data = await Get.toNamed(
|
||||||
"pushType": 1,
|
Routers.otherTypeKeyChangeValidityDatePage,
|
||||||
"fingerprintItemData": state.fingerprintItemData.value,
|
arguments: {
|
||||||
});
|
"pushType": 1,
|
||||||
if(data != null) {
|
"fingerprintItemData":
|
||||||
|
state.fingerprintItemData.value,
|
||||||
|
});
|
||||||
|
if (data != null) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.starDate.value = data["starDate"];
|
state.starDate.value = data["starDate"];
|
||||||
state.endDate.value = data["endDate"];
|
state.endDate.value = data["endDate"];
|
||||||
@ -154,12 +171,11 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
leftTitel: TranslationLoader.lanKeys!.additive!.tr,
|
leftTitel: TranslationLoader.lanKeys!.additive!.tr,
|
||||||
rightTitle: state.adder.value,
|
rightTitle: state.adder.value,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () {
|
action: () {})),
|
||||||
|
|
||||||
})),
|
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.addTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.addTime!.tr,
|
||||||
rightTitle: DateTool().dateToYMDHNString(state.addTime.value.toString()),
|
rightTitle: DateTool()
|
||||||
|
.dateToYMDHNString(state.addTime.value.toString()),
|
||||||
)),
|
)),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
@ -171,11 +187,12 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
rightWidget: SizedBox(
|
rightWidget: SizedBox(
|
||||||
width: 60.w, height: 50.h, child: _isStressFingerprint()))),
|
width: 60.w, height: 50.h, child: _isStressFingerprint()))),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: "是否是管理员".tr,
|
leftTitel: "是否为管理员".tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isTipsImg: false,
|
isTipsImg: false,
|
||||||
isHaveRightWidget: true,
|
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),
|
Container(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||||
@ -195,10 +212,12 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
btnName: TranslationLoader.lanKeys!.delete!.tr,
|
btnName: TranslationLoader.lanKeys!.delete!.tr,
|
||||||
isDelete: true,
|
isDelete: true,
|
||||||
borderRadius: 20.w,
|
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),
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
onClick: () {
|
onClick: () {
|
||||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr,
|
||||||
|
() async {
|
||||||
state.isDeletFingerprint.value = true;
|
state.isDeletFingerprint.value = true;
|
||||||
logic.senderAddFingerprint();
|
logic.senderAddFingerprint();
|
||||||
});
|
});
|
||||||
@ -225,7 +244,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否是管理员
|
// 是否为管理员
|
||||||
CupertinoSwitch _isAdmin() {
|
CupertinoSwitch _isAdmin() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
@ -233,9 +252,9 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: state.isAdministrator.value,
|
value: state.isAdministrator.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
state.isAdministrator.value = value;
|
// state.isAdministrator.value = value;
|
||||||
state.isDeletFingerprint.value = false;
|
// state.isDeletFingerprint.value = false;
|
||||||
logic.senderAddFingerprint();
|
// logic.senderAddFingerprint();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -290,5 +309,4 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
state.ifCurrentScreen.value = false;
|
state.ifCurrentScreen.value = false;
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,31 +1,30 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../fingerprintList/fingerprintListData_entity.dart';
|
import '../fingerprintList/fingerprintListData_entity.dart';
|
||||||
|
|
||||||
class FingerprintDetailState{
|
class FingerprintDetailState {
|
||||||
final fingerprintItemData = FingerprintItemData().obs;
|
final fingerprintItemData = FingerprintItemData().obs;
|
||||||
|
|
||||||
final TextEditingController changeNameController = TextEditingController();
|
final TextEditingController changeNameController = TextEditingController();
|
||||||
|
|
||||||
final typeNumber = "".obs;// 指纹号
|
final typeNumber = "".obs; // 指纹号
|
||||||
final typeName = "".obs;// 指纹名字
|
final typeName = "".obs; // 指纹名字
|
||||||
var starDate = "".obs;// 开始时间
|
var starDate = "".obs; // 开始时间
|
||||||
var endDate = "".obs;// 结束时间
|
var endDate = "".obs; // 结束时间
|
||||||
var startDate = "".obs;// 生效时间
|
var startDate = "".obs; // 生效时间
|
||||||
var endTime = "".obs;// 失效时间
|
var endTime = "".obs; // 失效时间
|
||||||
final keyType = 0.obs;// 永久:1;限时2,单次3,循环:4
|
final keyType = 0.obs; // 永久:1;限时2,单次3,循环:4
|
||||||
var weekDay = [].obs;// 有效日
|
var weekDay = [].obs; // 有效日
|
||||||
var adder = "".obs;// 添加者
|
var adder = "".obs; // 添加者
|
||||||
var addTime = 0.obs;// 添加时间
|
var addTime = 0.obs; // 添加时间
|
||||||
var keyId = 0.obs;
|
var keyId = 0.obs;
|
||||||
|
|
||||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||||
var sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
var sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
||||||
var isDeletFingerprint = true.obs;// 是否删除卡
|
var isDeletFingerprint = true.obs; // 是否删除卡
|
||||||
final isStressFingerprint = false.obs;
|
final isStressFingerprint = false.obs;
|
||||||
var isAdministrator = false.obs;// 是否是管理员
|
var isAdministrator = false.obs; // 是否为管理员
|
||||||
|
|
||||||
FingerprintDetailState() {
|
FingerprintDetailState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
@ -42,9 +41,11 @@ class FingerprintDetailState{
|
|||||||
keyType.value = fingerprintItemData.value.fingerprintType!;
|
keyType.value = fingerprintItemData.value.fingerprintType!;
|
||||||
adder.value = fingerprintItemData.value.senderUsername!;
|
adder.value = fingerprintItemData.value.senderUsername!;
|
||||||
addTime.value = fingerprintItemData.value.createDate!;
|
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!;
|
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:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/iris/addIrisType/addIrisType_logic.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/dateTool.dart';
|
||||||
import 'package:star_lock/tools/pickers/pickers.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/date_mode.dart';
|
||||||
@ -249,13 +250,17 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
|
|||||||
Widget keyBottomWidget() {
|
Widget keyBottomWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
Obx(() => Visibility(
|
||||||
leftTitel: "是否是管理员".tr,
|
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
|
||||||
rightTitle: "",
|
? true
|
||||||
isTipsImg: false,
|
: false,
|
||||||
isHaveRightWidget: true,
|
child: CommonItem(
|
||||||
rightWidget: SizedBox(
|
leftTitel: "是否为管理员".tr,
|
||||||
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))),
|
rightTitle: "",
|
||||||
|
isTipsImg: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: SizedBox(
|
||||||
|
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))))),
|
||||||
SizedBox(height: 30.h),
|
SizedBox(height: 30.h),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||||
@ -329,7 +334,7 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否是管理员
|
// 是否为管理员
|
||||||
CupertinoSwitch _isAdmin() {
|
CupertinoSwitch _isAdmin() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
|||||||
@ -7,7 +7,7 @@ class AddIrisTypeState {
|
|||||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||||
var fromTypeTwoStaffName = "".obs; // 考勤添加人脸员工名字
|
var fromTypeTwoStaffName = "".obs; // 考勤添加人脸员工名字
|
||||||
final isStressFingerprint = false.obs;
|
final isStressFingerprint = false.obs;
|
||||||
final isAdministrator = false.obs; // 是否是管理员
|
final isAdministrator = false.obs; // 是否为管理员
|
||||||
|
|
||||||
var beginTime = "".obs; // 开始时间
|
var beginTime = "".obs; // 开始时间
|
||||||
var endTime = "".obs; // 结束时间
|
var endTime = "".obs; // 结束时间
|
||||||
@ -24,6 +24,5 @@ class AddIrisTypeState {
|
|||||||
// fromTypeTwoStaffName = map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字
|
// fromTypeTwoStaffName = map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字
|
||||||
// // nameController.text = fromTypeTwoStaffName.value;
|
// // nameController.text = fromTypeTwoStaffName.value;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,8 @@ import 'package:intl/intl.dart';
|
|||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.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 '../../../app_settings/app_settings.dart';
|
||||||
import '../../../blue/blue_manage.dart';
|
import '../../../blue/blue_manage.dart';
|
||||||
import '../../../blue/io_protocol/io_openLock.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/io_tool/manager_event_bus.dart';
|
||||||
import '../../../blue/sender_manage.dart';
|
import '../../../blue/sender_manage.dart';
|
||||||
import '../../../network/api_repository.dart';
|
import '../../../network/api_repository.dart';
|
||||||
import '../../../permission/permission_dialog.dart';
|
|
||||||
import '../../../tools/baseGetXController.dart';
|
import '../../../tools/baseGetXController.dart';
|
||||||
import '../../../tools/commonDataManage.dart';
|
import '../../../tools/commonDataManage.dart';
|
||||||
import '../../../tools/eventBusEventManage.dart';
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
@ -32,7 +33,8 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 监听设备返回的数据
|
// 监听设备返回的数据
|
||||||
void initReplySubscription() {
|
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) {
|
if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) {
|
||||||
_replyOpenLock(reply);
|
_replyOpenLock(reply);
|
||||||
@ -88,7 +90,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
state.electricQuantity.value = power;
|
state.electricQuantity.value = power;
|
||||||
|
|
||||||
// 备用电量
|
// 备用电量
|
||||||
if(state.keyInfos.value.lockFeature!.isSupportBackupBattery == 1){
|
if (state.keyInfos.value.lockFeature!.isSupportBackupBattery == 1) {
|
||||||
int powerStandby = reply.data[9];
|
int powerStandby = reply.data[9];
|
||||||
state.electricQuantityStandby.value = powerStandby;
|
state.electricQuantityStandby.value = powerStandby;
|
||||||
}
|
}
|
||||||
@ -123,10 +125,6 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
signKey: signKeyDataList,
|
signKey: signKeyDataList,
|
||||||
privateKey: getPrivateKeyList,
|
privateKey: getPrivateKeyList,
|
||||||
);
|
);
|
||||||
break;
|
|
||||||
case 0x07:
|
|
||||||
//无权限
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 0x16:
|
case 0x16:
|
||||||
// 正在开锁中...
|
// 正在开锁中...
|
||||||
@ -136,8 +134,20 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 0x0d:
|
||||||
|
// 正在开锁中...
|
||||||
|
showToast('钥匙无效'.tr);
|
||||||
|
state.openLockBtnState.value = 0;
|
||||||
|
state.openDoorBtnisUneable.value = false;
|
||||||
|
state.animationController!.stop();
|
||||||
|
cancelBlueConnetctToastTimer();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
//失败
|
//失败
|
||||||
|
state.openLockBtnState.value = 0;
|
||||||
|
state.openDoorBtnisUneable.value = false;
|
||||||
|
state.animationController!.stop();
|
||||||
|
cancelBlueConnetctToastTimer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -173,7 +183,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
if (dataLength > 0) {
|
if (dataLength > 0) {
|
||||||
reply.data.removeRange(0, 7);
|
reply.data.removeRange(0, 7);
|
||||||
// 把得到的数据按8位分割成数组 然后塞进一个新的数组里面
|
// 把得到的数据按8位分割成数组 然后塞进一个新的数组里面
|
||||||
if(reply.data.length < 17){
|
if (reply.data.length < 17) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var getList = splitList(reply.data, 17);
|
var getList = splitList(reply.data, 17);
|
||||||
@ -185,29 +195,29 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
var indexMap = {};
|
var indexMap = {};
|
||||||
indexMap["type"] = indexList[0].toString();
|
indexMap["type"] = indexList[0].toString();
|
||||||
|
|
||||||
if(indexList[0] == 2){
|
if (indexList[0] == 2) {
|
||||||
var passwordData = reply.data.sublist(7, 17);
|
var passwordData = reply.data.sublist(7, 17);
|
||||||
var password = utf8String(passwordData);
|
var password = utf8String(passwordData);
|
||||||
indexMap["user"] = password.toString();
|
indexMap["user"] = password.toString();
|
||||||
}else{
|
} else {
|
||||||
int userNo = (indexList[1]*255) + indexList[2];
|
int userNo = (indexList[1] * 255) + indexList[2];
|
||||||
indexMap["user"] = userNo.toString();
|
indexMap["user"] = userNo.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
indexMap["success"] = "1";
|
indexMap["success"] = "1";
|
||||||
|
|
||||||
int time = ((0xff & indexList[(3)]) << 24 |
|
int time = ((0xff & indexList[(3)]) << 24 |
|
||||||
(0xff & indexList[4]) << 16 |
|
(0xff & indexList[4]) << 16 |
|
||||||
(0xff & indexList[5]) << 8 |
|
(0xff & indexList[5]) << 8 |
|
||||||
(0xFF & indexList[6]));
|
(0xFF & indexList[6]));
|
||||||
indexMap["date"] = "${time * 1000}";
|
indexMap["date"] = "${time * 1000}";
|
||||||
uploadList.add(indexMap);
|
uploadList.add(indexMap);
|
||||||
}
|
}
|
||||||
lockRecordUploadData(uploadList);
|
lockRecordUploadData(uploadList);
|
||||||
|
|
||||||
if(dataLength == state.logCountPage){
|
if (dataLength == state.logCountPage) {
|
||||||
senderReferEventRecordTime();
|
senderReferEventRecordTime();
|
||||||
}else{
|
} else {
|
||||||
await BlueManage().disconnect();
|
await BlueManage().disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -351,7 +361,9 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
var token = await Storage.getStringList(saveBlueToken);
|
var token = await Storage.getStringList(saveBlueToken);
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
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) {
|
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||||
IoSenderManage.senderOpenLock(
|
IoSenderManage.senderOpenLock(
|
||||||
keyID: BlueManage().connectDeviceName,
|
keyID: BlueManage().connectDeviceName,
|
||||||
@ -377,13 +389,15 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 查询事件记录(时间查询)
|
// 查询事件记录(时间查询)
|
||||||
Future<void> senderReferEventRecordTime() async {
|
Future<void> senderReferEventRecordTime() async {
|
||||||
showBlueConnetctToastTimer(isShowBlueConnetctToast: false, action: () {
|
showBlueConnetctToastTimer(
|
||||||
BlueManage().disconnect();
|
isShowBlueConnetctToast: false,
|
||||||
});
|
action: () {
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
BlueManage().disconnect();
|
||||||
|
});
|
||||||
|
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected) {
|
if (connectionState == BluetoothConnectionState.connected) {
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
@ -410,27 +424,30 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 从服务器获取锁的时间 开锁时传入
|
// 从服务器获取锁的时间 开锁时传入
|
||||||
void getServerDatetime() async{
|
void getServerDatetime() async {
|
||||||
var entity = await ApiRepository.to.getServerDatetimeData();
|
var entity = await ApiRepository.to.getServerDatetimeData();
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
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}");
|
// AppLog.log("entity.data!.date! ~/ 1000:${entity.data!.date! ~/ 1000} DateTime.now().millisecondsSinceEpoch ~/ 1000:${DateTime.now().millisecondsSinceEpoch ~/ 1000} 服务器时间差:${state.differentialTime}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int getUTCNetTime(){
|
int getUTCNetTime() {
|
||||||
return DateTime.now().millisecondsSinceEpoch ~/ 1000 + state.differentialTime;
|
return DateTime.now().millisecondsSinceEpoch ~/ 1000 +
|
||||||
|
state.differentialTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取手机联网token,根据锁设置里面获取的开锁时是否联网来判断是否调用这个接口
|
// 获取手机联网token,根据锁设置里面获取的开锁时是否联网来判断是否调用这个接口
|
||||||
void getLockNetToken() async {
|
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) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.lockNetToken = entity.data!.token!.toString();
|
state.lockNetToken = entity.data!.token!.toString();
|
||||||
AppLog.log("从服务器获取联网token:${state.lockNetToken}");
|
AppLog.log("从服务器获取联网token:${state.lockNetToken}");
|
||||||
openDoorAction();
|
openDoorAction();
|
||||||
}else{
|
} else {
|
||||||
showToast("网络访问失败,请检查网络是否正常".tr, something: (){
|
showToast("网络访问失败,请检查网络是否正常".tr, something: () {
|
||||||
state.openLockBtnState.value = 0;
|
state.openLockBtnState.value = 0;
|
||||||
state.animationController!.forward();
|
state.animationController!.forward();
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
@ -442,12 +459,13 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//电量更新请求
|
//电量更新请求
|
||||||
Future<void> uploadElectricQuantityRequest() async {
|
Future<void> uploadElectricQuantityRequest() async {
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to.uploadElectricQuantity(
|
KeyOperationRecordEntity entity = await ApiRepository.to
|
||||||
electricQuantity:state.electricQuantity.value.toString(),
|
.uploadElectricQuantity(
|
||||||
electricQuantityStandby: state.electricQuantityStandby.value.toString(),
|
electricQuantity: state.electricQuantity.value.toString(),
|
||||||
lockId: state.keyInfos.value.lockId.toString(),
|
electricQuantityStandby:
|
||||||
isUnShowLoading: true
|
state.electricQuantityStandby.value.toString(),
|
||||||
);
|
lockId: state.keyInfos.value.lockId.toString(),
|
||||||
|
isUnShowLoading: true);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
@ -476,9 +494,9 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 查询锁记录最后时间
|
// 查询锁记录最后时间
|
||||||
void getLockRecordLastUploadDataTime() async {
|
void getLockRecordLastUploadDataTime() async {
|
||||||
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to.getLockRecordLastUploadDataTime(
|
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to
|
||||||
lockId: state.keyInfos.value.lockId.toString()
|
.getLockRecordLastUploadDataTime(
|
||||||
);
|
lockId: state.keyInfos.value.lockId.toString());
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.operateDate = entity.data!.operateDate! ~/ 1000;
|
state.operateDate = entity.data!.operateDate! ~/ 1000;
|
||||||
senderReferEventRecordTime();
|
senderReferEventRecordTime();
|
||||||
@ -487,14 +505,14 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 操作记录上传
|
// 操作记录上传
|
||||||
void lockRecordUploadData(List list) async {
|
void lockRecordUploadData(List list) async {
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordUploadData(
|
KeyOperationRecordEntity entity = await ApiRepository.to
|
||||||
lockId: state.keyInfos.value.lockId.toString(),
|
.lockRecordUploadData(
|
||||||
records: list
|
lockId: state.keyInfos.value.lockId.toString(), records: list);
|
||||||
);
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
// mockNetworkDataRequest();
|
// mockNetworkDataRequest();
|
||||||
AppLog.log("state.keyInfos.value.keyType:${state.keyInfos.value.keyType}");
|
AppLog.log(
|
||||||
if(state.keyInfos.value.keyType == XSConstantMacro.keyTypeOnce){
|
"state.keyInfos.value.keyType:${state.keyInfos.value.keyType}");
|
||||||
|
if (state.keyInfos.value.keyType == XSConstantMacro.keyTypeOnce) {
|
||||||
// 单次删除
|
// 单次删除
|
||||||
deletKeyData();
|
deletKeyData();
|
||||||
}
|
}
|
||||||
@ -504,9 +522,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
// 普通用户或者授权管理员删除钥匙
|
// 普通用户或者授权管理员删除钥匙
|
||||||
void deletKeyData() async {
|
void deletKeyData() async {
|
||||||
var entity = await ApiRepository.to.deleteElectronicKey(
|
var entity = await ApiRepository.to.deleteElectronicKey(
|
||||||
keyId:state.keyInfos.value.keyId.toString(),
|
keyId: state.keyInfos.value.keyId.toString(), includeUnderlings: 0);
|
||||||
includeUnderlings: 0
|
|
||||||
);
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
BlueManage().connectDeviceMacAddress = "";
|
BlueManage().connectDeviceMacAddress = "";
|
||||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||||
@ -516,21 +532,24 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// 锁设置里面开启关闭考勤刷新锁详情
|
/// 锁设置里面开启关闭考勤刷新锁详情
|
||||||
void initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction() {
|
void initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction() {
|
||||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||||
state.lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent =
|
state.lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent =
|
||||||
eventBus.on<LockSetChangeSetRefreshLockDetailWithType>().listen((event) {
|
eventBus
|
||||||
|
.on<LockSetChangeSetRefreshLockDetailWithType>()
|
||||||
|
.listen((event) {
|
||||||
if (event.type == 0) {
|
if (event.type == 0) {
|
||||||
// 0考勤
|
// 0考勤
|
||||||
state.isAttendance.value = int.parse(event.setResult);
|
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) {
|
} else if (event.type == 1) {
|
||||||
// 1 开锁时是否需联网
|
// 1 开锁时是否需联网
|
||||||
state.isOpenLockNeedOnline.value = int.parse(event.setResult);
|
state.isOpenLockNeedOnline.value = int.parse(event.setResult);
|
||||||
state.keyInfos.value.lockSetting!.appUnlockOnline = int.parse(event.setResult);
|
state.keyInfos.value.lockSetting!.appUnlockOnline =
|
||||||
state.lockNetToken = "";// 改变开锁时是否联网状态的时候清空token
|
int.parse(event.setResult);
|
||||||
|
state.lockNetToken = ""; // 改变开锁时是否联网状态的时候清空token
|
||||||
} else if (event.type == 2) {
|
} else if (event.type == 2) {
|
||||||
// 2 常开模式
|
// 2 常开模式
|
||||||
state.isOpenPassageMode.value = int.parse(event.setResult);
|
state.isOpenPassageMode.value = int.parse(event.setResult);
|
||||||
@ -562,7 +581,8 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired ||
|
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired ||
|
||||||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted ||
|
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted ||
|
||||||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) {
|
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) {
|
||||||
text = "${"你的钥匙".tr}${XSConstantMacro.getKeyStatusStr(state.keyInfos.value.keyStatus!)}";
|
text =
|
||||||
|
"${"你的钥匙".tr}${XSConstantMacro.getKeyStatusStr(state.keyInfos.value.keyStatus!)}";
|
||||||
} else {
|
} else {
|
||||||
text = state.isOpenPassageMode.value == 1
|
text = state.isOpenPassageMode.value == 1
|
||||||
? "常开模式启动!长按闭锁".tr
|
? "常开模式启动!长按闭锁".tr
|
||||||
@ -587,5 +607,4 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
await PermissionDialog.request(Permission.location);
|
await PermissionDialog.request(Permission.location);
|
||||||
await PermissionDialog.requestBluetooth();
|
await PermissionDialog.requestBluetooth();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,15 +1,14 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:get_storage/get_storage.dart';
|
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:star_lock/app_settings/app_colors.dart';
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
import 'package:star_lock/flavors.dart';
|
import 'package:star_lock/flavors.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_list_page.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/aliyunRealNameAuth/aliyunRealNameAuthHandle.dart';
|
||||||
|
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||||
import 'package:star_lock/tools/showTipView.dart';
|
import 'package:star_lock/tools/showTipView.dart';
|
||||||
import 'package:star_lock/widget/flavors_img.dart';
|
import 'package:star_lock/widget/flavors_img.dart';
|
||||||
|
|
||||||
@ -147,23 +146,35 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
body: Obx(() {
|
body: Obx(() {
|
||||||
return Column(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
Column(
|
||||||
height: 35.h,
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 35.h,
|
||||||
|
),
|
||||||
|
xhjInfoView(),
|
||||||
|
SizedBox(
|
||||||
|
height: 35.h,
|
||||||
|
),
|
||||||
|
labelText('images/icon_slider_horizontal.png', '功能'.tr, () {
|
||||||
|
Get.to(LockDetailListPage(
|
||||||
|
title: '功能'.tr, items: getBottomWidget()));
|
||||||
|
}),
|
||||||
|
labelText('images/icon_puzzlepiece_extension.png', '配件'.tr, () {
|
||||||
|
Get.to(LockDetailListPage(
|
||||||
|
title: '配件'.tr, items: getAttachmentWidget()));
|
||||||
|
}),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
xhjInfoView(),
|
Visibility(
|
||||||
SizedBox(
|
visible: state.iSClosedUnlockSuccessfulPopup.value,
|
||||||
height: 35.h,
|
child: Container(
|
||||||
),
|
width: 1.sw,
|
||||||
labelText('images/icon_slider_horizontal.png', '功能'.tr, () {
|
height: 1.sh - ScreenUtil().statusBarHeight * 2,
|
||||||
Get.to(
|
color: Colors.black.withOpacity(0.3),
|
||||||
LockDetailListPage(title: '功能'.tr, items: getBottomWidget()));
|
child: _unlockSuccessWidget()),
|
||||||
}),
|
)
|
||||||
labelText('images/icon_puzzlepiece_extension.png', '配件'.tr, () {
|
|
||||||
Get.to(LockDetailListPage(
|
|
||||||
title: '配件'.tr, items: getAttachmentWidget()));
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
@ -182,7 +193,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.black.withOpacity(0.15),
|
color: Colors.black.withOpacity(0.15),
|
||||||
offset: Offset(0, 0),
|
offset: const Offset(0, 0),
|
||||||
blurRadius: 10.r,
|
blurRadius: 10.r,
|
||||||
spreadRadius: 0,
|
spreadRadius: 0,
|
||||||
),
|
),
|
||||||
@ -257,7 +268,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.black.withOpacity(0.3),
|
color: Colors.black.withOpacity(0.3),
|
||||||
offset: Offset(0, 0),
|
offset: const Offset(0, 0),
|
||||||
blurRadius: 10.r,
|
blurRadius: 10.r,
|
||||||
spreadRadius: 0,
|
spreadRadius: 0,
|
||||||
),
|
),
|
||||||
@ -449,19 +460,11 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: state.iSClosedUnlockSuccessfulPopup.value,
|
visible: state.iSClosedUnlockSuccessfulPopup.value,
|
||||||
// visible: true,
|
child: Container(
|
||||||
child: GestureDetector(
|
width: 1.sw,
|
||||||
onTap: () {
|
height: 1.sh - ScreenUtil().statusBarHeight * 2,
|
||||||
setState(() {
|
color: Colors.black.withOpacity(0.3),
|
||||||
state.iSClosedUnlockSuccessfulPopup.value = false;
|
child: _unlockSuccessWidget()),
|
||||||
});
|
|
||||||
},
|
|
||||||
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(
|
SizedBox(
|
||||||
height: 30.h,
|
height: 30.h,
|
||||||
),
|
),
|
||||||
F.sw(defaultCall: () => adminInfoView(), xhjCall: () => SizedBox()),
|
F.sw(
|
||||||
|
defaultCall: () => adminInfoView(),
|
||||||
|
xhjCall: () => const SizedBox()),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
@ -691,7 +723,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
if (add) SizedBox(width: 20.w) else SizedBox(width: 40.w),
|
if (add) SizedBox(width: 20.w) else SizedBox(width: 40.w),
|
||||||
FlavorsImg(
|
FlavorsImg(
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
state.keyInfos.value.remoteEnable == 1
|
state.keyInfos.value.hasGateway == 1
|
||||||
? 'images/main/icon_main_remoteUnlocking.png'
|
? 'images/main/icon_main_remoteUnlocking.png'
|
||||||
: 'images/main/icon_main_remoteUnlocking_grey.png',
|
: 'images/main/icon_main_remoteUnlocking_grey.png',
|
||||||
width: 24.w,
|
width: 24.w,
|
||||||
@ -703,7 +735,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
TranslationLoader.lanKeys!.gatewayDevice!.tr,
|
TranslationLoader.lanKeys!.gatewayDevice!.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.sp,
|
fontSize: 20.sp,
|
||||||
color: state.keyInfos.value.remoteEnable == 1
|
color: state.keyInfos.value.hasGateway == 1
|
||||||
? AppColors.mainColor
|
? AppColors.mainColor
|
||||||
: AppColors.btnDisableColor),
|
: AppColors.btnDisableColor),
|
||||||
),
|
),
|
||||||
@ -1222,36 +1254,54 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _unlockSuccessWidget() {
|
Widget _unlockSuccessWidget() {
|
||||||
return Stack(
|
return Center(
|
||||||
alignment: Alignment.center,
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
state.iSOpenLock.value == true
|
state.iSOpenLock.value == true
|
||||||
? 'images/main/unlocked_bg.png'
|
? 'images/main/unlocked_bg.png'
|
||||||
: 'images/main/locked_bg.png',
|
: 'images/main/locked_bg.png',
|
||||||
width: 358.w,
|
width: 358.w,
|
||||||
height: 348.h,
|
height: 348.h,
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
top: (1.sh - ScreenUtil().statusBarHeight * 2) / 2,
|
top: 180.h,
|
||||||
child: Column(
|
left: 55.w,
|
||||||
children: [
|
child: Column(
|
||||||
Text(
|
mainAxisSize: MainAxisSize.min,
|
||||||
state.keyInfos.value.lockAlias!,
|
children: [
|
||||||
style: TextStyle(
|
Text(
|
||||||
color: AppColors.placeholderTextColor, fontSize: 24.sp),
|
state.keyInfos.value.lockAlias!,
|
||||||
),
|
style: TextStyle(
|
||||||
SizedBox(
|
color: AppColors.placeholderTextColor, fontSize: 24.sp),
|
||||||
height: 10.h,
|
),
|
||||||
),
|
SizedBox(
|
||||||
Text(
|
height: 10.h,
|
||||||
getCurrentFormattedTime(),
|
),
|
||||||
style: TextStyle(
|
Text(
|
||||||
color: AppColors.darkGrayTextColor, fontSize: 24.sp),
|
getCurrentFormattedTime(),
|
||||||
)
|
style: TextStyle(
|
||||||
],
|
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:crypto/crypto.dart';
|
||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:star_lock/blue/blue_manage.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/io_tool/manager_event_bus.dart';
|
||||||
import 'package:star_lock/blue/sender_manage.dart';
|
import 'package:star_lock/blue/sender_manage.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSet_logic.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/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/commonDataManage.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/tools/storage.dart';
|
||||||
|
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||||
|
|
||||||
import '../../../../app_settings/app_settings.dart';
|
import '../../../../app_settings/app_settings.dart';
|
||||||
import 'lockEscalation_state.dart';
|
import 'lockEscalation_state.dart';
|
||||||
@ -67,7 +69,15 @@ class LockEscalationLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
String md5Str = md5.convert(otaBin!).toString();
|
String md5Str = md5.convert(otaBin!).toString();
|
||||||
headJson!['fwMd5'] = md5Str;
|
headJson!['fwMd5'] = md5Str;
|
||||||
blueOTAUpgrade(headJson!, [0, 0, 0, 0]);
|
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 升级
|
//蓝牙操作 ota 升级
|
||||||
@ -217,7 +227,7 @@ class LockEscalationLogic extends BaseGetXController {
|
|||||||
Uint8List bin = data.sublist(binOffset.toInt(), data.length);
|
Uint8List bin = data.sublist(binOffset.toInt(), data.length);
|
||||||
//md5 校验有问题,暂时不解析
|
//md5 校验有问题,暂时不解析
|
||||||
String md5Str = md5.convert(bin).toString().toUpperCase();
|
String md5Str = md5.convert(bin).toString().toUpperCase();
|
||||||
AppLog.log('---> $md5Str ${meta['fwMd5']}');
|
AppLog.log('固件 md5 检验md5:$md5Str 固件信息 md5:${meta['fwMd5']}');
|
||||||
if (md5Str != meta['fwMd5']) {
|
if (md5Str != meta['fwMd5']) {
|
||||||
showToast('文件校验失败 0x02'.tr);
|
showToast('文件校验失败 0x02'.tr);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -31,136 +31,161 @@ class _LockEscalationPageState extends State<LockEscalationPage> {
|
|||||||
),
|
),
|
||||||
body: Container(
|
body: Container(
|
||||||
padding: EdgeInsets.all(30.w),
|
padding: EdgeInsets.all(30.w),
|
||||||
child: Column(
|
child: Obx(() {
|
||||||
children: [
|
return updateView(logic);
|
||||||
Obx(() {
|
}),
|
||||||
return logic.state.otaUpdateIng.value
|
|
||||||
? PopScope(
|
|
||||||
canPop: false,
|
|
||||||
onPopInvoked: (didPop) async {
|
|
||||||
if (logic.state.otaUpdateIng.value) {
|
|
||||||
logic.closeOTADAta();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: const SizedBox(),
|
|
||||||
)
|
|
||||||
: const SizedBox();
|
|
||||||
}),
|
|
||||||
SizedBox(
|
|
||||||
height: 60.h,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Image.asset(
|
|
||||||
'images/main/icon_main_lockSet_lockEscalation.png',
|
|
||||||
width: 36.w,
|
|
||||||
height: 36.w,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 10.w,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
// TranslationLoader.lanKeys!.haveNewVersion!.tr,
|
|
||||||
"未发现新版本",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 24.sp, fontWeight: FontWeight.w600),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 30.h,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"${TranslationLoader.lanKeys!.currentVersion!.tr}:1.0.0",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 40.h,
|
|
||||||
),
|
|
||||||
Obx(() {
|
|
||||||
return !logic.state.otaUpdateIng.value
|
|
||||||
? SubmitBtn(
|
|
||||||
btnName: TranslationLoader.lanKeys!.upgrade!.tr,
|
|
||||||
onClick: () {})
|
|
||||||
: SizedBox();
|
|
||||||
}),
|
|
||||||
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(
|
|
||||||
onTap: () {
|
|
||||||
logic.otaUpdate();
|
|
||||||
},
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Text(
|
|
||||||
'手动升级',
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.mainColor,
|
|
||||||
fontSize: 18.sp,
|
|
||||||
fontWeight: FontWeight.w400),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: Padding(
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 50.w, vertical: 15.h),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'固件传输中',
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.mainColor,
|
|
||||||
fontSize: 18.sp,
|
|
||||||
fontWeight: FontWeight.w400),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 10.w,
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(10.r)),
|
|
||||||
child: LinearProgressIndicator(
|
|
||||||
value: logic
|
|
||||||
.state.otaProgress.value, // 50% 进度
|
|
||||||
backgroundColor: Colors.grey[200],
|
|
||||||
valueColor:
|
|
||||||
AlwaysStoppedAnimation<Color>(
|
|
||||||
AppColors.mainColor),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
'images/main/icon_main_lockSet_lockEscalation.png',
|
||||||
|
width: 36.w,
|
||||||
|
height: 36.w,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 10.w,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
// TranslationLoader.lanKeys!.haveNewVersion!.tr,
|
||||||
|
"未发现新版本",
|
||||||
|
style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 30.h,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"${TranslationLoader.lanKeys!.currentVersion!.tr}:1.0.0",
|
||||||
|
style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 40.h,
|
||||||
|
),
|
||||||
|
Obx(() {
|
||||||
|
return !logic.state.otaUpdateIng.value
|
||||||
|
? SubmitBtn(
|
||||||
|
btnName: TranslationLoader.lanKeys!.upgrade!.tr,
|
||||||
|
onClick: () {})
|
||||||
|
: SizedBox();
|
||||||
|
}),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.h,
|
||||||
|
),
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//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: [
|
||||||
|
Text(
|
||||||
|
'固件传输中',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.mainColor,
|
||||||
|
fontSize: 18.sp,
|
||||||
|
fontWeight: FontWeight.w400),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 10.w,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
||||||
|
child: LinearProgressIndicator(
|
||||||
|
value: logic.state.otaProgress.value, // 50% 进度
|
||||||
|
backgroundColor: Colors.grey[200],
|
||||||
|
valueColor:
|
||||||
|
AlwaysStoppedAnimation<Color>(AppColors.mainColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/palm/addPalmType/addPalmType_logic.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/dateTool.dart';
|
||||||
import 'package:star_lock/tools/pickers/pickers.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/date_mode.dart';
|
||||||
@ -249,13 +250,17 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
|
|||||||
Widget keyBottomWidget() {
|
Widget keyBottomWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
Obx(() => Visibility(
|
||||||
leftTitel: "是否是管理员".tr,
|
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
|
||||||
rightTitle: "",
|
? true
|
||||||
isTipsImg: false,
|
: false,
|
||||||
isHaveRightWidget: true,
|
child: CommonItem(
|
||||||
rightWidget: SizedBox(
|
leftTitel: "是否为管理员".tr,
|
||||||
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))),
|
rightTitle: "",
|
||||||
|
isTipsImg: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: SizedBox(
|
||||||
|
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))))),
|
||||||
SizedBox(height: 30.h),
|
SizedBox(height: 30.h),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||||
@ -329,7 +334,7 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否是管理员
|
// 是否为管理员
|
||||||
CupertinoSwitch _isAdmin() {
|
CupertinoSwitch _isAdmin() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
|||||||
@ -7,7 +7,7 @@ class AddPalmTypeState {
|
|||||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||||
var fromTypeTwoStaffName = "".obs; // 考勤添加人脸员工名字
|
var fromTypeTwoStaffName = "".obs; // 考勤添加人脸员工名字
|
||||||
final isStressFingerprint = false.obs;
|
final isStressFingerprint = false.obs;
|
||||||
final isAdministrator = false.obs; // 是否是管理员
|
final isAdministrator = false.obs; // 是否为管理员
|
||||||
|
|
||||||
var beginTime = "".obs; // 开始时间
|
var beginTime = "".obs; // 开始时间
|
||||||
var endTime = "".obs; // 结束时间
|
var endTime = "".obs; // 结束时间
|
||||||
|
|||||||
@ -25,7 +25,8 @@ class PasswordKeyDetailPage extends StatefulWidget {
|
|||||||
State<PasswordKeyDetailPage> createState() => _PasswordKeyDetailPageState();
|
State<PasswordKeyDetailPage> createState() => _PasswordKeyDetailPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with RouteAware {
|
class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
|
||||||
|
with RouteAware {
|
||||||
final logic = Get.put(PasswordKeyDetailLogic());
|
final logic = Get.put(PasswordKeyDetailLogic());
|
||||||
final state = Get.find<PasswordKeyDetailLogic>().state;
|
final state = Get.find<PasswordKeyDetailLogic>().state;
|
||||||
|
|
||||||
@ -64,13 +65,15 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
|||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.password!.tr,
|
leftTitel: TranslationLoader.lanKeys!.password!.tr,
|
||||||
rightTitle: state.keyboardPwd.value,
|
rightTitle: state.keyboardPwd.value,
|
||||||
isHaveDirection: state.itemData.value.isCustom! == 1 ? true : false,
|
isHaveDirection:
|
||||||
|
state.itemData.value.isCustom! == 1 ? true : false,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () {
|
action: () {
|
||||||
if (state.itemData.value.isCustom! != 1) {
|
if (state.itemData.value.isCustom! != 1) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
showCupertinoAlertDialog(context, state.inputPwdController);
|
showCupertinoAlertDialog(
|
||||||
|
context, state.inputPwdController);
|
||||||
}
|
}
|
||||||
})),
|
})),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
@ -86,31 +89,37 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
|||||||
leftTitel: "有效期",
|
leftTitel: "有效期",
|
||||||
rightTitle: logic.getUseDateStr(),
|
rightTitle: logic.getUseDateStr(),
|
||||||
isHaveLine: state.isCirculation.value,
|
isHaveLine: state.isCirculation.value,
|
||||||
isHaveDirection: state.itemData.value.isCustom! == 1 ? true : false,
|
isHaveDirection:
|
||||||
|
state.itemData.value.isCustom! == 1 ? true : false,
|
||||||
allHeight:
|
allHeight:
|
||||||
state.itemData.value.keyboardPwdType == 3 ? 90.h : 65.h,
|
state.itemData.value.keyboardPwdType == 3 ? 90.h : 65.h,
|
||||||
action: () async {
|
action: () async {
|
||||||
if (state.itemData.value.isCustom! != 1) {
|
if (state.itemData.value.isCustom! != 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var backData = await Get.toNamed(Routers.passwordKeyDetailChangeDatePage, arguments: {
|
var backData = await Get.toNamed(
|
||||||
'itemData': state.itemData.value,
|
Routers.passwordKeyDetailChangeDatePage,
|
||||||
});
|
arguments: {
|
||||||
|
'itemData': state.itemData.value,
|
||||||
|
});
|
||||||
if (backData != null) {
|
if (backData != null) {
|
||||||
state.itemData.value.startDate = int.parse(backData["beginTimeTimestamp"])*1000;
|
state.itemData.value.startDate =
|
||||||
state.itemData.value.endDate = int.parse(backData["endTimeTimestamp"])*1000;
|
int.parse(backData["beginTimeTimestamp"]) * 1000;
|
||||||
|
state.itemData.value.endDate =
|
||||||
|
int.parse(backData["endTimeTimestamp"]) * 1000;
|
||||||
// 改了日期之后,永久只能改限时的
|
// 改了日期之后,永久只能改限时的
|
||||||
state.itemData.value.keyboardPwdType = 3;
|
state.itemData.value.keyboardPwdType = 3;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
})),
|
})),
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.isCirculation.value,
|
visible: state.isCirculation.value,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: "结束时间",
|
leftTitel: "结束时间",
|
||||||
rightTitle: DateTool().dateToYMDHNString(state.itemData.value.endDate.toString()),
|
rightTitle: DateTool().dateToYMDHNString(
|
||||||
isHaveLine: true),
|
state.itemData.value.endDate.toString()),
|
||||||
)),
|
isHaveLine: true),
|
||||||
|
)),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.sender!.tr,
|
leftTitel: TranslationLoader.lanKeys!.sender!.tr,
|
||||||
@ -123,19 +132,20 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
|||||||
action: () {}),
|
action: () {}),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.itemData.value.isCustom! == 1,
|
visible: state.itemData.value.isCustom! == 1,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: "管理员".tr,
|
leftTitel: "是否为管理员".tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isTipsImg: false,
|
isTipsImg: false,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isAdmin())),
|
rightWidget: SizedBox(
|
||||||
Container(height: 10.h),
|
width: 60.w, height: 50.h, child: _isAdmin())),
|
||||||
],
|
Container(height: 10.h),
|
||||||
),
|
],
|
||||||
)),
|
),
|
||||||
|
)),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
@ -223,7 +233,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
|||||||
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
left: 30.w, right: 30.w, 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: () {
|
onClick: () {
|
||||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, (){
|
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () {
|
||||||
state.isDeletPasswordKey.value = true;
|
state.isDeletPasswordKey.value = true;
|
||||||
logic.senderCustomPasswords();
|
logic.senderCustomPasswords();
|
||||||
});
|
});
|
||||||
@ -233,7 +243,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否是管理员
|
// 是否为管理员
|
||||||
CupertinoSwitch _isAdmin() {
|
CupertinoSwitch _isAdmin() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
@ -241,9 +251,9 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
|||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: state.isAdministrator.value,
|
value: state.isAdministrator.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
state.isAdministrator.value = value;
|
// state.isAdministrator.value = value;
|
||||||
state.isDeletPasswordKey.value = false;
|
// state.isDeletPasswordKey.value = false;
|
||||||
logic.senderCustomPasswords();
|
// logic.senderCustomPasswords();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -251,7 +261,8 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
|||||||
//发送时间
|
//发送时间
|
||||||
String getSenderDate(PasswordKeyListItem indexEntity) {
|
String getSenderDate(PasswordKeyListItem indexEntity) {
|
||||||
String senderDate = '';
|
String senderDate = '';
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
|
DateTime dateStr =
|
||||||
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
|
||||||
senderDate = dateStr.toLocal().toString().substring(0, 16);
|
senderDate = dateStr.toLocal().toString().substring(0, 16);
|
||||||
return senderDate;
|
return senderDate;
|
||||||
}
|
}
|
||||||
@ -265,28 +276,33 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
|||||||
title: inputController == state.inputNameController
|
title: inputController == state.inputNameController
|
||||||
? "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}"
|
? "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}"
|
||||||
: "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.password!.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,
|
controller: inputController,
|
||||||
keyboardType: inputController == state.inputNameController
|
keyboardType: inputController == state.inputNameController
|
||||||
? TextInputType.text
|
? TextInputType.text
|
||||||
: TextInputType.number,
|
: TextInputType.number,
|
||||||
inputFormatters: <TextInputFormatter>[
|
inputFormatters: <TextInputFormatter>[
|
||||||
FilteringTextInputFormatter.deny('\n'),
|
FilteringTextInputFormatter.deny('\n'),
|
||||||
LengthLimitingTextInputFormatter(inputController == state.inputNameController ? 50 : 9),
|
LengthLimitingTextInputFormatter(
|
||||||
],
|
inputController == state.inputNameController ? 50 : 9),
|
||||||
|
],
|
||||||
sureClick: () {
|
sureClick: () {
|
||||||
//发送编辑钥匙名称请求
|
//发送编辑钥匙名称请求
|
||||||
if(inputController == state.inputPwdController){
|
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位密码");
|
logic.showToast("请输入6-9位密码");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
state.isDeletPasswordKey.value = false;
|
state.isDeletPasswordKey.value = false;
|
||||||
if(inputController == state.inputNameController){
|
if (inputController == state.inputNameController) {
|
||||||
// 修改密码名称
|
// 修改密码名称
|
||||||
logic.updatePwdRequest(1);
|
logic.updatePwdRequest(1);
|
||||||
}else{
|
} else {
|
||||||
// 修改密码
|
// 修改密码
|
||||||
logic.senderCustomPasswords();
|
logic.senderCustomPasswords();
|
||||||
}
|
}
|
||||||
@ -386,13 +402,13 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
|||||||
case 0:
|
case 0:
|
||||||
//微信好友
|
//微信好友
|
||||||
{
|
{
|
||||||
NativeInteractionTool().loadNativeShare(shareText:pwdShareStr);
|
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
//短信
|
//短信
|
||||||
{
|
{
|
||||||
NativeInteractionTool().loadNativeShare(shareText:pwdShareStr);
|
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@ -404,7 +420,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
|||||||
case 3:
|
case 3:
|
||||||
//更多
|
//更多
|
||||||
{
|
{
|
||||||
NativeInteractionTool().loadNativeShare(shareText:pwdShareStr);
|
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -335,18 +335,22 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
|||||||
|
|
||||||
// 自定义是管理员密码
|
// 自定义是管理员密码
|
||||||
Widget keyIfAdministratorWidget() {
|
Widget keyIfAdministratorWidget() {
|
||||||
return Column(
|
return Visibility(
|
||||||
children: [
|
visible:
|
||||||
// SizedBox(height: 10.h),
|
CommonDataManage().currentKeyInfo.isLockOwner == 1 ? true : false,
|
||||||
Obx(() => CommonItem(
|
child: Column(
|
||||||
leftTitel: "是否是管理员".tr,
|
children: [
|
||||||
rightTitle: "",
|
// SizedBox(height: 10.h),
|
||||||
isTipsImg: false,
|
Obx(() => CommonItem(
|
||||||
isHaveRightWidget: true,
|
leftTitel: "是否为管理员".tr,
|
||||||
rightWidget: SizedBox(
|
rightTitle: "",
|
||||||
width: 60.w, height: 50.h, child: _isAdministrator()))),
|
isTipsImg: false,
|
||||||
SizedBox(height: 10.h),
|
isHaveRightWidget: true,
|
||||||
],
|
rightWidget: SizedBox(
|
||||||
|
width: 60.w, height: 50.h, child: _isAdministrator()))),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -629,7 +633,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否是管理员
|
// 是否为管理员
|
||||||
CupertinoSwitch _isAdministrator() {
|
CupertinoSwitch _isAdministrator() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class PasswordKeyPerpetualState {
|
|||||||
final isPermanent = true.obs; //是否永久
|
final isPermanent = true.obs; //是否永久
|
||||||
var getPwdStr = ''.obs;
|
var getPwdStr = ''.obs;
|
||||||
var pwdNameStr = '';
|
var pwdNameStr = '';
|
||||||
final isAdministrator = false.obs; // 是否是管理员
|
final isAdministrator = false.obs; // 是否为管理员
|
||||||
|
|
||||||
var beginTime = DateTool().getNowDateWithType(3).obs; //默认为当前时间 开始时间
|
var beginTime = DateTool().getNowDateWithType(3).obs; //默认为当前时间 开始时间
|
||||||
var endTime = DateTool().getNowDateWithType(3).obs; //默认为当前时间 结束时间
|
var endTime = DateTool().getNowDateWithType(3).obs; //默认为当前时间 结束时间
|
||||||
|
|||||||
@ -130,6 +130,7 @@ class LockListInfoItemEntity {
|
|||||||
Bluetooth? bluetooth;
|
Bluetooth? bluetooth;
|
||||||
LockFeature? lockFeature;
|
LockFeature? lockFeature;
|
||||||
LockSetting? lockSetting;
|
LockSetting? lockSetting;
|
||||||
|
int? hasGateway;
|
||||||
|
|
||||||
LockListInfoItemEntity(
|
LockListInfoItemEntity(
|
||||||
{this.keyId,
|
{this.keyId,
|
||||||
@ -163,7 +164,8 @@ class LockListInfoItemEntity {
|
|||||||
this.isOnlyManageSelf,
|
this.isOnlyManageSelf,
|
||||||
this.restoreCount,
|
this.restoreCount,
|
||||||
this.model,
|
this.model,
|
||||||
this.vendor});
|
this.vendor,
|
||||||
|
this.hasGateway});
|
||||||
|
|
||||||
LockListInfoItemEntity.fromJson(Map<String, dynamic> json) {
|
LockListInfoItemEntity.fromJson(Map<String, dynamic> json) {
|
||||||
keyId = json['keyId'];
|
keyId = json['keyId'];
|
||||||
@ -204,6 +206,7 @@ class LockListInfoItemEntity {
|
|||||||
lockSetting = json['lockSetting'] != null
|
lockSetting = json['lockSetting'] != null
|
||||||
? LockSetting.fromJson(json['lockSetting'])
|
? LockSetting.fromJson(json['lockSetting'])
|
||||||
: null;
|
: null;
|
||||||
|
hasGateway = json['hasGateway'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@ -246,6 +249,7 @@ class LockListInfoItemEntity {
|
|||||||
if (lockSetting != null) {
|
if (lockSetting != null) {
|
||||||
data['lockSetting'] = lockSetting!.toJson();
|
data['lockSetting'] = lockSetting!.toJson();
|
||||||
}
|
}
|
||||||
|
data['hasGateway'] = hasGateway;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
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';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
|
|
||||||
class AboutConsole extends GetxController {
|
class AboutConsole extends GetxController {
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:date_format/date_format.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
@ -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_colors.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
import 'package:star_lock/blue/blue_manage.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/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/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/main/lockMian/entity/lockListInfo_entity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/mine/about/debug/log.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
|
||||||
import 'package:star_lock/tools/commonDataManage.dart';
|
import 'package:star_lock/tools/commonDataManage.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
@ -4,11 +4,10 @@ import 'dart:async';
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
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
|
/// # Debug Console
|
||||||
///
|
///
|
||||||
@ -1,7 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/debug/controller.dart';
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
import 'package:star_lock/debug/debug_console.dart';
|
import 'package:star_lock/mine/about/debug/debug_console.dart';
|
||||||
|
|
||||||
class DeBug {
|
class DeBug {
|
||||||
static void log(String message, {String? tag}) {
|
static void log(String message, {String? tag}) {
|
||||||
@ -24,7 +25,15 @@ class DeBug {
|
|||||||
offset.value += details.delta;
|
offset.value += details.delta;
|
||||||
},
|
},
|
||||||
child: FloatingActionButton(
|
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: () {
|
onPressed: () {
|
||||||
if (openInfo) {
|
if (openInfo) {
|
||||||
Get.back();
|
Get.back();
|
||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:star_lock/debug/controller.dart';
|
import 'package:star_lock/mine/about/debug/controller.dart';
|
||||||
import 'package:star_lock/debug/debug_console.dart';
|
import 'package:star_lock/mine/about/debug/debug_console.dart';
|
||||||
|
|
||||||
/// A widget that adds a floating button for debugging purposes.
|
/// A widget that adds a floating button for debugging purposes.
|
||||||
class DebugConsolePopup extends StatefulWidget {
|
class DebugConsolePopup extends StatefulWidget {
|
||||||
@ -4,8 +4,8 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
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/debug/log.dart';
|
import 'package:star_lock/mine/about/debug/log.dart';
|
||||||
|
|
||||||
class DebugConsoleTile extends StatefulWidget {
|
class DebugConsoleTile extends StatefulWidget {
|
||||||
final DebugConsoleLog log;
|
final DebugConsoleLog log;
|
||||||
@ -4,8 +4,8 @@ import 'package:get/get.dart';
|
|||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/mine/addLock/addLock/addLock_state.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/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||||
|
|
||||||
|
|
||||||
class AddLockLogic extends BaseGetXController {
|
class AddLockLogic extends BaseGetXController {
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:amap_flutter_map/amap_flutter_map.dart';
|
import 'package:amap_flutter_map/amap_flutter_map.dart';
|
||||||
import 'package:amap_flutter_base/amap_flutter_base.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 '../../../../appRouters.dart';
|
||||||
import '../../../../app_settings/app_colors.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_otaUpgrade.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_processOtaUpgrade.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/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/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||||
|
|
||||||
import '../../../appRouters.dart';
|
import '../../../appRouters.dart';
|
||||||
import '../../../app_settings/app_settings.dart';
|
import '../../../app_settings/app_settings.dart';
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -27,12 +26,17 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
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(
|
body: Column(
|
||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 80.h,),
|
SizedBox(
|
||||||
|
height: 80.h,
|
||||||
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(left: 50.w, right: 50.w),
|
margin: EdgeInsets.only(left: 50.w, right: 50.w),
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
@ -40,22 +44,29 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
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(
|
Container(
|
||||||
height: 80.h,
|
height: 80.h,
|
||||||
// color: Colors.red,
|
// color: Colors.red,
|
||||||
padding: EdgeInsets.only(left: 50.w, right: 50.w),
|
padding: EdgeInsets.only(left: 50.w, right: 50.w),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: state.aliNameController,
|
focusNode: state.focusNode,
|
||||||
onChanged: (v){
|
autofocus: true,
|
||||||
|
controller: state.aliNameController,
|
||||||
|
onChanged: (v) {
|
||||||
state.aliName.value = v;
|
state.aliName.value = v;
|
||||||
},
|
},
|
||||||
textAlign:TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
LengthLimitingTextInputFormatter(32),
|
LengthLimitingTextInputFormatter(32),
|
||||||
],
|
],
|
||||||
@ -63,58 +74,44 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: '请填写信息'.tr,
|
hintText: '请填写信息'.tr,
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
// height: 1.1,
|
// height: 1.1,
|
||||||
fontSize: 24.sp,
|
fontSize: 24.sp,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
color: const Color(0xFF999999)
|
color: const Color(0xFF999999)),
|
||||||
),
|
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
///设置边框四个角的弧度
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(50.h)),
|
borderRadius: BorderRadius.all(Radius.circular(50.h)),
|
||||||
///用来配置边框的样式
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
///设置边框的颜色
|
|
||||||
color: AppColors.mainColor,
|
color: AppColors.mainColor,
|
||||||
///设置边框的粗细
|
|
||||||
width: 1,
|
width: 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
///用来配置输入框获取焦点时的颜色
|
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
///设置边框四个角的弧度
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(50.h)),
|
borderRadius: BorderRadius.all(Radius.circular(50.h)),
|
||||||
///用来配置边框的样式
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
///设置边框的颜色
|
|
||||||
color: AppColors.mainColor,
|
color: AppColors.mainColor,
|
||||||
///设置边框的粗细
|
|
||||||
width: 1,
|
width: 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)),
|
||||||
),
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 120.h,
|
||||||
),
|
),
|
||||||
SizedBox(height: 120.h,),
|
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.sure!.tr,
|
btnName: TranslationLoader.lanKeys!.sure!.tr,
|
||||||
borderRadius: 20.w,
|
borderRadius: 20.w,
|
||||||
margin: EdgeInsets.only(
|
margin: EdgeInsets.only(
|
||||||
left: 50.w,
|
left: 50.w,
|
||||||
right: 50.w,
|
right: 50.w,
|
||||||
// top: 30.w,
|
// top: 30.w,
|
||||||
// bottom: 30.w
|
// bottom: 30.w
|
||||||
),
|
),
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
top: 25.w,
|
onClick: () {
|
||||||
bottom: 25.w
|
|
||||||
),
|
|
||||||
onClick: (){
|
|
||||||
logic.addUserConnectBlue();
|
logic.addUserConnectBlue();
|
||||||
}
|
}),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
)
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -130,6 +127,7 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
|
|||||||
void dispose() {
|
void dispose() {
|
||||||
// TODO: implement dispose
|
// TODO: implement dispose
|
||||||
/// 取消路由订阅
|
/// 取消路由订阅
|
||||||
|
state.focusNode.unfocus();
|
||||||
AppRouteObserver().routeObserver.unsubscribe(this);
|
AppRouteObserver().routeObserver.unsubscribe(this);
|
||||||
super.dispose();
|
super.dispose();
|
||||||
BlueManage().stopScan();
|
BlueManage().stopScan();
|
||||||
|
|||||||
@ -7,12 +7,12 @@ import 'package:get/get.dart';
|
|||||||
import '../../../blue/blue_manage.dart';
|
import '../../../blue/blue_manage.dart';
|
||||||
|
|
||||||
class SaveLockState {
|
class SaveLockState {
|
||||||
|
|
||||||
var aliName = ''.obs;
|
var aliName = ''.obs;
|
||||||
var pwdTimestamp= 0.obs;
|
var pwdTimestamp = 0.obs;
|
||||||
var addressInfo = {}.obs;
|
var addressInfo = {}.obs;
|
||||||
|
|
||||||
TextEditingController aliNameController = TextEditingController();
|
TextEditingController aliNameController = TextEditingController();
|
||||||
|
FocusNode focusNode = FocusNode();
|
||||||
|
|
||||||
var lockUserNo = 0;
|
var lockUserNo = 0;
|
||||||
var lockInfo = {};
|
var lockInfo = {};
|
||||||
@ -22,15 +22,16 @@ class SaveLockState {
|
|||||||
var isFromMap = 0; // 0:不是从地图界面进入 1:从地图界面进入
|
var isFromMap = 0; // 0:不是从地图界面进入 1:从地图界面进入
|
||||||
|
|
||||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||||
var sureBtnState = 0.obs;// 0可点击 1 不可点击
|
var sureBtnState = 0.obs; // 0可点击 1 不可点击
|
||||||
|
|
||||||
// 管理员密码
|
// 管理员密码
|
||||||
// var adminPasswordTF = TextEditingController();
|
var adminPasswordTF = TextEditingController();
|
||||||
|
|
||||||
var adminPassword = '';
|
var adminPassword = '';
|
||||||
var lockId = 0;
|
var lockId = 0;
|
||||||
|
|
||||||
SaveLockState() {
|
SaveLockState() {
|
||||||
aliName.value = BlueManage().connectDeviceName;
|
aliName.value = BlueManage().connectDeviceName;
|
||||||
aliNameController.text = aliName.value;
|
aliNameController.text = aliName.value;
|
||||||
adminPassword = getAdminPassword();
|
adminPassword = getAdminPassword();
|
||||||
|
|
||||||
@ -54,3 +55,4 @@ class SaveLockState {
|
|||||||
return number.toString();
|
return number.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,17 +1,15 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
|
||||||
import 'package:fluwx/fluwx.dart';
|
import 'package:fluwx/fluwx.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/flavors.dart';
|
import 'package:star_lock/flavors.dart';
|
||||||
import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_logic.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_entity.dart';
|
||||||
import 'package:star_lock/mine/mall/lockMall_state.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/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/pay/wx_pay_tool.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 'package:webview_flutter/webview_flutter.dart';
|
||||||
|
|
||||||
import '../../app_settings/app_settings.dart';
|
import '../../app_settings/app_settings.dart';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.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';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
|
|
||||||
class LockMallState {
|
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/app_settings/app_settings.dart';
|
||||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.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/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 '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
import '../../../tools/eventBusEventManage.dart';
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:flutter_slidable/flutter_slidable.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdminListEntity.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdminListEntity.dart';
|
||||||
import 'package:star_lock/tools/noData.dart';
|
import 'package:star_lock/tools/noData.dart';
|
||||||
|
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||||
|
|
||||||
import '../../../../../appRouters.dart';
|
import '../../../../../appRouters.dart';
|
||||||
import '../../../../../app_settings/app_colors.dart';
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
@ -23,14 +24,15 @@ class AuthorizedAdministratorListPage extends StatefulWidget {
|
|||||||
_AuthorizedAdministratorListPageState();
|
_AuthorizedAdministratorListPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministratorListPage> {
|
class _AuthorizedAdministratorListPageState
|
||||||
|
extends State<AuthorizedAdministratorListPage> {
|
||||||
final logic = Get.put(AuthorizedAdministratorListLogic());
|
final logic = Get.put(AuthorizedAdministratorListLogic());
|
||||||
final state = Get.find<AuthorizedAdministratorListLogic>().state;
|
final state = Get.find<AuthorizedAdministratorListLogic>().state;
|
||||||
|
|
||||||
Future<void> getHttpData() async {
|
Future<void> getHttpData() async {
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
logic.mockNetworkDataRequest().then((AuthorizedAdminListEntity value){
|
logic.mockNetworkDataRequest().then((AuthorizedAdminListEntity value) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -60,7 +62,9 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
|||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// 处理操作按钮的点击事件
|
// 处理操作按钮的点击事件
|
||||||
Navigator.pushNamed(context, Routers.addAuthorizedAdministratorPage).then((value) {
|
Navigator.pushNamed(
|
||||||
|
context, Routers.addAuthorizedAdministratorPage)
|
||||||
|
.then((value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
logic.pageNo = 1;
|
logic.pageNo = 1;
|
||||||
getHttpData();
|
getHttpData();
|
||||||
@ -71,119 +75,98 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: EasyRefreshTool(
|
body: EasyRefreshTool(
|
||||||
onRefresh: (){
|
onRefresh: () {
|
||||||
logic.pageNo = 1;
|
logic.pageNo = 1;
|
||||||
getHttpData();
|
getHttpData();
|
||||||
},
|
},
|
||||||
onLoad: (){
|
onLoad: () {
|
||||||
getHttpData();
|
getHttpData();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// _searchWidget(),
|
// _searchWidget(),
|
||||||
Expanded(child: _buildMainUI()),
|
Expanded(child: _buildMainUI()),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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() {
|
Widget _buildMainUI() {
|
||||||
return Obx(() => state.itemDataList.value.isEmpty
|
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(
|
: SlidableAutoCloseBehavior(
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
itemCount: state.itemDataList.value.length,
|
itemCount: state.itemDataList.value.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (c, index) {
|
||||||
AuthorizedAdminListItem authorizedAdminListItem = state.itemDataList.value[index];
|
AuthorizedAdminListItem authorizedAdminListItem =
|
||||||
|
state.itemDataList.value[index];
|
||||||
|
|
||||||
return Slidable(
|
return Slidable(
|
||||||
key:ValueKey(authorizedAdminListItem.uid),
|
key: ValueKey(authorizedAdminListItem.uid),
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
extentRatio: 0.2,
|
extentRatio: 0.2,
|
||||||
motion: const ScrollMotion(),
|
motion: const ScrollMotion(),
|
||||||
children: [
|
children: [
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
onPressed: (BuildContext context){
|
onPressed: (BuildContext context) {
|
||||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
ShowTipView()
|
||||||
logic.deleteAdministratorRequest(authorizedAdminListItem.uid.toString(), isAllData ? 1 : 0);
|
.showDeleteAdministratorIsHaveAllDataDialog(
|
||||||
});
|
'同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
||||||
},
|
logic.deleteAdministratorRequest(
|
||||||
backgroundColor: Colors.red,
|
authorizedAdminListItem.uid.toString(),
|
||||||
foregroundColor: Colors.white,
|
isAllData ? 1 : 0);
|
||||||
label: '删除',
|
});
|
||||||
padding: EdgeInsets.only(left: 5.w, right: 5.w),
|
},
|
||||||
),
|
backgroundColor: Colors.red,
|
||||||
],
|
foregroundColor: Colors.white,
|
||||||
|
label: '删除',
|
||||||
|
padding: EdgeInsets.only(left: 5.w, right: 5.w),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: _electronicKeyItem(authorizedAdminListItem),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return const Divider(
|
||||||
|
height: 1,
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
child: _electronicKeyItem(authorizedAdminListItem),
|
));
|
||||||
);
|
|
||||||
},
|
|
||||||
separatorBuilder: (BuildContext context, int index) {
|
|
||||||
return const Divider(
|
|
||||||
height: 1,
|
|
||||||
color: AppColors.greyLineColor,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _electronicKeyItem(AuthorizedAdminListItem itemData) {
|
Widget _electronicKeyItem(AuthorizedAdminListItem itemData) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
Navigator.pushNamed(context, Routers.administratorDetailsPage, arguments: {'itemData': itemData}).then((value) {
|
//高级功能
|
||||||
setState(() {
|
var isVip = await Storage.getBool(saveIsVip);
|
||||||
logic.pageNo = 1;
|
if (isVip == true) {
|
||||||
getHttpData();
|
Get.toNamed(Routers.administratorDetailsPage,
|
||||||
|
arguments: {'itemData': itemData})?.then((value) {
|
||||||
|
setState(() {
|
||||||
|
logic.pageNo = 1;
|
||||||
|
getHttpData();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
} else {
|
||||||
|
ShowCupertinoAlertView().advancedFeatureAlert();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 100.h,
|
height: 100.h,
|
||||||
color: Colors.white,
|
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(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width: 30.w,),
|
SizedBox(
|
||||||
|
width: 30.w,
|
||||||
|
),
|
||||||
Image.asset('images/controls_user.png', width: 60.w, height: 60.w),
|
Image.asset('images/controls_user.png', width: 60.w, height: 60.w),
|
||||||
SizedBox(width: 20.w),
|
SizedBox(width: 20.w),
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -193,24 +176,18 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Text(
|
|
||||||
// itemData.name ?? '',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 24.sp, color: AppColors.blackColor),
|
|
||||||
// ),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 1.sw - 110.w - 100.w,
|
width: 1.sw - 110.w - 100.w,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(itemData.name ?? '',
|
||||||
itemData.name ?? '',
|
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
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/lockUserManage/expireLockList/expireElectronicKey/expireLockList_entity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet/weChatQRCodeEntity.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/storage.dart';
|
||||||
import 'package:star_lock/tools/xs_jPhush.dart';
|
import 'package:star_lock/tools/xs_jPhush.dart';
|
||||||
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
||||||
@ -85,7 +85,7 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void showQRImageAlert(String qrCodeUrl, BuildContext widgetContext) {
|
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:get/get.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
import 'package:star_lock/flavors.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_entity.dart';
|
||||||
import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFeaturesWeb_state.dart';
|
import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFeaturesWeb_state.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/pay/wx_pay_tool.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 'package:webview_flutter/webview_flutter.dart';
|
||||||
|
|
||||||
class AdvancedFeaturesWebLogic extends BaseGetXController {
|
class AdvancedFeaturesWebLogic extends BaseGetXController {
|
||||||
@ -23,8 +23,8 @@ class AdvancedFeaturesWebLogic extends BaseGetXController {
|
|||||||
AdvancedFeaturesWebEntity entity =
|
AdvancedFeaturesWebEntity entity =
|
||||||
await ApiRepository.to.getServicePackageBuyUrl();
|
await ApiRepository.to.getServicePackageBuyUrl();
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.vipBuyUrl.value = state.isShop.value == true
|
state.vipBuyUrl.value = state.isVipShop.value == true
|
||||||
? entity.data!.shopList!
|
? entity.data!.vipBuyUrl!
|
||||||
: entity.data!.cloudauthBuyUrl!;
|
: entity.data!.cloudauthBuyUrl!;
|
||||||
state.vipBuyWebView.setNavigationDelegate(
|
state.vipBuyWebView.setNavigationDelegate(
|
||||||
NavigationDelegate(
|
NavigationDelegate(
|
||||||
|
|||||||
@ -32,8 +32,9 @@ class _AdvancedFeaturesWebPageState extends State<AdvancedFeaturesWebPage> {
|
|||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
backgroundColor: const Color(0xFFFFFFFF),
|
backgroundColor: const Color(0xFFFFFFFF),
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle:
|
barTitle: logic.state.isVipShop.value == true
|
||||||
logic.state.isShop.value == true ? '高级功能'.tr : '实名认证'.tr,
|
? '高级功能'.tr
|
||||||
|
: '实名认证'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
backAction: () => logic.canGoBack(false),
|
backAction: () => logic.canGoBack(false),
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.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';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
|
|
||||||
class AdvancedFeaturesWebState {
|
class AdvancedFeaturesWebState {
|
||||||
@ -8,7 +8,7 @@ class AdvancedFeaturesWebState {
|
|||||||
var webProgress = 0.0.obs;
|
var webProgress = 0.0.obs;
|
||||||
bool allowReturn = true;
|
bool allowReturn = true;
|
||||||
late WebViewController vipBuyWebView = initWebViewController();
|
late WebViewController vipBuyWebView = initWebViewController();
|
||||||
var isShop = true.obs; //是否为高级功能购买页面
|
var isVipShop = true.obs; //是否为高级功能购买页面
|
||||||
bool canGoBack = false;
|
bool canGoBack = false;
|
||||||
|
|
||||||
//初始化webView控制器
|
//初始化webView控制器
|
||||||
@ -23,7 +23,7 @@ class AdvancedFeaturesWebState {
|
|||||||
AdvancedFeaturesWebState() {
|
AdvancedFeaturesWebState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
if (map['isShop'] != null) {
|
if (map['isShop'] != null) {
|
||||||
isShop.value = map['isShop'];
|
isVipShop.value = map['isShop'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:star_lock/flavors.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_page.dart';
|
||||||
import 'package:star_lock/login/login/starLock_login_xhj_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/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/tools/appFirstEnterHandle.dart';
|
||||||
import 'package:star_lock/debug/debug_tool.dart';
|
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
|
|
||||||
import '../main/lockMian/lockMain/lockMain_page.dart';
|
import '../main/lockMian/lockMain/lockMain_page.dart';
|
||||||
@ -31,7 +30,6 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
AppFirstEnterHandle().getAppFirstEnter(context, isAgreePrivacy);
|
|
||||||
getAgreePrivacyShowUpdate();
|
getAgreePrivacyShowUpdate();
|
||||||
|
|
||||||
return FutureBuilder<bool>(
|
return FutureBuilder<bool>(
|
||||||
@ -48,6 +46,8 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
|||||||
xhjCall: () => const StarLockMainXHJPage());
|
xhjCall: () => const StarLockMainXHJPage());
|
||||||
} else {
|
} else {
|
||||||
// 如果用户未登录,返回登录页面
|
// 如果用户未登录,返回登录页面
|
||||||
|
AppFirstEnterHandle().getAppFirstEnter(isAgreePrivacy);
|
||||||
|
|
||||||
return F.sw(
|
return F.sw(
|
||||||
defaultCall: () => const StarLockLoginPage(),
|
defaultCall: () => const StarLockLoginPage(),
|
||||||
xhjCall: () => const StarLockLoginXHJPage());
|
xhjCall: () => const StarLockLoginXHJPage());
|
||||||
@ -73,7 +73,7 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
|||||||
Future<void> getAgreePrivacyShowUpdate() async {
|
Future<void> getAgreePrivacyShowUpdate() async {
|
||||||
final data = await Storage.getString(isAgreePrivacy);
|
final data = await Storage.getString(isAgreePrivacy);
|
||||||
if (data == 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/cupertino.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/app_settings/app_colors.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';
|
import '../versionUndate/versionUndateTool.dart';
|
||||||
|
|
||||||
class AppFirstEnterHandle {
|
class AppFirstEnterHandle {
|
||||||
Future getAppFirstEnter(BuildContext widgetContext, String flagStr) async {
|
Future getAppFirstEnter(String flagStr) async {
|
||||||
var getFlag = await Storage.getString(flagStr);
|
var getFlag = await Storage.getString(flagStr);
|
||||||
switch (flagStr) {
|
switch (flagStr) {
|
||||||
case isAgreePrivacy: // 隐私协议
|
case isAgreePrivacy: // 隐私协议
|
||||||
{
|
{
|
||||||
if (getFlag != isAgreePrivacy) {
|
if (getFlag != isAgreePrivacy) {
|
||||||
showPrivacyAgreementAlert(widgetContext);
|
showPrivacyAgreementAlert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case isAgreePosition: // 位置权限
|
case isAgreePosition: // 位置权限
|
||||||
{
|
{
|
||||||
if (getFlag != isAgreePosition) showPositionAlert(widgetContext);
|
if (getFlag != isAgreePosition) showPositionAlert();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case isAgreeCamera: // 相机权限
|
case isAgreeCamera: // 相机权限
|
||||||
{
|
{
|
||||||
if (getFlag != isAgreeCamera) showCameraAlert(widgetContext);
|
if (getFlag != isAgreeCamera) showCameraAlert();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case isShowUpdateVersion: // 版本更新
|
case isShowUpdateVersion: // 版本更新
|
||||||
@ -45,9 +44,9 @@ class AppFirstEnterHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//隐私协议弹窗
|
//隐私协议弹窗
|
||||||
void showPrivacyAgreementAlert(BuildContext widgetContext) {
|
void showPrivacyAgreementAlert() {
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
context: widgetContext,
|
context: Get.context!,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return PopScope(
|
return PopScope(
|
||||||
canPop: false,
|
canPop: false,
|
||||||
@ -118,7 +117,7 @@ class AppFirstEnterHandle {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
getAppFirstEnter(context, isShowUpdateVersion);
|
getAppFirstEnter(isShowUpdateVersion);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -188,7 +187,7 @@ class AppFirstEnterHandle {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
getAppFirstEnter(context, isShowUpdateVersion);
|
getAppFirstEnter(isShowUpdateVersion);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -196,9 +195,9 @@ class AppFirstEnterHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//位置权限弹窗
|
//位置权限弹窗
|
||||||
void showPositionAlert(BuildContext widgetContext) {
|
void showPositionAlert() {
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
context: widgetContext,
|
context: Get.context!,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return PopScope(
|
return PopScope(
|
||||||
canPop: false,
|
canPop: false,
|
||||||
@ -226,9 +225,9 @@ class AppFirstEnterHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//相机权限弹窗
|
//相机权限弹窗
|
||||||
void showCameraAlert(BuildContext widgetContext) {
|
void showCameraAlert() {
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
context: widgetContext,
|
context: Get.context!,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return PopScope(
|
return PopScope(
|
||||||
canPop: false,
|
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 {
|
// _launchURL(String url) async {
|
||||||
// if (await canLaunchUrl(Uri.parse(url))) {
|
// if (await canLaunchUrl(Uri.parse(url))) {
|
||||||
// await launchUrl(Uri.parse(url));
|
// await launchUrl(Uri.parse(url));
|
||||||
|
|||||||
@ -1,13 +1,63 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/app_settings/app_colors.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 {
|
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() {
|
void advancedFeatureAlert() {
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
@ -207,6 +257,10 @@ class ShowCupertinoAlertView {
|
|||||||
CupertinoDialogAction(
|
CupertinoDialogAction(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// 在这里处理确认按钮的逻辑
|
// 在这里处理确认按钮的逻辑
|
||||||
|
if (idCard.isEmpty || name.isEmpty) {
|
||||||
|
EasyLoading.showToast('请输入身份证号和真实姓名'.tr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
callback(idCard, name);
|
callback(idCard, name);
|
||||||
Get.back();
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ const saveIsVip = "saveIsVip"; //是否是VIP
|
|||||||
|
|
||||||
const saveUserLoginData = "userLoginData";
|
const saveUserLoginData = "userLoginData";
|
||||||
const saveLockMainListData = "lockMainListData";
|
const saveLockMainListData = "lockMainListData";
|
||||||
const isOpenDeBug = "isOpenDeBug";//是否打开 debug
|
const isOpenDeBug = "isOpenDeBug"; //是否打开 debug
|
||||||
|
|
||||||
class Storage {
|
class Storage {
|
||||||
Storage._internal();
|
Storage._internal();
|
||||||
@ -145,6 +145,12 @@ class Storage {
|
|||||||
static Future<void> clearAll() async {
|
static Future<void> clearAll() async {
|
||||||
SharedPreferences sp = await SharedPreferences.getInstance();
|
SharedPreferences sp = await SharedPreferences.getInstance();
|
||||||
sp.clear();
|
sp.clear();
|
||||||
|
|
||||||
|
// 重新设置需要保留的数据
|
||||||
|
if (isAgreePrivacy != null) {
|
||||||
|
//退出登录不清除隐私协议同意状态
|
||||||
|
await setString(isAgreePrivacy, isAgreePrivacy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String?> getUid() async {
|
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