# Conflicts:
#	star_lock/lib/appRouters.dart
#	star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_page.dart
#	star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart
#	star_lock/lib/network/api_provider.dart
#	star_lock/lib/network/api_repository.dart
#	star_lock/lib/network/request_interceptor.dart
This commit is contained in:
魏少阳 2023-09-15 16:15:31 +08:00
commit dd69edd4e8
47 changed files with 2653 additions and 809 deletions

25
star_lock/.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,25 @@
{
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "star_lock",
"request": "launch",
"type": "dart"
},
{
"name": "star_lock (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "star_lock (release mode)",
"request": "launch",
"type": "dart",
"flutterMode": "release"
}
]
}

View File

@ -136,7 +136,7 @@
"lockEscalation":"锁升级",
"markedHouseState":"标记房态",
"unlockReminder":"开锁提醒",
"unlockQRCode":"开锁二维码",
"unlockQRCode":"微信二维码",
"lockNumber":"锁编号",
"electricQuantity":"电量",
"lockName":"名称",

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 122 KiB

View File

@ -1,15 +1,22 @@
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: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/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart';
import 'package:star_lock/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_page.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserList_page.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart';
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.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/authorizedAdministrator/administratorDetails/administratorDetails_page.dart';
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart';
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList_page.dart';
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockList_page.dart';
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList_Page.dart';
import 'package:star_lock/mine/mineSet/mineSet_page.dart';
import 'package:star_lock/mine/mineSet/transferGateway/selectGetewayList_page.dart';
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation_page.dart';
@ -301,6 +308,8 @@ abstract class Routers {
static const massSendLockGroupPage = '/massSendLockGroupPage'; //
static const massSendReceiverPage = '/massSendReceiverPage'; //
static const lockUserListPage = '/lockUserListPage'; //
static const administratorDetailsPage = '/administratorDetailsPage'; //
static const expireLockListPage = '/expireLockListPage'; //
}
abstract class AppRouters {
@ -706,7 +715,7 @@ abstract class AppRouters {
page: () => const AuthorizedAdministratorListPage()),
GetPage(
name: Routers.lockUserManageLisPage,
page: () => const LockUserManageListListPage()),
page: () => const LockUserManageListPage()),
GetPage(
name: Routers.lockGroupListPage, page: () => const LockGroupListPage()),
GetPage(
@ -753,7 +762,7 @@ abstract class AppRouters {
GetPage(
name: Routers.configuringWifiPage,
page: () => const ConfiguringWifiPage()),
GetPage(
GetPage(
name: Routers.massSendLockGroupPage,
page: () => const MassSendLockGroupListPage()),
GetPage(
@ -766,5 +775,13 @@ abstract class AppRouters {
GetPage(
name: Routers.checkingInStaffDetailPage, page: () => const CheckingInStaffDetailPage())
name: Routers.checkInCreatCompanyPage,
page: () => const CheckInCreatCompanyPage()),
GetPage(
name: Routers.administratorDetailsPage,
page: () => const AdministratorDetailsPage()),
GetPage(
name: Routers.expireLockListPage,
page: () => const ExpireLockListPage())
];
}

View File

@ -452,7 +452,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
value: _isAuthentication,
onChanged: (value) {
setState(() {
_isAuthentication = value;
_isAuthentication = !_isAuthentication;
});
},
);

View File

@ -1,8 +1,14 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.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:get/get.dart';
import 'package:star_lock/app_settings/app_colors.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 '../../../../tools/commonItem.dart';
@ -23,27 +29,71 @@ class VolumeAuthorizationLockPage extends StatefulWidget {
class _VolumeAuthorizationLockPageState
extends State<VolumeAuthorizationLockPage> {
final FlutterContactPicker _contactPicker = FlutterContactPicker();
final TextEditingController _emailOrPhoneController =
TextEditingController(); ///
final TextEditingController _keyNameController =
TextEditingController(); //
late Contact _contact;
late List _lockIdList;
late bool _isSendSuccess;
late bool _isCreateUser; //
late bool _isRemoteUnlock; //
var _selectEffectiveDate = ''; //
var _selectFailureDate = ''; //
late DateTime _effectiveDateTime;
late DateTime _failureDateTime;
String countryName = '中国';
String countryCode = '86';
@override
Widget build(BuildContext context) {
return indexChangeWidget();
return SingleChildScrollView(
child: indexChangeWidget(),
);
}
@override
void initState() {
// TODO: implement initState
super.initState();
_lockIdList = [];
_isRemoteUnlock = false;
_isSendSuccess = false;
_isCreateUser = false;
DateTime dateTime = DateTime.now();
_effectiveDateTime = dateTime;
_failureDateTime = dateTime;
_selectEffectiveDate =
'${dateTime.year}-${dateTime.month}-${dateTime.day} ${dateTime.hour}:${dateTime.minute}'; //
_selectFailureDate =
'${dateTime.year}-${dateTime.month}-${dateTime.day} ${dateTime.hour}:${dateTime.minute}'; //
}
Widget indexChangeWidget() {
switch (int.parse(widget.type)) {
case 0:
{
//
if (_isSendSuccess) {
return sendElectronicKeySucceed();
} else {
switch (int.parse(widget.type)) {
case 0:
{
//
return Column(
children: [
keyInfoWidget(),
remoteUnlockingWidget(),
SizedBox(
height: 30.h,
),
keyBottomWidget()
],
);
}
default:
//
return Column(
children: [
keyInfoWidget(),
keyTimeWidget(),
remoteUnlockingWidget(),
SizedBox(
height: 30.h,
@ -51,20 +101,7 @@ class _VolumeAuthorizationLockPageState
keyBottomWidget()
],
);
}
default:
//
return Column(
children: [
keyInfoWidget(),
keyTimeWidget(),
remoteUnlockingWidget(),
SizedBox(
height: 30.h,
),
keyBottomWidget()
],
);
}
}
}
@ -74,18 +111,43 @@ class _VolumeAuthorizationLockPageState
children: [
Container(height: 10.h),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.number!.tr,
leftTitel: TranslationLoader.lanKeys!.accountNumber!.tr,
rightTitle: "",
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: getTFWidget(
true, TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr)),
true,
TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
_emailOrPhoneController)),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
rightTitle: "",
isHaveLine: true,
isHaveRightWidget: true,
isHaveDirection: true,
rightWidget: Text(
'$countryName +$countryCode',
textAlign: TextAlign.end,
style:
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
),
action: () async {
var result = await Navigator.pushNamed(
context, Routers.seletCountryRegionPage);
result as Map<String, dynamic>;
countryCode = result['code'];
countryName = result['countryName'];
setState(() {});
},
),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.name!.tr,
rightTitle: "",
isHaveRightWidget: true,
rightWidget:
getTFWidget(false, TranslationLoader.lanKeys!.pleaseEnter!.tr)),
rightWidget: getTFWidget(
false,
TranslationLoader.lanKeys!.pleaseEnter!.tr,
_keyNameController)),
Container(height: 10.h),
],
);
@ -97,12 +159,33 @@ class _VolumeAuthorizationLockPageState
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
rightTitle: "2020.06.20 11:49",
isHaveLine: true),
rightTitle: _selectEffectiveDate,
isHaveLine: true,
isHaveDirection: true,
action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
onConfirm: (p) {
setState(() {
_selectEffectiveDate =
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
_effectiveDateTime = DateTime.parse(_selectEffectiveDate);
});
});
}),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
rightTitle: "2020.06.20 11:49",
),
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
rightTitle: _selectFailureDate,
isHaveDirection: true,
action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
onConfirm: (p) {
setState(() {
_selectFailureDate =
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
_failureDateTime = DateTime.parse(_selectFailureDate);
});
});
}),
Container(height: 10.h),
],
);
@ -114,9 +197,22 @@ class _VolumeAuthorizationLockPageState
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.lock!.tr,
rightTitle: TranslationLoader.lanKeys!.pleaseSelet!.tr,
rightTitle: _lockIdList.isEmpty
? TranslationLoader.lanKeys!.pleaseSelet!.tr
: _lockIdList.length.toString(),
isHaveDirection: true,
action: () {}),
action: () {
Navigator.pushNamed(context, Routers.massSendLockGroupPage)
.then((value) {
//ID列表
if (value != null) {
value as Map<String, dynamic>;
_lockIdList = value['selectLockIdList'];
setState(() {});
}
});
}),
Container(height: 10.h),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
@ -138,21 +234,23 @@ class _VolumeAuthorizationLockPageState
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {
// Navigator.pushNamed(context, Routers.nearbyLockPage);
addAuthorizedAdminRequest();
}),
],
);
}
//
Widget getTFWidget(bool isHaveBtn, String tfStr) {
return Container(
Widget getTFWidget(
bool isHaveBtn, String tfStr, TextEditingController editController) {
return SizedBox(
height: 50.h,
width: 300.w,
child: Row(
children: [
Expanded(
child: TextField(
controller: editController,
//
maxLines: 1,
// controller: _controller,
@ -198,18 +296,127 @@ class _VolumeAuthorizationLockPageState
);
}
//
Future<void> addAuthorizedAdminRequest() async {
String getFailureDateTime = '0';
String getEffectiveDateTime = '0';
if (widget.type == '1') {
getFailureDateTime = _failureDateTime.millisecondsSinceEpoch.toString();
getEffectiveDateTime =
_effectiveDateTime.millisecondsSinceEpoch.toString();
}
var entity = await ApiRepository.to.addAuthorizedAdmin(
_isCreateUser ? "1" : "0",
getFailureDateTime,
_isRemoteUnlock == true ? '1' : '2',
[],
_lockIdList,
_keyNameController.text,
getEffectiveDateTime,
_emailOrPhoneController.text,
countryCode,
'1',
);
if (entity.errorCode!.codeIsSuccessful) {
print('发送电子钥匙成功');
_isSendSuccess = true;
setState(() {});
} else {
Toast.show(msg: '${entity.errorMsg}');
if (entity.errorCode == 425) {
//
_isCreateUser = true;
}
}
}
//
Widget sendElectronicKeySucceed() {
return Column(
children: [
Container(
height: 250.h,
width: 1.sw,
color: Colors.white,
child: Column(
children: [
SizedBox(
height: 30.h,
),
Image.asset(
'images/icon_send_success.png',
width: 100.w,
height: 100.w,
),
SizedBox(
height: 20.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"发送成功",
style: TextStyle(
fontSize: 26.sp,
color: Colors.black,
fontWeight: FontWeight.w500),
),
],
),
],
),
),
SizedBox(
height: 20.h,
),
SubmitBtn(
btnName: '完成',
onClick: () {
_isSendSuccess = false;
Navigator.pop(context, true);
}),
SizedBox(
height: 10.h,
),
OutLineBtn(
btnName: '邮件通知',
onClick: () {
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
},
),
SizedBox(
height: 10.h,
),
OutLineBtn(
btnName: '微信通知',
onClick: () {},
),
SizedBox(
height: 10.h,
),
OutLineBtn(
btnName: '标记为已入住',
onClick: () {},
),
],
);
}
CupertinoSwitch _switch() {
bool _isOn = false;
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: _isOn,
value: _isRemoteUnlock,
onChanged: (value) {
setState(() {
_isOn = value;
_isRemoteUnlock = !_isRemoteUnlock;
});
},
);
}
String intToStr(int v) {
return (v < 10) ? "0$v" : "$v";
}
}

View File

@ -0,0 +1,117 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
import 'checkingInStaffList_logic.dart';
class CheckingInStaffListPage extends StatefulWidget {
const CheckingInStaffListPage({Key? key}) : super(key: key);
@override
State<CheckingInStaffListPage> createState() =>
_CheckingInStaffListPageState();
}
class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
final logic = Get.put(CheckingInStaffManageLogic());
final state = Get.find<CheckingInStaffManageLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.greyBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.staff!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
actionsList: [
GestureDetector(
onTap: () {
Navigator.pushNamed(context, Routers.checkingInAddStaffPage,
arguments: {
"getKeyInfosData": state.getKeyInfosData.value,
"companyId": state.companyId.value
});
},
child: Image.asset(
'images/icon_add_white.png',
width: 36.w,
height: 36.w,
)),
SizedBox(
width: 30.w,
),
],
),
body: Container(
color: Colors.white,
child: ListView.separated(
itemCount: 10,
itemBuilder: (c, index) {
return _checkingInStaffManageItem('images/icon_lock.png', "张三",
"2023.6.21 11.15", "2023.6.21 11.15", () {
// Navigator.pushNamed(context, Routers.electronicKeyDetailPage);
});
},
separatorBuilder: (context, index) {
return const Divider(
height: 1, indent: 20, color: AppColors.greyLineColor);
},
),
));
}
Widget _checkingInStaffManageItem(String lockTypeIcon, String lockTypeTitle,
String beginTime, String endTime, Function() action) {
return GestureDetector(
onTap: action,
child: Container(
height: 60.h,
margin:
EdgeInsets.only(left: 10.w, right: 10.w, top: 10.h, bottom: 10.h),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(10.w),
// ),
child: Row(
children: [
SizedBox(
width: 30.w,
),
Image.asset(
'images/controls_user.png',
width: 40.w,
height: 40.w,
),
// Container(
// width: 60.h,
// height: 60.h,
// decoration: BoxDecoration(
// color: AppColors.mainColor,
// border: Border.all(width: 1, color: AppColors.mainColor),
// borderRadius: BorderRadius.circular(30.h),
// ),
// padding: EdgeInsets.all(10.w),
// child: Image.asset(
// 'images/controls_user.png',
// width: 40.w,
// height: 40.w,
// color: Colors.white,
// )),
SizedBox(
width: 30.w,
),
Text(
lockTypeTitle,
style: TextStyle(fontSize: 24.sp),
),
],
),
),
);
}
}

View File

