Merge branch 'master' of https://gitee.com/weishaoyang/star_lock
This commit is contained in:
commit
1a659b5579
@ -1,6 +1,7 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
|
||||
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart';
|
||||
@ -246,26 +247,32 @@ abstract class Routers {
|
||||
'/ValueAddedServicesListEmailTemplatePage'; // 增值服务-邮箱模版列表
|
||||
static const valueAddedServicesAddEmailTemplatePage =
|
||||
'/ValueAddedServicesAddEmailTemplatePage'; // 增值服务-自定义邮箱模版
|
||||
static const valueAddedServicesBuyAndUseRecordManagePage = '/ValueAddedServicesBuyAndUseRecordManagePage'; // 增值服务-购买使用记录
|
||||
static const valueAddedServicesBuyAndUseRecordManagePage =
|
||||
'/ValueAddedServicesBuyAndUseRecordManagePage'; // 增值服务-购买使用记录
|
||||
|
||||
static const lockScreenPage = '/LockScreenPage'; // 我的设置-锁屏
|
||||
static const aPPUnlockNeedMobileNetworkingLockPage = '/APPUnlockNeedMobileNetworkingLockPage'; // 我的设置-app开锁时需手机连网的锁
|
||||
static const hideInvalidUnlockPermissionsPage = '/HideInvalidUnlockPermissionsPage'; // 我的设置-隐藏无效开锁权限
|
||||
static const aPPUnlockNeedMobileNetworkingLockPage =
|
||||
'/APPUnlockNeedMobileNetworkingLockPage'; // 我的设置-app开锁时需手机连网的锁
|
||||
static const hideInvalidUnlockPermissionsPage =
|
||||
'/HideInvalidUnlockPermissionsPage'; // 我的设置-隐藏无效开锁权限
|
||||
|
||||
static const lockUserManageLisPage = '/LockUserManageLisPage'; //我的设置-锁用户管理
|
||||
static const authorizedAdministratorListPage = '/AuthorizedAdministratorListPage'; //我的设置-授权管理员
|
||||
static const authorizedAdministratorListPage =
|
||||
'/AuthorizedAdministratorListPage'; //我的设置-授权管理员
|
||||
static const lockGroupListPage = '/LockGroupListPage'; //我的设置-锁分组
|
||||
static const lockItemListPage = '/LockItemListPage'; //锁分组-锁列表
|
||||
static const transferSmartLockPage = '/transferSmartLockPage'; //转移智能锁
|
||||
static const recipientInformationPage = '/recipientInformationPage'; //接受人信息
|
||||
static const selectBranchPage = '/SelectBranchPage'; //选择分店
|
||||
static const selectGetewayListPage = '/selectGetewayListPage'; //选择网关
|
||||
static const addAuthorizedAdministratorPage = '/addAuthorizedAdministratorPage'; //添加授权管理员
|
||||
static const addAuthorizedAdministratorPage =
|
||||
'/addAuthorizedAdministratorPage'; //添加授权管理员
|
||||
static const ownedKeyListPage = '/ownedKeyListPage'; //拥有的钥匙
|
||||
|
||||
static const starLockLoginPage = '/StarLockLoginPage'; // 登录
|
||||
static const starLockRegisterPage = '/StarLockRegisterPage'; // 注册
|
||||
static const starLockForgetPasswordPage = '/StarLockForgetPasswordPage'; // 忘记密码
|
||||
static const starLockForgetPasswordPage =
|
||||
'/StarLockForgetPasswordPage'; // 忘记密码
|
||||
static const seletCountryRegionPage = '/SeletCountryRegionPage'; // 选择国家和地区
|
||||
static const safetyVerificationPage = '/SafetyVerificationPage'; // 安全验证
|
||||
|
||||
@ -395,9 +402,9 @@ abstract class AppRouters {
|
||||
page: () => const StarLockLoginPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.starLockRegisterPage,
|
||||
page: () => const StarLockRegisterPage(), binding:StarLockRegisterBinding()
|
||||
),
|
||||
name: Routers.starLockRegisterPage,
|
||||
page: () => const StarLockRegisterPage(),
|
||||
binding: StarLockRegisterBinding()),
|
||||
GetPage(
|
||||
name: Routers.starLockForgetPasswordPage,
|
||||
page: () => const StarLockForgetPasswordPage(),
|
||||
@ -672,52 +679,46 @@ abstract class AppRouters {
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.authorizedAdministratorListPage,
|
||||
page: () => const AuthorizedAdministratorListPage()
|
||||
),
|
||||
page: () => const AuthorizedAdministratorListPage()),
|
||||
GetPage(
|
||||
name: Routers.lockUserManageLisPage,
|
||||
page: () => const LockUserManageListListPage()
|
||||
),
|
||||
page: () => const LockUserManageListListPage()),
|
||||
GetPage(
|
||||
name: Routers.lockGroupListPage, page: () => const LockGroupListPage()
|
||||
),
|
||||
name: Routers.lockGroupListPage, page: () => const LockGroupListPage()),
|
||||
GetPage(
|
||||
name: Routers.lockItemListPage, page: () => const LockItemListPage()
|
||||
),
|
||||
name: Routers.lockItemListPage, page: () => const LockItemListPage()),
|
||||
GetPage(
|
||||
name: Routers.transferSmartLockPage,
|
||||
page: () => const TransferSmartLockPage()
|
||||
),
|
||||
page: () => const TransferSmartLockPage()),
|
||||
GetPage(
|
||||
name: Routers.recipientInformationPage,
|
||||
page: () => const RecipientInformationPage()
|
||||
),
|
||||
page: () => const RecipientInformationPage()),
|
||||
GetPage(
|
||||
name: Routers.selectBranchPage, page: () => const SelectBranchPage()
|
||||
),
|
||||
name: Routers.selectBranchPage, page: () => const SelectBranchPage()),
|
||||
GetPage(
|
||||
name: Routers.selectGetewayListPage,
|
||||
page: () => const SelectGetewayListPage()
|
||||
),
|
||||
page: () => const SelectGetewayListPage()),
|
||||
GetPage(
|
||||
name: Routers.minePersonInfoEditEmailPage,
|
||||
page: () => const MinePersonInfoEditEmailPage()
|
||||
),
|
||||
page: () => const MinePersonInfoEditEmailPage()),
|
||||
GetPage(
|
||||
name: Routers.addAuthorizedAdministratorPage,
|
||||
page: () => const AddAuthorizedAdministratorPage()
|
||||
),
|
||||
page: () => const AddAuthorizedAdministratorPage()),
|
||||
GetPage(
|
||||
name: Routers.safetyVerificationPage,
|
||||
page: () => const SafetyVerificationPage(),
|
||||
name: Routers.safetyVerificationPage,
|
||||
page: () => const SafetyVerificationPage(),
|
||||
binding: SafetyVerificationBinding(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.ownedKeyListPage, page: () => const OwnedKeyListPage()
|
||||
),
|
||||
GetPage(name: Routers.keyOperationRecordPage, page: () => const KeyOperationRecordPage()),
|
||||
GetPage(name: Routers.getDeviceListPage, page: () => const GetDeviceListPage()),
|
||||
name: Routers.ownedKeyListPage, page: () => const OwnedKeyListPage()),
|
||||
GetPage(
|
||||
name: Routers.keyOperationRecordPage,
|
||||
page: () => const KeyOperationRecordPage()),
|
||||
GetPage(
|
||||
name: Routers.getDeviceListPage, page: () => const GetDeviceListPage()),
|
||||
GetPage(name: Routers.getNameListPage, page: () => const GetNameListPage()),
|
||||
GetPage(name: Routers.authorityManagementPage, page: () => const AuthorityManagementPage()),
|
||||
GetPage(
|
||||
name: Routers.authorityManagementPage,
|
||||
page: () => const AuthorityManagementPage()),
|
||||
];
|
||||
}
|
||||
|
||||
@ -10,7 +10,6 @@ import 'io_sender.dart';
|
||||
import 'io_type.dart';
|
||||
|
||||
class GetPublicKeyCommand extends SenderProtocol {
|
||||
|
||||
String? lockID;
|
||||
GetPublicKeyCommand({
|
||||
this.lockID,
|
||||
@ -22,9 +21,9 @@ class GetPublicKeyCommand extends SenderProtocol {
|
||||
|
||||
// 指令类型
|
||||
int type = commandType!.typeValue;
|
||||
double typeDouble = type/256;
|
||||
double typeDouble = type / 256;
|
||||
int type1 = typeDouble.toInt();
|
||||
int type2 = type%256;
|
||||
int type2 = type % 256;
|
||||
data.add(type1);
|
||||
data.add(type2);
|
||||
// print("type:$type");
|
||||
@ -41,9 +40,9 @@ class GetPublicKeyCommand extends SenderProtocol {
|
||||
}
|
||||
|
||||
class GetPublicKeyReply extends Reply {
|
||||
GetPublicKeyReply.parseData(CommandType commandType, List<int> dataDetail)
|
||||
GetPublicKeyReply.parseData(CommandType commandType, List<int> dataDetail)
|
||||
: super.parseData(commandType, dataDetail) {
|
||||
status = dataDetail[2];
|
||||
data = dataDetail;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
import 'package:star_lock/tools/jh_pop_menus.dart';
|
||||
|
||||
import '../../../../../appRouters.dart';
|
||||
@ -25,6 +26,13 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ElectronicKeyListItem itemData = ElectronicKeyListItem();
|
||||
|
||||
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
||||
if (obj != null && (obj["itemData"] != null)) {
|
||||
itemData = obj["itemData"];
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
@ -55,7 +63,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
||||
rightTitle: "魏",
|
||||
rightTitle: itemData.keyName,
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () {
|
||||
@ -64,7 +72,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||
allHeight: 90.h,
|
||||
rightTitle: "2020.06.20 11:49\n2020.06.21 11:49",
|
||||
rightTitle: getUseDateStr(itemData),
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Navigator.pushNamed(
|
||||
@ -73,24 +81,27 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
|
||||
rightTitle: "786612630@qq.com",
|
||||
rightTitle: itemData.username,
|
||||
action: () {}),
|
||||
const SizedBox(height: 1),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.sender!.tr,
|
||||
rightTitle: "15080825640",
|
||||
rightTitle: itemData.senderUsername,
|
||||
action: () {}),
|
||||
const SizedBox(height: 1),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.senderTime!.tr,
|
||||
rightTitle: "2020.06.21 11:49",
|
||||
rightTitle: itemData.date.toString(),
|
||||
action: () {}),
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||
rightTitle: "",
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, child: _switch()),
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w,
|
||||
child:
|
||||
_switch(itemData.faceAuthentication == 1 ? true : false)),
|
||||
action: () {}),
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
@ -115,6 +126,33 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
);
|
||||
}
|
||||
|
||||
//使用期限
|
||||
String getUseDateStr(ElectronicKeyListItem indexEntity) {
|
||||
String useDateStr = '';
|
||||
if (indexEntity.keyType == 1) {
|
||||
//限期
|
||||
DateTime startDateStr =
|
||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
||||
DateTime endDateStr =
|
||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
||||
useDateStr =
|
||||
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
|
||||
} else if (indexEntity.keyType == 2) {
|
||||
//永久
|
||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||
useDateStr = '${dateStr.toLocal().toString()} 永久';
|
||||
} else if (indexEntity.keyType == 3) {
|
||||
//单次
|
||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||
useDateStr = '${dateStr.toLocal().toString()} 单次';
|
||||
} else if (indexEntity.keyType == 4) {
|
||||
//循环
|
||||
useDateStr = '循环';
|
||||
}
|
||||
|
||||
return useDateStr;
|
||||
}
|
||||
|
||||
Widget commonItem(String leftTitle, String rightTitle,
|
||||
{bool isHaveDirection = false,
|
||||
bool isHaveLine = false,
|
||||
@ -178,16 +216,15 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
);
|
||||
}
|
||||
|
||||
CupertinoSwitch _switch() {
|
||||
bool _isOn = false;
|
||||
CupertinoSwitch _switch(isOn) {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: _isOn,
|
||||
value: isOn,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_isOn = value;
|
||||
isOn = value;
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@ -0,0 +1,114 @@
|
||||
class KeyOperationRecordEntity {
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
KeyOperationRecordData? data;
|
||||
|
||||
KeyOperationRecordEntity(
|
||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
KeyOperationRecordEntity.fromJson(Map<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
data = json['data'] != null
|
||||
? KeyOperationRecordData.fromJson(json['data'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['errorCode'] = errorCode;
|
||||
data['description'] = description;
|
||||
data['errorMsg'] = errorMsg;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class KeyOperationRecordData {
|
||||
List<KeyRecordDataItem>? itemList;
|
||||
int? pageNo;
|
||||
int? pageSize;
|
||||
int? pages;
|
||||
int? total;
|
||||
|
||||
KeyOperationRecordData(
|
||||
{this.itemList, this.pageNo, this.pageSize, this.pages, this.total});
|
||||
|
||||
KeyOperationRecordData.fromJson(Map<String, dynamic> json) {
|
||||
if (json['list'] != null) {
|
||||
itemList = <KeyRecordDataItem>[];
|
||||
json['list'].forEach((v) {
|
||||
itemList!.add(KeyRecordDataItem.fromJson(v));
|
||||
});
|
||||
}
|
||||
pageNo = json['pageNo'];
|
||||
pageSize = json['pageSize'];
|
||||
pages = json['pages'];
|
||||
total = json['total'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (itemList != null) {
|
||||
data['list'] = itemList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['pageNo'] = pageNo;
|
||||
data['pageSize'] = pageSize;
|
||||
data['pages'] = pages;
|
||||
data['total'] = total;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class KeyRecordDataItem {
|
||||
int? recordId;
|
||||
int? lockId;
|
||||
int? recordType;
|
||||
String? recordTypeName;
|
||||
int? success;
|
||||
String? username;
|
||||
String? lockDate;
|
||||
int? operateDate;
|
||||
String? keyboardPwd;
|
||||
|
||||
KeyRecordDataItem(
|
||||
{this.recordId,
|
||||
this.lockId,
|
||||
this.recordType,
|
||||
this.recordTypeName,
|
||||
this.success,
|
||||
this.username,
|
||||
this.lockDate,
|
||||
this.operateDate,
|
||||
this.keyboardPwd});
|
||||
|
||||
KeyRecordDataItem.fromJson(Map<String, dynamic> json) {
|
||||
recordId = json['recordId'];
|
||||
lockId = json['lockId'];
|
||||
recordType = json['recordType'];
|
||||
recordTypeName = json['recordTypeName'];
|
||||
success = json['success'];
|
||||
username = json['username'];
|
||||
lockDate = json['lockDate'];
|
||||
operateDate = json['operateDate'];
|
||||
keyboardPwd = json['keyboardPwd'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['recordId'] = recordId;
|
||||
data['lockId'] = lockId;
|
||||
data['recordType'] = recordType;
|
||||
data['recordTypeName'] = recordTypeName;
|
||||
data['success'] = success;
|
||||
data['username'] = username;
|
||||
data['lockDate'] = lockDate;
|
||||
data['operateDate'] = operateDate;
|
||||
data['keyboardPwd'] = keyboardPwd;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
@ -25,14 +29,48 @@ class _KeyOperationRecordPageState extends State<KeyOperationRecordPage> {
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(child: _buildMainUI()),
|
||||
],
|
||||
),
|
||||
body: FutureBuilder<List<KeyRecordDataItem>>(
|
||||
// future: mockNetworkDataRequest(),
|
||||
builder: (BuildContext context,
|
||||
AsyncSnapshot<List<KeyRecordDataItem>> snapshot) {
|
||||
//请求结束
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasError) {
|
||||
//请求失败
|
||||
return const Text('请求失败');
|
||||
} else {
|
||||
//请求成功
|
||||
final List<KeyRecordDataItem> itemData = snapshot.data!;
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(child: _buildMainUI()),
|
||||
],
|
||||
);
|
||||
}
|
||||
} else {
|
||||
//请求未结束 显示loading
|
||||
return Container();
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
//请求操作记录列表
|
||||
Future<List<KeyRecordDataItem>?> mockNetworkDataRequest() async {
|
||||
KeyOperationRecordEntity entity = (await ApiRepository.to
|
||||
.lockRecordList('0', '63', '0', '28', '1', '1', '20', '0', '', '', ''));
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("操作记录列表成功:${entity.data?.itemList}");
|
||||
}
|
||||
if (entity.data != null) {
|
||||
return entity.data!.itemList;
|
||||
} else {
|
||||
List<KeyRecordDataItem> dataList = [];
|
||||
return dataList;
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildMainUI() {
|
||||
return ListView.separated(
|
||||
itemCount: 5,
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/electr
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/toast.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
@ -24,7 +25,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
final logic = Get.put(ElectronicKeyListLogic());
|
||||
|
||||
//请求电子钥匙列表
|
||||
Future<List<ElectronicKeyListItem>> mockNetworkData() async {
|
||||
Future<List<ElectronicKeyListItem>> mockNetworkDataRequest() async {
|
||||
ElectronicKeyListEntity entity = await ApiRepository.to
|
||||
.electronicKeyList('0', '63', '0', '28', '1', '1', '20', '0');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
@ -38,6 +39,18 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
}
|
||||
}
|
||||
|
||||
//电子钥匙重置请求
|
||||
Future<void> resetElectronicKeyListRequest() async {
|
||||
ElectronicKeyListEntity entity =
|
||||
await ApiRepository.to.resetElectronicKey('28', '0');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("重置电子钥匙成功啦啦啦啦啦");
|
||||
Toast.show(msg: "重置成功");
|
||||
mockNetworkDataRequest();
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -52,12 +65,14 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
TranslationLoader.lanKeys!.reset!.tr,
|
||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
resetElectronicKeyListRequest();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: FutureBuilder<List<ElectronicKeyListItem>>(
|
||||
future: mockNetworkData(),
|
||||
future: mockNetworkDataRequest(),
|
||||
builder: (BuildContext context,
|
||||
AsyncSnapshot<List<ElectronicKeyListItem>> snapshot) {
|
||||
//请求结束
|
||||
@ -155,8 +170,9 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
isAdminKey = false;
|
||||
}
|
||||
return _electronicKeyItem('images/controls_user.png',
|
||||
indexEntity.senderUsername!, useDateStr, keyStatus, isAdminKey, () {
|
||||
Navigator.pushNamed(context, Routers.electronicKeyDetailPage);
|
||||
indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
|
||||
Navigator.pushNamed(context, Routers.electronicKeyDetailPage,
|
||||
arguments: {"itemData": indexEntity});
|
||||
});
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
|
||||
@ -86,7 +86,7 @@ class ElectronicKeyListItem {
|
||||
int? date;
|
||||
int? remoteEnable;
|
||||
int? appUnlockMustOnline;
|
||||
List<int>? weekDays;
|
||||
List? weekDays;
|
||||
|
||||
ElectronicKeyListItem(
|
||||
{this.keyId,
|
||||
|
||||
@ -6,30 +6,62 @@ import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
class SendElectronicKeyLogic extends BaseGetXController {
|
||||
final SendElectronicKeyState state = SendElectronicKeyState();
|
||||
// final stateMyLogic = Get.put(SendElectronicKeyLogic()).state;
|
||||
final stateMyLogic = Get.put(SendElectronicKeyLogic()).state;
|
||||
|
||||
void sendElectronicKey() async {
|
||||
var entity = await ApiRepository.to.sendElectronicKey(
|
||||
'0',
|
||||
'0',
|
||||
'0',
|
||||
'0',
|
||||
'2',
|
||||
'2',
|
||||
'2',
|
||||
'0',
|
||||
'1',
|
||||
'0',
|
||||
'0',
|
||||
'小吴副号',
|
||||
'19128333512',
|
||||
'0',
|
||||
'0',
|
||||
'0');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print('发送电子钥匙成功');
|
||||
Get.back();
|
||||
}
|
||||
// String getFailureDateTime = '0';
|
||||
// String getEffectiveDateTime = '0';
|
||||
// String getKeyType = (int.parse(state.keyType) + 1).toString();
|
||||
|
||||
// if (state.keyType == '1') {
|
||||
// getFailureDateTime = DateTime.fromMillisecondsSinceEpoch(
|
||||
// int.parse(state.failureDate.value) * 1000)
|
||||
// .toString()
|
||||
// .substring(0, 19);
|
||||
// getEffectiveDateTime = DateTime.fromMillisecondsSinceEpoch(
|
||||
// int.parse(state.effectiveDate.value) * 1000)
|
||||
// .toString()
|
||||
// .substring(0, 19);
|
||||
// }
|
||||
// var entity = await ApiRepository.to.sendElectronicKey(
|
||||
// '0',
|
||||
// '0',
|
||||
// '1',
|
||||
// getFailureDateTime,
|
||||
// state.isRealName == true ? '1' : '2',
|
||||
// '2',
|
||||
// state.isRemoteUnlock == true ? '1' : '2',
|
||||
// state.keyNameController.text,
|
||||
// '1',
|
||||
// getKeyType,
|
||||
// '28',
|
||||
// '小吴副号',
|
||||
// emailOrPhoneController.text,
|
||||
// '0',
|
||||
// getEffectiveDateTime, []);
|
||||
// if (entity.errorCode!.codeIsSuccessful) {
|
||||
// // print('发送电子钥匙成功');
|
||||
// }
|
||||
// var entity = await ApiRepository.to.sendElectronicKey(
|
||||
// '0',
|
||||
// '0',
|
||||
// '1',
|
||||
// state.failureDate,
|
||||
// state.isRealName == true ? '1' : '2',
|
||||
// '2',
|
||||
// state.isRemoteUnlock == true ? '1' : '2',
|
||||
// state.emailOrPhoneController.text,
|
||||
// '1',
|
||||
// '0',
|
||||
// '28',
|
||||
// '小吴副号',
|
||||
// '18682150237',
|
||||
// '0',
|
||||
// '0', []);
|
||||
// if (entity.errorCode!.codeIsSuccessful) {
|
||||
// print('发送电子钥匙成功');
|
||||
// Get.back();
|
||||
// }
|
||||
}
|
||||
|
||||
// void checkNext(TextEditingController controller) {
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_pickers/pickers.dart';
|
||||
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_logic.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import '../../../../../appRouters.dart';
|
||||
import '../../../../../tools/commonItem.dart';
|
||||
@ -24,11 +29,29 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
final FlutterContactPicker _contactPicker = FlutterContactPicker();
|
||||
late Contact _contact;
|
||||
|
||||
final logic = Get.put(SendElectronicKeyLogic());
|
||||
// final logic = Get.put(SendElectronicKeyLogic());
|
||||
// final state = Get.find<SendElectronicKeyLogic>().state;
|
||||
|
||||
bool _isRemoteUnlock = false; //是否允许远程开锁
|
||||
bool _isAuthentication = false; //是否可以实名认证
|
||||
var _selectEffectiveDate = ''; //生效时间
|
||||
var _selectFailureDate = ''; //失效时间
|
||||
TextEditingController emailOrPhoneController =
|
||||
TextEditingController(); //邮箱/手机号输入框
|
||||
TextEditingController keyNameController = TextEditingController(); //钥匙名输入框
|
||||
late bool _isSendSuccess;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
DateTime dateTime = DateTime.now();
|
||||
_selectEffectiveDate =
|
||||
'${dateTime.year}-${dateTime.month}-${dateTime.day} ${dateTime.hour}:${dateTime.minute}'; //默认为当前时间
|
||||
_selectFailureDate =
|
||||
'${dateTime.year}-${dateTime.month}-${dateTime.day} ${dateTime.hour}:${dateTime.minute}'; //默认为当前时间
|
||||
_isSendSuccess = false;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -42,53 +65,60 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
case 0:
|
||||
{
|
||||
// 限时
|
||||
return sendElectronicKeySucceed();
|
||||
// return Column(
|
||||
// children: [
|
||||
// keyInfoWidget(),
|
||||
// keyTimeWidget(),
|
||||
// remoteUnlockingWidget(),
|
||||
// keyRealNameWidget(),
|
||||
// keyBottomWidget()
|
||||
// ],
|
||||
// );
|
||||
return _isSendSuccess
|
||||
? sendElectronicKeySucceed()
|
||||
: Column(
|
||||
children: [
|
||||
keyInfoWidget(),
|
||||
keyTimeWidget(),
|
||||
remoteUnlockingWidget(),
|
||||
keyRealNameWidget(),
|
||||
keyBottomWidget()
|
||||
],
|
||||
);
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
// 永久
|
||||
return Column(
|
||||
children: [
|
||||
keyInfoWidget(),
|
||||
remoteUnlockingWidget(),
|
||||
keyRealNameWidget(),
|
||||
keyBottomWidget()
|
||||
],
|
||||
);
|
||||
return _isSendSuccess
|
||||
? sendElectronicKeySucceed()
|
||||
: Column(
|
||||
children: [
|
||||
keyInfoWidget(),
|
||||
remoteUnlockingWidget(),
|
||||
keyRealNameWidget(),
|
||||
keyBottomWidget()
|
||||
],
|
||||
);
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
// 单次
|
||||
return Column(
|
||||
children: [
|
||||
keyInfoWidget(),
|
||||
remoteUnlockingWidget(),
|
||||
keyRealNameWidget(),
|
||||
keyBottomWidget()
|
||||
],
|
||||
);
|
||||
return _isSendSuccess
|
||||
? sendElectronicKeySucceed()
|
||||
: Column(
|
||||
children: [
|
||||
keyInfoWidget(),
|
||||
remoteUnlockingWidget(),
|
||||
keyRealNameWidget(),
|
||||
keyBottomWidget()
|
||||
],
|
||||
);
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
// 循环
|
||||
return Column(
|
||||
children: [
|
||||
keyInfoWidget(),
|
||||
keyPeriodValidityWidget(),
|
||||
remoteUnlockingWidget(),
|
||||
keyRealNameWidget(),
|
||||
keyBottomWidget()
|
||||
],
|
||||
);
|
||||
return _isSendSuccess
|
||||
? sendElectronicKeySucceed()
|
||||
: Column(
|
||||
children: [
|
||||
keyInfoWidget(),
|
||||
keyPeriodValidityWidget(),
|
||||
remoteUnlockingWidget(),
|
||||
keyRealNameWidget(),
|
||||
keyBottomWidget()
|
||||
],
|
||||
);
|
||||
}
|
||||
default:
|
||||
return Container();
|
||||
@ -124,18 +154,30 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||
rightTitle: "2020.06.20 11:49",
|
||||
rightTitle: _selectEffectiveDate,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
// _showDatePicker();
|
||||
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||
onConfirm: (p) {
|
||||
setState(() {
|
||||
_selectEffectiveDate =
|
||||
'${p.year}-${p.month}-${p.day} ${p.hour}:${p.minute}';
|
||||
});
|
||||
});
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||
rightTitle: "2020.06.20 11:49",
|
||||
rightTitle: _selectFailureDate,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
// _showDatePicker();
|
||||
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||
onConfirm: (p) {
|
||||
setState(() {
|
||||
_selectFailureDate =
|
||||
'${p.year}-${p.month}-${p.day} ${p.hour}:${p.minute}';
|
||||
});
|
||||
});
|
||||
}),
|
||||
Container(height: 10.h),
|
||||
],
|
||||
@ -199,7 +241,10 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
btnName: TranslationLoader.lanKeys!.send!.tr,
|
||||
onClick: () {
|
||||
//发送钥匙请求
|
||||
logic.sendElectronicKey();
|
||||
if (emailOrPhoneController.text.isNotEmpty &&
|
||||
keyNameController.text.isNotEmpty) {
|
||||
sendElectronicKeyRequest();
|
||||
}
|
||||
}),
|
||||
Container(
|
||||
padding: EdgeInsets.only(right: 30.w),
|
||||
@ -224,6 +269,44 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> sendElectronicKeyRequest() async {
|
||||
String getFailureDateTime = '0';
|
||||
String getEffectiveDateTime = '0';
|
||||
String deviceID = '28';
|
||||
String getKeyType = (int.parse(widget.type) + 1).toString();
|
||||
if (widget.type == '0') {
|
||||
getFailureDateTime =
|
||||
DateTime.fromMillisecondsSinceEpoch(int.parse(_selectFailureDate))
|
||||
.toString()
|
||||
.substring(0, 19);
|
||||
getEffectiveDateTime =
|
||||
DateTime.fromMillisecondsSinceEpoch(int.parse(_selectEffectiveDate))
|
||||
.toString()
|
||||
.substring(0, 19);
|
||||
}
|
||||
var entity = await ApiRepository.to.sendElectronicKey(
|
||||
'0',
|
||||
'0',
|
||||
'1',
|
||||
getFailureDateTime,
|
||||
_isAuthentication == true ? '1' : '2',
|
||||
'2',
|
||||
_isRemoteUnlock == true ? '1' : '2',
|
||||
keyNameController.text,
|
||||
'1',
|
||||
getKeyType,
|
||||
deviceID,
|
||||
'小吴副号',
|
||||
emailOrPhoneController.text,
|
||||
'0',
|
||||
getEffectiveDateTime, []);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
// print('发送电子钥匙成功');
|
||||
_isSendSuccess = true;
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
// 发送电子钥匙成功
|
||||
Widget sendElectronicKeySucceed() {
|
||||
return Column(
|
||||
@ -263,23 +346,35 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
SubmitBtn(btnName: '完成', onClick: () {}),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '邮件通知',
|
||||
btnName: '完成',
|
||||
onClick: () {
|
||||
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
||||
_isSendSuccess = false;
|
||||
setState(() {});
|
||||
}),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
SubmitBtn(btnName: '微信通知', onClick: () {}),
|
||||
OutLineBtn(
|
||||
btnName: '邮件通知',
|
||||
onClick: () {
|
||||
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
SubmitBtn(btnName: '标记为已入住', onClick: () {}),
|
||||
OutLineBtn(
|
||||
btnName: '微信通知',
|
||||
onClick: () {},
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
OutLineBtn(
|
||||
btnName: '标记为已入住',
|
||||
onClick: () {},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -293,9 +388,8 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
// controller: lineIndex == 1
|
||||
// ? state.emailOrPhoneController
|
||||
// : state.keyNameController,
|
||||
controller:
|
||||
lineIndex == 1 ? emailOrPhoneController : keyNameController,
|
||||
//输入框一行
|
||||
maxLines: 1,
|
||||
// controller: _controller,
|
||||
|
||||
@ -2,22 +2,28 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class SendElectronicKeyState {
|
||||
var emailOrPhone = ''.obs;
|
||||
var keyName = ''.obs;
|
||||
var canNext = false.obs;
|
||||
bool get isEmailOrPhoneOK => emailOrPhone.value.isNotEmpty;
|
||||
bool get isKeyNameOK => keyName.value.isNotEmpty;
|
||||
// var emailOrPhone = ''.obs;
|
||||
// var keyName = ''.obs;
|
||||
// var effectiveDate = ''.obs; //生效时间
|
||||
// var failureDate = ''.obs; //失效时间
|
||||
// var isRemoteUnlock = false; //远程开锁
|
||||
// var isRealName = false; //实名认证
|
||||
// var keyType = '1'; //钥匙类型 限期1,永久2,单次3,循环4
|
||||
// var canNext = false.obs;
|
||||
|
||||
TextEditingController emailOrPhoneController =
|
||||
TextEditingController(); //邮箱/手机号输入框
|
||||
TextEditingController keyNameController = TextEditingController(); //钥匙名输入框
|
||||
SendElectronicKeyState() {
|
||||
emailOrPhoneController.text = emailOrPhone.value;
|
||||
keyNameController.text = keyName.value;
|
||||
}
|
||||
// bool get isEmailOrPhoneOK => emailOrPhone.value.isNotEmpty;
|
||||
// bool get isKeyNameOK => keyName.value.isNotEmpty;
|
||||
|
||||
void onClose() {
|
||||
emailOrPhoneController.dispose();
|
||||
keyNameController.dispose();
|
||||
}
|
||||
// TextEditingController emailOrPhoneController =
|
||||
// TextEditingController(); //邮箱/手机号输入框
|
||||
// TextEditingController keyNameController = TextEditingController(); //钥匙名输入框
|
||||
// SendElectronicKeyState() {
|
||||
// emailOrPhoneController.text = emailOrPhone.value;
|
||||
// keyNameController.text = keyName.value;
|
||||
// }
|
||||
|
||||
// void onClose() {
|
||||
// emailOrPhoneController.dispose();
|
||||
// keyNameController.dispose();
|
||||
// }
|
||||
}
|
||||
|
||||
@ -13,6 +13,8 @@ abstract class Api {
|
||||
final String getCountryRegionURL = '/system/listCountry'; //获取国家或地区
|
||||
final String electronicKeyListURL = '/key/listUser'; //电子钥匙列表
|
||||
final String sendElectronicKeyURL = '/key/send'; //发送电子钥匙
|
||||
final String resetElectronicKeyURL = '/key/reset'; //重置电子钥匙
|
||||
final String keyOperationRecordURL = '/lockRecords/list'; //电子钥匙操作记录
|
||||
final String uploadElectricQuantityURL =
|
||||
'/room/uploadElectricQuantity'; //锁电量更新
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ class ApiProvider extends BaseProvider {
|
||||
String receiverUsername,
|
||||
String remarks,
|
||||
String startDate,
|
||||
String weekDays) =>
|
||||
List weekDays) =>
|
||||
post(
|
||||
sendElectronicKeyURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -163,6 +163,38 @@ class ApiProvider extends BaseProvider {
|
||||
'electricQuantity': electricQuantity,
|
||||
'lockId': lockId,
|
||||
}));
|
||||
|
||||
Future<Response> resetElectronicKey(String lockId, String operatorUid) =>
|
||||
post(resetElectronicKeyURL.toUrl,
|
||||
jsonEncode({'lockId': lockId, 'operatorUid': operatorUid}));
|
||||
|
||||
Future<Response> lockRecordList(
|
||||
String endDate,
|
||||
String keyId,
|
||||
String keyStatus,
|
||||
String lockId,
|
||||
String operatorUid,
|
||||
String pageNo,
|
||||
String pageSize,
|
||||
String startDate,
|
||||
String recordType,
|
||||
String searchStr,
|
||||
String timezoneRawOffSet) =>
|
||||
post(
|
||||
keyOperationRecordURL.toUrl,
|
||||
jsonEncode({
|
||||
'endDate': endDate,
|
||||
'keyId': keyId,
|
||||
"keyStatus": keyStatus,
|
||||
'lockId': lockId,
|
||||
"operatorUid": operatorUid,
|
||||
'pageNo': pageNo,
|
||||
'pageSize': pageSize,
|
||||
'startDate': startDate,
|
||||
'recordType': recordType,
|
||||
'searchStr': searchStr,
|
||||
'timezoneRawOffSet': timezoneRawOffSet
|
||||
}));
|
||||
}
|
||||
|
||||
extension ExtensionString on String {
|
||||
|
||||
@ -53,7 +53,7 @@ class BaseProvider extends GetConnect with Api {
|
||||
statusText: res.statusText,
|
||||
);
|
||||
}
|
||||
print('得到的数据======>¥res');
|
||||
print('得到的数据======>$res');
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
||||
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
||||
@ -112,7 +113,7 @@ class ApiRepository {
|
||||
String receiverUsername,
|
||||
String remarks,
|
||||
String startDate,
|
||||
String weekDays) async {
|
||||
List weekDays) async {
|
||||
final res = await apiProvider.sendElectronicKey(
|
||||
createUser,
|
||||
countryCode,
|
||||
@ -132,4 +133,39 @@ class ApiRepository {
|
||||
weekDays);
|
||||
return ElectronicKeyListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
//重置电子钥匙
|
||||
Future<ElectronicKeyListEntity> resetElectronicKey(
|
||||
String lockId, String operatorUid) async {
|
||||
final res = await apiProvider.resetElectronicKey(lockId, operatorUid);
|
||||
return ElectronicKeyListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
//钥匙详情-操作记录
|
||||
Future<KeyOperationRecordEntity> lockRecordList(
|
||||
String endDate,
|
||||
String keyId,
|
||||
String keyStatus,
|
||||
String lockId,
|
||||
String operatorUid,
|
||||
String pageNo,
|
||||
String pageSize,
|
||||
String startDate,
|
||||
String recordType,
|
||||
String searchStr,
|
||||
String timezoneRawOffSet) async {
|
||||
final res = await apiProvider.lockRecordList(
|
||||
endDate,
|
||||
keyId,
|
||||
keyStatus,
|
||||
lockId,
|
||||
operatorUid,
|
||||
pageNo,
|
||||
pageSize,
|
||||
startDate,
|
||||
recordType,
|
||||
searchStr,
|
||||
timezoneRawOffSet);
|
||||
return KeyOperationRecordEntity.fromJson(res.body);
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,3 +160,41 @@ class AddBottomWhiteBtn extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 边框按钮 公用组件
|
||||
* */
|
||||
|
||||
class OutLineBtn extends StatelessWidget {
|
||||
String? btnName;
|
||||
|
||||
Function()? onClick;
|
||||
|
||||
OutLineBtn({
|
||||
Key? key,
|
||||
required this.btnName,
|
||||
this.onClick,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: ScreenUtil().screenWidth - 40.w,
|
||||
height: 60.h,
|
||||
child: OutlinedButton(
|
||||
style: OutlinedButton.styleFrom(
|
||||
backgroundColor: Colors.white,
|
||||
side: BorderSide(width: 1, color: AppColors.mainColor)),
|
||||
onPressed: () {
|
||||
if (onClick != null) {
|
||||
onClick!();
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
btnName!,
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor, fontSize: ScreenUtil().setSp(24)),
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user