修改普通用户、授权管理员开锁逻辑,修改电子钥匙、授权管理员部分bug
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 3.6 KiB |
@ -130,4 +130,6 @@ class AppColors {
|
||||
|
||||
static Color openPassageModeColor = const Color(0xFFEB2A3B);// 首页开启常开模式颜色(红色)
|
||||
static Color listTimeYellowColor = const Color(0xFFF3BA37);// 首页时间过期颜色(黄色)
|
||||
|
||||
static Color get lockDetailBottomBtnUneable => const Color(0xFF808080);// 首页时间灰色颜色(灰色)
|
||||
}
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.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/network/api_repository.dart';
|
||||
@ -340,7 +339,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
||||
// 接受者信息输入框
|
||||
Widget getTFWidget(bool isHaveBtn, String tfStr, int lineIndex) {
|
||||
return SizedBox(
|
||||
height: 50.h,
|
||||
height: 65.h,
|
||||
width: 300.w,
|
||||
child: Row(
|
||||
children: [
|
||||
@ -348,6 +347,10 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
||||
child: TextField(
|
||||
//输入框一行
|
||||
maxLines: 1,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.deny('\n'),
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
],
|
||||
controller: lineIndex == 1
|
||||
? state.emailOrPhoneController
|
||||
: state.keyNameController,
|
||||
@ -355,13 +358,24 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
||||
textAlign: TextAlign.end,
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
hintText: tfStr,
|
||||
hintStyle: TextStyle(
|
||||
color: AppColors.placeholderTextColor, fontSize: 22.sp),
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
disabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
enabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
border: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||
),
|
||||
// decoration: InputDecoration(
|
||||
// //输入里面输入文字内边距设置
|
||||
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
// hintText: tfStr,
|
||||
// hintStyle: TextStyle(
|
||||
// color: AppColors.placeholderTextColor, fontSize: 22.sp),
|
||||
// //不需要输入框下划线
|
||||
// border: InputBorder.none,
|
||||
// ),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
|
||||
@ -9,16 +9,16 @@ class AuthorizedAdminListLogic extends BaseGetXController {
|
||||
//请求电子钥匙列表
|
||||
Future<List<ElectronicKeyListItem>> mockNetworkDataRequest() async {
|
||||
ElectronicKeyListEntity entity = await ApiRepository.to.electronicKeyList(
|
||||
'0',
|
||||
state.keyInfo.value.keyId.toString(),
|
||||
'',
|
||||
state.keyInfo.value.lockId.toString(),
|
||||
'',
|
||||
state.pageNum.toString(),
|
||||
state.pageSize.toString(),
|
||||
'0',
|
||||
'0',
|
||||
state.searchStr.value);
|
||||
endDate: '0',
|
||||
keyId: state.keyInfo.value.keyId.toString(),
|
||||
keyStatus: '',
|
||||
lockId: state.keyInfo.value.lockId.toString(),
|
||||
operatorUid: '',
|
||||
pageNo: pageNo.toString(),
|
||||
pageSize: pageSize.toString(),
|
||||
startDate: '0',
|
||||
keyRight: '0',
|
||||
searchStr:state.searchStr.value);
|
||||
List<ElectronicKeyListItem> dataList = [];
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("电子钥匙列表成功:${entity.data?.itemList}");
|
||||
|
||||
@ -36,6 +36,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
actionsList: [
|
||||
(state.getKeyInfosData.value.isLockOwner == 1 && state.getKeyInfosData.value.keyRight == 1) ?
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
@ -48,7 +49,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
child: Image.asset('images/main/icon_lockDetail_checkIn_set.png', width: 36.w, height: 36.w,)),
|
||||
child: Image.asset('images/main/icon_lockDetail_checkIn_set.png', width: 36.w, height: 36.w,)) : Container(),
|
||||
SizedBox(width: 30.w),
|
||||
],
|
||||
),
|
||||
|
||||
@ -115,17 +115,20 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName:
|
||||
"${TranslationLoader.lanKeys!.delete!.tr}${TranslationLoader.lanKeys!.company!.tr}",
|
||||
borderRadius: 20.w,
|
||||
fontSize: 32.sp,
|
||||
isDelete: true,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w),
|
||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||
onClick: () {
|
||||
showDeletCompanyAlertDialog(context);
|
||||
}),
|
||||
Visibility(
|
||||
visible: state.getKeyInfosData.value.isLockOwner == 1,
|
||||
child: SubmitBtn(
|
||||
btnName:
|
||||
"${TranslationLoader.lanKeys!.delete!.tr}${TranslationLoader.lanKeys!.company!.tr}",
|
||||
borderRadius: 20.w,
|
||||
fontSize: 32.sp,
|
||||
isDelete: true,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w),
|
||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||
onClick: () {
|
||||
showDeletCompanyAlertDialog(context);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@ -5,6 +5,8 @@ import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import '../../../../../tools/eventBusEventManage.dart';
|
||||
|
||||
class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
final ElectronicKeyDetailState state = ElectronicKeyDetailState();
|
||||
|
||||
@ -15,8 +17,10 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
state.changeNameController.text, '');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("修改要是名称成功啦啦啦啦啦");
|
||||
showToast("修改成功");
|
||||
Get.back();
|
||||
showToast("修改成功", something: (){
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,8 +30,10 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
.deleteElectronicKey(state.itemData.value.keyId.toString());
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("删除电子钥匙成功");
|
||||
showToast("删除成功");
|
||||
Get.back();
|
||||
showToast("删除成功", something: (){
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,8 @@ import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/pass
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import '../../../../../tools/eventBusEventManage.dart';
|
||||
|
||||
class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
|
||||
final ElectronicKeyDetailChangeDateState state =
|
||||
ElectronicKeyDetailChangeDateState();
|
||||
@ -23,8 +25,10 @@ class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
|
||||
hoursEnd: state.hoursEnd.value,
|
||||
isCoerced: state.isCoerced.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("修改成功");
|
||||
Get.back();
|
||||
showToast("修改成功", something: (){
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,8 +44,10 @@ class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
|
||||
state.startDay.value,
|
||||
state.weekDays.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("修改成功");
|
||||
Get.back();
|
||||
showToast("修改成功", something: (){
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,24 +1,28 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_state.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 '../../../../tools/eventBusEventManage.dart';
|
||||
|
||||
class ElectronicKeyListLogic extends BaseGetXController {
|
||||
final ElectronicKeyListState state = ElectronicKeyListState();
|
||||
|
||||
//请求电子钥匙列表
|
||||
Future<ElectronicKeyListEntity> mockNetworkDataRequest() async {
|
||||
ElectronicKeyListEntity entity = await ApiRepository.to.electronicKeyList(
|
||||
'0',
|
||||
state.keyInfo.value.keyId.toString(),
|
||||
'',
|
||||
state.keyInfo.value.lockId.toString(),
|
||||
'',
|
||||
pageNo.toString(),
|
||||
pageSize.toString(),
|
||||
'0',
|
||||
'0',
|
||||
state.searchController.text);
|
||||
endDate: '0',
|
||||
keyId: state.keyInfo.value.keyId.toString(),
|
||||
keyStatus: '',
|
||||
lockId: state.keyInfo.value.lockId.toString(),
|
||||
operatorUid: '',
|
||||
pageNo: pageNo.toString(),
|
||||
pageSize: pageSize.toString(),
|
||||
startDate: '0',
|
||||
keyRight: '0',
|
||||
searchStr: state.searchController.text);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
if (pageNo == 1) {
|
||||
state.itemDataList.value = entity.data!.itemList!;
|
||||
@ -40,6 +44,7 @@ class ElectronicKeyListLogic extends BaseGetXController {
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("重置电子钥匙成功啦啦啦啦啦");
|
||||
showToast("重置成功");
|
||||
pageNo = 1;
|
||||
mockNetworkDataRequest();
|
||||
}
|
||||
}
|
||||
@ -51,14 +56,27 @@ class ElectronicKeyListLogic extends BaseGetXController {
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("删除电子钥匙成功");
|
||||
showToast("删除成功");
|
||||
pageNo = 1;
|
||||
mockNetworkDataRequest();
|
||||
}
|
||||
}
|
||||
|
||||
/// 刷新电子钥匙列表
|
||||
StreamSubscription? _getElectronicKeyListRefreshUIEvent;
|
||||
void _getElectronicKeyListRefreshUIAction() {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
_getElectronicKeyListRefreshUIEvent = eventBus.on<ElectronicKeyListRefreshUI>().listen((event) {
|
||||
pageNo = 1;
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
|
||||
_getElectronicKeyListRefreshUIAction();
|
||||
}
|
||||
|
||||
@override
|
||||
@ -70,5 +88,8 @@ class ElectronicKeyListLogic extends BaseGetXController {
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
|
||||
_getElectronicKeyListRefreshUIEvent?.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,63 +121,64 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
Widget _buildMainUI() {
|
||||
return Obx(() => state.itemDataList.value.isEmpty
|
||||
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight - 190.h - 64.h)
|
||||
: ListView.separated(
|
||||
: SlidableAutoCloseBehavior(
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
itemCount: state.itemDataList.value.length,
|
||||
itemBuilder: (c, index) {
|
||||
ElectronicKeyListItem indexEntity = state.itemDataList.value[index];
|
||||
String useDateStr = ''; //使用期限
|
||||
String keyStatus = ''; //钥匙状态
|
||||
ElectronicKeyListItem indexEntity = state.itemDataList.value[index];
|
||||
String useDateStr = ''; //使用期限
|
||||
String keyStatus = ''; //钥匙状态
|
||||
|
||||
//使用期限
|
||||
useDateStr = getUseDateStr(indexEntity);
|
||||
//使用期限
|
||||
useDateStr = getUseDateStr(indexEntity);
|
||||
|
||||
//钥匙状态
|
||||
keyStatus = getKeyStatus(indexEntity.keyStatus);
|
||||
//钥匙状态
|
||||
keyStatus = getKeyStatus(indexEntity.keyStatus);
|
||||
|
||||
//是否为管理钥匙
|
||||
bool isAdminKey = false;
|
||||
if (indexEntity.keyRight == 1) {
|
||||
isAdminKey = true;
|
||||
} else {
|
||||
isAdminKey = false;
|
||||
}
|
||||
//是否为管理钥匙
|
||||
bool isAdminKey = false;
|
||||
if (indexEntity.keyRight == 1) {
|
||||
isAdminKey = true;
|
||||
} else {
|
||||
isAdminKey = false;
|
||||
}
|
||||
|
||||
return Slidable(
|
||||
key:ValueKey(indexEntity.keyId),
|
||||
endActionPane: ActionPane(
|
||||
extentRatio: 0.2,
|
||||
motion: const ScrollMotion(),
|
||||
children: [
|
||||
SlidableAction(
|
||||
onPressed: (BuildContext context){
|
||||
showIosTipViewDialog(context, indexEntity.keyId!.toString());
|
||||
},
|
||||
backgroundColor: Colors.red,
|
||||
foregroundColor: Colors.white,
|
||||
label: '删除',
|
||||
),
|
||||
],
|
||||
),
|
||||
child: _electronicKeyItem('images/controls_user.png',
|
||||
indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
|
||||
Navigator.pushNamed(context, Routers.electronicKeyDetailPage,
|
||||
arguments: {"itemData": indexEntity}).then((val) {
|
||||
if (val != null) {
|
||||
logic.mockNetworkDataRequest();
|
||||
setState(() {});
|
||||
}
|
||||
});
|
||||
}),
|
||||
);
|
||||
return Slidable(
|
||||
key:ValueKey(indexEntity.keyId),
|
||||
endActionPane: ActionPane(
|
||||
extentRatio: 0.2,
|
||||
motion: const ScrollMotion(),
|
||||
children: [
|
||||
SlidableAction(
|
||||
onPressed: (BuildContext context){
|
||||
showIosTipViewDialog(context, indexEntity.keyId!.toString());
|
||||
},
|
||||
backgroundColor: Colors.red,
|
||||
foregroundColor: Colors.white,
|
||||
label: '删除',
|
||||
),
|
||||
],
|
||||
),
|
||||
child: _electronicKeyItem('images/controls_user.png', indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
|
||||
Navigator.pushNamed(context, Routers.electronicKeyDetailPage,
|
||||
arguments: {"itemData": indexEntity}).then((val) {
|
||||
if (val != null) {
|
||||
logic.mockNetworkDataRequest();
|
||||
setState(() {});
|
||||
}
|
||||
});
|
||||
}),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
);
|
||||
return const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
);
|
||||
},
|
||||
));
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildDeleteBtn(String keyId) {
|
||||
@ -269,6 +270,9 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
} else if (keyStatusFlag == 110410) {
|
||||
//已重置
|
||||
keyStatus = '已重置';
|
||||
} else if (keyStatusFlag == 110412) {
|
||||
//已过期
|
||||
keyStatus = '已过期';
|
||||
}
|
||||
|
||||
return keyStatus;
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
class SendElectronicKeyLogic extends BaseGetXController {
|
||||
@ -62,6 +63,9 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print('发送电子钥匙成功');
|
||||
state.isSendSuccess.value = true;
|
||||
state.sendSucceedType.value = int.parse(state.type.value);
|
||||
resetData();
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
} else {
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
@ -162,4 +166,11 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void resetData(){
|
||||
state.emailOrPhoneController.text = "";
|
||||
state.keyNameController.text = "";
|
||||
state.selectEffectiveDate = '${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}'.obs; //默认为当前时间
|
||||
state.selectFailureDate = '${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}'.obs; //默认为当前时间
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
}
|
||||
|
||||
Widget indexChangeWidget() {
|
||||
if (state.isSendSuccess.value == true) {
|
||||
if (state.isSendSuccess.value == true && state.sendSucceedType.value.toString() == widget.type) {
|
||||
return sendElectronicKeySucceed();
|
||||
} else {
|
||||
switch (int.parse(widget.type)) {
|
||||
@ -281,8 +281,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
state.failureDateTime.value.hour,
|
||||
state.failureDateTime.value.minute);
|
||||
//发送钥匙请求
|
||||
if (state.emailOrPhoneController.text.isNotEmpty &&
|
||||
state.keyNameController.text.isNotEmpty) {
|
||||
if (state.emailOrPhoneController.text.isNotEmpty && state.keyNameController.text.isNotEmpty) {
|
||||
if (int.parse(widget.type) == 0) {
|
||||
if (!startDateTime.isBefore(endDateTime) ||
|
||||
startDateTime.isAtSameMomentAs(endDateTime)) {
|
||||
@ -372,7 +371,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
btnName: '完成',
|
||||
onClick: () {
|
||||
state.isSendSuccess.value = false;
|
||||
Navigator.pop(context, true);
|
||||
logic.resetData();
|
||||
}),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
@ -443,7 +442,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
maxLines: 1,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.deny('\n'),
|
||||
LengthLimitingTextInputFormatter(18),
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
],
|
||||
// controller: _controller,
|
||||
autofocus: false,
|
||||
@ -508,17 +507,20 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
|
||||
// 远程开锁
|
||||
Widget remoteUnlockingWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
||||
rightTitle: "",
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, height: 50.h, child: _remoteSwitch(true)),
|
||||
action: () {}),
|
||||
Container(height: 10.h),
|
||||
],
|
||||
return Visibility(
|
||||
visible: state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false,
|
||||
child: Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
||||
rightTitle: "",
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, height: 50.h, child: _remoteSwitch(true)),
|
||||
action: () {}),
|
||||
Container(height: 10.h),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -35,6 +35,8 @@ class SendElectronicKeyState {
|
||||
var weekdaysList = [].obs;
|
||||
var isCreateUser = false.obs; //用户未注册时传1 已注册传0
|
||||
|
||||
final sendSucceedType = 0.obs;
|
||||
|
||||
SendElectronicKeyState() {
|
||||
Map map = Get.arguments;
|
||||
keyInfo.value = map["keyInfo"];
|
||||
|
||||
@ -38,6 +38,13 @@ class _SendElectronicKeyManageTabbarState
|
||||
vsync: this,
|
||||
length: _itemTabs.length,
|
||||
initialIndex: widget.initialIndex);
|
||||
|
||||
_tabController.addListener(() {
|
||||
// print("_tabController.animation!.value:${_tabController.animation!.value} _tabController.index:${_tabController.index}");
|
||||
if (_tabController.animation!.value==_tabController.index){
|
||||
FocusScope.of(context).requestFocus(FocusNode());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@ -54,6 +61,9 @@ class _SendElectronicKeyManageTabbarState
|
||||
TabBar _tabBar() {
|
||||
return TabBar(
|
||||
controller: _tabController,
|
||||
onTap: (index){
|
||||
FocusScope.of(context).requestFocus(FocusNode());
|
||||
},
|
||||
tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(),
|
||||
isScrollable: true,
|
||||
indicatorColor: Colors.red,
|
||||
|
||||
@ -137,7 +137,10 @@ class LockDetailLogic extends BaseGetXController {
|
||||
case 0x16:
|
||||
// 正在开锁中...
|
||||
print("${reply.commandType}正在开锁中...");
|
||||
showToast("正在开锁中...");
|
||||
state.openLockBtnState.value = 0;
|
||||
showToast("正在开锁中...", something: (){
|
||||
cancelBlueConnetctToastTimer();
|
||||
});
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
@ -317,7 +320,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
} else {
|
||||
getLockNetToken();
|
||||
}
|
||||
|
||||
// clickPushBtnAction();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
@ -598,38 +601,45 @@ class LockDetailLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
// 0开锁 1长按闭锁 2密码 3卡 4指纹 5遥控 6人脸 7监控 8操作记录 9消息提醒 10设置
|
||||
clickItemBtnAction(int type){
|
||||
state.clickNextType = type;
|
||||
if (state.lockUserNo == 0) {
|
||||
// 电子钥匙lockUserNo为0 要先添加用户
|
||||
addUserConnectBlue();
|
||||
} else {
|
||||
clickPushBtnAction();
|
||||
}
|
||||
}
|
||||
|
||||
clickPushBtnAction(){
|
||||
// 0开锁 1长按闭锁 2密码 3卡 4指纹 5遥控 6人脸 7监控 8操作记录 9消息提醒 10设置
|
||||
switch(state.clickNextType){
|
||||
case 0:
|
||||
// 开锁
|
||||
startOpenLock();
|
||||
break;
|
||||
case 1:
|
||||
// 长按闭锁
|
||||
startUnLock();
|
||||
break;
|
||||
case 2:
|
||||
// 密码
|
||||
Get.toNamed(Routers.passwordKeyListPage, arguments: {"keyInfo": state.keyInfos.value});
|
||||
break;
|
||||
case 3:
|
||||
// 卡
|
||||
Get.toNamed(Routers.passwordKeyListPage, arguments: {"keyInfo": state.keyInfos.value});
|
||||
break;
|
||||
}
|
||||
}
|
||||
// // 0开锁 1长按闭锁 2密码 3卡 4指纹 5遥控 6人脸 7监控 8操作记录 9消息提醒 10设置
|
||||
// clickItemBtnAction(int type){
|
||||
// state.clickNextType = type;
|
||||
// if (state.lockUserNo == 0) {
|
||||
// // 电子钥匙lockUserNo为0 要先添加用户
|
||||
// addUserConnectBlue();
|
||||
// } else {
|
||||
// clickPushBtnAction();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// clickPushBtnAction(){
|
||||
// // 0开锁 1长按闭锁 2密码 3卡 4指纹 5遥控 6人脸 7监控 8操作记录 9消息提醒 10设置
|
||||
// switch(state.clickNextType){
|
||||
// case 0:
|
||||
// // 开锁
|
||||
// startOpenLock();
|
||||
// break;
|
||||
// case 1:
|
||||
// // 长按闭锁
|
||||
// startUnLock();
|
||||
// break;
|
||||
// case 2:
|
||||
// // 密码
|
||||
// Get.toNamed(Routers.passwordKeyListPage, arguments: {"keyInfo": state.keyInfos.value});
|
||||
// break;
|
||||
// case 3:
|
||||
// // 卡
|
||||
// Get.toNamed(Routers.passwordKeyListPage, arguments: {"keyInfo": state.keyInfos.value});
|
||||
// break;
|
||||
// case 10:
|
||||
// // 设置
|
||||
// Get.toNamed(Routers.lockSetPage, arguments: {
|
||||
// "lockId": state.keyInfos.value.lockId,
|
||||
// "isOnlyOneData": state.isOnlyOneData,
|
||||
// });
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 获取手机联网token,根据锁设置里面获取的开锁时是否联网来判断是否调用这个接口
|
||||
void getLockNetToken() async {
|
||||
@ -648,6 +658,8 @@ class LockDetailLogic extends BaseGetXController {
|
||||
lockUserNo: state.lockUserNo.toString());
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
if (state.isOpenLockNeedOnline.value == 0) {
|
||||
state.bottomBtnisUneable.value = false;
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
openDoorAction(1);
|
||||
} else {
|
||||
getLockNetToken();
|
||||
|
||||
@ -36,12 +36,15 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
Get.log("LockDetailPage initState1111");
|
||||
// Get.log("LockDetailPage initState1111");
|
||||
|
||||
print("LockDetailPage isOnlyOneData==${widget.isOnlyOneData}");
|
||||
state.keyInfos.value = widget.lockListInfoItemEntity;
|
||||
state.lockUserNo = state.keyInfos.value.lockUserNo!;
|
||||
print("state.lockUserNo==${state.lockUserNo}");
|
||||
if(state.lockUserNo == 0){
|
||||
state.bottomBtnisUneable.value = true;
|
||||
}
|
||||
state.isOnlyOneData = widget.isOnlyOneData;
|
||||
// print("state.lockUserNo==${state.lockUserNo}");
|
||||
state.senderUserId = state.keyInfos.value.senderUserId!;
|
||||
state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!;
|
||||
state.isOpenLockNeedOnline.value =
|
||||
@ -111,7 +114,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
}
|
||||
|
||||
Widget topWidget() {
|
||||
// KeyInfos keyInfo = widget.lockMainEntity.data!.keyInfos![0];
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(height: 50.h),
|
||||
@ -300,8 +302,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
|
||||
// 根据权限显示不同的底部按钮
|
||||
List<Widget> getBottomWidget() {
|
||||
if (state.keyInfos.value.isLockOwner == 1 ||
|
||||
state.keyInfos.value.keyRight == 1) {
|
||||
if (state.keyInfos.value.isLockOwner == 1 || state.keyInfos.value.keyRight == 1) {
|
||||
// 超级管理员、授权管理员
|
||||
return getAllWidget();
|
||||
} else {
|
||||
@ -311,20 +312,24 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
|
||||
// 普通用户
|
||||
List<Widget> getNormalWidget() {
|
||||
var showWidgetArr = [
|
||||
var showWidgetArr = <Widget>[];
|
||||
// 考勤
|
||||
if (state.isAttendance.value == 1) {
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png', TranslationLoader.lanKeys!.checkingIn!.tr, state.bottomBtnisUneable.value, () {
|
||||
Get.toNamed(Routers.checkingInListPage,
|
||||
arguments: state.keyInfos.value);
|
||||
}));
|
||||
}
|
||||
// 操作记录
|
||||
bottomItem('images/main/icon_main_operatingRecord.png', TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
||||
Get.toNamed(Routers.lockOperatingRecordPage, arguments: {"keyInfo": state.keyInfos.value});
|
||||
}),
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_operatingRecord.png', TranslationLoader.lanKeys!.operatingRecord!.tr, state.bottomBtnisUneable.value,() {
|
||||
Get.toNamed(Routers.lockOperatingRecordPage, arguments: {"keyInfo": state.keyInfos.value});
|
||||
}));
|
||||
|
||||
// 设置
|
||||
bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, () {
|
||||
Get.toNamed(Routers.lockSetPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
"isOnlyOneData": widget.isOnlyOneData,
|
||||
});
|
||||
}),
|
||||
];
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, state.bottomBtnisUneable.value, () {
|
||||
Get.toNamed(Routers.lockSetPage, arguments: {"lockId": state.keyInfos.value.lockId, "isOnlyOneData": state.isOnlyOneData});
|
||||
}));
|
||||
|
||||
return showWidgetArr;
|
||||
}
|
||||
|
||||
@ -333,30 +338,27 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
var showWidgetArr = <Widget>[];
|
||||
// 考勤
|
||||
if (state.isAttendance.value == 1) {
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png',
|
||||
TranslationLoader.lanKeys!.checkingIn!.tr, () {
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png', TranslationLoader.lanKeys!.checkingIn!.tr, state.bottomBtnisUneable.value, () {
|
||||
Get.toNamed(Routers.checkingInListPage,
|
||||
arguments: state.keyInfos.value);
|
||||
}));
|
||||
}
|
||||
|
||||
// 电子钥匙
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_electronicKey.png',
|
||||
TranslationLoader.lanKeys!.electronicKey!.tr, () {
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_electronicKey.png', TranslationLoader.lanKeys!.electronicKey!.tr, state.bottomBtnisUneable.value, () {
|
||||
Get.toNamed(Routers.electronicKeyListPage,
|
||||
arguments: {"keyInfo": state.keyInfos.value});
|
||||
}));
|
||||
|
||||
// 密码
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_password.png',
|
||||
TranslationLoader.lanKeys!.password!.tr, () {
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_password.png', TranslationLoader.lanKeys!.password!.tr, state.bottomBtnisUneable.value, () {
|
||||
Get.toNamed(Routers.passwordKeyListPage,
|
||||
arguments: {"keyInfo": state.keyInfos.value});
|
||||
}));
|
||||
|
||||
// ic卡
|
||||
if (state.keyInfos.value.lockFeature!.icCard == 1) {
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, () {
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, state.bottomBtnisUneable.value, () {
|
||||
// logic.showToast("普通用户第一次需要在锁旁边操作哦。", something: () {
|
||||
// logic.showEasyLoading();
|
||||
// });
|
||||
@ -368,8 +370,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
|
||||
// 指纹
|
||||
if (state.keyInfos.value.lockFeature!.fingerprint == 1) {
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png',
|
||||
TranslationLoader.lanKeys!.fingerprint!.tr, () {
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', TranslationLoader.lanKeys!.fingerprint!.tr, state.bottomBtnisUneable.value, () {
|
||||
Get.toNamed(Routers.fingerprintListPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
});
|
||||
@ -378,8 +379,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
|
||||
// 遥控
|
||||
if (state.keyInfos.value.lockFeature!.bluetoothRemoteControl == 1) {
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_remoteControl.png',
|
||||
TranslationLoader.lanKeys!.remoteControl!.tr, () {
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_remoteControl.png', TranslationLoader.lanKeys!.remoteControl!.tr, state.bottomBtnisUneable.value, () {
|
||||
Get.toNamed(Routers.remoteControlListPage);
|
||||
}));
|
||||
}
|
||||
@ -387,8 +387,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
//可视对讲门锁新增->人脸
|
||||
if (state.keyInfos.value.lockFeature!.d3Face == 1) {
|
||||
showWidgetArr.add(
|
||||
bottomItem('images/main/icon_face.png',
|
||||
TranslationLoader.lanKeys!.humanFace!.tr, () {
|
||||
bottomItem('images/main/icon_face.png', TranslationLoader.lanKeys!.humanFace!.tr, state.bottomBtnisUneable.value, () {
|
||||
Get.toNamed(Routers.faceList, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
}); // Toast.show(msg: "功能暂未开放");
|
||||
@ -399,8 +398,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
//可视对讲门锁新增->监控
|
||||
if (state.keyInfos.value.lockFeature!.videoIntercom == 1) {
|
||||
showWidgetArr.add(
|
||||
bottomItem('images/main/icon_catEyes.png',
|
||||
TranslationLoader.lanKeys!.monitoring!.tr, () {
|
||||
bottomItem('images/main/icon_catEyes.png', TranslationLoader.lanKeys!.monitoring!.tr, state.bottomBtnisUneable.value, () {
|
||||
Get.toNamed(Routers.realTimePicturePage, arguments: {
|
||||
"lockName": state.keyInfos.value.lockName,
|
||||
"isMonitoring": true
|
||||
@ -409,40 +407,41 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
);
|
||||
}
|
||||
|
||||
var endWiddget = [
|
||||
// 授权管理员
|
||||
bottomItem('images/main/icon_main_authorizedAdmin.png',
|
||||
TranslationLoader.lanKeys!.authorizedAdmin!.tr, () {
|
||||
// 授权管理员
|
||||
if(state.keyInfos.value.isLockOwner == 1){
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_authorizedAdmin.png', TranslationLoader.lanKeys!.authorizedAdmin!.tr, state.bottomBtnisUneable.value, () {
|
||||
Get.toNamed(Routers.authorizedAdminListPage,
|
||||
arguments: {"keyInfo": state.keyInfos.value});
|
||||
}),
|
||||
}));
|
||||
}
|
||||
// bottomItem('images/main/icon_main_authorizedAdmin.png', TranslationLoader.lanKeys!.authorizedAdmin!.tr, state.bottomBtnisUneable.value, () {
|
||||
// Get.toNamed(Routers.authorizedAdminListPage,
|
||||
// arguments: {"keyInfo": state.keyInfos.value});
|
||||
// })
|
||||
|
||||
var endWiddget = [
|
||||
// 操作记录
|
||||
bottomItem('images/main/icon_main_operatingRecord.png',
|
||||
TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
||||
bottomItem('images/main/icon_main_operatingRecord.png', TranslationLoader.lanKeys!.operatingRecord!.tr, state.bottomBtnisUneable.value, () {
|
||||
// Get.toNamed(Routers.lockOperatingRecordPage,
|
||||
// arguments: {"keyInfo": state.keyInfos.value});
|
||||
Get.toNamed(Routers.doorLockLogPage,
|
||||
arguments: {"keyInfo": state.keyInfos.value});
|
||||
}),
|
||||
// 视频日志
|
||||
bottomItem('images/main/icon_lockDetail_videoLog.png',
|
||||
TranslationLoader.lanKeys!.videoLog!.tr, () {
|
||||
bottomItem('images/main/icon_lockDetail_videoLog.png', TranslationLoader.lanKeys!.videoLog!.tr, state.bottomBtnisUneable.value, () {
|
||||
//视频日志
|
||||
Get.toNamed(Routers.videoLogPage);
|
||||
}),
|
||||
// 消息提醒
|
||||
bottomItem('images/main/icon_lockDetail_messageReminding.png',
|
||||
TranslationLoader.lanKeys!.messageReminding!.tr, () {
|
||||
bottomItem('images/main/icon_lockDetail_messageReminding.png', TranslationLoader.lanKeys!.messageReminding!.tr, state.bottomBtnisUneable.value, () {
|
||||
Get.toNamed(Routers.msgNotificationPage);
|
||||
}),
|
||||
// 设置
|
||||
bottomItem(
|
||||
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr,
|
||||
() {
|
||||
// BlueManage().stopScan();
|
||||
bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, state.bottomBtnisUneable.value, () {
|
||||
// logic.clickItemBtnAction(10);
|
||||
Get.toNamed(Routers.lockSetPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
"isOnlyOneData": widget.isOnlyOneData,
|
||||
"isOnlyOneData": state.isOnlyOneData,
|
||||
});
|
||||
}),
|
||||
];
|
||||
@ -450,11 +449,14 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
return showWidgetArr;
|
||||
}
|
||||
|
||||
Widget bottomItem(String iconUrl, String name, Function() onClick) {
|
||||
//
|
||||
Widget bottomItem(String iconUrl, String name, bool isForbidden, Function() onClick) {
|
||||
var width = 42.w;
|
||||
var height = 42.h;
|
||||
return GestureDetector(
|
||||
onTap: onClick,
|
||||
onTap: isForbidden ? (){
|
||||
logic.showToast("请在锁旁边完成第一次开锁");
|
||||
} : onClick ,
|
||||
child: Container(
|
||||
// height: 300.h,
|
||||
color: Colors.white,
|
||||
@ -463,16 +465,13 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
children: [
|
||||
SizedBox(
|
||||
width: width,
|
||||
height: height,
|
||||
child: Image.asset(iconUrl,
|
||||
width: width, height: height, fit: BoxFit.fitWidth),
|
||||
height: height,// isForbidden ? "${iconUrl}_uneable.png" :"${iconUrl}.png"
|
||||
child: Image.asset(iconUrl, width: width, height: height, color: isForbidden ? AppColors.lockDetailBottomBtnUneable : AppColors.mainColor,fit: BoxFit.fitWidth),
|
||||
),
|
||||
SizedBox(height: 10.w),
|
||||
Expanded(
|
||||
child: Text(name,
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp, color: AppColors.blackColor),
|
||||
textAlign: TextAlign.center))
|
||||
child: Text(name, style: TextStyle(fontSize: 20.sp, color: isForbidden ? AppColors.lockDetailBottomBtnUneable : AppColors.blackColor), textAlign: TextAlign.center)
|
||||
)
|
||||
],
|
||||
)),
|
||||
);
|
||||
@ -552,7 +551,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
widget.lockListInfoItemEntity.lockAlias!,
|
||||
state.keyInfos.value.lockAlias!,
|
||||
style: TextStyle(
|
||||
color: AppColors.placeholderTextColor, fontSize: 24.sp),
|
||||
),
|
||||
|
||||
@ -21,6 +21,7 @@ class LockDetailState {
|
||||
String lockNetToken = "";
|
||||
var lockUserNo = 0;
|
||||
var senderUserId = 0;
|
||||
var isOnlyOneData = false;
|
||||
|
||||
var isAttendance = 0.obs;// 是否开启考勤
|
||||
var isOpenLockNeedOnline = 0.obs; // APP开锁时是否需联网
|
||||
@ -35,8 +36,7 @@ class LockDetailState {
|
||||
var iSOpenLock = true.obs; // 是开锁还是关锁
|
||||
Timer? closedUnlockSuccessfulTimer;
|
||||
|
||||
// 0开锁 1长按闭锁 2密码 3卡 4指纹 5遥控 6人脸 7监控 8操作记录 9消息提醒 10设置
|
||||
var clickNextType = 0;
|
||||
var bottomBtnisUneable = false.obs; // 是否不可用
|
||||
|
||||
//过渡动画控制器
|
||||
late AnimationController animationController;
|
||||
|
||||
@ -34,7 +34,8 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
actionsList: [
|
||||
IconButton(
|
||||
(state.keyInfos.value.isLockOwner == 1 || state.keyInfos.value.keyRight == 1)
|
||||
? IconButton(
|
||||
icon: Image.asset(
|
||||
'images/icon_bar_more.png',
|
||||
height: 30.h,
|
||||
@ -63,7 +64,8 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
|
||||
@ -91,6 +91,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
state.lockBasicInfo.value = data["lockBasicInfo"];
|
||||
print("state.lockBasicInfo.value.lockAlias:${state.lockBasicInfo.value.lockAlias}");
|
||||
});
|
||||
}
|
||||
})),
|
||||
@ -111,8 +112,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
||||
});
|
||||
})),
|
||||
Visibility(
|
||||
visible: (state.lockBasicInfo.value.isLockOwner == 1 ||
|
||||
state.lockBasicInfo.value.keyRight == 1)
|
||||
visible: state.lockBasicInfo.value.isLockOwner == 1
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
|
||||
@ -16,8 +16,8 @@ class EditLockNameLogic extends BaseGetXController{
|
||||
lockId: state.lockSetInfoData.value.lockId.toString(),
|
||||
lockName:state.changeLockNameController.text);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.lockBasicInfo.value.lockAlias = state.changeLockNameController.text;
|
||||
showToast("修改成功", something: (){
|
||||
state.lockBasicInfo.value.lockAlias = state.changeLockNameController.text;
|
||||
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(3, state.lockBasicInfo.value.lockAlias!));
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
});
|
||||
|
||||
@ -330,7 +330,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
}))),
|
||||
// 重置键
|
||||
Obx(() => Visibility(
|
||||
visible: state.lockFeature.value.resetSwitch == 1 ? true : false,
|
||||
visible: (state.lockBasicInfo.value.isLockOwner == 1 && state.lockFeature.value.resetSwitch == 1) ? true : false,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.resetButton!.tr,
|
||||
rightTitle: (state.lockSettingInfo.value.resetSwitch ?? 0) == 1
|
||||
@ -470,7 +470,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
// 考勤
|
||||
Obx(
|
||||
() => Visibility(
|
||||
visible: state.lockFeature.value.attendance == 1 ? true : false,
|
||||
visible: (state.lockBasicInfo.value.isLockOwner == 1 && state.lockFeature.value.attendance == 1) ? true : false,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
|
||||
rightTitle: "",
|
||||
@ -481,7 +481,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
// 开锁提醒
|
||||
Obx(
|
||||
() => Visibility(
|
||||
visible: state.lockFeature.value.unlockReminder == 1 ? true : false,
|
||||
visible: state.lockBasicInfo.value.isLockOwner == 1 && state.lockFeature.value.unlockReminder == 1 ? true : false,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr,
|
||||
rightTitle: "",
|
||||
@ -492,7 +492,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
// APP开锁时是否需联网
|
||||
Obx(
|
||||
() => Visibility(
|
||||
visible: state.lockFeature.value.appUnlockOnline == 1 ? true : false,
|
||||
visible: state.lockBasicInfo.value.isLockOwner == 1 && state.lockFeature.value.appUnlockOnline == 1 ? true : false,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader
|
||||
.lanKeys!.whetherInternetRequiredWhenUnlocking!.tr,
|
||||
|
||||
@ -23,13 +23,13 @@ class RemoteUnlockingLogic extends BaseGetXController{
|
||||
remoteUnlock:state.remoteEnable.value == 1 ? 0 : 1
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
|
||||
state.remoteEnable.value = state.remoteEnable.value == 1 ? 0 : 1;
|
||||
state.lockSetInfoData.value.lockSettingInfo!.remoteUnlock = state.remoteEnable.value;
|
||||
print("state.remoteEnable.value:${state.remoteEnable.value} state.getKeyInfosData.value.remoteEnable:${state.lockSetInfoData.value.lockSettingInfo!.remoteUnlock}");
|
||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||
showToast("操作成功");
|
||||
showToast("操作成功", something: (){
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
state.remoteEnable.value = state.remoteEnable.value == 1 ? 0 : 1;
|
||||
state.lockSetInfoData.value.lockSettingInfo!.remoteUnlock = state.remoteEnable.value;
|
||||
print("state.remoteEnable.value:${state.remoteEnable.value} state.getKeyInfosData.value.remoteEnable:${state.lockSetInfoData.value.lockSettingInfo!.remoteUnlock}");
|
||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -41,6 +41,7 @@ class PasswordKeyListLogic extends BaseGetXController {
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("重置电子钥匙成功啦啦啦啦啦");
|
||||
showToast("重置成功");
|
||||
pageNo = 1;
|
||||
mockNetworkDataRequest();
|
||||
}
|
||||
}
|
||||
@ -52,6 +53,7 @@ class PasswordKeyListLogic extends BaseGetXController {
|
||||
.deleteKeyboardPwd(lockId, keyboardPwdId, deleteType);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("删除成功");
|
||||
pageNo = 1;
|
||||
mockNetworkDataRequest();
|
||||
}
|
||||
}
|
||||
@ -146,6 +148,7 @@ class PasswordKeyListLogic extends BaseGetXController {
|
||||
void _getPasswordListRefreshUIAction() {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
_getPasswordListRefreshUIEvent = eventBus.on<GetPasswordListRefreshUI>().listen((event) {
|
||||
pageNo = 1;
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import 'package:easy_refresh/easy_refresh.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -6,7 +5,6 @@ import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
import '../../../network/api_repository.dart';
|
||||
import '../../../tools/EasyRefreshTool.dart';
|
||||
import '../../../tools/dateTool.dart';
|
||||
import '../../../tools/titleAppBar.dart';
|
||||
@ -79,7 +77,7 @@ class _MessageListPageState extends State<MessageListPage> with TickerProviderSt
|
||||
),
|
||||
],
|
||||
),
|
||||
child: _selectGatewayListListItem(messageItemEntity, () {
|
||||
child: _messageListItem(messageItemEntity, () {
|
||||
Get.toNamed(Routers.messageDetailPage, arguments: {"messageItemEntity": messageItemEntity});
|
||||
}),
|
||||
);
|
||||
@ -90,51 +88,51 @@ class _MessageListPageState extends State<MessageListPage> with TickerProviderSt
|
||||
);
|
||||
}
|
||||
|
||||
Widget _selectGatewayListListItem(MessageItemEntity messageItemEntity, Function() action) {
|
||||
Widget _messageListItem(MessageItemEntity messageItemEntity, Function() action) {
|
||||
return GestureDetector(
|
||||
onTap: action,
|
||||
child: Container(
|
||||
height: 90.h,
|
||||
width: 1.sw,
|
||||
margin: EdgeInsets.only(bottom: 2.h),
|
||||
// padding:
|
||||
// EdgeInsets.only(left: 10.w, right: 20.w, top: 20.h, bottom: 20.h),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10.w),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 20.w,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
child: Container(
|
||||
width: 1.sw,
|
||||
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
SizedBox(
|
||||
width: 1.sw - 20.w*2,
|
||||
child: Flexible(
|
||||
child: Text(
|
||||
messageItemEntity.data!,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: messageItemEntity.readAt! == 0 ? AppColors.blackColor : AppColors.placeholderTextColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
// Image.asset('images/mine/icon_mine_gatewaySignal_strong.png', width: 40.w, height: 40.w,),
|
||||
// SizedBox(width: 10.w,),
|
||||
Text(DateTool().dateToYMDHNString(messageItemEntity.createdAt!.toString()), style: TextStyle(fontSize: 18.sp, color: messageItemEntity.readAt! == 0 ? AppColors.blackColor : AppColors.placeholderTextColor)),
|
||||
],
|
||||
),
|
||||
SizedBox(width: 20.h),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
SizedBox(height: 10.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
// Image.asset('images/mine/icon_mine_gatewaySignal_strong.png', width: 40.w, height: 40.w,),
|
||||
// SizedBox(width: 10.w,),
|
||||
Text(DateTool().dateToYMDHNString(messageItemEntity.createdAt!.toString()), style: TextStyle(fontSize: 18.sp, color: messageItemEntity.readAt! == 0 ? AppColors.blackColor : AppColors.placeholderTextColor)),
|
||||
],
|
||||
),
|
||||
SizedBox(width: 20.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@ -32,7 +32,7 @@ class BaseProvider extends GetConnect with Api {
|
||||
// print("post: url:${url} body:${body} contentType:${contentType} headers:${headers} query:${query}");
|
||||
if (isUnShowLoading == false) EasyLoading.show();
|
||||
// print('请求url======>$url');
|
||||
// print('请求body体======>$body');
|
||||
print('请求body体======>$body');
|
||||
var res = await super.post(url, body,
|
||||
contentType: contentType,
|
||||
headers: headers,
|
||||
|
||||
@ -125,16 +125,18 @@ class ApiRepository {
|
||||
|
||||
//电子钥匙列表
|
||||
Future<ElectronicKeyListEntity> electronicKeyList(
|
||||
String endDate,
|
||||
String keyId,
|
||||
String keyStatus,
|
||||
String lockId,
|
||||
String operatorUid,
|
||||
String pageNo,
|
||||
String pageSize,
|
||||
String startDate,
|
||||
String keyRight,
|
||||
String searchStr) async {
|
||||
{
|
||||
required String endDate,
|
||||
required String keyId,
|
||||
required String keyStatus,
|
||||
required String lockId,
|
||||
required String operatorUid,
|
||||
required String pageNo,
|
||||
required String pageSize,
|
||||
required String startDate,
|
||||
required String keyRight,
|
||||
required String searchStr
|
||||
}) async {
|
||||
final res = await apiProvider.electronicKeyList(endDate, keyId, keyStatus,
|
||||
lockId, operatorUid, pageNo, pageSize, startDate, keyRight, searchStr);
|
||||
return ElectronicKeyListEntity.fromJson(res.body);
|
||||
|
||||
@ -89,3 +89,8 @@ class GetPasswordListRefreshUI {
|
||||
class ReadMessageRefreshUI {
|
||||
ReadMessageRefreshUI();
|
||||
}
|
||||
|
||||
/// 刷新电子钥匙列表
|
||||
class ElectronicKeyListRefreshUI {
|
||||
ElectronicKeyListRefreshUI();
|
||||
}
|
||||
|
||||