@ -1,7 +1,14 @@
import 'package:flutter/cupertino.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:get/get.dart';
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/toast.dart';
import '../../../../../tools/commonItem.dart';
import '../../../../../tools/submitBtn.dart';
@ -22,6 +29,18 @@ class MassSendElectronicKeyPage extends StatefulWidget {
class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
final FlutterContactPicker _contactPicker = FlutterContactPicker();
late Contact _contact;
var _selectEffectiveDate = ''; //
var _selectFailureDate = ''; //
late DateTime _effectiveDateTime;
late DateTime _failureDateTime;
late bool _isSendSuccess;
late bool _isRemote; //
List _receiverList = []; //
List _lockIdList = []; //ID列表
String countryName = '中国';
String countryCode = '86';
List weekdaysList = [];
bool _isCreateUser = false; //1 0
@override
Widget build(BuildContext context) {
@ -31,6 +50,16 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
@override
void initState() {
super.initState();
DateTime dateTime = DateTime.now();
_effectiveDateTime = dateTime;
_failureDateTime = dateTime;
_selectEffectiveDate =
'${dateTime.year}-${dateTime.month}-${dateTime.day} ${dateTime.hour}:${dateTime.minute}'; //
_selectFailureDate =
'${dateTime.year}-${dateTime.month}-${dateTime.day} ${dateTime.hour}:${dateTime.minute}'; //
_isSendSuccess = false;
_isRemote = false;
}
Widget indexChangeWidget() {
@ -75,6 +104,58 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
}
}
//
Future<void> MassKeyChecksRequest() async {
String getFailureDateTime = '0';
if (int.parse(widget.type) != 1) {
getFailureDateTime = _failureDateTime.millisecondsSinceEpoch.toString();
}
var entity =
await ApiRepository.to.canSendKey(getFailureDateTime, [], _lockIdList);
if (entity.errorCode!.codeIsSuccessful) {
for (int i = 0; i < _receiverList.length; i++) {
LockUserData data = _receiverList[i];
batchSendElectronicKeyRequest(data.userid ?? '');
}
} else {
Toast.show(msg: '检查失败');
}
}
//
Future<void> batchSendElectronicKeyRequest(String receiverUserID) async {
String getFailureDateTime = '0';
String getEffectiveDateTime = '0';
if (widget.type == '0') {
getFailureDateTime = _failureDateTime.millisecondsSinceEpoch.toString();
getEffectiveDateTime =
_effectiveDateTime.millisecondsSinceEpoch.toString();
}
var entity = await ApiRepository.to.batchSendKey(
getFailureDateTime,
[],
_lockIdList,
'1',
_isRemote ? '1' : '2',
receiverUserID,
receiverUserID,
getEffectiveDateTime,
countryCode,
'1',
weekdaysList);
if (entity.errorCode!.codeIsSuccessful) {
print('群发电子钥匙成功');
_isSendSuccess = true;
setState(() {});
} else {
Toast.show(msg: '${entity.errorMsg}');
if (entity.errorCode == 425) {
//
_isCreateUser = true;
}
}
}
// widget
Widget keyInfoWidget() {
return Column(
@ -82,18 +163,60 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
Container(height: 10.h),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
rightTitle: TranslationLoader.lanKeys!.pleaseAdd!.tr,
rightTitle: _receiverList.isEmpty
? TranslationLoader.lanKeys!.pleaseAdd!.tr
: _receiverList.length.toString(),
isHaveLine: true,
isHaveDirection: true,
action: () {
Navigator.pushNamed(context, Routers.massSendReceiverPage);
Navigator.pushNamed(context, Routers.massSendReceiverPage)
.then((value) {
if (value != null) {
value as Map<String, dynamic>;
_receiverList = value['lockUserList'];
setState(() {});
}
});
}),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
rightTitle: "",
isHaveLine: true,
isHaveRightWidget: true,
isHaveDirection: true,
rightWidget: Text(
'$countryName +$countryCode',
textAlign: TextAlign.end,
style:
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
),
action: () async {
var result = await Navigator.pushNamed(
context, Routers.seletCountryRegionPage);
result as Map<String, dynamic>;
countryCode = result['code'];
countryName = result['countryName'];
setState(() {});
},
),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.lock!.tr,
rightTitle: TranslationLoader.lanKeys!.pleaseSelet!.tr,
rightTitle: _lockIdList.isEmpty
? TranslationLoader.lanKeys!.pleaseSelet!.tr
: _lockIdList.length.toString(),
isHaveDirection: true,
action: () {
Navigator.pushNamed(context, Routers.massSendLockGroupPage);
Navigator.pushNamed(context, Routers.massSendLockGroupPage)
.then((value) {
//ID列表
if (value != null) {
value as Map<String, dynamic>;
_lockIdList = value['selectLockIdList'];
setState(() {});
}
});
}),
Container(height: 10.h),
],
@ -106,12 +229,33 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
rightTitle: "2020.06.20 11:49",
isHaveLine: true),
rightTitle: _selectEffectiveDate,
isHaveLine: true,
isHaveDirection: true,
action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
onConfirm: (p) {
setState(() {
_selectEffectiveDate =
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
_effectiveDateTime = DateTime.parse(_selectEffectiveDate);
});
});
}),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
rightTitle: "2020.06.20 11:49",
),
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
rightTitle: _selectFailureDate,
isHaveDirection: true,
action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
onConfirm: (p) {
setState(() {
_selectFailureDate =
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
_failureDateTime = DateTime.parse(_selectFailureDate);
});
});
}),
Container(height: 10.h),
],
);
@ -155,24 +299,27 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
SubmitBtn(
btnName: TranslationLoader.lanKeys!.send!.tr,
onClick: () {
// Navigator.pushNamed(context, Routers.nearbyLockPage);
MassKeyChecksRequest();
}),
],
);
}
CupertinoSwitch _switch() {
bool _isOn = false;
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: _isOn,
value: _isRemote,
onChanged: (value) {
setState(() {
_isOn = value;
_isRemote = !_isRemote;
});
},
);
}
String intToStr(int v) {
return (v < 10) ? "0$v" : "$v";
}
}

View File

