修改bug
This commit is contained in:
parent
c2fd318087
commit
6e47abd78c
Binary file not shown.
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 166 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 168 KiB |
@ -127,4 +127,7 @@ class AppColors {
|
||||
Color.fromRGBO(223, 237, 254, 1); //蓝色背景板 139 148 176
|
||||
static const msgNoticeTextColor = Color.fromRGBO(139, 148, 176, 1); //消息提醒字体颜色
|
||||
static const alphaBgViewColor = Color.fromRGBO(0, 0, 0, 0.2); //透明度背景
|
||||
|
||||
static Color openPassageModeColor = const Color(0xFFEB2A3B);// 首页开启常开模式颜色(红色)
|
||||
static Color listTimeYellowColor = const Color(0xFFF3BA37);// 首页时间过期颜色(黄色)
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ class BlueManage {
|
||||
stateCallBack(deviceConnectionState!);
|
||||
});
|
||||
}else{
|
||||
stopScan();
|
||||
// stopScan();
|
||||
stateCallBack(deviceConnectionState!);
|
||||
}
|
||||
}else{
|
||||
@ -151,7 +151,7 @@ class BlueManage {
|
||||
connectDeviceMacAddress = "";
|
||||
connectStateCallBack(DeviceConnectionState.disconnected);
|
||||
completer.complete();
|
||||
await stopScan();
|
||||
stopScan();
|
||||
timer.cancel();
|
||||
// deviceConnectionState = DeviceConnectionState.disconnected;
|
||||
// print("timer index1:$index");
|
||||
@ -162,6 +162,7 @@ class BlueManage {
|
||||
if (knownDeviceIndex >= 0) {
|
||||
// 存在的时候销毁定时器,赋值
|
||||
connectDeviceMacAddress = scanDevices[knownDeviceIndex].id;
|
||||
stopScan();
|
||||
completer.complete();
|
||||
timer.cancel();
|
||||
// print("timer index2:$index");
|
||||
@ -185,7 +186,7 @@ class BlueManage {
|
||||
await completer.future;
|
||||
}
|
||||
print("1 connectDeviceId:$connectDeviceMacAddress connectDeviceName:$connectDeviceName");
|
||||
await stopScan();
|
||||
// stopScan();
|
||||
if (connectDeviceMacAddress.isEmpty) {
|
||||
return;
|
||||
}
|
||||
@ -194,6 +195,7 @@ class BlueManage {
|
||||
_currentConnectionStream = _flutterReactiveBle!.connectToDevice(id: connectDeviceMacAddress, connectionTimeout: const Duration(seconds: 5)).listen((connectionStateUpdate) async {
|
||||
// 获取状态
|
||||
deviceConnectionState = connectionStateUpdate.connectionState;
|
||||
stopScan();
|
||||
print('2 deviceConnectionState:$deviceConnectionState connectionStateUpdate.connectionState:${connectionStateUpdate.connectionState}');
|
||||
if (connectionStateUpdate.connectionState == DeviceConnectionState.connected) {
|
||||
// 如果状态是连接的开始发现服务
|
||||
@ -326,7 +328,7 @@ class BlueManage {
|
||||
}
|
||||
|
||||
// 停止扫描蓝牙设备
|
||||
Future<void> stopScan() async {
|
||||
void stopScan() {
|
||||
// print("444444444");
|
||||
if(_scanSubscription != null){
|
||||
// print("555555555555");
|
||||
|
||||
@ -23,7 +23,7 @@ class SenderCustomPasswordsCommand extends SenderProtocol {
|
||||
int? startTime;
|
||||
int? endTime;
|
||||
int? needAuthor;
|
||||
List<int>? publicKey;
|
||||
List<int>? signKey;
|
||||
List<int>? privateKey;
|
||||
|
||||
SenderCustomPasswordsCommand({
|
||||
@ -36,7 +36,7 @@ class SenderCustomPasswordsCommand extends SenderProtocol {
|
||||
this.startTime,
|
||||
this.endTime,
|
||||
this.needAuthor,
|
||||
this.publicKey,
|
||||
this.signKey,
|
||||
this.privateKey,
|
||||
}) : super(CommandType.generalExtendedCommond);
|
||||
|
||||
@ -102,16 +102,16 @@ class SenderCustomPasswordsCommand extends SenderProtocol {
|
||||
} else {
|
||||
List<int> authCodeData = [];
|
||||
|
||||
//authUserID
|
||||
authCodeData.addAll(utf8.encode(userID!));
|
||||
|
||||
//KeyID
|
||||
authCodeData.addAll(utf8.encode(keyID!));
|
||||
|
||||
//authUserID
|
||||
authCodeData.addAll(utf8.encode(userID!));
|
||||
|
||||
//token 4 首次请求 Token 填 0,如果锁需要鉴权操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。
|
||||
authCodeData.addAll(token!);
|
||||
|
||||
authCodeData.addAll(publicKey!);
|
||||
authCodeData.addAll(signKey!);
|
||||
|
||||
print("${commandType!.typeValue}-authCodeData:$authCodeData");
|
||||
|
||||
|
||||
@ -268,7 +268,7 @@ class IoSenderManage {
|
||||
required int? startTime,
|
||||
required int? endTime,
|
||||
required int? needAuthor,
|
||||
required List<int>? publicKey,
|
||||
required List<int>? signKey,
|
||||
required List<int>? privateKey,
|
||||
CommandSendCallBack? callBack}) {
|
||||
CommandSenderManager().managerSendData(
|
||||
@ -282,7 +282,7 @@ class IoSenderManage {
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
needAuthor: needAuthor,
|
||||
publicKey: publicKey,
|
||||
signKey: signKey,
|
||||
privateKey: privateKey,
|
||||
), callBack:callBack);
|
||||
}
|
||||
|
||||
@ -5,7 +5,6 @@ import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import '../../mine/mine/starLockMine_logic.dart';
|
||||
import '../../network/api_repository.dart';
|
||||
import '../../tools/store_service.dart';
|
||||
import 'starLock_login_state.dart';
|
||||
|
||||
class StarLockLoginLogic extends BaseGetXController {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
@ -301,24 +302,35 @@ class _AddCardPageState extends State<AddCardPage> {
|
||||
// 接受者信息输入框
|
||||
Widget getTFWidget(String tfStr) {
|
||||
return Container(
|
||||
height: 50.h,
|
||||
// color: Colors.red,
|
||||
height: 65.h,
|
||||
width: 300.w,
|
||||
padding: EdgeInsets.only(top: 5.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
//输入框一行
|
||||
maxLines: 1,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.deny('\n'),
|
||||
LengthLimitingTextInputFormatter(18),
|
||||
],
|
||||
controller: state.nameController,
|
||||
autofocus: false,
|
||||
textAlign: TextAlign.end,
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
hintText: tfStr,
|
||||
hintStyle: TextStyle(fontSize: 24.sp),
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
disabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
enabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
border: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../tools/dateTool.dart';
|
||||
import '../../../../tools/keySearchWidget.dart';
|
||||
import '../../../../tools/left_slide_actions.dart';
|
||||
import '../../../../tools/noData.dart';
|
||||
import '../../../../tools/showIosTipView.dart';
|
||||
@ -57,7 +59,12 @@ class _CardListPageState extends State<CardListPage> {
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
_searchWidget(),
|
||||
KeySearchWidget(
|
||||
editingController: state.searchController,
|
||||
onSubmittedAction: () {
|
||||
logic.getICCardListData();
|
||||
},
|
||||
),
|
||||
SizedBox(height: 20.h),
|
||||
Expanded(child: _buildMainUI()),
|
||||
AddBottomWhiteBtn(
|
||||
@ -82,49 +89,6 @@ class _CardListPageState extends State<CardListPage> {
|
||||
);
|
||||
}
|
||||
|
||||
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: state.searchController,
|
||||
autofocus: false,
|
||||
onChanged: (value) {
|
||||
print("onChanged:$value");
|
||||
},
|
||||
onEditingComplete: () {
|
||||
print("onEditingComplete:");
|
||||
},
|
||||
onSubmitted: (value) {
|
||||
logic.getICCardListData();
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(
|
||||
top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
||||
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
//左边图标设置
|
||||
icon: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
|
||||
child: Image.asset(
|
||||
'images/main/icon_main_search.png',
|
||||
width: 40.w,
|
||||
height: 40.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMainUI() {
|
||||
return Obx(() => state.fingerprintItemListData.value.isNotEmpty
|
||||
? ListView.separated(
|
||||
|
||||
@ -11,6 +11,7 @@ import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/toast.dart';
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../tools/keySearchWidget.dart';
|
||||
import '../../../../tools/left_slide_actions.dart';
|
||||
import '../../../../tools/showIosTipView.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
@ -73,7 +74,13 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
_searchWidget(),
|
||||
// _searchWidget(),
|
||||
KeySearchWidget(
|
||||
editingController: state.searchController,
|
||||
onSubmittedAction: () {
|
||||
logic.mockNetworkDataRequest();
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
@ -128,45 +135,45 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
_refreshController.refreshCompleted();
|
||||
}
|
||||
|
||||
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,
|
||||
controller: state.searchController,
|
||||
onSubmitted: (value) {
|
||||
logic.mockNetworkDataRequest();
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(
|
||||
top: 18.0, left: -19.0, right: -15.0, bottom: 2),
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
style:
|
||||
TextStyle(fontSize: 22.sp, textBaseline: TextBaseline.alphabetic),
|
||||
),
|
||||
);
|
||||
}
|
||||
// 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,
|
||||
// controller: state.searchController,
|
||||
// onSubmitted: (value) {
|
||||
// logic.mockNetworkDataRequest();
|
||||
// },
|
||||
// decoration: InputDecoration(
|
||||
// //输入里面输入文字内边距设置
|
||||
// contentPadding: const EdgeInsets.only(
|
||||
// top: 18.0, left: -19.0, right: -15.0, bottom: 2),
|
||||
// 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,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// style:
|
||||
// TextStyle(fontSize: 22.sp, textBaseline: TextBaseline.alphabetic),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
||||
Widget _buildMainUI(itemData) {
|
||||
List<ElectronicKeyListItem> getItemData = itemData;
|
||||
|
||||
@ -431,7 +431,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
// 接受者信息输入框
|
||||
Widget getTFWidget(bool isHaveBtn, String tfStr, int lineIndex) {
|
||||
return SizedBox(
|
||||
height: 50.h,
|
||||
height: 65.h,
|
||||
width: 320.w,
|
||||
child: Row(
|
||||
children: [
|
||||
@ -442,16 +442,31 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
: state.keyNameController,
|
||||
//输入框一行
|
||||
maxLines: 1,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.deny('\n'),
|
||||
LengthLimitingTextInputFormatter(18),
|
||||
],
|
||||
// controller: _controller,
|
||||
autofocus: false,
|
||||
textAlign: TextAlign.end,
|
||||
// decoration: InputDecoration(
|
||||
// //输入里面输入文字内边距设置
|
||||
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
// hintText: tfStr,
|
||||
// hintStyle: TextStyle(fontSize: 22.sp),
|
||||
// //不需要输入框下划线
|
||||
// border: InputBorder.none,
|
||||
// ),
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
hintText: tfStr,
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
disabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
enabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
border: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, textBaseline: TextBaseline.alphabetic),
|
||||
|
||||
@ -118,7 +118,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
if(reply.data[5] == 255){
|
||||
// 注册指纹失败
|
||||
print("${reply.commandType!.typeValue} 注册指纹失败");
|
||||
// print("${reply.commandType!.typeValue} 注册指纹失败");
|
||||
Toast.show(msg: "添加失败");
|
||||
Get.close(2);
|
||||
}else{
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
// import 'package:flutter_pickers/pickers.dart';
|
||||
// import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -284,24 +285,35 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
|
||||
// 接受者信息输入框
|
||||
Widget getTFWidget(String tfStr) {
|
||||
return Container(
|
||||
height: 50.h,
|
||||
// color: Colors.red,
|
||||
height: 65.h,
|
||||
width: 300.w,
|
||||
padding: EdgeInsets.only(top: 5.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
//输入框一行
|
||||
maxLines: 1,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.deny('\n'),
|
||||
LengthLimitingTextInputFormatter(18),
|
||||
],
|
||||
controller: state.nameController,
|
||||
autofocus: false,
|
||||
textAlign: TextAlign.end,
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
hintText: tfStr,
|
||||
hintStyle: TextStyle(fontSize: 24.sp),
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
disabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
enabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
border: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -32,7 +32,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: "${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
||||
barTitle: "指纹详情",
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
// actionsList: [
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../tools/dateTool.dart';
|
||||
import '../../../../tools/keySearchWidget.dart';
|
||||
import '../../../../tools/left_slide_actions.dart';
|
||||
import '../../../../tools/noData.dart';
|
||||
import '../../../../tools/showIosTipView.dart';
|
||||
@ -57,7 +59,12 @@ class _FingerprintListPageState extends State<FingerprintListPage> {
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
_searchWidget(),
|
||||
KeySearchWidget(
|
||||
editingController: state.searchController,
|
||||
onSubmittedAction: () {
|
||||
logic.getFingerprintsListData();
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
@ -81,49 +88,6 @@ class _FingerprintListPageState extends State<FingerprintListPage> {
|
||||
);
|
||||
}
|
||||
|
||||
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: state.searchController,
|
||||
autofocus: false,
|
||||
onChanged: (value) {
|
||||
print("onChanged:$value");
|
||||
},
|
||||
onEditingComplete: () {
|
||||
print("onEditingComplete:");
|
||||
},
|
||||
onSubmitted: (value) {
|
||||
logic.getFingerprintsListData();
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(
|
||||
top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
||||
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
//左边图标设置
|
||||
icon: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
|
||||
child: Image.asset(
|
||||
'images/main/icon_main_search.png',
|
||||
width: 40.w,
|
||||
height: 40.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMainUI() {
|
||||
return Obx(() => state.fingerprintItemListData.value.isNotEmpty
|
||||
? ListView.separated(
|
||||
|
||||
@ -316,6 +316,7 @@ class LockBasicInfo {
|
||||
String? mac;
|
||||
int? keyRight;
|
||||
int? senderUserId;
|
||||
int? lockUserNo;
|
||||
|
||||
LockBasicInfo(
|
||||
{this.keyId,
|
||||
@ -332,7 +333,8 @@ class LockBasicInfo {
|
||||
this.endDate,
|
||||
this.mac,
|
||||
this.keyRight,
|
||||
this.senderUserId});
|
||||
this.senderUserId,
|
||||
this.lockUserNo});
|
||||
|
||||
LockBasicInfo.fromJson(Map<String, dynamic> json) {
|
||||
keyId = json['keyId'];
|
||||
@ -355,7 +357,7 @@ class LockBasicInfo {
|
||||
mac = json['mac'];
|
||||
keyRight = json['keyRight'];
|
||||
senderUserId = json['senderUserId'];
|
||||
|
||||
lockUserNo = json['lockUserNo'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -377,6 +379,7 @@ class LockBasicInfo {
|
||||
data['mac'] = mac;
|
||||
data['keyRight'] = keyRight;
|
||||
data['senderUserId'] = senderUserId;
|
||||
data['lockUserNo'] = lockUserNo;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -449,7 +449,11 @@ class LockSetLogic extends BaseGetXController {
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
BlueManage().connectDeviceMacAddress = "";
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
Get.close(2);
|
||||
if(state.isOnlyOneData.value == true){
|
||||
Get.close(1);
|
||||
}else{
|
||||
Get.close(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -462,7 +466,11 @@ class LockSetLogic extends BaseGetXController {
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
BlueManage().connectDeviceMacAddress = "";
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
Get.close(2);
|
||||
if(state.isOnlyOneData.value == true){
|
||||
Get.close(1);
|
||||
}else{
|
||||
Get.close(2);
|
||||
}
|
||||
// Get.offAllNamed(Routers.starLockMain);
|
||||
}
|
||||
}
|
||||
@ -510,8 +518,14 @@ class LockSetLogic extends BaseGetXController {
|
||||
// 如果是锁拥有者直接删除锁,调用初始化协议
|
||||
factoryDataResetAction();
|
||||
} else {
|
||||
// 不是锁拥有者,调用删除钥匙协议
|
||||
deletUserAction();
|
||||
// 不是锁拥有者
|
||||
if(state.lockSetInfoData.value.lockBasicInfo!.lockUserNo != 0){
|
||||
// 如果已经创建了用户调用协议删除
|
||||
deletUserAction();
|
||||
}else{
|
||||
// 如果没有创建用户 调用接口删除
|
||||
deletKeyData();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -573,8 +587,14 @@ class LockSetLogic extends BaseGetXController {
|
||||
// 如果是锁拥有者直接删除锁,调用初始化协议
|
||||
factoryDataResetAction();
|
||||
} else {
|
||||
// 不是锁拥有者,调用删除钥匙协议
|
||||
deletUserAction();
|
||||
// 不是锁拥有者
|
||||
if(state.lockSetInfoData.value.lockBasicInfo!.lockUserNo != 0){
|
||||
// 如果已经创建了用户调用协议删除
|
||||
deletUserAction();
|
||||
}else{
|
||||
// 如果没有创建用户 调用接口删除
|
||||
deletKeyData();
|
||||
}
|
||||
}
|
||||
}else if(state.currentDeviceUUid.value[31] == "0"){
|
||||
// 未配对 表示这把锁已被强制初始化 处于可添加状态 直接弹窗删除即可
|
||||
|
||||
@ -107,8 +107,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
}))),
|
||||
// 常开模式
|
||||
Obx(() => Visibility(
|
||||
visible: state.lockFeature.value.passageMode == 1 ? true : false,
|
||||
// visible:true,
|
||||
// visible: state.lockFeature.value.passageMode == 1 ? true : false,
|
||||
visible:true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
||||
rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == 1
|
||||
@ -287,8 +287,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
SizedBox(height: 10.h),
|
||||
// 常开模式
|
||||
Obx(() => Visibility(
|
||||
// visible: state.lockFeature.value.passageMode == 1 ? true : false,
|
||||
visible:true,
|
||||
visible: state.lockFeature.value.passageMode == 1 ? true : false,
|
||||
// visible:true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
||||
rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == 1
|
||||
|
||||
@ -13,7 +13,9 @@ class LockSetState {
|
||||
final lockBasicInfo = LockBasicInfo().obs;
|
||||
|
||||
final lockId = 0.obs;
|
||||
// var lockCount = 1;
|
||||
|
||||
var isOnlyOneData = false.obs;
|
||||
var isAttendance = 0.obs;// 是否开启考勤
|
||||
var currentDeviceUUid = "".obs;// 当前设备的uuid
|
||||
var isOpenLockNeedOnline = 0.obs;// APP开锁时是否需联网
|
||||
@ -34,7 +36,7 @@ class LockSetState {
|
||||
LockSetState() {
|
||||
Map map = Get.arguments;
|
||||
lockId.value = map["lockId"];
|
||||
|
||||
isOnlyOneData.value = map["isOnlyOneData"];
|
||||
// getKeyInfosData.value = Get.arguments as KeyInfos;
|
||||
// isAttendance.value = getKeyInfosData.value.isAttendance!;
|
||||
// isLockPickingReminder.value = getKeyInfosData.value.monitorFlag!;
|
||||
|
||||
@ -29,7 +29,7 @@ class LockSoundSetLogic extends BaseGetXController {
|
||||
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
// eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
state.lockSetInfoData.value.lockSettingInfo!.lockSound = state.isOpenLockSound.value == true ? 1 :2;
|
||||
state.lockSetInfoData.value.lockSettingInfo!.lockSound = state.isOpenLockSound.value == true ? 1 :0;
|
||||
state.lockSetInfoData.value.lockSettingInfo!.lockSoundVolume = state.lockSoundLevel.value;
|
||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||
Toast.show(msg: "操作成功");
|
||||
|
||||
@ -25,7 +25,7 @@ class NormallyOpenModeLogic extends BaseGetXController{
|
||||
|
||||
// 配置锁的常开模式设置
|
||||
void configPassageMode() async{
|
||||
if(state.weekDays.value.isNotEmpty){
|
||||
if(state.weekDays.value.isEmpty){
|
||||
Toast.show(msg:"请选择常开日期");
|
||||
return;
|
||||
}
|
||||
@ -35,24 +35,27 @@ class NormallyOpenModeLogic extends BaseGetXController{
|
||||
return;
|
||||
}
|
||||
|
||||
var passageModeConfig = [];
|
||||
var map = {
|
||||
"isAllDay":state.isAllDay.value,
|
||||
"weekDays":state.weekDays.value,
|
||||
"startDate":state.beginTimeMinute.value,
|
||||
"endDate":state.endTimeMinute.value,
|
||||
};
|
||||
passageModeConfig.add(map);
|
||||
|
||||
// print("state.isOpenNormallyOpenMode.value:${state.isOpenNormallyOpenMode.value}");
|
||||
var entity = await ApiRepository.to.setNormallyModeData(
|
||||
lockId: state.lockSetInfoData.value.lockId!,
|
||||
passageMode:state.isOpenNormallyOpenMode.value == true ? 1:0,
|
||||
passageModeConfig: map,
|
||||
passageModeConfig: passageModeConfig,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
|
||||
state.lockSetInfoData.value.lockSettingInfo!.passageMode = state.isOpenNormallyOpenMode.value == true ? 1:2;
|
||||
state.lockSetInfoData.value.lockSettingInfo!.passageMode = state.isOpenNormallyOpenMode.value == true ? 1:0;
|
||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(2, state.lockSetInfoData.value.lockSettingInfo!.passageMode!));
|
||||
Toast.show(msg: "操作成功");
|
||||
}
|
||||
}
|
||||
@ -218,7 +221,7 @@ class NormallyOpenModeLogic extends BaseGetXController{
|
||||
list.add(state.isAllDay.value == 1 ? 1:0);
|
||||
list.add(number);
|
||||
list.add(0);
|
||||
print("listlistlistlist:$list");
|
||||
// print("listlistlistlist:$list");
|
||||
|
||||
IoSenderManage.setSupportFunctionsWithParametersCommand(
|
||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
|
||||
@ -193,7 +193,7 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> with RouteA
|
||||
}
|
||||
state.weekDays.value.sort();
|
||||
setState(() {});
|
||||
// print("index:$index data:${state.normallyOpenPeriod.value}");
|
||||
print("index:$index data:${state.weekDays.value}");
|
||||
},
|
||||
child: Obx(() => Container(
|
||||
width: 40.w,
|
||||
|
||||
@ -8,7 +8,7 @@ class NormallyOpenModeState{
|
||||
var isJustForShow = false.obs;// 是否只是作为展示作用,因为普通用户只是展示,不可修改
|
||||
|
||||
// var getPassageModeConfigData = GetPassageModeConfigEntity().obs;
|
||||
var isOpenNormallyOpenMode = false.obs;// 是否开启常开模式 常开模式:1-开启、2-关闭
|
||||
var isOpenNormallyOpenMode = false.obs;// 是否开启常开模式 常开模式:1-开启、0-关闭
|
||||
// var isOpenAutomaticUnLock = false.obs;// 是否开启自动开锁模式 自动开锁:1-开启、2-关闭,开启后锁将在常开模式开始时自动打开
|
||||
var isAllDay = 0.obs;// 是否开启全天模式 是否全天常开:1-是、2-否, 如果全天常开,startDate和endDate参数将被忽略.
|
||||
var weekDays = [].obs;// 常开时期
|
||||
|
||||
@ -653,6 +653,10 @@ class LockDetailLogic extends BaseGetXController {
|
||||
// 1 开锁时是否需联网
|
||||
state.isOpenLockNeedOnline.value = event.setResult;
|
||||
state.keyInfos.value.lockSetting!.appUnlockOnline = event.setResult;
|
||||
} else if (event.type == 2) {
|
||||
// 2 常开模式
|
||||
state.isOpenPassageMode.value = event.setResult;
|
||||
state.keyInfos.value.passageMode = event.setResult;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ class _LockDetailMainPageState extends State<LockDetailMainPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bool isFrist;
|
||||
final bool isOnlyOneData;
|
||||
LockListInfoItemEntity keyInfos = LockListInfoItemEntity();
|
||||
// LockMainEntity lockEntity = LockMainEntity();
|
||||
|
||||
@ -36,13 +36,15 @@ class _LockDetailMainPageState extends State<LockDetailMainPage> {
|
||||
if (obj != null && (obj["keyInfo"] != null)) {
|
||||
keyInfos = obj["keyInfo"];
|
||||
}
|
||||
isOnlyOneData = obj["isOnlyOneData"];
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.starLock!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: LockDetailPage(isFrist:true, lockListInfoItemEntity: keyInfos),
|
||||
body: LockDetailPage(isOnlyOneData:isOnlyOneData, lockListInfoItemEntity: keyInfos),
|
||||
// body: Container(),
|
||||
);
|
||||
}
|
||||
|
||||
@ -16,11 +16,11 @@ import '../../lockMian/entity/lockListInfo_entity.dart';
|
||||
import 'lockDetail_logic.dart';
|
||||
|
||||
class LockDetailPage extends StatefulWidget {
|
||||
final bool isFrist;
|
||||
final bool isOnlyOneData;
|
||||
final LockListInfoItemEntity lockListInfoItemEntity;
|
||||
|
||||
const LockDetailPage(
|
||||
{Key? key, required this.isFrist, required this.lockListInfoItemEntity})
|
||||
{Key? key, required this.isOnlyOneData, required this.lockListInfoItemEntity})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
@ -38,7 +38,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
|
||||
print("LockDetailPage isOnlyOneData==${widget.isOnlyOneData}");
|
||||
state.keyInfos.value = widget.lockListInfoItemEntity;
|
||||
state.lockUserNo = state.keyInfos.value.lockUserNo!;
|
||||
state.senderUserId = state.keyInfos.value.senderUserId!;
|
||||
@ -46,6 +46,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
state.isOpenLockNeedOnline.value =
|
||||
state.keyInfos.value.lockSetting!.appUnlockOnline!;
|
||||
state.electricQuantity.value = state.keyInfos.value.electricQuantity!;
|
||||
state.isOpenPassageMode.value = state.keyInfos.value.passageMode!;
|
||||
|
||||
BlueManage().connectDeviceName =
|
||||
state.keyInfos.value.bluetooth!.bluetoothDeviceName!;
|
||||
@ -119,12 +120,13 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 1.sw - 120.w * 2,
|
||||
child: Center(
|
||||
child: Obx(() => Center(
|
||||
child: Text(
|
||||
widget.lockListInfoItemEntity.lockAlias!,
|
||||
style:
|
||||
TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w400),
|
||||
))),
|
||||
widget.lockListInfoItemEntity.lockAlias!,
|
||||
style:
|
||||
TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w400, color: state.isOpenPassageMode.value == 1 ? AppColors.openPassageModeColor : AppColors.darkGrayTextColor),
|
||||
)))
|
||||
),
|
||||
Positioned(
|
||||
child: Obx(() => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
@ -156,7 +158,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
children: [
|
||||
Image.asset(
|
||||
// state.connectState.value == 0 ? 'images/main/icon_main_openLockBtn_grey.png' : 'images/main/icon_main_openLockBtn_center.png',
|
||||
'images/main/icon_main_openLockBtn_center.png',
|
||||
state.isOpenPassageMode.value == 1 ? 'images/main/icon_main_normallyOpenMode_center.png' : 'images/main/icon_main_openLockBtn_center.png',
|
||||
width: 330.w,
|
||||
height: 330.w,
|
||||
),
|
||||
@ -164,7 +166,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
? buildRotationTransition()
|
||||
: Positioned(
|
||||
child: Image.asset(
|
||||
'images/main/icon_main_openLockBtn_circle.png',
|
||||
// 'images/main/icon_main_openLockBtn_circle.png',
|
||||
state.isOpenPassageMode.value == 1 ? 'images/main/icon_main_normallyOpenMode_circle.png' : 'images/main/icon_main_openLockBtn_circle.png',
|
||||
width: 330.w,
|
||||
height: 330.w,
|
||||
)),
|
||||
@ -203,13 +206,13 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
TranslationLoader.lanKeys!.clickUnlockAndHoldDownClose!.tr,
|
||||
Obx(() => Text(
|
||||
state.isOpenPassageMode.value == 1 ? "常开模式启动!长按闭锁" : TranslationLoader.lanKeys!.clickUnlockAndHoldDownClose!.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.btnDisableColor,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
@ -222,43 +225,32 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
'images/icon_electronicKey_admin.png',
|
||||
width: 24.w,
|
||||
height: 20.w,
|
||||
color: AppColors.mainColor, //应根据状态显示(当前角色为超级管理员 应显示蓝色图标)
|
||||
),
|
||||
SizedBox(
|
||||
width: 6.w,
|
||||
color: AppColors.blackColor, //应根据状态显示(当前角色为超级管理员 应显示蓝色图标)
|
||||
),
|
||||
SizedBox(width: 6.w),
|
||||
Text(
|
||||
state.keyInfos.value.isLockOwner == 1
|
||||
? TranslationLoader.lanKeys!.superAdmin!.tr
|
||||
: (state.keyInfos.value.keyRight == 1
|
||||
? TranslationLoader.lanKeys!.authorizedAdmin!.tr
|
||||
: TranslationLoader.lanKeys!.normalUser!.tr),
|
||||
: (state.keyInfos.value.keyRight == 1 ? TranslationLoader.lanKeys!.authorizedAdmin!.tr : TranslationLoader.lanKeys!.normalUser!.tr),
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
SizedBox(
|
||||
width: 80.w,
|
||||
),
|
||||
SizedBox(width: 80.w),
|
||||
Image.asset(
|
||||
state.keyInfos.value.remoteEnable == 1
|
||||
? 'images/main/icon_main_remoteUnlocking.png'
|
||||
: 'images/main/icon_main_remoteUnlocking_grey.png',
|
||||
state.keyInfos.value.remoteEnable == 1 ? 'images/main/icon_main_remoteUnlocking.png' : 'images/main/icon_main_remoteUnlocking_grey.png',
|
||||
width: 24.w,
|
||||
height: 20.w,
|
||||
// color: state.keyInfos.value.remoteEnable == 1
|
||||
// ? AppColors.btnDisableColor
|
||||
// : AppColors.mainColor,
|
||||
),
|
||||
SizedBox(
|
||||
width: 6.w,
|
||||
),
|
||||
SizedBox(width: 6.w),
|
||||
Text(
|
||||
TranslationLoader.lanKeys!.gatewayDevice!.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp,
|
||||
color: state.keyInfos.value.remoteEnable == 1
|
||||
? AppColors.mainColor
|
||||
: AppColors.btnDisableColor),
|
||||
color: state.keyInfos.value.remoteEnable == 1 ? AppColors.mainColor : AppColors.btnDisableColor
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -285,7 +277,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
turns: state.animationController,
|
||||
//将要执行动画的子view
|
||||
child: Image.asset(
|
||||
'images/main/icon_main_openLockBtn_circle.png',
|
||||
state.isOpenPassageMode.value == 1 ? 'images/main/icon_main_normallyOpenMode_circle.png' : 'images/main/icon_main_openLockBtn_circle.png',
|
||||
width: 330.w,
|
||||
height: 330.w,
|
||||
),
|
||||
@ -322,19 +314,16 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
List<Widget> getNormalWidget() {
|
||||
var showWidgetArr = [
|
||||
// 操作记录
|
||||
bottomItem('images/main/icon_main_operatingRecord.png',
|
||||
TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
||||
Get.toNamed(Routers.lockOperatingRecordPage,
|
||||
arguments: {"keyInfo": widget.lockListInfoItemEntity});
|
||||
bottomItem('images/main/icon_main_operatingRecord.png', TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
||||
Get.toNamed(Routers.lockOperatingRecordPage, arguments: {"keyInfo": widget.lockListInfoItemEntity});
|
||||
}),
|
||||
|
||||
// 设置
|
||||
bottomItem(
|
||||
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr,
|
||||
() {
|
||||
// BlueManage().stopScan();
|
||||
Get.toNamed(Routers.lockSetPage,
|
||||
arguments: {"lockId": widget.lockListInfoItemEntity.lockId});
|
||||
bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, () {
|
||||
Get.toNamed(Routers.lockSetPage, arguments: {
|
||||
"lockId": widget.lockListInfoItemEntity.lockId,
|
||||
"isOnlyOneData": widget.isOnlyOneData,
|
||||
});
|
||||
}),
|
||||
];
|
||||
return showWidgetArr;
|
||||
@ -455,8 +444,10 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr,
|
||||
() {
|
||||
// BlueManage().stopScan();
|
||||
Get.toNamed(Routers.lockSetPage,
|
||||
arguments: {"lockId": widget.lockListInfoItemEntity.lockId});
|
||||
Get.toNamed(Routers.lockSetPage, arguments: {
|
||||
"lockId": widget.lockListInfoItemEntity.lockId,
|
||||
"isOnlyOneData": widget.isOnlyOneData,
|
||||
});
|
||||
}),
|
||||
];
|
||||
showWidgetArr.addAll(endWiddget);
|
||||
|
||||
@ -25,6 +25,7 @@ class LockDetailState {
|
||||
var isAttendance = 0.obs;// 是否开启考勤
|
||||
var isOpenLockNeedOnline = 0.obs; // APP开锁时是否需联网
|
||||
var electricQuantity = 0.obs; // 电量
|
||||
var isOpenPassageMode = 0.obs; // 是否开启了常开模式
|
||||
|
||||
var currentDeviceUUid = "".obs;// 当前设备的uuid
|
||||
|
||||
@ -38,4 +39,9 @@ class LockDetailState {
|
||||
// var lockState = 0.obs;// 0未连接普通状态 1连接开锁中(展示动画) 2已连接开锁成功 3检测可用性 4连接失败 5连接失败重连中
|
||||
var openLockBtnState = 0.obs;// 0普通状态(未转动) 1连接中(转动状态)
|
||||
// var connectState = 0.obs;// 0未连接 1连接
|
||||
|
||||
// LockDetailState() {
|
||||
// Map map = Get.arguments;
|
||||
// lockCount = map["lockCount"];
|
||||
// }
|
||||
}
|
||||
@ -10,6 +10,7 @@ import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/toast.dart';
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../tools/keySearchWidget.dart';
|
||||
import '../../../../tools/left_slide_actions.dart';
|
||||
import '../../../../tools/showIosTipView.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
@ -71,7 +72,13 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
_searchWidget(),
|
||||
// _searchWidget(),
|
||||
KeySearchWidget(
|
||||
editingController: state.searchController,
|
||||
onSubmittedAction: () {
|
||||
logic.mockNetworkDataRequest();
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
|
||||
@ -178,17 +178,16 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
|
||||
addKeyboardPwdRequest();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 需要鉴权");
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList =
|
||||
changeStringListToIntList(privateKey!);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
print('得到的开始时间时间戳$getStartDate');
|
||||
|
||||
@ -201,7 +200,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
startTime: 0x11223344,
|
||||
endTime: 0x11223344,
|
||||
needAuthor: 1,
|
||||
publicKey: publicKeyDataList,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: token);
|
||||
break;
|
||||
@ -231,11 +230,10 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
|
||||
// 设置自定义密码
|
||||
Future<void> senderCustomPasswords() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||
(DeviceConnectionState state) async {
|
||||
if (state == DeviceConnectionState.connected) {
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == DeviceConnectionState.connected) {
|
||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
@ -248,12 +246,12 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
keyID: "1",
|
||||
userID: await Storage.getUid(),
|
||||
pwdNo: 1,
|
||||
pwd: "123456",
|
||||
pwd:state.pwdController.text,
|
||||
useCountLimit: 0xff,
|
||||
startTime: 0x11223344,
|
||||
endTime: 0x11223344,
|
||||
needAuthor: 1,
|
||||
publicKey: publicKeyDataList,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList);
|
||||
}
|
||||
|
||||
@ -430,7 +430,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
||||
}
|
||||
}
|
||||
|
||||
logic.addKeyboardPwdRequest();
|
||||
logic.senderCustomPasswords();
|
||||
} else {
|
||||
if (state.nameController.text.isEmpty) {
|
||||
Toast.show(msg: '请输入姓名');
|
||||
@ -539,7 +539,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
||||
// 接受者信息输入框
|
||||
Widget getTFWidget(String tfStr, TextEditingController editController) {
|
||||
return SizedBox(
|
||||
height: 50.h,
|
||||
height: 65.h,
|
||||
width: 300.w,
|
||||
child: Row(
|
||||
children: [
|
||||
@ -547,16 +547,31 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
||||
child: TextField(
|
||||
//输入框一行
|
||||
maxLines: 1,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.deny('\n'),
|
||||
LengthLimitingTextInputFormatter(18),
|
||||
],
|
||||
controller: editController,
|
||||
autofocus: false,
|
||||
textAlign: TextAlign.end,
|
||||
// decoration: InputDecoration(
|
||||
// //输入里面输入文字内边距设置
|
||||
// contentPadding: EdgeInsets.only(top: 24.h, bottom: 16.h),
|
||||
// hintText: tfStr,
|
||||
// hintStyle: TextStyle(fontSize: 22.sp),
|
||||
// //不需要输入框下划线
|
||||
// border: InputBorder.none,
|
||||
// ),
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: EdgeInsets.only(top: 24.h, bottom: 16.h),
|
||||
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
hintText: tfStr,
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
disabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
enabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
border: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -1,5 +1,76 @@
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
class LockListLogic extends BaseGetXController{
|
||||
import '../../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import '../entity/lockListInfo_entity.dart';
|
||||
import 'lockList_state.dart';
|
||||
|
||||
class LockListLogic extends BaseGetXController{
|
||||
LockListState state = LockListState();
|
||||
|
||||
String getUseKeyTypeStr(LockListInfoItemEntity indexEntity) {
|
||||
String useDateStr = '';
|
||||
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||
//限期
|
||||
DateTime startDateStr =
|
||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
||||
DateTime endDateStr =
|
||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
||||
useDateStr =
|
||||
'${startDateStr.toLocal().toString().substring(0, 16)} - ${endDateStr.toLocal().toString().substring(0, 16)}';
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||
//永久
|
||||
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)}\n永久';
|
||||
useDateStr = '永久';
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||
//单次
|
||||
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} \n单次';
|
||||
useDateStr = '单次';
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||
//循环
|
||||
useDateStr = '循环';
|
||||
}
|
||||
|
||||
return useDateStr;
|
||||
}
|
||||
|
||||
String showElectricIcon (int electricnumber){
|
||||
if(electricnumber >= 100){
|
||||
return 'images/main/icon_lockElectricLevel_5.png';
|
||||
}else if((electricnumber > 50) && (electricnumber < 100)){
|
||||
return 'images/main/icon_lockElectricLevel_4.png';
|
||||
}else if((electricnumber > 25) && (electricnumber <= 50)){
|
||||
return 'images/main/icon_lockElectricLevel_3.png';
|
||||
}else if((electricnumber > 5) && (electricnumber <= 25)){
|
||||
return 'images/main/icon_lockElectricLevel_2.png';
|
||||
}else if(electricnumber <= 5){
|
||||
return 'images/main/icon_lockElectricLevel_1.png';
|
||||
}
|
||||
return 'images/main/icon_lockElectricLevel_5.png';
|
||||
}
|
||||
|
||||
/// 获取是否超过现在的时间
|
||||
bool compareTimeIsOvertime(int endTiem){
|
||||
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(endTiem); // 将时间戳转换为 DateTime
|
||||
DateTime now = DateTime.now(); // 获取当前时间
|
||||
if (now.isAfter(dateTime)) {
|
||||
print('The timestamp is after the current time.');
|
||||
// 过期
|
||||
return true;
|
||||
} else {
|
||||
print('The timestamp is not after the current time.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// 获取两个距离当前时间相差几天 1705132260000
|
||||
int compareTimeGetDaysFromNow(int endTiem){
|
||||
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(endTiem); // 将时间戳转换为 DateTime
|
||||
DateTime now = DateTime.now(); // 获取当前时间
|
||||
Duration difference = dateTime.difference(now); // 计算两个日期之间的差异
|
||||
int days = difference.inDays; // 获取差异的天数
|
||||
print('dateTime:$dateTime now:$now The difference is $days days.');
|
||||
return days;
|
||||
}
|
||||
}
|
||||
@ -6,9 +6,9 @@ import 'package:get/get.dart';
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
import '../../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import '../../../tools/ExpandedListView.dart';
|
||||
import '../entity/lockListInfo_entity.dart';
|
||||
import 'lockListGroup_page.dart';
|
||||
import 'lockList_logic.dart';
|
||||
|
||||
class LockListPage extends StatefulWidget {
|
||||
final LockListInfoGroupEntity lockListInfoGroupEntity;
|
||||
@ -20,6 +20,9 @@ class LockListPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _LockListPageState extends State<LockListPage> {
|
||||
final logic = Get.put(LockListLogic());
|
||||
final state = Get.find<LockListLogic>().state;
|
||||
|
||||
var groupDataList = <GroupList>[];
|
||||
|
||||
@override
|
||||
@ -95,9 +98,18 @@ class _LockListPageState extends State<LockListPage> {
|
||||
}
|
||||
// print("lockItemList.length:${lockItemList.length} == ${index+1} $isLast");
|
||||
return lockInfoListItem(keyInfo, isLast, () {
|
||||
if(logic.compareTimeIsOvertime(keyInfo.endDate!) && keyInfo.keyType == XSConstantMacro.keyTypeTime){
|
||||
logic.showToast("钥匙已过期");
|
||||
return;
|
||||
}
|
||||
// var lockCount = 0;
|
||||
// for(GroupList itemData in groupDataList){
|
||||
// lockCount+=itemData.lockList!.length;
|
||||
// }
|
||||
Get.toNamed(Routers.lockDetailMainPage, arguments: {
|
||||
// "lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": keyInfo
|
||||
"keyInfo": keyInfo,
|
||||
"isOnlyOneData": false,
|
||||
});
|
||||
});
|
||||
}),
|
||||
@ -111,7 +123,7 @@ class _LockListPageState extends State<LockListPage> {
|
||||
// height: 122.h,
|
||||
margin: isLast ? EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w, bottom: 20.w) : EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: (logic.compareTimeIsOvertime(keyInfo.endDate!) && keyInfo.keyType == XSConstantMacro.keyTypeTime) ? AppColors.greyBackgroundColor : Colors.white,
|
||||
borderRadius: BorderRadius.circular(20.w),
|
||||
),
|
||||
child: Column(
|
||||
@ -131,7 +143,7 @@ class _LockListPageState extends State<LockListPage> {
|
||||
Text(
|
||||
keyInfo.lockAlias!,
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp, fontWeight: FontWeight.w500),
|
||||
fontSize: 24.sp, fontWeight: FontWeight.w500, color: keyInfo.passageMode == 1 ? AppColors.openPassageModeColor : AppColors.darkGrayTextColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -144,21 +156,53 @@ class _LockListPageState extends State<LockListPage> {
|
||||
),
|
||||
SizedBox(width: 2.w),
|
||||
Image.asset(
|
||||
showElectricIcon(keyInfo.electricQuantity!),
|
||||
logic.showElectricIcon(keyInfo.electricQuantity!),
|
||||
width: 30.w,
|
||||
height: 24.w,
|
||||
),
|
||||
SizedBox(width: 30.w),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.h,
|
||||
),
|
||||
Visibility(
|
||||
visible: keyInfo.remoteEnable == 1 ? true : false,
|
||||
child:Row(
|
||||
children: [
|
||||
SizedBox(width: 30.w),
|
||||
Text(
|
||||
"远程开锁", style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
],
|
||||
)),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Visibility(
|
||||
visible: keyInfo.keyType == XSConstantMacro.keyTypeTime ? true : false,
|
||||
// visible: true,
|
||||
child:Row(
|
||||
children: [
|
||||
SizedBox(width: 30.w),
|
||||
Container(
|
||||
padding: EdgeInsets.only(right: 5.w, left: 5.w),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5.w),
|
||||
color: logic.compareTimeIsOvertime(keyInfo.endDate!) ? AppColors.listTimeYellowColor : AppColors.mainColor,
|
||||
),
|
||||
child: Text(
|
||||
logic.compareTimeIsOvertime(keyInfo.endDate!) ? "已过期" : "余${logic.compareTimeGetDaysFromNow(keyInfo.endDate!)}天", style: TextStyle(fontSize: 18.sp, color: Colors.white)
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
SizedBox(height: 5.h),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(width: 30.w),
|
||||
Text(
|
||||
"${getUseDateStr(keyInfo)}/${keyInfo.isLockOwner == 1 ? '超级管理员' : (keyInfo.keyRight == 1 ? "授权管理员" : "普通用户")}",
|
||||
"${logic.getUseKeyTypeStr(keyInfo)}/${keyInfo.isLockOwner == 1 ? '超级管理员' : (keyInfo.keyRight == 1 ? "授权管理员" : "普通用户")}",
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
@ -173,47 +217,4 @@ class _LockListPageState extends State<LockListPage> {
|
||||
);
|
||||
}
|
||||
|
||||
String getUseDateStr(LockListInfoItemEntity indexEntity) {
|
||||
String useDateStr = '';
|
||||
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||
//限期
|
||||
DateTime startDateStr =
|
||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
||||
DateTime endDateStr =
|
||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
||||
useDateStr =
|
||||
'${startDateStr.toLocal().toString().substring(0, 16)} ${endDateStr.toLocal().toString().substring(0, 16)}';
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||
//永久
|
||||
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)}\n永久';
|
||||
useDateStr = '永久';
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||
//单次
|
||||
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} \n单次';
|
||||
useDateStr = '单次';
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||
//循环
|
||||
useDateStr = '循环';
|
||||
}
|
||||
|
||||
return useDateStr;
|
||||
}
|
||||
|
||||
String showElectricIcon (int electricnumber){
|
||||
if(electricnumber >= 100){
|
||||
return 'images/main/icon_lockElectricLevel_5.png';
|
||||
}else if((electricnumber > 50) && (electricnumber < 100)){
|
||||
return 'images/main/icon_lockElectricLevel_4.png';
|
||||
}else if((electricnumber > 25) && (electricnumber <= 50)){
|
||||
return 'images/main/icon_lockElectricLevel_3.png';
|
||||
}else if((electricnumber > 5) && (electricnumber <= 25)){
|
||||
return 'images/main/icon_lockElectricLevel_2.png';
|
||||
}else if(electricnumber <= 5){
|
||||
return 'images/main/icon_lockElectricLevel_1.png';
|
||||
}
|
||||
return 'images/main/icon_lockElectricLevel_5.png';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
|
||||
case 1:
|
||||
// 只有一条数据
|
||||
Storage.setBool(ifIsDemoModeOrNot, false);
|
||||
returnWidget = LockDetailPage(isFrist: true, lockListInfoItemEntity: state.lockListInfoEntity.value.data!.groupList![0].lockList![0]);
|
||||
returnWidget = LockDetailPage(isOnlyOneData: true, lockListInfoItemEntity: state.lockListInfoEntity.value.data!.groupList![0].lockList![0]);
|
||||
break;
|
||||
case 2:
|
||||
// 有多条数据
|
||||
|
||||
@ -3,10 +3,8 @@ import 'dart:async';
|
||||
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../blue/blue_manage.dart';
|
||||
import '../../../blue/io_protocol/io_addUser.dart';
|
||||
import '../../../blue/io_protocol/io_getStarLockStatusInfo.dart';
|
||||
import '../../../blue/io_reply.dart';
|
||||
import '../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../blue/io_tool/manager_event_bus.dart';
|
||||
@ -49,7 +47,7 @@ class SaveLockLogic extends BaseGetXController {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("添加用户数据解析成功");
|
||||
state.lockUserNo = reply.data[47] + 1;
|
||||
state.lockUserNo = reply.data[47];
|
||||
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
|
||||
@ -640,7 +640,7 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 设置常开模式
|
||||
Future<Response> setNormallyModeData(int lockId, int passageMode, Map passageModeConfig) =>
|
||||
Future<Response> setNormallyModeData(int lockId, int passageMode, List passageModeConfig) =>
|
||||
post(
|
||||
updateLockSettingUrl.toUrl,
|
||||
jsonEncode({
|
||||
|
||||
@ -676,7 +676,7 @@ class ApiRepository {
|
||||
Future<LoginEntity> setNormallyModeData({
|
||||
required int lockId,
|
||||
required int passageMode,
|
||||
required Map passageModeConfig,
|
||||
required List passageModeConfig,
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.setNormallyModeData(lockId, passageMode, passageModeConfig);
|
||||
|
||||
@ -1,13 +1,10 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:async/async.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
|
||||
import '../login/login/entity/LoginEntity.dart';
|
||||
import '../translations/trans_lib.dart';
|
||||
import 'manager/client_manager.dart';
|
||||
|
||||
class BaseGetXController extends GetxController{
|
||||
|
||||
@ -45,7 +45,7 @@ class LockGroupEditGroupLockRefreshEvent {
|
||||
|
||||
/// 锁设置里面开启关闭刷新锁详情
|
||||
class LockSetChangeSetRefreshLockDetailWithType {
|
||||
int type; // 0 考勤 1开锁时是否需联网
|
||||
int type; // 0 考勤 1开锁时是否需联网 2常开模式
|
||||
int setResult;
|
||||
LockSetChangeSetRefreshLockDetailWithType(this.type, this.setResult);
|
||||
}
|
||||
|
||||
86
star_lock/lib/tools/keySearchWidget.dart
Normal file
86
star_lock/lib/tools/keySearchWidget.dart
Normal file
@ -0,0 +1,86 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../translations/trans_lib.dart';
|
||||
|
||||
class KeySearchWidget extends StatelessWidget {
|
||||
TextEditingController editingController;
|
||||
Function() onSubmittedAction;
|
||||
|
||||
KeySearchWidget(
|
||||
{Key? key,
|
||||
required this.editingController,
|
||||
required this.onSubmittedAction})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 60.h,
|
||||
margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w),
|
||||
padding: EdgeInsets.only(top: 5.h,right: 10.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(5)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 15.h, bottom: 15.h, right: 5.w, left: 10.w),
|
||||
child: Image.asset(
|
||||
'images/main/icon_main_search.png',
|
||||
width: 40.w,
|
||||
height: 40.w,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 60.h,
|
||||
// width: 1.sw,
|
||||
// color: Colors.red,
|
||||
child: TextField(
|
||||
//输入框一行
|
||||
maxLines: 1,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.deny('\n'),
|
||||
LengthLimitingTextInputFormatter(18),
|
||||
],
|
||||
controller: editingController,
|
||||
autofocus: false,
|
||||
textAlign: TextAlign.start,
|
||||
onChanged: (value) {
|
||||
print("onChanged:$value");
|
||||
},
|
||||
onEditingComplete: () {
|
||||
print("onEditingComplete:");
|
||||
},
|
||||
onSubmitted: (value) {
|
||||
onSubmittedAction!();
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
// contentPadding: const EdgeInsets.only(
|
||||
// top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
||||
// hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
hintText:"搜索",
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
// border: InputBorder.none,
|
||||
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
disabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
enabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
border: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user