@ -1,10 +1,8 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/utils.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserListEntity.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/submitBtn.dart';
@ -162,7 +160,7 @@ class _LockUserListPageState extends State<LockUserListPage> {
Row(
children: [
Text(
itemData.nickname!,
itemData.nickname ?? '',
style: TextStyle(
fontSize: 24.sp, color: AppColors.blackColor),
)
@ -173,7 +171,7 @@ class _LockUserListPageState extends State<LockUserListPage> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
itemData.userid!,
itemData.userid ?? '',
style: TextStyle(
fontSize: 18.sp,
color: AppColors.placeholderTextColor),

View File

@ -0,0 +1,85 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
typedef _CallBack = void Function(int selectIndex, String selectLockId);
class massSendLockGroupCell extends StatelessWidget {
final int currentIndex;
List lockListByGroup;
final _CallBack selectLockAction;
massSendLockGroupCell(int index,
{Key? key,
required this.currentIndex,
required this.lockListByGroup,
required this.selectLockAction})
: super(key: key);
@override
Widget build(BuildContext context) {
return ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: lockListByGroup.length,
itemBuilder: (_, itemIndex) {
LockListItem itemData = lockListByGroup[itemIndex];
return _itemBuilder(itemData, itemIndex);
},
separatorBuilder: (BuildContext context, int index) {
return const Divider(
height: 1,
color: AppColors.greyLineColor,
);
},
);
}
Widget _itemBuilder(LockListItem itemData, int itemIndex) {
return GestureDetector(
child: Container(
height: 60.h,
color: Colors.white,
width: ScreenUtil().screenWidth,
child: Row(
children: [
SizedBox(
width: 30.w,
),
Image.asset(
'images/mine/icon_mine_gatewaySignal_prompt.png',
width: 36.w,
height: 36.w,
),
SizedBox(
width: 10.w,
),
Text(
itemData.lockAlias!,
style: TextStyle(
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
),
Expanded(
child: SizedBox(
width: 20.w,
)),
Image.asset(
itemData.isChecked
? "images/icon_round_selet.png"
: "images/icon_round_unSelet.png",
width: 30.w,
height: 30.w,
),
SizedBox(
width: 30.w,
)
],
),
),
onTap: () {
selectLockAction(itemIndex, itemData.lockId.toString());
},
);
}
}

View File

@ -2,7 +2,7 @@ class MassSendLockGroupListEntity {
int? errorCode;
String? description;
String? errorMsg;
LockListData? data;
GroupListData? data;
MassSendLockGroupListEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
@ -11,7 +11,7 @@ class MassSendLockGroupListEntity {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null ? LockListData.fromJson(json['data']) : null;
data = json['data'] != null ? GroupListData.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
@ -26,15 +26,49 @@ class MassSendLockGroupListEntity {
}
}
class LockListData {
List<LockListItem>? lockList;
class GroupListData {
List<GroupListItem>? groupList;
LockListData({this.lockList});
GroupListData({this.groupList});
LockListData.fromJson(Map<String, dynamic> json) {
GroupListData.fromJson(Map<String, dynamic> json) {
if (json['list'] != null) {
lockList = <LockListItem>[];
groupList = <GroupListItem>[];
json['list'].forEach((v) {
groupList!.add(GroupListItem.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
if (groupList != null) {
data['list'] = groupList!.map((v) => v.toJson()).toList();
}
return data;
}
}
class GroupListItem {
int? lockNum;
int? keyGroupId;
String? keyGroupName;
List<LockListItem>? lockList;
bool _isChecked = false;
bool get isChecked => _isChecked ?? false;
set isChecked(bool value) => _isChecked = value;
GroupListItem(
{this.lockNum, this.keyGroupId, this.keyGroupName, this.lockList});
GroupListItem.fromJson(Map<String, dynamic> json) {
lockNum = json['lockNum'];
keyGroupId = json['keyGroupId'];
keyGroupName = json['keyGroupName'];
if (json['lockList'] != null) {
lockList = <LockListItem>[];
json['lockList'].forEach((v) {
lockList!.add(LockListItem.fromJson(v));
});
}
@ -42,8 +76,11 @@ class LockListData {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['lockNum'] = lockNum;
data['keyGroupId'] = keyGroupId;
data['keyGroupName'] = keyGroupName;
if (lockList != null) {
data['list'] = lockList!.map((v) => v.toJson()).toList();
data['lockList'] = lockList!.map((v) => v.toJson()).toList();
}
return data;
}
@ -52,9 +89,12 @@ class LockListData {
class LockListItem {
int? lockId;
String? lockAlias;
bool? isRefresh = false;
bool _isChecked = false;
bool get isChecked => _isChecked ?? false;
LockListItem({this.lockId, this.lockAlias, this.isRefresh});
set isChecked(bool value) => _isChecked = value;
LockListItem({this.lockId, this.lockAlias});
LockListItem.fromJson(Map<String, dynamic> json) {
lockId = json['lockId'];

View File

@ -2,11 +2,12 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/utils.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupCell.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/LockGroupListEntity.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/ExpandedListView.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/submitBtn.dart';
import 'package:star_lock/translations/trans_lib.dart';
class MassSendLockGroupListPage extends StatefulWidget {
@ -19,9 +20,10 @@ class MassSendLockGroupListPage extends StatefulWidget {
}
class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
List lockListByGroup = [];
List lockGroupList = [];
List clickIndexList = [];
List selectGroupIdList = [];
List selectLockIdList = [];
int clickIndex = -1;
@override
void initState() {
@ -66,6 +68,15 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
height: 10.h,
),
Expanded(child: _buildListView(context, lockGroupList)),
SubmitBtn(
btnName: '确定',
onClick: () {
print('得到lockid为$selectLockIdList ');
Map<String, dynamic> resultMap = {};
resultMap['selectLockIdList'] = selectLockIdList;
Navigator.pop(context, resultMap);
},
),
SizedBox(
height: 40.h,
)
@ -74,12 +85,13 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
}
//
Future<List<LockGroupItem>> mockNetworkDataRequest() async {
LockGroupListEntity entity = await ApiRepository.to.lockGroupList('1');
List<LockGroupItem> dataList = [];
Future<List<GroupListItem>> mockNetworkDataRequest() async {
MassSendLockGroupListEntity entity =
await ApiRepository.to.lockGroupList('1');
List<GroupListItem> dataList = [];
if (entity.errorCode!.codeIsSuccessful) {
if (entity.data != null) {
dataList = entity.data!.itemList!;
dataList = entity.data!.groupList!;
}
}
lockGroupList = dataList;
@ -87,27 +99,11 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
return dataList;
}
//
Future<List<LockListItem>> listLockByGroup(String groupId) async {
MassSendLockGroupListEntity entity =
await ApiRepository.to.listLockByGroup('3', groupId);
List<LockListItem> dataList = [];
if (entity.errorCode!.codeIsSuccessful) {
if (entity.data != null) {
dataList = entity.data!.lockList!;
}
}
lockListByGroup = dataList;
setState(() {});
return dataList;
}
Widget _buildListView(BuildContext context, List itemList) {
return ListView.separated(
itemCount: itemList.length,
itemBuilder: (context, index) {
LockGroupItem itemData = itemList[index];
GroupListItem itemData = itemList[index];
return _buildLockExpandedList(context, index, itemData);
},
shrinkWrap: true,
@ -120,73 +116,26 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
}
//
Widget _buildLockExpandedList(context, index, LockGroupItem itemData) {
Widget _buildLockExpandedList(context, index, GroupListItem itemData) {
List lockItemList = itemData.lockList ?? [];
return ExpandedListTile(
onTap: () {
listLockByGroup(itemData.keyGroupId.toString());
clickIndexList.add(index);
selectGroupIdList.add(index);
clickIndex = index;
},
title: itemData.keyGroupName!,
imgName: '',
typeImgList: const [],
child: ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: lockListByGroup.length,
itemBuilder: (_, itemIndex) {
LockListItem itemData = lockListByGroup[itemIndex];
return _buildNameWidget(context, itemIndex,
'images/icon_password.png', itemData.lockAlias);
},
separatorBuilder: (BuildContext context, int index) {
return const Divider(
height: 1,
color: AppColors.greyLineColor,
);
},
),
);
}
//
Widget _buildNameWidget(context, index, imageName, getName) {
return GestureDetector(
child: Container(
height: 60.h,
color: Colors.white,
width: ScreenUtil().screenWidth,
child: Row(
children: [
SizedBox(
width: 30.w,
),
Image.asset(
'images/mine/icon_mine_gatewaySignal_prompt.png',
width: 36.w,
height: 36.w,
),
SizedBox(
width: 10.w,
),
Text(
getName,
style: TextStyle(
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
),
SizedBox(
width: 30.w,
)
],
),
),
onTap: () {
// selectNameIndex = index;
// setState(() {
// if (selectNameIndex == index) {
// isNameSelect = !isNameSelect;
// }
// });
},
groupItem: itemData,
child: massSendLockGroupCell(index,
currentIndex: index, lockListByGroup: lockItemList,
selectLockAction: (selectIndex, selectLockId) {
LockListItem lockItem = lockItemList[selectIndex];
setState(() {
lockItem.isChecked = !lockItem.isChecked;
if (lockItem.isChecked) {
selectLockIdList.add(lockItem.lockId);
}
});
}),
);
}
}

View File

@ -0,0 +1,155 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_utils/get_utils.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
import 'package:star_lock/tools/commonItem.dart';
import 'package:star_lock/translations/trans_lib.dart';
class MassSendReceiverCell extends StatelessWidget {
final int currentIndex;
LockUserData userData;
final VoidCallback clickDeleteUser;
MassSendReceiverCell(int index,
{Key? key,
required this.currentIndex,
required this.userData,
required this.clickDeleteUser})
: super(key: key);
@override
Widget build(BuildContext context) {
TextEditingController emailOrPhoneController = TextEditingController();
TextEditingController keyNameController = TextEditingController();
return Container(
color: Colors.white,
child: Row(
children: [
GestureDetector(
child: SizedBox(
width: 40.w,
child: Row(
children: [
SizedBox(
width: 10.w,
),
Image.asset(
'images/icon_massSend_delete.png',
width: 26.w,
height: 26.w,
)
],
),
),
onTap: () {
clickDeleteUser();
// _lockUserList.removeAt(index - 1);
// setState(() {});
},
),
Expanded(
child: Column(
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
rightTitle: userData.userid ?? ' ',
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: getTFWidget(
true,
TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
1,
userData)),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.name!.tr,
rightTitle: userData.nickname ?? ' ',
isHaveRightWidget: true,
rightWidget: getTFWidget(
false,
TranslationLoader.lanKeys!.enterYourName!.tr,
2,
userData)),
],
))
],
),
);
}
TextEditingController _receiverController(String getStr) {
TextEditingController controller = TextEditingController(text: getStr);
controller.addListener(() {
print(controller.text);
});
return controller;
}
TextEditingController _nickNameController(String getStr) {
TextEditingController controller = TextEditingController(text: getStr);
controller.addListener(() {
print(controller.text);
});
return controller;
}
//
Widget getTFWidget(
bool isHaveBtn, String tfStr, int lineIndex, LockUserData userData) {
return SizedBox(
height: 50.h,
width: 380.w,
child: Row(
children: [
Expanded(
child: TextField(
controller: lineIndex == 1
? _receiverController(userData.userid ?? '')
: _nickNameController(userData.nickname ?? ''),
//
maxLines: 1,
autofocus: false,
textAlign: TextAlign.end,
decoration: InputDecoration(
//
contentPadding: const EdgeInsets.only(top: -12.0, bottom: 0.0),
hintText: tfStr,
hintStyle: TextStyle(fontSize: 22.sp),
//线
border: InputBorder.none,
),
),
),
SizedBox(
width: 10.w,
),
isHaveBtn
? Container(
width: 32.w,
height: 32.w,
decoration: const BoxDecoration(
color: Colors.white,
image: DecorationImage(
image: AssetImage('images/icon_addressBook.png'),
fit: BoxFit.fill),
),
alignment: Alignment.center,
child: InkWell(
onTap: () async {
// Contact? currentContact =
// await _contactPicker.selectContact();
// setState(() {
// _contact = currentContact!;
// // print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}");
// });
},
),
)
: Container()
],
),
);
}
}

View File

@ -3,7 +3,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/utils.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserListEntity.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiverCell.dart';
import 'package:star_lock/tools/commonItem.dart';
import 'package:star_lock/translations/trans_lib.dart';
@ -38,7 +39,7 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
appBar: AppBar(
backgroundColor: AppColors.mainColor,
title: Text(
'接收者',
TranslationLoader.lanKeys!.receiver!.tr,
style: TextStyle(
color: Colors.white,
fontSize: 28.sp,
@ -49,6 +50,19 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
icon: const Icon(Icons.arrow_back_ios, color: Colors.white),
onPressed: () => Navigator.of(context).pop(),
),
actions: [
TextButton(
child: Text(
TranslationLoader.lanKeys!.save!.tr,
style: TextStyle(color: Colors.white, fontSize: 24.sp),
),
onPressed: () {
Map<String, dynamic> resultMap = {};
resultMap['lockUserList'] = _lockUserList;
Navigator.pop(context, resultMap);
},
),
],
),
body: Column(
children: [
@ -83,6 +97,9 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
child: ListView.separated(
itemBuilder: (BuildContext context, int index) {
LockUserData data = _lockUserList[index];
emailOrPhoneController.text = data.userid ?? '';
keyNameController.text = data.nickname ?? '';
return _itemBuilder(index, data);
},
itemCount: _lockUserList.length,
@ -149,110 +166,14 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
}
Widget _itemBuilder(int index, LockUserData userData) {
return Container(
color: Colors.white,
child: Row(
children: [
GestureDetector(
child: SizedBox(
width: 40.w,
child: Row(
children: [
SizedBox(
width: 10.w,
),
Image.asset(
'images/icon_massSend_delete.png',
width: 26.w,
height: 26.w,
)
],
),
),
onTap: () {
_lockUserList.removeAt(index - 1);
setState(() {});
},
),
Expanded(
child: Column(
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
rightTitle: userData.userid ?? ' ',
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: getTFWidget(
true,
TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
1)),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.name!.tr,
rightTitle: userData.nickname ?? ' ',
isHaveRightWidget: true,
rightWidget: getTFWidget(
false, TranslationLoader.lanKeys!.enterYourName!.tr, 2)),
],
))
],
),
);
}
//
Widget getTFWidget(bool isHaveBtn, String tfStr, int lineIndex) {
return SizedBox(
height: 50.h,
width: 320.w,
child: Row(
children: [
Expanded(
child: TextField(
controller:
lineIndex == 1 ? emailOrPhoneController : keyNameController,
//
maxLines: 1,
// 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,
),
),
),
SizedBox(
width: 10.w,
),
isHaveBtn
? Container(
width: 32.w,
height: 32.w,
decoration: const BoxDecoration(
color: Colors.white,
image: DecorationImage(
image: AssetImage('images/icon_addressBook.png'),
fit: BoxFit.fill),
),
alignment: Alignment.center,
child: InkWell(
onTap: () async {
// Contact? currentContact =
// await _contactPicker.selectContact();
// setState(() {
// _contact = currentContact!;
// // print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}");
// });
},
),
)
: Container()
],
),
return MassSendReceiverCell(
index,
currentIndex: index,
userData: userData,
clickDeleteUser: () {
_lockUserList.removeAt(index - 1);
setState(() {});
},
);
}
}

View File

@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_utils/get_utils.dart';
import 'package:star_lock/translations/trans_lib.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/commonItem.dart';
@ -30,7 +32,7 @@ class _SendEmailNotificationPageState extends State<SendEmailNotificationPage> {
body: Column(
children: [
CommonItem(
leftTitel: "接收者",
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
rightTitle: "786612630@qq.com",
isHaveLine: true,
),

View File

@ -128,12 +128,21 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
leftTitel: TranslationLoader
.lanKeys!.adminOpenLockPassword!.tr,
rightTitle: "",
isHaveLine: false,
isHaveLine: true,
isHaveDirection: true,
action: () {
Navigator.pushNamed(context,
Routers.adminOpenLockPasswordPage);
}),
CommonItem(
leftTitel:
TranslationLoader.lanKeys!.unlockQRCode!.tr,
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.unlockQRCodePage);
}),
],
),
),

View File

@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/basicInformation/KeyDetailEntity.dart';
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/LockGroupListEntity.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/showTFView.dart';
@ -38,10 +38,10 @@ class _LockSeletGroupingPageState extends State<LockSeletGroupingPage> {
barTitle: TranslationLoader.lanKeys!.selectGroup!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: FutureBuilder<List<LockGroupItem>>(
body: FutureBuilder<List<GroupListItem>>(
future: mockNetworkDataRequest(),
builder: (BuildContext context,
AsyncSnapshot<List<LockGroupItem>> snapshot) {
AsyncSnapshot<List<GroupListItem>> snapshot) {
//
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasError) {
@ -49,7 +49,7 @@ class _LockSeletGroupingPageState extends State<LockSeletGroupingPage> {
return const Text('请求失败');
} else {
//
final List<LockGroupItem> itemData = snapshot.data!;
final List<GroupListItem> itemData = snapshot.data!;
return Column(
children: [
@ -82,7 +82,7 @@ class _LockSeletGroupingPageState extends State<LockSeletGroupingPage> {
return ListView.builder(
itemCount: itemList.length,
itemBuilder: (c, index) {
LockGroupItem itemData = itemList[index];
GroupListItem itemData = itemList[index];
return CommonItem(
leftTitel: itemData.keyGroupName,
rightTitle: "",
@ -107,7 +107,7 @@ class _LockSeletGroupingPageState extends State<LockSeletGroupingPage> {
//
Future<void> addLockGroupRequest() async {
LockGroupListEntity entity =
MassSendLockGroupListEntity entity =
await ApiRepository.to.addLockGroup(_changeNameController.text, '0');
if (entity.errorCode!.codeIsSuccessful) {
Toast.show(msg: "创建成功");
@ -117,8 +117,8 @@ class _LockSeletGroupingPageState extends State<LockSeletGroupingPage> {
}
//
Future<void> setLockGroupRequest(LockGroupItem itemData) async {
LockGroupListEntity entity = await ApiRepository.to.setLockGroup(
Future<void> setLockGroupRequest(GroupListItem itemData) async {
MassSendLockGroupListEntity entity = await ApiRepository.to.setLockGroup(
_lockData.lockId.toString(), itemData.keyGroupId.toString());
if (entity.errorCode!.codeIsSuccessful) {
Toast.show(msg: "设置锁分组成功");
@ -127,13 +127,14 @@ class _LockSeletGroupingPageState extends State<LockSeletGroupingPage> {
}
//
Future<List<LockGroupItem>> mockNetworkDataRequest() async {
LockGroupListEntity entity = await ApiRepository.to.lockGroupList('1');
Future<List<GroupListItem>> mockNetworkDataRequest() async {
MassSendLockGroupListEntity entity =
await ApiRepository.to.lockGroupList('1');
if (entity.errorCode!.codeIsSuccessful) {
if (entity.data != null) {
return entity.data!.itemList!;
return entity.data!.groupList!;
} else {
List<LockGroupItem> dataList = [];
List<GroupListItem> dataList = [];
return dataList;
}
} else {

View File

@ -1,4 +1,3 @@
import 'dart:async';
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
@ -21,73 +20,76 @@ import 'CheckingInInfoDataEntity.dart';
import 'lockSet_state.dart';
typedef BlockSetStateCallback = void Function();
typedef BlockSetCheckInCallback = void Function(CheckingInInfoDataEntity checkingInInfoDataEntity);
typedef BlockSetCheckInCallback = void Function(
CheckingInInfoDataEntity checkingInInfoDataEntity);
class LockSetLogic extends BaseGetXController{
class LockSetLogic extends BaseGetXController {
final LockSetState state = LockSetState();
//
void deletLockInfoData() async{
void deletLockInfoData() async {
var entity = await ApiRepository.to.deletLockData(
lockId:state.getKeyInfosData.value.lockId.toString(),
lockId: state.getKeyInfosData.value.lockId.toString(),
);
if(entity.errorCode!.codeIsSuccessful){
if (entity.errorCode!.codeIsSuccessful) {
Get.offAllNamed(Routers.starLockMain);
}
}
//
void openCheckingInData(BlockSetCheckInCallback blockSetCheckInCallback) async{
void openCheckingInData(
BlockSetCheckInCallback blockSetCheckInCallback) async {
var entity = await ApiRepository.to.openCheckingInData(
lockId:state.getKeyInfosData.value.lockId.toString(),
lockId: state.getKeyInfosData.value.lockId.toString(),
);
if(entity.errorCode!.codeIsSuccessful){
if (entity.errorCode!.codeIsSuccessful) {
blockSetCheckInCallback(entity);
}
}
//
void setLockSetGeneralSetting(String isOn) async{
void setLockSetGeneralSetting(String isOn) async {
var entity = await ApiRepository.to.setLockSetGeneralSettingData(
lockId: state.getKeyInfosData.value.lockId.toString(),
changeType:"1",
isOn:isOn,
type:"1",
changeType: "1",
isOn: isOn,
type: "1",
);
if(entity.errorCode!.codeIsSuccessful){
if (entity.errorCode!.codeIsSuccessful) {
eventBus.fire(RefreshLockListInfoDataEvent());
state.getKeyInfosData.value.isAttendance = int.parse(isOn);
eventBus.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
eventBus
.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
Toast.show(msg: "设置成功");
}else{
}
} else {}
}
//
void setLockPickingReminder() async{
void setLockPickingReminder() async {
var entity = await ApiRepository.to.setLockPickingReminderData(
lockId: state.getKeyInfosData.value.lockId.toString(),
keyId:state.getKeyInfosData.value.keyId.toString(),
monitorFlag:state.isLockPickingReminder.value == 1 ? "1" : "2", // 12
keyId: state.getKeyInfosData.value.keyId.toString(),
monitorFlag:
state.isLockPickingReminder.value == 1 ? "1" : "2", // 12
);
if(entity.errorCode!.codeIsSuccessful){
if (entity.errorCode!.codeIsSuccessful) {
eventBus.fire(RefreshLockListInfoDataEvent());
state.getKeyInfosData.value.monitorFlag = state.isLockPickingReminder.value;
eventBus.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
state.getKeyInfosData.value.monitorFlag =
state.isLockPickingReminder.value;
eventBus
.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
Toast.show(msg: "设置成功");
}else{
}
} else {}
}
//
StreamSubscription? _passCurrentLockInformationEvent;
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
// eventBus
_passCurrentLockInformationEvent = eventBus.on<PassCurrentLockInformationEvent>().listen((event) {
_passCurrentLockInformationEvent =
eventBus.on<PassCurrentLockInformationEvent>().listen((event) {
state.getKeyInfosData.value = event.keyInfo;
blockSetStateCallback();
});
@ -96,8 +98,9 @@ class LockSetLogic extends BaseGetXController{
//
late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() {
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
if(reply is DeletUserReply) {
_replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
if (reply is DeletUserReply) {
var tokenData = reply.data.sublist(2, 6);
var saveStrList = changeIntListToStringList(tokenData);
print("openDoorToken:$tokenData");
@ -105,45 +108,46 @@ class LockSetLogic extends BaseGetXController{
int status = reply.data[6];
print("status:$status");
switch(status){
switch (status) {
case 0x00:
//
//
print("${reply.commandType}解析成功");
deletLockInfoData();
break;
case 0x06:
//
//
print("${reply.commandType}需要鉴权");
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!);
IoSenderManage.deletUser(
lockID:state.getKeyInfosData.value.bluetooth!.bluetoothDeviceName,
authUserID:await Storage.getUid(),
keyID:"1",
delUserID:await Storage.getUid(),
needAuthor:1,
publicKey:publicKeyDataList,
privateKey:getPrivateKeyList,
token: tokenData
);
lockID:
state.getKeyInfosData.value.bluetooth!.bluetoothDeviceName,
authUserID: await Storage.getUid(),
keyID: "1",
delUserID: await Storage.getUid(),
needAuthor: 1,
publicKey: publicKeyDataList,
privateKey: getPrivateKeyList,
token: tokenData);
break;
case 0x07:
//
//
print("${reply.commandType}用户无权限");
break;
case 0x09:
//
//
print("${reply.commandType}权限校验错误");
break;
default:
//
//
print("${reply.commandType}失败");
break;
@ -154,8 +158,10 @@ class LockSetLogic extends BaseGetXController{
//
Future<void> deletUserAction() async {
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
if (connectionState == DeviceConnectionState.connected){
BlueManage().judgeReconnect(
BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName,
(DeviceConnectionState connectionState) async {
if (connectionState == DeviceConnectionState.connected) {
var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
@ -165,17 +171,17 @@ class LockSetLogic extends BaseGetXController{
var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!);
print("openDoorTokenPubToken:$getTokenList");
print("state.getKeyInfosData.value.bluetooth!.bluetoothDeviceName:${state.getKeyInfosData.value.bluetooth!.bluetoothDeviceName}");
print(
"state.getKeyInfosData.value.bluetooth!.bluetoothDeviceName:${state.getKeyInfosData.value.bluetooth!.bluetoothDeviceName}");
IoSenderManage.deletUser(
lockID:state.getKeyInfosData.value.bluetooth!.bluetoothDeviceName,
authUserID:"100001",
keyID:"1",
delUserID:"100001",
needAuthor:1,
publicKey:publicKeyDataList,
privateKey:getPrivateKeyList,
token: getTokenList
);
lockID: state.getKeyInfosData.value.bluetooth!.bluetoothDeviceName,
authUserID: "100001",
keyID: "1",
delUserID: "100001",
needAuthor: 1,
publicKey: publicKeyDataList,
privateKey: getPrivateKeyList,
token: getTokenList);
}
});
}
@ -194,8 +200,6 @@ class LockSetLogic extends BaseGetXController{
// TODO: implement onInit
super.onInit();
print("onInit()");
}
@override
@ -204,5 +208,4 @@ class LockSetLogic extends BaseGetXController{
_replySubscription.cancel();
_passCurrentLockInformationEvent!.cancel();
}
}
}

View File

@ -67,57 +67,43 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
height: 10.h,
),
CommonItem(
leftTitel:
TranslationLoader.lanKeys!.wirelessKeyboard!.tr,
leftTitel: TranslationLoader.lanKeys!.doorMagnetic!.tr,
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
// Get.toNamed(Routers.wirelessKeyboardPage);
Toast.show(msg: "功能暂未开放");
Get.toNamed(Routers.doorMagneticPage);
// Toast.show(msg: "功能暂未开放");
}),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.doorMagnetic!.tr,
leftTitel:
TranslationLoader.lanKeys!.wirelessKeyboard!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
// Get.toNamed(Routers.doorMagneticPage);
Toast.show(msg: "功能暂未开放");
Get.toNamed(Routers.wirelessKeyboardPage);
// Toast.show(msg: "功能暂未开放");
}),
SizedBox(
height: 10.h,
),
Obx(()=> CommonItem(
leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr,
rightTitle: state.getKeyInfosData.value.remoteEnable == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.remoteUnlockingPage, arguments: state.getKeyInfosData.value);
})),
Obx(() => CommonItem(
leftTitel:
TranslationLoader.lanKeys!.automaticBlocking!.tr,
rightTitle: state.getKeyInfosData.value.autoLockTime! > -1 ? "${state.getKeyInfosData.value.autoLockTime!.toString()}s" : TranslationLoader.lanKeys!.closed!.tr,
TranslationLoader.lanKeys!.automaticBlocking!.tr,
rightTitle: state.getKeyInfosData.value.autoLockTime! > -1
? "${state.getKeyInfosData.value.autoLockTime!.toString()}s"
: TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.automaticBlockingPage, arguments: state.getKeyInfosData.value);
Get.toNamed(Routers.automaticBlockingPage,
arguments: state.getKeyInfosData.value);
})),
Obx(() => CommonItem(
leftTitel:
TranslationLoader.lanKeys!.normallyOpenMode!.tr,
rightTitle: state.getKeyInfosData.value.passageMode == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.normallyOpenModePage, arguments: state.getKeyInfosData.value);
}),),
Obx(() {
var titleStr = "";
if(state.getKeyInfosData.value.lockSound == 1){
switch(state.getKeyInfosData.value.volume){
if (state.getKeyInfosData.value.lockSound == 1) {
switch (state.getKeyInfosData.value.volume) {
case 1:
titleStr = TranslationLoader.lanKeys!.low!.tr;
break;
@ -134,7 +120,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
titleStr = TranslationLoader.lanKeys!.higher!.tr;
break;
}
}else{
} else {
titleStr = TranslationLoader.lanKeys!.closed!.tr;
}
return CommonItem(
@ -143,51 +129,115 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.lockSoundSetPage, arguments: state.getKeyInfosData.value);
Get.toNamed(Routers.lockSoundSetPage,
arguments: state.getKeyInfosData.value);
});
}),
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.burglarAlarm!.tr,
rightTitle: state.getKeyInfosData.value.tamperAlert == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr,
rightTitle: state.getKeyInfosData.value.tamperAlert == 1
? TranslationLoader.lanKeys!.opened!.tr
: TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.burglarAlarmPage, arguments: state.getKeyInfosData.value);
Get.toNamed(Routers.burglarAlarmPage,
arguments: state.getKeyInfosData.value);
})),
SizedBox(
height: 10.h,
),
Obx(
() => CommonItem(
leftTitel:
TranslationLoader.lanKeys!.normallyOpenMode!.tr,
rightTitle: state.getKeyInfosData.value.passageMode == 1
? TranslationLoader.lanKeys!.opened!.tr
: TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.normallyOpenModePage,
arguments: state.getKeyInfosData.value);
}),
),
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr,
rightTitle: state.getKeyInfosData.value.remoteEnable == 1
? TranslationLoader.lanKeys!.opened!.tr
: TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.remoteUnlockingPage,
arguments: state.getKeyInfosData.value);
})),
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.resetButton!.tr,
rightTitle: state.getKeyInfosData.value.resetButton == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr,
rightTitle: state.getKeyInfosData.value.resetButton == 1
? TranslationLoader.lanKeys!.opened!.tr
: TranslationLoader.lanKeys!.closed!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.resetButtonPage, arguments: state.getKeyInfosData.value);
Get.toNamed(Routers.resetButtonPage,
arguments: state.getKeyInfosData.value);
})),
SizedBox(
height: 10.h,
),
Obx(() {
var title = "";
if (state.getKeyInfosData.value.roomStatus == 1) {
title = TranslationLoader.lanKeys!.checkedIn!.tr;
} else if (state.getKeyInfosData.value.roomStatus == 2) {
title = TranslationLoader.lanKeys!.leisure!.tr;
}
return CommonItem(
leftTitel:
TranslationLoader.lanKeys!.markedHouseState!.tr,
rightTitle: title,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.markedHouseStatePage,
arguments: state.getKeyInfosData.value);
});
}),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.unlockQRCode!.tr,
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.unlockQRCodePage);
}),
isHaveRightWidget: true,
rightWidget:
SizedBox(width: 60.w, child: _openCheckInSwitch())),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.wifiDistributionNetwork!.tr,
leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr,
rightTitle: "",
isHaveLine: false,
isHaveRightWidget: true,
rightWidget:
SizedBox(width: 60.w, child: _lockRemindSwitch())),
SizedBox(
height: 10.h,
),
CommonItem(
leftTitel: TranslationLoader
.lanKeys!.wifiDistributionNetwork!.tr,
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.configuringWifiPage);
}),
SizedBox(
height: 10.h,
),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.lockTime!.tr,
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.lockTimePage, arguments: state.getKeyInfosData.value);
Get.toNamed(Routers.lockTimePage,
arguments: state.getKeyInfosData.value);
}),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.diagnose!.tr,
@ -195,7 +245,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.diagnosePage, arguments: state.getKeyInfosData.value);
Get.toNamed(Routers.diagnosePage,
arguments: state.getKeyInfosData.value);
}),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.uploadData!.tr,
@ -222,57 +273,6 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
action: () {
Get.toNamed(Routers.lockEscalationPage);
}),
SizedBox(
height: 10.h,
),
CommonItem(
leftTitel: "Amazon Alexa",
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Toast.show(msg: "功能暂未开放");
}),
CommonItem(
leftTitel: "Google Home",
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
Toast.show(msg: "功能暂未开放");
}),
SizedBox(
height: 10.h,
),
Obx((){
var title = "";
if(state.getKeyInfosData.value.roomStatus == 1){
title = TranslationLoader.lanKeys!.checkedIn!.tr;
}else if(state.getKeyInfosData.value.roomStatus == 2){
title = TranslationLoader.lanKeys!.leisure!.tr;
}
return CommonItem(
leftTitel:
TranslationLoader.lanKeys!.markedHouseState!.tr,
rightTitle: title,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.markedHouseStatePage, arguments: state.getKeyInfosData.value);
});
}),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
rightTitle: "",
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: SizedBox(width: 60.w, child: _openCheckInSwitch())),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr,
rightTitle: "",
isHaveLine: false,
isHaveRightWidget: true,
rightWidget: SizedBox(width: 60.w, child: _lockRemindSwitch())),
SizedBox(
height: 30.h,
),
@ -302,16 +302,16 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
onChanged: (value) {
setState(() {
int isOnStr;
if(value == true){
if (value == true) {
isOnStr = 1;
}else{
} else {
isOnStr = 2;
}
logic.openCheckingInData((checkingInInfoDataEntity){
if(checkingInInfoDataEntity.data!.companyId == 0){
logic.openCheckingInData((checkingInInfoDataEntity) {
if (checkingInInfoDataEntity.data!.companyId == 0) {
showCupertinoAlertDialog(context);
}else{
} else {
logic.setLockSetGeneralSetting(isOnStr.toString());
}
});
@ -328,7 +328,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
value: state.isLockPickingReminder.value == 1 ? true : false,
onChanged: (value) {
setState(() {
state.isLockPickingReminder.value = state.isLockPickingReminder.value == 1 ? 2 : 1;
state.isLockPickingReminder.value =
state.isLockPickingReminder.value == 1 ? 2 : 1;
logic.setLockPickingReminder();
});
},
@ -336,8 +337,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
}
void showCupertinoAlertDialog(
BuildContext context,
) {
BuildContext context,
) {
showDialog(
context: context,
builder: (BuildContext context) {
@ -347,7 +348,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
sureClick: () {
//
Navigator.pop(context);
Get.toNamed(Routers.checkInCreatCompanyPage, arguments: state.getKeyInfosData.value);
Get.toNamed(Routers.checkInCreatCompanyPage,
arguments: state.getKeyInfosData.value);
},
cancelClick: () {
Navigator.pop(context);
@ -361,6 +363,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
void didChangeDependencies() {
// TODO: implement didChangeDependencies
super.didChangeDependencies();
///
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
}
@ -396,5 +399,4 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
void didPushNext() {
print("lockSet===didPushNext");
}
}

View File

@ -21,7 +21,7 @@ class _UnlockQRCodePageState extends State<UnlockQRCodePage> {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.burglarAlarm!.tr,
barTitle: TranslationLoader.lanKeys!.unlockQRCode!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: Column(

View File

@ -30,7 +30,7 @@ class LockDetailPage extends StatefulWidget {
State<LockDetailPage> createState() => _LockDetailPageState();
}
class _LockDetailPageState extends State<LockDetailPage> with RouteAware{
class _LockDetailPageState extends State<LockDetailPage> with RouteAware {
final logic = Get.put(LockDetailLogic());
final state = Get.find<LockDetailLogic>().state;
@ -57,7 +57,8 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware{
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
// signKey
List<int> signKeyData = state.keyInfos.value.bluetooth!.signKey!.cast<int>();
List<int> signKeyData =
state.keyInfos.value.bluetooth!.signKey!.cast<int>();
var saveSignKeyList = changeIntListToStringList(signKeyData);
Storage.setStringList(saveBlueSignKey, saveSignKeyList);
// print("publicKeyData:$publicKeyData saveStrList:$saveStrList privateKeyData:$privateKeyData savePrivateKeyList:$savePrivateKeyList");
@ -130,7 +131,8 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware{
width: 268.w, height: 268.w),
)),
Visibility(
visible: state.keyInfos.value.remoteEnable == 1 ? true: false,
visible:
state.keyInfos.value.remoteEnable == 1 ? true : false,
child: Align(
alignment: const Alignment(0.6, 1),
child: Image.asset(
@ -175,31 +177,32 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware{
// color: Colors.blue,
child: SizedBox(
child: GridView.count(
crossAxisCount: 4,
// childAspectRatio: 3,
crossAxisSpacing: 20.w,
mainAxisSpacing: 0.h,
physics: const NeverScrollableScrollPhysics(),
children: getShowWidget()
),
crossAxisCount: 4,
// childAspectRatio: 3,
crossAxisSpacing: 20.w,
mainAxisSpacing: 0.h,
physics: const NeverScrollableScrollPhysics(),
children: getShowWidget()),
),
);
}
List<Widget> getShowWidget(){
List<Widget> getShowWidget() {
var showWidgetArr = <Widget>[];
//
if(state.keyInfos.value.isAttendance == 1){
if (state.keyInfos.value.isAttendance == 1) {
showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png',
TranslationLoader.lanKeys!.checkingIn!.tr, () {
Get.toNamed(Routers.checkingInListPage, arguments: state.keyInfos.value);
}));
Get.toNamed(Routers.checkingInListPage,
arguments: state.keyInfos.value);
}));
}
var defaultWidgetArr = [
//
bottomItem('images/main/icon_main_electronicKey.png', TranslationLoader.lanKeys!.electronicKey!.tr, () {
bottomItem('images/main/icon_main_electronicKey.png',
TranslationLoader.lanKeys!.electronicKey!.tr, () {
Get.toNamed(Routers.electronicKeyListPage, arguments: {
"lockMainEntity": widget.lockMainEntity,
"keyInfo": widget.keyInfo
@ -207,13 +210,13 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware{
}),
//
bottomItem('images/main/icon_main_password.png', TranslationLoader.lanKeys!.password!.tr, () {
Get.toNamed(Routers.passwordKeyListPage,
arguments: {
"lockMainEntity": widget.lockMainEntity,
"keyInfo": widget.keyInfo
});
}),
bottomItem('images/main/icon_main_password.png',
TranslationLoader.lanKeys!.password!.tr, () {
Get.toNamed(Routers.passwordKeyListPage, arguments: {
"lockMainEntity": widget.lockMainEntity,
"keyInfo": widget.keyInfo
});
}),
// ic卡
bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, () {
@ -237,42 +240,49 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware{
"lockId": widget.keyInfo.lockId,
"fromType": 2
});
}),
];
showWidgetArr.addAll(defaultWidgetArr);
//->
showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', '人脸', () {
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
// arguments: 1);
}),);
showWidgetArr.add(
bottomItem('images/main/icon_face.png', '人脸', () {
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
// arguments: 1);
}),
);
//->
showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', '监控', () {
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
// arguments: 1);
}),);
showWidgetArr.add(
bottomItem('images/main/icon_catEyes.png', '监控', () {
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
// arguments: 1);
}),
);
var endWiddget = [
//
bottomItem('images/main/icon_main_authorizedAdmin.png', TranslationLoader.lanKeys!.authorizedAdmin!.tr, () {
Get.toNamed(Routers.authorizedAdminListPage, arguments: {
"lockMainEntity": widget.lockMainEntity,
"keyInfo": widget.keyInfo
});
}),
bottomItem('images/main/icon_main_authorizedAdmin.png',
TranslationLoader.lanKeys!.authorizedAdmin!.tr, () {
Get.toNamed(Routers.authorizedAdminListPage, arguments: {
"lockMainEntity": widget.lockMainEntity,
"keyInfo": widget.keyInfo
});
}),
//
bottomItem('images/main/icon_main_operatingRecord.png', TranslationLoader.lanKeys!.operatingRecord!.tr, () {
Get.toNamed(Routers.lockOperatingRecordPage,
arguments: {
"lockMainEntity": widget.lockMainEntity,
"keyInfo": widget.keyInfo
});
}),
bottomItem('images/main/icon_main_operatingRecord.png',
TranslationLoader.lanKeys!.operatingRecord!.tr, () {
Get.toNamed(Routers.lockOperatingRecordPage, arguments: {
"lockMainEntity": widget.lockMainEntity,
"keyInfo": widget.keyInfo
});
}),
//
bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, () {
Get.toNamed(Routers.lockSetPage, arguments: widget.keyInfo);
}),
bottomItem(
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr,
() {
Get.toNamed(Routers.lockSetPage, arguments: widget.keyInfo);
}),
];
showWidgetArr.addAll(endWiddget);
return showWidgetArr;
@ -310,6 +320,7 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware{
void didChangeDependencies() {
// TODO: implement didChangeDependencies
super.didChangeDependencies();
///
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
}
@ -324,26 +335,17 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware{
///
@override
void didPush() {
}
void didPush() {}
/// Called when the current route has been popped off.
@override
void didPop() {
}
void didPop() {}
/// Called when the current route has been popped off.
@override
void didPopNext() {
}
void didPopNext() {}
/// Called when the current route has been popped off.
@override
void didPushNext() {
}
void didPushNext() {}
}

View File

@ -86,8 +86,8 @@ class _PasswordKeyManageTabbarPageState
Tab _tab(ItemView item) {
return Tab(
// text: item.title,
child: Container(
width: 1.sw / 8,
child: SizedBox(
width: item.title.length > 2 ? 1.sw / 8 : 1.sw / 12,
// margin: EdgeInsets.all(10.w),
// color: Colors.red,
child: Text(

View File

@ -41,7 +41,7 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
TranslationLoader.lanKeys!.doorLock!.tr, () {
Navigator.pushNamed(context, Routers.addLockPage);
}),
lockTypeItem('images/lockType/lockType_doorLock.png',
lockTypeItem('images/lockType/lockType_NFCLock.png',
TranslationLoader.lanKeys!.NFCPassiveLock!.tr, () {
Navigator.pushNamed(context, Routers.addLockPage);
}),
@ -57,8 +57,7 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
TranslationLoader.lanKeys!.parkingLock!.tr, () {
Navigator.pushNamed(context, Routers.addLockPage);
}),
lockTypeItem(
'images/lockType/lockType_intelligentLockCore.png',
lockTypeItem('images/lockType/lockType_entranceGuardLock.png',
TranslationLoader.lanKeys!.itelligentAccessControl!.tr,
() {
Navigator.pushNamed(context, Routers.addLockPage);
@ -68,7 +67,7 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
// TranslationLoader.lanKeys!.bicycleLock!.tr, () {
// Navigator.pushNamed(context, Routers.addLockPage);
// }),
lockTypeItem('images/lockType/lockType_remoteControl.png',
lockTypeItem('images/lockType/lockType_gatewayLock.png',
TranslationLoader.lanKeys!.gateway!.tr, () {
Navigator.pushNamed(context, Routers.gatewayListPage);
}),
@ -138,8 +137,8 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
SizedBox(width: 30.w),
Image.asset(
lockTypeIcon,
width: 32.w,
height: 48.w,
width: 48.w,
height: 60.w,
),
SizedBox(width: 20.w),
Expanded(

View File

@ -17,32 +17,62 @@ class MineMultiLanguagePage extends StatefulWidget {
}
class _MineMultiLanguagePageState extends State<MineMultiLanguagePage> {
final logic = Get.put(MineMultiLanguageLogic());
final state = Get.find<MineMultiLanguageLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.multilingual!.tr, haveBack:true, backgroundColor: AppColors.mainColor),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: _children(),
)
);
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.multilingual!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: _children(),
));
}
List<Widget> _children(){
List<Widget> _children() {
List<Widget> l = [];
for(int i = 0; i < state.languages.length; i++){
l.add(
CommonItem(
leftTitel: '跟随系统',
rightTitle: "",
allHeight: 90.h,
isHaveLine: true,
isHaveDirection: false,
isHaveRightWidget: true,
rightWidget: Container(),
action: () {
// logic.changeLanguage(e);
}),
);
for (int i = 0; i < state.languages.length; i++) {
var e = state.languages[i];
var lanType = ExtensionLanguageType.fromLanguageCode(e.languageCode);
l.add(CommonItem(leftTitel:lanType.lanTitle, rightTitle:"", allHeight: 90.h, isHaveLine: true, isHaveDirection:false, isHaveRightWidget: true, rightWidget: Obx(() => state.currentLanguageType.value == lanType ? Image(image: const AssetImage("images/icon_item_checked.png"),width:30.w,height:30.w, fit: BoxFit.contain,): Container()), action: (){
logic.changeLanguage(e);
}),);
l.add(
CommonItem(
leftTitel: lanType.lanTitle,
rightTitle: "",
allHeight: 90.h,
isHaveLine: true,
isHaveDirection: false,
isHaveRightWidget: true,
rightWidget: Obx(() => state.currentLanguageType.value == lanType
? Image(
image: const AssetImage("images/icon_item_checked.png"),
width: 30.w,
height: 30.w,
fit: BoxFit.contain,
)
: Container()),
action: () {
logic.changeLanguage(e);
}),
);
}
return l;
}

View File

@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_utils/get_utils.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
import 'package:star_lock/tools/ExpandedListView.dart';
import 'package:star_lock/tools/submitBtn.dart';
import 'package:star_lock/translations/trans_lib.dart';
@ -167,9 +168,10 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
Widget _buildDeviceExpandedList(context, index, deviceName) {
return ExpandedListTile(
onTap: () => print("onTap."),
title: deviceName,
imgName: 'images/icon_lock.png',
// title: deviceName,
// imgName: 'images/icon_lock.png',
typeImgList: const [],
groupItem: GroupListItem(),
child: ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
@ -205,9 +207,10 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
Widget _buildNameExpandedList(context, index, deviceName) {
return ExpandedListTile(
onTap: () => print("onTap."),
title: deviceName,
imgName: 'images/controls_user.png',
// title: deviceName,
// imgName: 'images/controls_user.png',
typeImgList: const ['images/icon_password.png', 'images/icon_card.png'],
groupItem: GroupListItem(),
child: ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,

View File

@ -0,0 +1,272 @@
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/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/jh_pop_menus.dart';
import 'package:star_lock/tools/toast.dart';
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
import '../../../../../appRouters.dart';
import '../../../../../app_settings/app_colors.dart';
import '../../../../../tools/commonItem.dart';
import '../../../../../tools/showTFView.dart';
import '../../../../../tools/submitBtn.dart';
import '../../../../../tools/titleAppBar.dart';
import '../../../../../translations/trans_lib.dart';
class AdministratorDetailsPage extends StatefulWidget {
const AdministratorDetailsPage({Key? key}) : super(key: key);
@override
State<AdministratorDetailsPage> createState() =>
_AdministratorDetailsPageState();
}
class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
final TextEditingController _changeNameController = TextEditingController();
AuthorizedAdminListItem itemData = AuthorizedAdminListItem();
@override
Widget build(BuildContext context) {
dynamic obj = ModalRoute.of(context)?.settings.arguments;
if (obj != null && (obj["itemData"] != null)) {
itemData = obj["itemData"];
}
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: '管理员详情',
haveBack: true,
actionsList: [
IconButton(
icon: Image.asset(
'images/icon_bar_more.png',
height: 30.h,
width: 10.w,
),
onPressed: () {
JhPopMenus.showLinePop(context,
clickCallback: (index, selText) {
print('选中index: $index');
print('选中text: $selText');
}, listData: [
{'text': '冻结'},
{'text': '取消授权'}
]);
},
),
],
backgroundColor: AppColors.mainColor),
body: Column(
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.name!.tr,
rightTitle: _changeNameController.text.isNotEmpty
? _changeNameController.text
: itemData.name,
isHaveDirection: true,
isHaveLine: true,
action: () {
showCupertinoAlertDialog(context);
}),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
allHeight: 90.h,
rightTitle: getUseDateStr(itemData),
isHaveDirection: true,
action: () {
Navigator.pushNamed(
context, Routers.electronicKeyDetailChangeDate,
arguments: {"itemData": itemData});
}),
Container(height: 10.h),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.lock!.tr,
rightTitle: itemData.lockNum.toString(),
isHaveDirection: true,
action: () {
//
}),
Container(height: 10.h),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr,
rightTitle: "",
isHaveRightWidget: true,
rightWidget: SizedBox(
width: 60.w,
child: _switch(itemData.isRemoteUnlock == 1 ? true : false)),
action: () {}),
Container(height: 40.h),
SubmitBtn(
btnName: TranslationLoader.lanKeys!.delete!.tr,
borderRadius: 20.w,
isDelete: true,
margin: EdgeInsets.only(
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {
deleteAdministratorRequest();
}),
],
),
);
}
//使
String getUseDateStr(AuthorizedAdminListItem 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().substring(0, 16)} 永久';
} else if (indexEntity.keyType == 3) {
//
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
} else if (indexEntity.keyType == 4) {
//
useDateStr = '循环';
}
return useDateStr;
}
Widget commonItem(String leftTitle, String rightTitle,
{bool isHaveDirection = false,
bool isHaveLine = false,
bool isHaveRightWidget = false,
Widget? rightWidget,
Function()? action}) {
return GestureDetector(
onTap: action,
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
// height: 80.h,
color: Colors.white,
padding: EdgeInsets.only(
left: 20.w, right: 10.w, top: 20.w, bottom: 20.w),
child: Row(
children: [
SizedBox(width: 20.w),
Text(
leftTitle,
style:
TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),
),
SizedBox(width: 20.w),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
isHaveRightWidget
? rightWidget!
: Text(
rightTitle,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 28.sp, fontWeight: FontWeight.w500),
)
],
),
),
SizedBox(width: 5.w),
isHaveDirection
? Image.asset(
'images/icon_right.png',
width: 50.w,
height: 50.w,
)
: SizedBox(width: 10.w),
// SizedBox(width:10.w),
],
),
),
isHaveLine
? Container(
height: 0.5.h,
color: Colors.grey,
)
: Container()
],
),
);
}
CupertinoSwitch _switch(isOn) {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: isOn,
onChanged: (value) {
setState(() {
isOn = value;
});
},
);
}
//
Future<void> updateAdministratorRequest() async {
ElectronicKeyListEntity entity = await ApiRepository.to.updateAdministrator(
itemData.uid.toString(), _changeNameController.text, '', '', '');
if (entity.errorCode!.codeIsSuccessful) {
print("修改管理员信息成功啦啦啦啦啦");
Toast.show(msg: "修改成功");
setState(() {
Navigator.pop(context);
});
}
}
//
Future<void> deleteAdministratorRequest() async {
ElectronicKeyListEntity entity =
await ApiRepository.to.deleteAdministrator(itemData.uid.toString(), '');
if (entity.errorCode!.codeIsSuccessful) {
print("删除电子钥匙成功");
Toast.show(msg: "删除成功");
setState(() {
Navigator.pop(context);
});
}
}
void showCupertinoAlertDialog(BuildContext context) {
showDialog(
context: context,
builder: (BuildContext context) {
return ShowTFView(
title:
"${TranslationLoader.lanKeys!.amend!.tr} ${TranslationLoader.lanKeys!.name!.tr}",
tipTitle: "请输入",
controller: _changeNameController,
sureClick: () {
//
if (_changeNameController.text.isNotEmpty) {
updateAdministratorRequest();
}
},
cancelClick: () {
Navigator.pop(context);
},
);
},
);
}
}

View File

@ -0,0 +1,122 @@
class AuthorizedAdminListEntity {
int? errorCode;
String? description;
String? errorMsg;
AuthorizedAdminListData? data;
AuthorizedAdminListEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
AuthorizedAdminListEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null
? AuthorizedAdminListData.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 AuthorizedAdminListData {
List<AuthorizedAdminListItem>? itemList;
int? pageNo;
int? pageSize;
int? pages;
int? total;
AuthorizedAdminListData(
{this.itemList, this.pageNo, this.pageSize, this.pages, this.total});
AuthorizedAdminListData.fromJson(Map<String, dynamic> json) {
if (json['list'] != null) {
itemList = <AuthorizedAdminListItem>[];
json['list'].forEach((v) {
itemList!.add(AuthorizedAdminListItem.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 AuthorizedAdminListItem {
int? uid;
int? keyStatus;
int? lockNum;
int? endDate;
int? startDate;
String? name;
String? headUrl;
String? userid;
int? keyType;
int? date;
int? isRemoteUnlock;
AuthorizedAdminListItem(
{this.uid,
this.keyStatus,
this.lockNum,
this.endDate,
this.startDate,
this.name,
this.headUrl,
this.userid,
this.keyType,
this.date,
this.isRemoteUnlock});
AuthorizedAdminListItem.fromJson(Map<String, dynamic> json) {
uid = json['uid'];
keyStatus = json['keyStatus'];
lockNum = json['lockNum'];
endDate = json['endDate'];
startDate = json['startDate'];
name = json['name'];
headUrl = json['headUrl'];
userid = json['userid'];
keyType = json['keyType'];
date = json['date'];
isRemoteUnlock = json['isRemoteUnlock'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['uid'] = uid;
data['keyStatus'] = keyStatus;
data['lockNum'] = lockNum;
data['endDate'] = endDate;
data['startDate'] = startDate;
data['name'] = name;
data['headUrl'] = headUrl;
data['userid'] = userid;
data['keyType'] = keyType;
data['date'] = date;
data['isRemoteUnlock'] = isRemoteUnlock;
return data;
}
}

View File

@ -1,6 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.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';
@ -17,6 +20,13 @@ class AuthorizedAdministratorListPage extends StatefulWidget {
class _AuthorizedAdministratorListPageState
extends State<AuthorizedAdministratorListPage> {
@override
void initState() {
super.initState();
mockNetworkDataRequest();
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -40,15 +50,49 @@ class _AuthorizedAdministratorListPageState
),
],
),
body: Column(
children: [
_searchWidget(),
Expanded(child: _buildMainUI()),
],
),
body: FutureBuilder<List<AuthorizedAdminListItem>>(
future: mockNetworkDataRequest(),
builder: (BuildContext context,
AsyncSnapshot<List<AuthorizedAdminListItem>> snapshot) {
//
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasError) {
//
return const Text('请求失败');
} else {
//
final List<AuthorizedAdminListItem> itemList = snapshot.data!;
return Column(
children: [
_searchWidget(),
Expanded(child: _buildMainUI(itemList)),
],
);
}
} else {
// loading
return Container();
}
}),
);
}
//
Future<List<AuthorizedAdminListItem>> mockNetworkDataRequest() async {
AuthorizedAdminListEntity entity =
await ApiRepository.to.authorizedAdminList('1', '20');
if (entity.errorCode!.codeIsSuccessful) {
print("授权管理员列表成功:${entity.data?.itemList}");
}
if (entity.data != null) {
return entity.data!.itemList!;
} else {
List<AuthorizedAdminListItem> dataList = [];
return dataList;
}
}
Widget _searchWidget() {
return Container(
height: 60.h,
@ -84,22 +128,21 @@ class _AuthorizedAdministratorListPageState
);
}
Widget _buildMainUI() {
Widget _buildMainUI(List itemList) {
return ListView.builder(
itemCount: 5,
itemCount: itemList.length,
itemBuilder: (c, index) {
return _electronicKeyItem('images/controls_user.png', "张三",
"2023.6.21 11.15", "2023.6.21 11.15", () {
// Navigator.pushNamed(context, Routers.authorizedAdminDetailPage);
Navigator.pushNamed(context, Routers.electronicKeyDetailPage);
});
AuthorizedAdminListItem itemData = itemList[index];
return _electronicKeyItem(itemData);
});
}
Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle,
String beginTime, String endTime, Function() action) {
Widget _electronicKeyItem(AuthorizedAdminListItem itemData) {
return GestureDetector(
onTap: action,
onTap: () {
Navigator.pushNamed(context, Routers.administratorDetailsPage,
arguments: {'itemData': itemData});
},
child: Container(
height: 100.h,
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
@ -113,7 +156,7 @@ class _AuthorizedAdministratorListPageState
width: 30.w,
),
Image.asset(
lockTypeIcon,
'images/controls_user.png',
width: 60.w,
height: 60.w,
),
@ -128,7 +171,7 @@ class _AuthorizedAdministratorListPageState
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
lockTypeTitle,
itemData.name ?? '',
style: TextStyle(
fontSize: 24.sp, color: AppColors.blackColor),
),
@ -156,4 +199,33 @@ class _AuthorizedAdministratorListPageState
),
);
}
//使
String getUseDateStr(AuthorizedAdminListItem indexEntity) {
String useDateStr = '';
if (indexEntity.keyType == 1) {
//
if (indexEntity.startDate != null && indexEntity.endDate != null) {
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 {
useDateStr = '限期';
}
} else if (indexEntity.keyType == 2) {
//
useDateStr = '永久';
} else if (indexEntity.keyType == 3) {
//
useDateStr = '单次';
} else if (indexEntity.keyType == 4) {
//
useDateStr = '循环';
}
return useDateStr;
}
}

View File

@ -0,0 +1,144 @@
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/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.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';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
class ExpireLockListPage extends StatefulWidget {
const ExpireLockListPage({Key? key}) : super(key: key);
@override
State<ExpireLockListPage> createState() => _ExpireLockListPageState();
}
class _ExpireLockListPageState extends State<ExpireLockListPage> {
List<LockUserData> dataList = [];
@override
void initState() {
super.initState();
expireLockListRequest();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: '即将到期',
haveBack: true,
backgroundColor: AppColors.mainColor,
actionsList: [
TextButton(
child: Text(
TranslationLoader.lanKeys!.aboutToExpire!.tr,
style: TextStyle(color: Colors.white, fontSize: 24.sp),
),
onPressed: () {},
),
],
),
body: _buildMainUI(),
);
}
Widget _buildMainUI() {
return ListView.separated(
itemCount: dataList.length,
itemBuilder: (c, index) {
LockUserData indexEntity = dataList[index];
return _electronicKeyItem(indexEntity);
},
separatorBuilder: (BuildContext context, int index) {
return const Divider(
height: 1,
color: AppColors.greyLineColor,
);
},
);
}
//
Future<List<LockUserData>> expireLockListRequest() async {
ElectronicKeyListEntity entity =
await ApiRepository.to.expireLockList('0', '1', '20');
// if (entity.errorCode!.codeIsSuccessful) {
// setState(() {
// dataList = entity.data! as List<LockUserData>;
// // dataList = entity.data!;
// });
// }
return dataList;
}
Widget _electronicKeyItem(LockUserData itemData) {
return GestureDetector(
onTap: () {
Navigator.pushNamed(context, Routers.ownedKeyListPage,
arguments: {'uid': itemData.uid});
},
child: Container(
height: 90.h,
color: Colors.white,
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(10.w),
// ),
child: Row(
children: [
SizedBox(
width: 30.w,
),
Image.asset(
'images/controls_user.png',
width: 60.w,
height: 60.w,
),
SizedBox(
width: 20.w,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
itemData.nickname ?? '',
style: TextStyle(
fontSize: 24.sp, color: AppColors.blackColor),
),
],
),
SizedBox(height: 5.h),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
itemData.userid ?? '',
style: TextStyle(
fontSize: 18.sp,
color: AppColors.placeholderTextColor),
),
],
),
SizedBox(width: 20.h),
],
),
),
SizedBox(width: 20.w),
],
),
),
);
}
}

View File

@ -0,0 +1,206 @@
class KeyListByUserEntity {
int? errorCode;
String? description;
String? errorMsg;
KeyListByUserData? data;
KeyListByUserEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
KeyListByUserEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data =
json['data'] != null ? KeyListByUserData.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 KeyListByUserData {
List<KeyListItem>? keyList;
int? pageNo;
int? pageSize;
int? pages;
int? total;
KeyListByUserData(
{this.keyList, this.pageNo, this.pageSize, this.pages, this.total});
KeyListByUserData.fromJson(Map<String, dynamic> json) {
if (json['list'] != null) {
keyList = <KeyListItem>[];
json['list'].forEach((v) {
keyList!.add(KeyListItem.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 (keyList != null) {
data['list'] = keyList!.map((v) => v.toJson()).toList();
}
data['pageNo'] = pageNo;
data['pageSize'] = pageSize;
data['pages'] = pages;
data['total'] = total;
return data;
}
}
class KeyListItem {
String? clientId;
int? lockOwnerId;
int? lockId;
int? senderUserId;
String? keyName;
int? keyType;
int? startDate;
int? endDate;
List? weekDays;
String? remarks;
int? remoteEnable;
int? isCameraEnable;
int? faceAuthentication;
int? keyRight;
int? userType;
int? keyStatus;
int? groupId;
int? lockUserNo;
int? date;
String? createdAt;
String? updatedAt;
UserInfo? userInfo;
int? keyId;
int? uid;
String? lockAlias;
KeyListItem(
{this.clientId,
this.lockOwnerId,
this.lockId,
this.senderUserId,
this.keyName,
this.keyType,
this.startDate,
this.endDate,
this.weekDays,
this.remarks,
this.remoteEnable,
this.isCameraEnable,
this.faceAuthentication,
this.keyRight,
this.userType,
this.keyStatus,
this.groupId,
this.lockUserNo,
this.date,
this.createdAt,
this.updatedAt,
this.userInfo,
this.keyId,
this.uid,
this.lockAlias});
KeyListItem.fromJson(Map<String, dynamic> json) {
clientId = json['clientId'];
lockOwnerId = json['lockOwnerId'];
lockId = json['lockId'];
senderUserId = json['senderUserId'];
keyName = json['keyName'];
keyType = json['keyType'];
startDate = json['startDate'];
endDate = json['endDate'];
if (json['weekDays'] != null) {
weekDays = [];
json['weekDays'].forEach((v) {
weekDays!.add(v);
});
}
remarks = json['remarks'];
remoteEnable = json['remoteEnable'];
isCameraEnable = json['isCameraEnable'];
faceAuthentication = json['faceAuthentication'];
keyRight = json['keyRight'];
userType = json['userType'];
keyStatus = json['keyStatus'];
groupId = json['groupId'];
lockUserNo = json['lockUserNo'];
date = json['date'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
userInfo =
json['user_info'] != null ? UserInfo.fromJson(json['user_info']) : null;
keyId = json['keyId'];
uid = json['uid'];
lockAlias = json['lockAlias'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['clientId'] = clientId;
data['lockOwnerId'] = lockOwnerId;
data['lockId'] = lockId;
data['senderUserId'] = senderUserId;
data['keyName'] = keyName;
data['keyType'] = keyType;
data['startDate'] = startDate;
data['endDate'] = endDate;
if (weekDays != null) {
data['weekDays'] = weekDays!.map((v) => v.toJson()).toList();
}
data['remarks'] = remarks;
data['remoteEnable'] = remoteEnable;
data['isCameraEnable'] = isCameraEnable;
data['faceAuthentication'] = faceAuthentication;
data['keyRight'] = keyRight;
data['userType'] = userType;
data['keyStatus'] = keyStatus;
data['groupId'] = groupId;
data['lockUserNo'] = lockUserNo;
data['date'] = date;
data['created_at'] = createdAt;
data['updated_at'] = updatedAt;
if (userInfo != null) {
data['user_info'] = userInfo!.toJson();
}
data['keyId'] = keyId;
data['uid'] = uid;
data['lockAlias'] = lockAlias;
return data;
}
}
class UserInfo {
int? id;
String? accountName;
UserInfo({this.id, this.accountName});
UserInfo.fromJson(Map<String, dynamic> json) {
id = json['id'];
accountName = json['account_name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['account_name'] = accountName;
return data;
}
}

View File

@ -1,22 +1,32 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.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';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
class LockUserManageListListPage extends StatefulWidget {
const LockUserManageListListPage({Key? key}) : super(key: key);
class LockUserManageListPage extends StatefulWidget {
const LockUserManageListPage({Key? key}) : super(key: key);
@override
State<LockUserManageListListPage> createState() =>
_LockUserManageListListPageState();
State<LockUserManageListPage> createState() => _LockUserManageListPageState();
}
class _LockUserManageListListPageState
extends State<LockUserManageListListPage> {
class _LockUserManageListPageState extends State<LockUserManageListPage> {
List<LockUserData> dataList = [];
@override
void initState() {
super.initState();
lockUserListRequest();
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -31,7 +41,9 @@ class _LockUserManageListListPageState
TranslationLoader.lanKeys!.aboutToExpire!.tr,
style: TextStyle(color: Colors.white, fontSize: 24.sp),
),
onPressed: () {},
onPressed: () {
Navigator.pushNamed(context, Routers.expireLockListPage);
},
),
],
),
@ -54,7 +66,7 @@ class _LockUserManageListListPageState
context, Routers.massSendElectronicKeyManagePage);
},
child: Text(
'群发钥匙',
TranslationLoader.lanKeys!.sendGroupKey!.tr,
style: TextStyle(
color: AppColors.mainColor,
fontSize: 24.sp,
@ -105,12 +117,10 @@ class _LockUserManageListListPageState
Widget _buildMainUI() {
return ListView.separated(
itemCount: 5,
itemCount: dataList.length,
itemBuilder: (c, index) {
return _electronicKeyItem('images/controls_user.png', "张三",
"2023.6.21 11.15", "2023.6.21 11.15", () {
Navigator.pushNamed(context, Routers.ownedKeyListPage);
});
LockUserData indexEntity = dataList[index];
return _electronicKeyItem(indexEntity);
},
separatorBuilder: (BuildContext context, int index) {
return const Divider(
@ -121,10 +131,24 @@ class _LockUserManageListListPageState
);
}
Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle,
String beginTime, String endTime, Function() action) {
//
Future<List<LockUserData>> lockUserListRequest() async {
LockUserListEntity entity =
await ApiRepository.to.lockUserList('1', '20', '');
if (entity.errorCode!.codeIsSuccessful) {
setState(() {
dataList = entity.data!;
});
}
return dataList;
}
Widget _electronicKeyItem(LockUserData itemData) {
return GestureDetector(
onTap: action,
onTap: () {
Navigator.pushNamed(context, Routers.ownedKeyListPage,
arguments: {'uid': itemData.uid});
},
child: Container(
height: 90.h,
color: Colors.white,
@ -138,7 +162,7 @@ class _LockUserManageListListPageState
width: 30.w,
),
Image.asset(
lockTypeIcon,
'images/controls_user.png',
width: 60.w,
height: 60.w,
),
@ -153,7 +177,7 @@ class _LockUserManageListListPageState
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
lockTypeTitle,
itemData.nickname ?? '',
style: TextStyle(
fontSize: 24.sp, color: AppColors.blackColor),
),
@ -164,7 +188,7 @@ class _LockUserManageListListPageState
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"2023.6.21 11.15 永久",
itemData.userid ?? '',
style: TextStyle(
fontSize: 18.sp,
color: AppColors.placeholderTextColor),

View File

@ -1,9 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_utils/get_utils.dart';
import 'package:star_lock/mine/mineSet/lockUserManage/keyListByUserEntity.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/translations/trans_lib.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/titleAppBar.dart';
@ -15,22 +17,53 @@ class OwnedKeyListPage extends StatefulWidget {
}
class _OwnedKeyListPageState extends State<OwnedKeyListPage> {
String getUidStr = '';
List dataList = [];
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
dynamic obj = ModalRoute.of(context)?.settings.arguments;
if (obj != null && (obj["uid"] != null)) {
getUidStr = obj["uid"].toString();
}
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.ownedKey!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: Column(
children: [
_topOwnedKeyText(),
Expanded(child: _buildMainUI()),
],
),
);
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.ownedKey!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: FutureBuilder<List<KeyListItem>>(
future: mockNetworkDataRequest(),
builder: (BuildContext context,
AsyncSnapshot<List<KeyListItem>> snapshot) {
//
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasError) {
//
return const Text('请求失败');
} else {
//
final List<KeyListItem> itemList = snapshot.data!;
return Column(
children: [
_topOwnedKeyText(),
Expanded(child: _buildMainUI(itemList)),
],
);
}
} else {
// loading
return Container();
}
}));
}
Widget _topOwnedKeyText() {
@ -49,21 +82,62 @@ class _OwnedKeyListPageState extends State<OwnedKeyListPage> {
);
}
Widget _buildMainUI() {
//
Future<List<KeyListItem>> mockNetworkDataRequest() async {
KeyListByUserEntity entity =
await ApiRepository.to.keyListByUser('1', '20', getUidStr);
if (entity.errorCode!.codeIsSuccessful) {
print("请求用户拥有的锁:${entity.data!.keyList}");
}
if (entity.data != null) {
return entity.data!.keyList!;
} else {
List<KeyListItem> dataList = [];
return dataList;
}
}
//使
String getUseDateStr(KeyListItem indexEntity) {
String useDateStr = '';
if (indexEntity.keyType == 1) {
//
if (indexEntity.startDate != null && indexEntity.endDate != null) {
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 {
useDateStr = '限期';
}
} else if (indexEntity.keyType == 2) {
//
useDateStr = '永久';
} else if (indexEntity.keyType == 3) {
//
useDateStr = '单次';
} else if (indexEntity.keyType == 4) {
//
useDateStr = '循环';
}
return useDateStr;
}
Widget _buildMainUI(List itemList) {
return ListView.builder(
itemCount: 5,
itemCount: itemList.length,
itemBuilder: (c, index) {
return _electronicKeyItem('images/controls_user.png', "JBL01_5a3de9",
"2023.6.21 11.15", "2023.6.21 11.15", () {
// Navigator.pushNamed(context, Routers.authorizedAdminDetailPage);
});
KeyListItem itemData = itemList[index];
return _electronicKeyItem(itemData);
});
}
Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle,
String beginTime, String endTime, Function() action) {
Widget _electronicKeyItem(KeyListItem itemData) {
return GestureDetector(
onTap: action,
onTap: () {},
child: Container(
height: 90.h,
margin: const EdgeInsets.only(top: 1),
@ -77,7 +151,7 @@ class _OwnedKeyListPageState extends State<OwnedKeyListPage> {
width: 30.w,
),
Image.asset(
lockTypeIcon,
'images/icon_lockGroup_item.png',
width: 60.w,
height: 60.w,
),
@ -92,7 +166,7 @@ class _OwnedKeyListPageState extends State<OwnedKeyListPage> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
lockTypeTitle,
itemData.lockAlias ?? '',
style: TextStyle(
fontSize: 24.sp, color: AppColors.blackColor),
),
@ -103,7 +177,7 @@ class _OwnedKeyListPageState extends State<OwnedKeyListPage> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"2023.6.21 11.15 永久",
getUseDateStr(itemData),
style: TextStyle(
fontSize: 18.sp,
color: AppColors.placeholderTextColor),

View File

@ -153,6 +153,21 @@ class _MineSetPageState extends State<MineSetPage> {
Navigator.pushNamed(context,
Routers.aPPUnlockNeedMobileNetworkingLockPage);
}),
SizedBox(
height: 10.h,
),
CommonItem(
leftTitel: "Amazon Alexa",
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {}),
CommonItem(
leftTitel: "Google Home",
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {}),
// CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){
//
// }),

View File

@ -46,16 +46,20 @@ abstract class Api {
final String getWifiServiceIpURL = '/wifiLock/getWifiServiceIp'; // Wifi锁服务器
final String updateSpecialValueUrl = '/room/updateSpecialValue'; // /
final String setAutoLockTimeUrl = '/room/setAutoLockTime'; //
final String getPassageModeConfigUrl = '/room/getPassageModeConfig'; //
final String getPassageModeConfigUrl =
'/room/getPassageModeConfig'; //
final String configPassageModeUrl = '/room/configPassageMode'; //
final String updateSettingUrl = '/room/updateSetting'; // ///
final String roomQueryDateUrl = '/room/queryDate'; //
final String lockDiagnoseUrl = '/room/uploadLockInfo'; //
final String getServerDatetimeUrl = '/check/getServerDatetime'; //
final String getLockVersionInfoUrl = '/room/update'; //
final String openCheckingInURL = '/attendanceCompany/isExistenceCompany'; //
final String setCheckInCreateCompanyURL = '/attendanceCompany/add'; //
final String setLockPickingReminderDataURL = '/key/updateMonitorFlag'; //
final String openCheckingInURL =
'/attendanceCompany/isExistenceCompany'; //
final String setCheckInCreateCompanyURL =
'/attendanceCompany/add'; //
final String setLockPickingReminderDataURL =
'/key/updateMonitorFlag'; //
final String getAttendanceRecordListByDateURL = '/attendanceRecord/listByDate'; // -
final String getAttendanceRecordListByMonthURL = '/attendanceRecord/earlyListByMonth'; // -
@ -80,5 +84,11 @@ abstract class Api {
final String lockUserListURL = '/keyUser/listKeyUser'; //
final String canSendKeyURL = '/keyUser/canSendKey'; //
final String batchSendKeyURL = '/key/batchSend'; //
final String addAuthorizedAdminURL = '/authorizedAdmin/add'; //
final String keyListByUserURL = '/keyUser/listByUse'; //
final String authorizedAdminListURL = '/authorizedAdmin/list'; //
final String deleteAdministratorURL = '/authorizedAdmin/delete'; //
final String updateAdministratorURL =
'/authorizedAdmin/update'; ////
final String expireLockListURL = '/keyUser/listExpireUser'; //
}

View File

@ -115,7 +115,8 @@ class ApiProvider extends BaseProvider {
'pageSize': pageSize,
'startDate': startDate,
'keyRight': keyRight
}));
}),
isShowLoading: true);
Future<Response> sendElectronicKey(
String createUser,
@ -252,7 +253,8 @@ class ApiProvider extends BaseProvider {
'keyboardPwdId': keyboardPwdId,
'cardId': cardId,
'fingerprintId': fingerprintId
}));
}),
isShowLoading: true);
//
Future<Response> bindingBlueAdmin(
@ -297,10 +299,8 @@ class ApiProvider extends BaseProvider {
}));
// Wifi锁服务器
Future<Response> getWifiLockServiceIpAndPort() => post(
getWifiServiceIpURL.toUrl,
jsonEncode({
}));
Future<Response> getWifiLockServiceIpAndPort() =>
post(getWifiServiceIpURL.toUrl, jsonEncode({}));
Future<Response> passwordKeyList(
String keyStatus,
@ -346,7 +346,8 @@ class ApiProvider extends BaseProvider {
'operatorUid': operatorUid,
'startDate': startDate,
'timezoneRawOffSet': timezoneRawOffSet
}));
}),
isShowLoading: true);
Future<Response> addKeyboardPwd(
String lockId,
@ -402,11 +403,38 @@ class ApiProvider extends BaseProvider {
jsonEncode({'lockId': lockId, 'groupId': groupId}));
Future<Response> lockGroupList(String type) =>
post(lockGroupListURL.toUrl, jsonEncode({'type': type}));
post(lockGroupListURL.toUrl, jsonEncode({'type': type}),
isShowLoading: true);
Future<Response> deleteElectronicKey(String keyId) =>
post(deleteElectronicKeyURL.toUrl, jsonEncode({'keyId': keyId}));
Future<Response> deleteAdministrator(String uid, String includeUnderlings) =>
post(deleteElectronicKeyURL.toUrl,
jsonEncode({'uid': uid, 'includeUnderlings': includeUnderlings}));
Future<Response> updateAdministrator(String uid, String name, String endDate,
String startDate, String isRemoteUnlock) =>
post(
deleteElectronicKeyURL.toUrl,
jsonEncode({
'uid': uid,
'name': name,
'endDate': endDate,
'startDate': startDate,
'isRemoteUnlock': isRemoteUnlock
}));
Future<Response> expireLockList(
String operatorUid, String pageNo, String pageSize) =>
post(
expireLockListURL.toUrl,
jsonEncode({
'operatorUid': operatorUid,
'pageNo': pageNo,
'pageSize': pageSize,
}));
Future<Response> deleteKeyboardPwd(
String lockId, String keyboardPwdId, String deleteType) =>
post(
@ -428,10 +456,10 @@ class ApiProvider extends BaseProvider {
lockListByGroupURL.toUrl,
jsonEncode({'type': type, 'keyGroupId': keyGroupId}));
///
///
//
Future<Response> remoteUnlockingOpenOrCloseLoadData(String lockId, String featureValue) =>
Future<Response> remoteUnlockingOpenOrCloseLoadData(
String lockId, String featureValue) =>
post(
updateSpecialValueUrl.toUrl,
jsonEncode({
@ -440,7 +468,8 @@ class ApiProvider extends BaseProvider {
}));
//
Future<Response> setAutoUnlockLoadData(String lockId, String autoLockTime, String type) =>
Future<Response> setAutoUnlockLoadData(
String lockId, String autoLockTime, String type) =>
post(
setAutoLockTimeUrl.toUrl,
jsonEncode({
@ -450,15 +479,22 @@ class ApiProvider extends BaseProvider {
}));
//
Future<Response> getPassageModeConfigLoadData(String lockId) =>
post(
getPassageModeConfigUrl.toUrl,
jsonEncode({
'lockId': lockId,
}));
Future<Response> getPassageModeConfigLoadData(String lockId) => post(
getPassageModeConfigUrl.toUrl,
jsonEncode({
'lockId': lockId,
}));
//
Future<Response> configPassageMode(String lockId, String passageMode, String autoUnlock, String type, String startDate, String endDate, String isAllDay, List weekDays) =>
Future<Response> configPassageMode(
String lockId,
String passageMode,
String autoUnlock,
String type,
String startDate,
String endDate,
String isAllDay,
List weekDays) =>
post(
configPassageModeUrl.toUrl,
jsonEncode({
@ -473,7 +509,8 @@ class ApiProvider extends BaseProvider {
}));
//
Future<Response> setLockSetGeneralSetting(String lockId, String changeType, String isOn, String type) =>
Future<Response> setLockSetGeneralSetting(
String lockId, String changeType, String isOn, String type) =>
post(
updateSettingUrl.toUrl,
jsonEncode({
@ -484,31 +521,29 @@ class ApiProvider extends BaseProvider {
}));
//
Future<Response> getLockTimeFromGatewayLoadData(String lockId) =>
post(
roomQueryDateUrl.toUrl,
jsonEncode({
'lockId': lockId,
}));
Future<Response> getLockTimeFromGatewayLoadData(String lockId) => post(
roomQueryDateUrl.toUrl,
jsonEncode({
'lockId': lockId,
}));
//
Future<Response> getServerDatetimeLoadData(String lockId) =>
post(
getServerDatetimeUrl.toUrl,
jsonEncode({
'lockId': lockId,
}));
Future<Response> getServerDatetimeLoadData(String lockId) => post(
getServerDatetimeUrl.toUrl,
jsonEncode({
'lockId': lockId,
}));
//
Future<Response> setLockDiagnoseData(
String lockId,
String electricQuantity,
String firmwareRevision,
String hardwareRevision,
String lockDate,
String modelNum,
String pwdInfo,
String timestamp) =>
String lockId,
String electricQuantity,
String firmwareRevision,
String hardwareRevision,
String lockDate,
String modelNum,
String pwdInfo,
String timestamp) =>
post(
lockDiagnoseUrl.toUrl,
jsonEncode({
@ -523,11 +558,11 @@ class ApiProvider extends BaseProvider {
}));
//
Future<Response> getLockVersionInfoLoadData(String lockId) =>
post(
getLockVersionInfoUrl.toUrl,
jsonEncode({
'lockId': lockId,}));
Future<Response> getLockVersionInfoLoadData(String lockId) => post(
getLockVersionInfoUrl.toUrl,
jsonEncode({
'lockId': lockId,
}));
//
Future<Response> openCheckingInGetData(String lockId) => post(
@ -540,22 +575,26 @@ class ApiProvider extends BaseProvider {
//
Future<Response> setCheckInCreateCompanyData(
String lockId,
String attendanceType,
String companyName,
List workDay,
String workEndTime,
String workStartTime) => post(setCheckInCreateCompanyURL.toUrl, jsonEncode({
'lockId': lockId,
'attendanceType': attendanceType,
'companyName': companyName,
'workDay': workDay,
'workEndTime': workEndTime,
'workStartTime': workStartTime,
}));
String lockId,
String attendanceType,
String companyName,
List workDay,
String workEndTime,
String workStartTime) =>
post(
setCheckInCreateCompanyURL.toUrl,
jsonEncode({
'lockId': lockId,
'attendanceType': attendanceType,
'companyName': companyName,
'workDay': workDay,
'workEndTime': workEndTime,
'workStartTime': workStartTime,
}));
//
Future<Response> setLockPickingReminderData(String lockId, String keyId, String monitorFlag) =>
Future<Response> setLockPickingReminderData(
String lockId, String keyId, String monitorFlag) =>
post(
setLockPickingReminderDataURL.toUrl,
jsonEncode({
@ -565,23 +604,22 @@ class ApiProvider extends BaseProvider {
}));
//
Future<Response> getStaffListData(String companyId, String lockId) =>
post(
getStaffListURL.toUrl,
jsonEncode({
'companyId': companyId,
'lockId': lockId,
}));
Future<Response> getStaffListData(String companyId, String lockId) => post(
getStaffListURL.toUrl,
jsonEncode({
'companyId': companyId,
'lockId': lockId,
}));
//
Future<Response> addStaffData(
String attendanceType,
String attendanceWay,
String companyId,
String have,
String staffName,
String countryCode,
String usernameType) =>
String attendanceType,
String attendanceWay,
String companyId,
String have,
String staffName,
String countryCode,
String usernameType) =>
post(
addStaffURL.toUrl,
jsonEncode({
@ -790,20 +828,29 @@ class ApiProvider extends BaseProvider {
jsonEncode({'type': type, 'keyGroupId': keyGroupId}));
Future<Response> getKeyDetail(String lockId) =>
post(getKeyDetailURL.toUrl, jsonEncode({'lockId': lockId}));
post(getKeyDetailURL.toUrl, jsonEncode({'lockId': lockId}),
isShowLoading: true);
Future<Response> lockUserList(
String pageNo, String pageSize, String searchStr) =>
post(
lockUserListURL.toUrl,
jsonEncode({
'pageNo': pageNo,
'pageSize': pageSize,
'searchStr': searchStr
}));
jsonEncode(
{'pageNo': pageNo, 'pageSize': pageSize, 'searchStr': searchStr}),
isShowLoading: true);
Future<Response> keyListByUser(String pageNo, String pageSize, String uid) =>
post(keyListByUserURL.toUrl,
jsonEncode({'pageNo': pageNo, 'pageSize': pageSize, 'uid': uid}),
isShowLoading: true);
Future<Response> authorizedAdminList(String pageNo, String pageSize) => post(
authorizedAdminListURL.toUrl,
jsonEncode({'pageNo': pageNo, 'pageSize': pageSize}),
isShowLoading: true);
Future<Response> canSendKey(
String endDate, String keyGroupIdList, String lockIdList) =>
String endDate, List keyGroupIdList, List lockIdList) =>
post(
canSendKeyURL.toUrl,
jsonEncode({
@ -811,6 +858,60 @@ class ApiProvider extends BaseProvider {
'keyGroupIdList': keyGroupIdList,
'lockIdList': lockIdList
}));
Future<Response> batchSendKey(
String endDate,
List keyGroupIdList,
List lockIdList,
String createUser,
String isRemoteUnlock,
String keyNameForAdmin,
String receiverUsername,
String startDate,
String countryCode,
String usernameType,
List weekDays) =>
post(
batchSendKeyURL.toUrl,
jsonEncode({
'endDate': endDate,
'keyGroupIdList': keyGroupIdList,
'lockIdList': lockIdList,
'createUser': createUser,
'isRemoteUnlock': isRemoteUnlock,
'keyNameForAdmin': keyNameForAdmin,
'receiverUsername': receiverUsername,
'startDate': startDate,
'countryCode': countryCode,
'usernameType': usernameType,
'weekDays': weekDays,
}));
Future<Response> addAuthorizedAdmin(
String createUser,
String endDate,
String isRemoteUnlock,
List keyGroupIdList,
List lockIdList,
String name,
String startDate,
String userid,
String countryCode,
String usernameType) =>
post(
addAuthorizedAdminURL.toUrl,
jsonEncode({
'createUser': createUser,
'endDate': endDate,
'isRemoteUnlock': isRemoteUnlock,
'keyGroupIdList': keyGroupIdList,
'lockIdList': lockIdList,
'name': name,
'startDate': startDate,
'userid': userid,
'countryCode': countryCode,
'usernameType': usernameType
}));
}
extension ExtensionString on String {

View File

@ -2,12 +2,14 @@ import 'package:get/get.dart';
import 'package:star_lock/login/seletCountryRegion/common/countryRegionEntity.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/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserListEntity.dart';
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/basicInformation/KeyDetailEntity.dart';
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/LockGroupListEntity.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
import 'package:star_lock/mine/mineSet/lockUserManage/keyListByUserEntity.dart';
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
import '../login/login/entity/LoginEntity.dart';
@ -364,23 +366,23 @@ class ApiRepository {
}
//
Future<LockGroupListEntity> addLockGroup(
Future<MassSendLockGroupListEntity> addLockGroup(
String groupName, String operatorUid) async {
final res = await apiProvider.addLockGroup(groupName, operatorUid);
return LockGroupListEntity.fromJson(res.body);
return MassSendLockGroupListEntity.fromJson(res.body);
}
//
Future<LockGroupListEntity> setLockGroup(
Future<MassSendLockGroupListEntity> setLockGroup(
String lockId, String groupId) async {
final res = await apiProvider.setLockGroup(lockId, groupId);
return LockGroupListEntity.fromJson(res.body);
return MassSendLockGroupListEntity.fromJson(res.body);
}
//
Future<LockGroupListEntity> lockGroupList(String type) async {
Future<MassSendLockGroupListEntity> lockGroupList(String type) async {
final res = await apiProvider.lockGroupList(type);
return LockGroupListEntity.fromJson(res.body);
return MassSendLockGroupListEntity.fromJson(res.body);
}
//
@ -389,6 +391,28 @@ class ApiRepository {
return ElectronicKeyListEntity.fromJson(res.body);
}
//
Future<ElectronicKeyListEntity> deleteAdministrator(
String uid, String includeUnderlings) async {
final res = await apiProvider.deleteAdministrator(uid, includeUnderlings);
return ElectronicKeyListEntity.fromJson(res.body);
}
//
Future<ElectronicKeyListEntity> updateAdministrator(String uid, String name,
String endDate, String startDate, String isRemoteUnlock) async {
final res = await apiProvider.updateAdministrator(
uid, name, endDate, startDate, isRemoteUnlock);
return ElectronicKeyListEntity.fromJson(res.body);
}
//
Future<ElectronicKeyListEntity> expireLockList(
String operatorUid, String pageNo, String pageSize) async {
final res = await apiProvider.expireLockList(operatorUid, pageNo, pageSize);
return ElectronicKeyListEntity.fromJson(res.body);
}
//
Future<PasswordKeyEntity> deleteKeyboardPwd(
String lockId, String keyboardPwdId, String deleteType) async {
@ -417,122 +441,116 @@ class ApiRepository {
return PasswordKeyEntity.fromJson(res.body);
}
// Wifi锁服务器
Future<ConfiguringWifiEntity> getWifiLockServiceIpAndPort() async {
final res = await apiProvider.getWifiLockServiceIpAndPort();
return ConfiguringWifiEntity.fromJson(res.body);
}
///
///
// /
Future<LoginEntity> remoteUnlockingOpenOrClose(
{
Future<LoginEntity> remoteUnlockingOpenOrClose({
required String lockId,
required String featureValue,
}) async {
final res =
await apiProvider.remoteUnlockingOpenOrCloseLoadData(lockId, featureValue);
final res = await apiProvider.remoteUnlockingOpenOrCloseLoadData(
lockId, featureValue);
return LoginEntity.fromJson(res.body);
}
//
Future<LoginEntity> setAutoUnlock(
{
required String lockId,
required String autoLockTime,
required String type,
}) async {
Future<LoginEntity> setAutoUnlock({
required String lockId,
required String autoLockTime,
required String type,
}) async {
final res =
await apiProvider.setAutoUnlockLoadData(lockId, autoLockTime, type);
await apiProvider.setAutoUnlockLoadData(lockId, autoLockTime, type);
return LoginEntity.fromJson(res.body);
}
// configPassageMode
Future<GetPassageModeConfigEntity> getPassageModeConfig(
{
required String lockId,
}) async {
final res =
await apiProvider.getPassageModeConfigLoadData(lockId);
Future<GetPassageModeConfigEntity> getPassageModeConfig({
required String lockId,
}) async {
final res = await apiProvider.getPassageModeConfigLoadData(lockId);
return GetPassageModeConfigEntity.fromJson(res.body);
}
//
Future<GetPassageModeConfigEntity> configPassageModeLoadData(
{
required String lockId,
required String passageMode,
required String autoUnlock,
required String type,
required String startDate,
required String endDate,
required String isAllDay,
required List weekDays,
}) async {
final res =
await apiProvider.configPassageMode(lockId, passageMode, autoUnlock, type, startDate, endDate, isAllDay, weekDays);
Future<GetPassageModeConfigEntity> configPassageModeLoadData({
required String lockId,
required String passageMode,
required String autoUnlock,
required String type,
required String startDate,
required String endDate,
required String isAllDay,
required List weekDays,
}) async {
final res = await apiProvider.configPassageMode(lockId, passageMode,
autoUnlock, type, startDate, endDate, isAllDay, weekDays);
return GetPassageModeConfigEntity.fromJson(res.body);
}
//
Future<LoginEntity> setLockSetGeneralSettingData(
{
required String lockId,
required String changeType,
required String isOn,
required String type,
}) async {
final res =
await apiProvider.setLockSetGeneralSetting(lockId, changeType, isOn, type);
Future<LoginEntity> setLockSetGeneralSettingData({
required String lockId,
required String changeType,
required String isOn,
required String type,
}) async {
final res = await apiProvider.setLockSetGeneralSetting(
lockId, changeType, isOn, type);
return LoginEntity.fromJson(res.body);
}
//
Future<GetPassageModeConfigEntity> getLockTimeFromGateway(
{
required String lockId,
}) async {
final res =
await apiProvider.getLockTimeFromGatewayLoadData(lockId);
Future<GetPassageModeConfigEntity> getLockTimeFromGateway({
required String lockId,
}) async {
final res = await apiProvider.getLockTimeFromGatewayLoadData(lockId);
return GetPassageModeConfigEntity.fromJson(res.body);
}
//
Future<GetServerDatetimeEntity> getServerDatetimeData(
{
required String lockId,
}) async {
final res =
await apiProvider.getServerDatetimeLoadData(lockId);
Future<GetServerDatetimeEntity> getServerDatetimeData({
required String lockId,
}) async {
final res = await apiProvider.getServerDatetimeLoadData(lockId);
return GetServerDatetimeEntity.fromJson(res.body);
}
//
Future<LoginEntity> setLockDiagnoseData(
{
required String lockId,
required String electricQuantity,
required String firmwareRevision,
required String hardwareRevision,
required String lockDate,
required String modelNum,
required String pwdInfo,
required String timestamp,
}) async {
final res =
await apiProvider.setLockDiagnoseData(lockId, electricQuantity, firmwareRevision, hardwareRevision, lockDate, modelNum, pwdInfo, timestamp);
Future<LoginEntity> setLockDiagnoseData({
required String lockId,
required String electricQuantity,
required String firmwareRevision,
required String hardwareRevision,
required String lockDate,
required String modelNum,
required String pwdInfo,
required String timestamp,
}) async {
final res = await apiProvider.setLockDiagnoseData(
lockId,
electricQuantity,
firmwareRevision,
hardwareRevision,
lockDate,
modelNum,
pwdInfo,
timestamp);
return LoginEntity.fromJson(res.body);
}
//
Future<GetServerDatetimeEntity> getLockVersionInfoData(
{
required String lockId,
}) async {
final res =
await apiProvider.getLockVersionInfoLoadData(lockId);
return GetServerDatetimeEntity.fromJson(res.body);}
Future<GetServerDatetimeEntity> getLockVersionInfoData({
required String lockId,
}) async {
final res = await apiProvider.getLockVersionInfoLoadData(lockId);
return GetServerDatetimeEntity.fromJson(res.body);
}
//
Future<MassSendLockGroupListEntity> listLockByGroup(
@ -554,44 +572,110 @@ class ApiRepository {
return LockUserListEntity.fromJson(res.body);
}
//
//
Future<KeyListByUserEntity> keyListByUser(
String pageNo, String pageSize, String uid) async {
final res = await apiProvider.keyListByUser(pageNo, pageSize, uid);
return KeyListByUserEntity.fromJson(res.body);
}
//
Future<KeyDetailEntity> canSendKey(
String endDate, String keyGroupIdList, String lockIdList) async {
String endDate, List keyGroupIdList, List lockIdList) async {
final res =
await apiProvider.canSendKey(endDate, keyGroupIdList, lockIdList);
return KeyDetailEntity.fromJson(res.body);
}
//
Future<KeyDetailEntity> batchSendKey(
String endDate,
List keyGroupIdList,
List lockIdList,
String createUser,
String isRemoteUnlock,
String keyNameForAdmin,
String receiverUsername,
String startDate,
String countryCode,
String usernameType,
List weekDays) async {
final res = await apiProvider.batchSendKey(
endDate,
keyGroupIdList,
lockIdList,
createUser,
isRemoteUnlock,
keyNameForAdmin,
receiverUsername,
startDate,
countryCode,
usernameType,
weekDays);
return KeyDetailEntity.fromJson(res.body);
}
//
Future<KeyDetailEntity> addAuthorizedAdmin(
String createUser,
String endDate,
String isRemoteUnlock,
List keyGroupIdList,
List lockIdList,
String name,
String startDate,
String userid,
String countryCode,
String usernameType) async {
final res = await apiProvider.addAuthorizedAdmin(
createUser,
endDate,
isRemoteUnlock,
keyGroupIdList,
lockIdList,
name,
startDate,
userid,
countryCode,
usernameType);
return KeyDetailEntity.fromJson(res.body);
}
//
Future<AuthorizedAdminListEntity> authorizedAdminList(
String pageNo, String pageSize) async {
final res = await apiProvider.authorizedAdminList(pageNo, pageSize);
return AuthorizedAdminListEntity.fromJson(res.body);
}
//
Future<CheckingInInfoDataEntity> openCheckingInData({required String lockId}) async {
Future<CheckingInInfoDataEntity> openCheckingInData(
{required String lockId}) async {
final res = await apiProvider.openCheckingInGetData(lockId);
return CheckingInInfoDataEntity.fromJson(res.body);
}
//
Future<LoginEntity> setCheckInCreateCompanyData(
{
required String lockId,
required String attendanceType,
required String companyName,
required List workDay,
required String workEndTime,
required String workStartTime
}) async {
final res =
await apiProvider.setCheckInCreateCompanyData(lockId, attendanceType, companyName, workDay, workEndTime, workStartTime);
{required String lockId,
required String attendanceType,
required String companyName,
required List workDay,
required String workEndTime,
required String workStartTime}) async {
final res = await apiProvider.setCheckInCreateCompanyData(lockId,
attendanceType, companyName, workDay, workEndTime, workStartTime);
return LoginEntity.fromJson(res.body);
}
//
Future<LoginEntity> setLockPickingReminderData(
{
required String lockId,
required String keyId,
required String monitorFlag,
}) async {
final res =
await apiProvider.setLockPickingReminderData(lockId, keyId, monitorFlag);
Future<LoginEntity> setLockPickingReminderData({
required String lockId,
required String keyId,
required String monitorFlag,
}) async {
final res = await apiProvider.setLockPickingReminderData(
lockId, keyId, monitorFlag);
return LoginEntity.fromJson(res.body);
}
@ -672,21 +756,28 @@ class ApiRepository {
final res =
await apiProvider.getStaffListData(companyId, lockId);
return CheckingInAddStaffListEntity.fromJson(res.body);
//
Future<LoginEntity> getStaffListData({
required String companyId,
required String lockId,
}) async {
final res = await apiProvider.getStaffListData(companyId, lockId);
return LoginEntity.fromJson(res.body);
}
//
Future<LoginEntity> addStaffData(
{
required String attendanceType,
required String attendanceWay,
required String companyId,
required String have,
required String staffName,
required String countryCode,
required String usernameType,
}) async {
final res =
await apiProvider.addStaffData(attendanceType, attendanceWay, companyId, have, staffName, countryCode, usernameType);
Future<LoginEntity> addStaffData({
required String attendanceType,
required String attendanceWay,
required String companyId,
required String have,
required String staffName,
required String countryCode,
required String usernameType,
}) async {
final res = await apiProvider.addStaffData(attendanceType, attendanceWay,
companyId, have, staffName, countryCode, usernameType);
return LoginEntity.fromJson(res.body);
}
@ -808,5 +899,4 @@ class ApiRepository {
await apiProvider.addFingerprintsData(lockId, endDate, addType, fingerprintName, fingerprintNumber, fingerprintType, isCoerced, startDate, cyclicConfig);
return CheckingInListMonthEntity.fromJson(res.body);
}
}

View File

@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'package:get/get.dart';
import 'package:get/get_connect/http/src/request/request.dart';
import 'package:star_lock/login/login/entity/LoginData.dart';
import '../login/login/entity/LoginData.dart';
import '../login/login/entity/LoginEntity.dart';

View File

@ -1,22 +1,23 @@
import 'dart:core';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
class ExpandedListTile extends StatefulWidget {
const ExpandedListTile(
{Key? key,
required this.title,
this.child,
this.onTap,
required this.typeImgList,
required this.imgName})
required this.groupItem,
required this.typeImgList})
: super(key: key);
final String title;
final String imgName;
final Widget? child;
final List typeImgList;
final Function()? onTap;
final GroupListItem groupItem;
@override
_ExpandedListTileState createState() => _ExpandedListTileState();
@ -78,7 +79,9 @@ class _ExpandedListTileState extends State<ExpandedListTile> {
//
setState(() {
_isCheck = !_isCheck;
widget.groupItem.isChecked = _isCheck;
});
widget.onTap?.call();
},
));
widgetList.add(GestureDetector(
@ -96,7 +99,7 @@ class _ExpandedListTileState extends State<ExpandedListTile> {
width: 10.w,
),
Text(
widget.title,
widget.groupItem.keyGroupName ?? '',
style: TextStyle(color: AppColors.blackColor, fontSize: 22.sp),
),
Expanded(
@ -119,7 +122,6 @@ class _ExpandedListTileState extends State<ExpandedListTile> {
setState(() {
_isExpanded = !_isExpanded;
});
widget.onTap?.call();
},
));
return widgetList;

View File

@ -45,11 +45,10 @@ class ShowTFView extends StatelessWidget {
controller: controller,
autofocus: false,
decoration: InputDecoration(
//
contentPadding:
EdgeInsets.only(top: 20.h, left: 15.0, bottom: 13.h),
hintText: tipTitle,
hintStyle: TextStyle(fontSize: 28.sp),
const EdgeInsets.only(left: 5, top: -8, bottom: 6),
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
hintStyle: TextStyle(fontSize: 22.sp, height: 1.0),
//线
border: InputBorder.none,
//