Merge remote-tracking branch 'origin/master'

This commit is contained in:
葛佳祥 2024-01-29 17:48:55 +08:00
commit a6251cbc2d
38 changed files with 366 additions and 263 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -130,4 +130,6 @@ class AppColors {
static Color openPassageModeColor = const Color(0xFFEB2A3B);// () static Color openPassageModeColor = const Color(0xFFEB2A3B);// ()
static Color listTimeYellowColor = const Color(0xFFF3BA37);// () static Color listTimeYellowColor = const Color(0xFFF3BA37);// ()
static Color get lockDetailBottomBtnUneable => const Color(0xFF808080);// ()
} }

View File

@ -1,8 +1,7 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.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:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/network/api_repository.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) { Widget getTFWidget(bool isHaveBtn, String tfStr, int lineIndex) {
return SizedBox( return SizedBox(
height: 50.h, height: 65.h,
width: 300.w, width: 300.w,
child: Row( child: Row(
children: [ children: [
@ -348,6 +347,10 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
child: TextField( child: TextField(
// //
maxLines: 1, maxLines: 1,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(30),
],
controller: lineIndex == 1 controller: lineIndex == 1
? state.emailOrPhoneController ? state.emailOrPhoneController
: state.keyNameController, : state.keyNameController,
@ -355,13 +358,24 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
textAlign: TextAlign.end, textAlign: TextAlign.end,
decoration: InputDecoration( decoration: InputDecoration(
// //
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), // contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
hintText: tfStr, hintText: tfStr,
hintStyle: TextStyle( hintStyle: TextStyle(fontSize: 22.sp),
color: AppColors.placeholderTextColor, fontSize: 22.sp), focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
//线 disabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
border: InputBorder.none, 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( SizedBox(

View File

@ -9,16 +9,16 @@ class AuthorizedAdminListLogic extends BaseGetXController {
// //
Future<List<ElectronicKeyListItem>> mockNetworkDataRequest() async { Future<List<ElectronicKeyListItem>> mockNetworkDataRequest() async {
ElectronicKeyListEntity entity = await ApiRepository.to.electronicKeyList( ElectronicKeyListEntity entity = await ApiRepository.to.electronicKeyList(
'0', endDate: '0',
state.keyInfo.value.keyId.toString(), keyId: state.keyInfo.value.keyId.toString(),
'', keyStatus: '',
state.keyInfo.value.lockId.toString(), lockId: state.keyInfo.value.lockId.toString(),
'', operatorUid: '',
state.pageNum.toString(), pageNo: pageNo.toString(),
state.pageSize.toString(), pageSize: pageSize.toString(),
'0', startDate: '0',
'0', keyRight: '0',
state.searchStr.value); searchStr:state.searchStr.value);
List<ElectronicKeyListItem> dataList = []; List<ElectronicKeyListItem> dataList = [];
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print("电子钥匙列表成功:${entity.data?.itemList}"); print("电子钥匙列表成功:${entity.data?.itemList}");

View File

@ -36,6 +36,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
actionsList: [ actionsList: [
(state.getKeyInfosData.value.isLockOwner == 1 && state.getKeyInfosData.value.keyRight == 1) ?
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
@ -48,7 +49,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
logic.showToast("演示模式"); 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), SizedBox(width: 30.w),
], ],
), ),

View File

@ -115,17 +115,20 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
SizedBox( SizedBox(
height: 30.h, height: 30.h,
), ),
SubmitBtn( Visibility(
btnName: visible: state.getKeyInfosData.value.isLockOwner == 1,
"${TranslationLoader.lanKeys!.delete!.tr}${TranslationLoader.lanKeys!.company!.tr}", child: SubmitBtn(
borderRadius: 20.w, btnName:
fontSize: 32.sp, "${TranslationLoader.lanKeys!.delete!.tr}${TranslationLoader.lanKeys!.company!.tr}",
isDelete: true, borderRadius: 20.w,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w), fontSize: 32.sp,
padding: EdgeInsets.only(top: 20.w, bottom: 20.w), isDelete: true,
onClick: () { margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w),
showDeletCompanyAlertDialog(context); padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
}), onClick: () {
showDeletCompanyAlertDialog(context);
}),
),
], ],
), ),
); );

View File

@ -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/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../../tools/eventBusEventManage.dart';
class ElectronicKeyDetailLogic extends BaseGetXController { class ElectronicKeyDetailLogic extends BaseGetXController {
final ElectronicKeyDetailState state = ElectronicKeyDetailState(); final ElectronicKeyDetailState state = ElectronicKeyDetailState();
@ -15,8 +17,10 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
state.changeNameController.text, ''); state.changeNameController.text, '');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print("修改要是名称成功啦啦啦啦啦"); print("修改要是名称成功啦啦啦啦啦");
showToast("修改成功"); showToast("修改成功", something: (){
Get.back(); eventBus.fire(ElectronicKeyListRefreshUI());
Get.back();
});
} }
} }
@ -26,8 +30,10 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
.deleteElectronicKey(state.itemData.value.keyId.toString()); .deleteElectronicKey(state.itemData.value.keyId.toString());
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print("删除电子钥匙成功"); print("删除电子钥匙成功");
showToast("删除成功"); showToast("删除成功", something: (){
Get.back(); eventBus.fire(ElectronicKeyListRefreshUI());
Get.back();
});
} }
} }
} }

View File

@ -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/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../../tools/eventBusEventManage.dart';
class ElectronicKeyDetailChangeDateLogic extends BaseGetXController { class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
final ElectronicKeyDetailChangeDateState state = final ElectronicKeyDetailChangeDateState state =
ElectronicKeyDetailChangeDateState(); ElectronicKeyDetailChangeDateState();
@ -23,8 +25,10 @@ class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
hoursEnd: state.hoursEnd.value, hoursEnd: state.hoursEnd.value,
isCoerced: state.isCoerced.value); isCoerced: state.isCoerced.value);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("修改成功"); showToast("修改成功", something: (){
Get.back(); eventBus.fire(ElectronicKeyListRefreshUI());
Get.back();
});
} }
} }
@ -40,8 +44,10 @@ class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
state.startDay.value, state.startDay.value,
state.weekDays.value); state.weekDays.value);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("修改成功"); showToast("修改成功", something: (){
Get.back(); eventBus.fire(ElectronicKeyListRefreshUI());
Get.back();
});
} }
} }
} }

View File

@ -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/electronicKeyList_state.dart';
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../tools/eventBusEventManage.dart';
class ElectronicKeyListLogic extends BaseGetXController { class ElectronicKeyListLogic extends BaseGetXController {
final ElectronicKeyListState state = ElectronicKeyListState(); final ElectronicKeyListState state = ElectronicKeyListState();
// //
Future<ElectronicKeyListEntity> mockNetworkDataRequest() async { Future<ElectronicKeyListEntity> mockNetworkDataRequest() async {
ElectronicKeyListEntity entity = await ApiRepository.to.electronicKeyList( ElectronicKeyListEntity entity = await ApiRepository.to.electronicKeyList(
'0', endDate: '0',
state.keyInfo.value.keyId.toString(), keyId: state.keyInfo.value.keyId.toString(),
'', keyStatus: '',
state.keyInfo.value.lockId.toString(), lockId: state.keyInfo.value.lockId.toString(),
'', operatorUid: '',
pageNo.toString(), pageNo: pageNo.toString(),
pageSize.toString(), pageSize: pageSize.toString(),
'0', startDate: '0',
'0', keyRight: '0',
state.searchController.text); searchStr: state.searchController.text);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
if (pageNo == 1) { if (pageNo == 1) {
state.itemDataList.value = entity.data!.itemList!; state.itemDataList.value = entity.data!.itemList!;
@ -40,6 +44,7 @@ class ElectronicKeyListLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print("重置电子钥匙成功啦啦啦啦啦"); print("重置电子钥匙成功啦啦啦啦啦");
showToast("重置成功"); showToast("重置成功");
pageNo = 1;
mockNetworkDataRequest(); mockNetworkDataRequest();
} }
} }
@ -51,14 +56,27 @@ class ElectronicKeyListLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print("删除电子钥匙成功"); print("删除电子钥匙成功");
showToast("删除成功"); showToast("删除成功");
pageNo = 1;
mockNetworkDataRequest(); mockNetworkDataRequest();
} }
} }
///
StreamSubscription? _getElectronicKeyListRefreshUIEvent;
void _getElectronicKeyListRefreshUIAction() {
// eventBus
_getElectronicKeyListRefreshUIEvent = eventBus.on<ElectronicKeyListRefreshUI>().listen((event) {
pageNo = 1;
mockNetworkDataRequest();
});
}
@override @override
void onReady() { void onReady() {
// TODO: implement onReady // TODO: implement onReady
super.onReady(); super.onReady();
_getElectronicKeyListRefreshUIAction();
} }
@override @override
@ -70,5 +88,8 @@ class ElectronicKeyListLogic extends BaseGetXController {
@override @override
void onClose() { void onClose() {
// TODO: implement onClose // TODO: implement onClose
super.onClose();
_getElectronicKeyListRefreshUIEvent?.cancel();
} }
} }

View File

@ -121,63 +121,64 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
Widget _buildMainUI() { Widget _buildMainUI() {
return Obx(() => state.itemDataList.value.isEmpty return Obx(() => state.itemDataList.value.isEmpty
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight - 190.h - 64.h) ? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight - 190.h - 64.h)
: ListView.separated( : SlidableAutoCloseBehavior(
child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
itemCount: state.itemDataList.value.length, itemCount: state.itemDataList.value.length,
itemBuilder: (c, index) { itemBuilder: (c, index) {
ElectronicKeyListItem indexEntity = state.itemDataList.value[index]; ElectronicKeyListItem indexEntity = state.itemDataList.value[index];
String useDateStr = ''; //使 String useDateStr = ''; //使
String keyStatus = ''; // String keyStatus = ''; //
//使 //使
useDateStr = getUseDateStr(indexEntity); useDateStr = getUseDateStr(indexEntity);
// //
keyStatus = getKeyStatus(indexEntity.keyStatus); keyStatus = getKeyStatus(indexEntity.keyStatus);
// //
bool isAdminKey = false; bool isAdminKey = false;
if (indexEntity.keyRight == 1) { if (indexEntity.keyRight == 1) {
isAdminKey = true; isAdminKey = true;
} else { } else {
isAdminKey = false; isAdminKey = false;
} }
return Slidable( return Slidable(
key:ValueKey(indexEntity.keyId), key:ValueKey(indexEntity.keyId),
endActionPane: ActionPane( endActionPane: ActionPane(
extentRatio: 0.2, extentRatio: 0.2,
motion: const ScrollMotion(), motion: const ScrollMotion(),
children: [ children: [
SlidableAction( SlidableAction(
onPressed: (BuildContext context){ onPressed: (BuildContext context){
showIosTipViewDialog(context, indexEntity.keyId!.toString()); showIosTipViewDialog(context, indexEntity.keyId!.toString());
}, },
backgroundColor: Colors.red, backgroundColor: Colors.red,
foregroundColor: Colors.white, foregroundColor: Colors.white,
label: '删除', label: '删除',
), ),
], ],
), ),
child: _electronicKeyItem('images/controls_user.png', child: _electronicKeyItem('images/controls_user.png', indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () { Navigator.pushNamed(context, Routers.electronicKeyDetailPage,
Navigator.pushNamed(context, Routers.electronicKeyDetailPage, arguments: {"itemData": indexEntity}).then((val) {
arguments: {"itemData": indexEntity}).then((val) { if (val != null) {
if (val != null) { logic.mockNetworkDataRequest();
logic.mockNetworkDataRequest(); setState(() {});
setState(() {}); }
} });
}); }),
}), );
);
}, },
separatorBuilder: (BuildContext context, int index) { separatorBuilder: (BuildContext context, int index) {
return const Divider( return const Divider(
height: 1, height: 1,
color: AppColors.greyLineColor, color: AppColors.greyLineColor,
); );
}, },
)); ),
));
} }
Widget _buildDeleteBtn(String keyId) { Widget _buildDeleteBtn(String keyId) {
@ -269,6 +270,9 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
} else if (keyStatusFlag == 110410) { } else if (keyStatusFlag == 110410) {
// //
keyStatus = '已重置'; keyStatus = '已重置';
} else if (keyStatusFlag == 110412) {
//
keyStatus = '已过期';
} }
return keyStatus; return keyStatus;

View File

@ -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/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart';
import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/eventBusEventManage.dart';
import 'package:star_lock/translations/trans_lib.dart'; import 'package:star_lock/translations/trans_lib.dart';
class SendElectronicKeyLogic extends BaseGetXController { class SendElectronicKeyLogic extends BaseGetXController {
@ -62,6 +63,9 @@ class SendElectronicKeyLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print('发送电子钥匙成功'); print('发送电子钥匙成功');
state.isSendSuccess.value = true; state.isSendSuccess.value = true;
state.sendSucceedType.value = int.parse(state.type.value);
resetData();
eventBus.fire(ElectronicKeyListRefreshUI());
} else { } else {
if (entity.errorCode == 425) { 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; //
}
} }

View File

@ -53,7 +53,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
} }
Widget indexChangeWidget() { Widget indexChangeWidget() {
if (state.isSendSuccess.value == true) { if (state.isSendSuccess.value == true && state.sendSucceedType.value.toString() == widget.type) {
return sendElectronicKeySucceed(); return sendElectronicKeySucceed();
} else { } else {
switch (int.parse(widget.type)) { switch (int.parse(widget.type)) {
@ -281,8 +281,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
state.failureDateTime.value.hour, state.failureDateTime.value.hour,
state.failureDateTime.value.minute); state.failureDateTime.value.minute);
// //
if (state.emailOrPhoneController.text.isNotEmpty && if (state.emailOrPhoneController.text.isNotEmpty && state.keyNameController.text.isNotEmpty) {
state.keyNameController.text.isNotEmpty) {
if (int.parse(widget.type) == 0) { if (int.parse(widget.type) == 0) {
if (!startDateTime.isBefore(endDateTime) || if (!startDateTime.isBefore(endDateTime) ||
startDateTime.isAtSameMomentAs(endDateTime)) { startDateTime.isAtSameMomentAs(endDateTime)) {
@ -372,7 +371,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
btnName: '完成', btnName: '完成',
onClick: () { onClick: () {
state.isSendSuccess.value = false; state.isSendSuccess.value = false;
Navigator.pop(context, true); logic.resetData();
}), }),
SizedBox( SizedBox(
height: 10.h, height: 10.h,
@ -443,7 +442,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
maxLines: 1, maxLines: 1,
inputFormatters: <TextInputFormatter>[ inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(18), LengthLimitingTextInputFormatter(30),
], ],
// controller: _controller, // controller: _controller,
autofocus: false, autofocus: false,
@ -508,17 +507,20 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
// //
Widget remoteUnlockingWidget() { Widget remoteUnlockingWidget() {
return Column( return Visibility(
children: [ visible: state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false,
CommonItem( child: Column(
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr, children: [
rightTitle: "", CommonItem(
isHaveRightWidget: true, leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
rightWidget: rightTitle: "",
SizedBox(width: 60.w, height: 50.h, child: _remoteSwitch(true)), isHaveRightWidget: true,
action: () {}), rightWidget:
Container(height: 10.h), SizedBox(width: 60.w, height: 50.h, child: _remoteSwitch(true)),
], action: () {}),
Container(height: 10.h),
],
),
); );
} }

View File

@ -35,6 +35,8 @@ class SendElectronicKeyState {
var weekdaysList = [].obs; var weekdaysList = [].obs;
var isCreateUser = false.obs; //1 0 var isCreateUser = false.obs; //1 0
final sendSucceedType = 0.obs;
SendElectronicKeyState() { SendElectronicKeyState() {
Map map = Get.arguments; Map map = Get.arguments;
keyInfo.value = map["keyInfo"]; keyInfo.value = map["keyInfo"];

View File

@ -38,6 +38,13 @@ class _SendElectronicKeyManageTabbarState
vsync: this, vsync: this,
length: _itemTabs.length, length: _itemTabs.length,
initialIndex: widget.initialIndex); 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 @override
@ -54,6 +61,9 @@ class _SendElectronicKeyManageTabbarState
TabBar _tabBar() { TabBar _tabBar() {
return TabBar( return TabBar(
controller: _tabController, controller: _tabController,
onTap: (index){
FocusScope.of(context).requestFocus(FocusNode());
},
tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(), tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(),
isScrollable: true, isScrollable: true,
indicatorColor: Colors.red, indicatorColor: Colors.red,

View File

@ -137,7 +137,10 @@ class LockDetailLogic extends BaseGetXController {
case 0x16: case 0x16:
// ... // ...
print("${reply.commandType}正在开锁中..."); print("${reply.commandType}正在开锁中...");
showToast("正在开锁中..."); state.openLockBtnState.value = 0;
showToast("正在开锁中...", something: (){
cancelBlueConnetctToastTimer();
});
break; break;
default: default:
// //
@ -317,7 +320,7 @@ class LockDetailLogic extends BaseGetXController {
} else { } else {
getLockNetToken(); getLockNetToken();
} }
// clickPushBtnAction();
break; break;
case 0x06: case 0x06:
// //
@ -598,38 +601,45 @@ class LockDetailLogic extends BaseGetXController {
} }
} }
// 0 1 2 3 4 5 6 7 8 9 10 // // 0 1 2 3 4 5 6 7 8 9 10
clickItemBtnAction(int type){ // clickItemBtnAction(int type){
state.clickNextType = type; // state.clickNextType = type;
if (state.lockUserNo == 0) { // if (state.lockUserNo == 0) {
// lockUserNo为0 // // lockUserNo为0
addUserConnectBlue(); // addUserConnectBlue();
} else { // } else {
clickPushBtnAction(); // clickPushBtnAction();
} // }
} // }
//
clickPushBtnAction(){ // clickPushBtnAction(){
// 0 1 2 3 4 5 6 7 8 9 10 // // 0 1 2 3 4 5 6 7 8 9 10
switch(state.clickNextType){ // switch(state.clickNextType){
case 0: // case 0:
// // //
startOpenLock(); // startOpenLock();
break; // break;
case 1: // case 1:
// // //
startUnLock(); // startUnLock();
break; // break;
case 2: // case 2:
// // //
Get.toNamed(Routers.passwordKeyListPage, arguments: {"keyInfo": state.keyInfos.value}); // Get.toNamed(Routers.passwordKeyListPage, arguments: {"keyInfo": state.keyInfos.value});
break; // break;
case 3: // case 3:
// // //
Get.toNamed(Routers.passwordKeyListPage, arguments: {"keyInfo": state.keyInfos.value}); // Get.toNamed(Routers.passwordKeyListPage, arguments: {"keyInfo": state.keyInfos.value});
break; // break;
} // case 10:
} // //
// Get.toNamed(Routers.lockSetPage, arguments: {
// "lockId": state.keyInfos.value.lockId,
// "isOnlyOneData": state.isOnlyOneData,
// });
// break;
// }
// }
// token // token
void getLockNetToken() async { void getLockNetToken() async {
@ -648,6 +658,8 @@ class LockDetailLogic extends BaseGetXController {
lockUserNo: state.lockUserNo.toString()); lockUserNo: state.lockUserNo.toString());
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
if (state.isOpenLockNeedOnline.value == 0) { if (state.isOpenLockNeedOnline.value == 0) {
state.bottomBtnisUneable.value = false;
eventBus.fire(RefreshLockListInfoDataEvent());
openDoorAction(1); openDoorAction(1);
} else { } else {
getLockNetToken(); getLockNetToken();

View File

@ -36,12 +36,15 @@ class _LockDetailPageState extends State<LockDetailPage>
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
Get.log("LockDetailPage initState1111"); // Get.log("LockDetailPage initState1111");
print("LockDetailPage isOnlyOneData==${widget.isOnlyOneData}");
state.keyInfos.value = widget.lockListInfoItemEntity; state.keyInfos.value = widget.lockListInfoItemEntity;
state.lockUserNo = state.keyInfos.value.lockUserNo!; 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.senderUserId = state.keyInfos.value.senderUserId!;
state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!; state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!;
state.isOpenLockNeedOnline.value = state.isOpenLockNeedOnline.value =
@ -111,7 +114,6 @@ class _LockDetailPageState extends State<LockDetailPage>
} }
Widget topWidget() { Widget topWidget() {
// KeyInfos keyInfo = widget.lockMainEntity.data!.keyInfos![0];
return Column( return Column(
children: [ children: [
SizedBox(height: 50.h), SizedBox(height: 50.h),
@ -300,8 +302,7 @@ class _LockDetailPageState extends State<LockDetailPage>
// //
List<Widget> getBottomWidget() { List<Widget> getBottomWidget() {
if (state.keyInfos.value.isLockOwner == 1 || if (state.keyInfos.value.isLockOwner == 1 || state.keyInfos.value.keyRight == 1) {
state.keyInfos.value.keyRight == 1) {
// //
return getAllWidget(); return getAllWidget();
} else { } else {
@ -311,20 +312,24 @@ class _LockDetailPageState extends State<LockDetailPage>
// //
List<Widget> getNormalWidget() { 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, () { 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}); Get.toNamed(Routers.lockOperatingRecordPage, arguments: {"keyInfo": state.keyInfos.value});
}), }));
// //
bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, () { showWidgetArr.add(bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, state.bottomBtnisUneable.value, () {
Get.toNamed(Routers.lockSetPage, arguments: { Get.toNamed(Routers.lockSetPage, arguments: {"lockId": state.keyInfos.value.lockId, "isOnlyOneData": state.isOnlyOneData});
"lockId": state.keyInfos.value.lockId, }));
"isOnlyOneData": widget.isOnlyOneData,
});
}),
];
return showWidgetArr; return showWidgetArr;
} }
@ -333,30 +338,27 @@ class _LockDetailPageState extends State<LockDetailPage>
var showWidgetArr = <Widget>[]; var showWidgetArr = <Widget>[];
// //
if (state.isAttendance.value == 1) { if (state.isAttendance.value == 1) {
showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png', showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png', TranslationLoader.lanKeys!.checkingIn!.tr, state.bottomBtnisUneable.value, () {
TranslationLoader.lanKeys!.checkingIn!.tr, () {
Get.toNamed(Routers.checkingInListPage, Get.toNamed(Routers.checkingInListPage,
arguments: state.keyInfos.value); arguments: state.keyInfos.value);
})); }));
} }
// //
showWidgetArr.add(bottomItem('images/main/icon_main_electronicKey.png', showWidgetArr.add(bottomItem('images/main/icon_main_electronicKey.png', TranslationLoader.lanKeys!.electronicKey!.tr, state.bottomBtnisUneable.value, () {
TranslationLoader.lanKeys!.electronicKey!.tr, () {
Get.toNamed(Routers.electronicKeyListPage, Get.toNamed(Routers.electronicKeyListPage,
arguments: {"keyInfo": state.keyInfos.value}); arguments: {"keyInfo": state.keyInfos.value});
})); }));
// //
showWidgetArr.add(bottomItem('images/main/icon_main_password.png', showWidgetArr.add(bottomItem('images/main/icon_main_password.png', TranslationLoader.lanKeys!.password!.tr, state.bottomBtnisUneable.value, () {
TranslationLoader.lanKeys!.password!.tr, () {
Get.toNamed(Routers.passwordKeyListPage, Get.toNamed(Routers.passwordKeyListPage,
arguments: {"keyInfo": state.keyInfos.value}); arguments: {"keyInfo": state.keyInfos.value});
})); }));
// ic卡 // ic卡
if (state.keyInfos.value.lockFeature!.icCard == 1) { 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.showToast("普通用户第一次需要在锁旁边操作哦。", something: () {
// logic.showEasyLoading(); // logic.showEasyLoading();
// }); // });
@ -368,8 +370,7 @@ class _LockDetailPageState extends State<LockDetailPage>
// //
if (state.keyInfos.value.lockFeature!.fingerprint == 1) { if (state.keyInfos.value.lockFeature!.fingerprint == 1) {
showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', TranslationLoader.lanKeys!.fingerprint!.tr, state.bottomBtnisUneable.value, () {
TranslationLoader.lanKeys!.fingerprint!.tr, () {
Get.toNamed(Routers.fingerprintListPage, arguments: { Get.toNamed(Routers.fingerprintListPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
}); });
@ -378,8 +379,7 @@ class _LockDetailPageState extends State<LockDetailPage>
// //
if (state.keyInfos.value.lockFeature!.bluetoothRemoteControl == 1) { if (state.keyInfos.value.lockFeature!.bluetoothRemoteControl == 1) {
showWidgetArr.add(bottomItem('images/main/icon_main_remoteControl.png', showWidgetArr.add(bottomItem('images/main/icon_main_remoteControl.png', TranslationLoader.lanKeys!.remoteControl!.tr, state.bottomBtnisUneable.value, () {
TranslationLoader.lanKeys!.remoteControl!.tr, () {
Get.toNamed(Routers.remoteControlListPage); Get.toNamed(Routers.remoteControlListPage);
})); }));
} }
@ -387,8 +387,7 @@ class _LockDetailPageState extends State<LockDetailPage>
//-> //->
if (state.keyInfos.value.lockFeature!.d3Face == 1) { if (state.keyInfos.value.lockFeature!.d3Face == 1) {
showWidgetArr.add( showWidgetArr.add(
bottomItem('images/main/icon_face.png', bottomItem('images/main/icon_face.png', TranslationLoader.lanKeys!.humanFace!.tr, state.bottomBtnisUneable.value, () {
TranslationLoader.lanKeys!.humanFace!.tr, () {
Get.toNamed(Routers.faceList, arguments: { Get.toNamed(Routers.faceList, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
}); // Toast.show(msg: "功能暂未开放"); }); // Toast.show(msg: "功能暂未开放");
@ -399,8 +398,7 @@ class _LockDetailPageState extends State<LockDetailPage>
//-> //->
if (state.keyInfos.value.lockFeature!.videoIntercom == 1) { if (state.keyInfos.value.lockFeature!.videoIntercom == 1) {
showWidgetArr.add( showWidgetArr.add(
bottomItem('images/main/icon_catEyes.png', bottomItem('images/main/icon_catEyes.png', TranslationLoader.lanKeys!.monitoring!.tr, state.bottomBtnisUneable.value, () {
TranslationLoader.lanKeys!.monitoring!.tr, () {
Get.toNamed(Routers.realTimePicturePage, arguments: { Get.toNamed(Routers.realTimePicturePage, arguments: {
"lockName": state.keyInfos.value.lockName, "lockName": state.keyInfos.value.lockName,
"isMonitoring": true "isMonitoring": true
@ -409,40 +407,41 @@ class _LockDetailPageState extends State<LockDetailPage>
); );
} }
var endWiddget = [ //
// if(state.keyInfos.value.isLockOwner == 1){
bottomItem('images/main/icon_main_authorizedAdmin.png', showWidgetArr.add(bottomItem('images/main/icon_main_authorizedAdmin.png', TranslationLoader.lanKeys!.authorizedAdmin!.tr, state.bottomBtnisUneable.value, () {
TranslationLoader.lanKeys!.authorizedAdmin!.tr, () {
Get.toNamed(Routers.authorizedAdminListPage, Get.toNamed(Routers.authorizedAdminListPage,
arguments: {"keyInfo": state.keyInfos.value}); 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', bottomItem('images/main/icon_main_operatingRecord.png', TranslationLoader.lanKeys!.operatingRecord!.tr, state.bottomBtnisUneable.value, () {
TranslationLoader.lanKeys!.operatingRecord!.tr, () {
// Get.toNamed(Routers.lockOperatingRecordPage, // Get.toNamed(Routers.lockOperatingRecordPage,
// arguments: {"keyInfo": state.keyInfos.value}); // arguments: {"keyInfo": state.keyInfos.value});
Get.toNamed(Routers.doorLockLogPage, Get.toNamed(Routers.doorLockLogPage,
arguments: {"keyInfo": state.keyInfos.value}); arguments: {"keyInfo": state.keyInfos.value});
}), }),
// //
bottomItem('images/main/icon_lockDetail_videoLog.png', bottomItem('images/main/icon_lockDetail_videoLog.png', TranslationLoader.lanKeys!.videoLog!.tr, state.bottomBtnisUneable.value, () {
TranslationLoader.lanKeys!.videoLog!.tr, () {
// //
Get.toNamed(Routers.videoLogPage); Get.toNamed(Routers.videoLogPage);
}), }),
// //
bottomItem('images/main/icon_lockDetail_messageReminding.png', bottomItem('images/main/icon_lockDetail_messageReminding.png', TranslationLoader.lanKeys!.messageReminding!.tr, state.bottomBtnisUneable.value, () {
TranslationLoader.lanKeys!.messageReminding!.tr, () {
Get.toNamed(Routers.msgNotificationPage); Get.toNamed(Routers.msgNotificationPage);
}), }),
// //
bottomItem( bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, state.bottomBtnisUneable.value, () {
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, // logic.clickItemBtnAction(10);
() {
// BlueManage().stopScan();
Get.toNamed(Routers.lockSetPage, arguments: { Get.toNamed(Routers.lockSetPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
"isOnlyOneData": widget.isOnlyOneData, "isOnlyOneData": state.isOnlyOneData,
}); });
}), }),
]; ];
@ -450,11 +449,14 @@ class _LockDetailPageState extends State<LockDetailPage>
return showWidgetArr; 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 width = 42.w;
var height = 42.h; var height = 42.h;
return GestureDetector( return GestureDetector(
onTap: onClick, onTap: isForbidden ? (){
logic.showToast("请在锁旁边完成第一次开锁");
} : onClick ,
child: Container( child: Container(
// height: 300.h, // height: 300.h,
color: Colors.white, color: Colors.white,
@ -463,16 +465,13 @@ class _LockDetailPageState extends State<LockDetailPage>
children: [ children: [
SizedBox( SizedBox(
width: width, width: width,
height: height, height: height,// isForbidden ? "${iconUrl}_uneable.png" :"${iconUrl}.png"
child: Image.asset(iconUrl, child: Image.asset(iconUrl, width: width, height: height, color: isForbidden ? AppColors.lockDetailBottomBtnUneable : AppColors.mainColor,fit: BoxFit.fitWidth),
width: width, height: height, fit: BoxFit.fitWidth),
), ),
SizedBox(height: 10.w), SizedBox(height: 10.w),
Expanded( Expanded(
child: Text(name, child: Text(name, style: TextStyle(fontSize: 20.sp, color: isForbidden ? AppColors.lockDetailBottomBtnUneable : AppColors.blackColor), textAlign: TextAlign.center)
style: TextStyle( )
fontSize: 20.sp, color: AppColors.blackColor),
textAlign: TextAlign.center))
], ],
)), )),
); );
@ -552,7 +551,7 @@ class _LockDetailPageState extends State<LockDetailPage>
child: Column( child: Column(
children: [ children: [
Text( Text(
widget.lockListInfoItemEntity.lockAlias!, state.keyInfos.value.lockAlias!,
style: TextStyle( style: TextStyle(
color: AppColors.placeholderTextColor, fontSize: 24.sp), color: AppColors.placeholderTextColor, fontSize: 24.sp),
), ),

View File

@ -21,6 +21,7 @@ class LockDetailState {
String lockNetToken = ""; String lockNetToken = "";
var lockUserNo = 0; var lockUserNo = 0;
var senderUserId = 0; var senderUserId = 0;
var isOnlyOneData = false;
var isAttendance = 0.obs;// var isAttendance = 0.obs;//
var isOpenLockNeedOnline = 0.obs; // APP开锁时是否需联网 var isOpenLockNeedOnline = 0.obs; // APP开锁时是否需联网
@ -35,8 +36,7 @@ class LockDetailState {
var iSOpenLock = true.obs; // var iSOpenLock = true.obs; //
Timer? closedUnlockSuccessfulTimer; Timer? closedUnlockSuccessfulTimer;
// 0 1 2 3 4 5 6 7 8 9 10 var bottomBtnisUneable = false.obs; //
var clickNextType = 0;
// //
late AnimationController animationController; late AnimationController animationController;

View File

@ -34,7 +34,8 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
actionsList: [ actionsList: [
IconButton( (state.keyInfos.value.isLockOwner == 1 || state.keyInfos.value.keyRight == 1)
? IconButton(
icon: Image.asset( icon: Image.asset(
'images/icon_bar_more.png', 'images/icon_bar_more.png',
height: 30.h, height: 30.h,
@ -63,7 +64,8 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
logic.showToast("演示模式"); logic.showToast("演示模式");
} }
}, },
), )
: Container(),
], ],
), ),
body: Column( body: Column(

View File

@ -91,6 +91,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
if (data != null) { if (data != null) {
setState(() { setState(() {
state.lockBasicInfo.value = data["lockBasicInfo"]; state.lockBasicInfo.value = data["lockBasicInfo"];
print("state.lockBasicInfo.value.lockAlias:${state.lockBasicInfo.value.lockAlias}");
}); });
} }
})), })),
@ -111,8 +112,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
}); });
})), })),
Visibility( Visibility(
visible: (state.lockBasicInfo.value.isLockOwner == 1 || visible: state.lockBasicInfo.value.isLockOwner == 1
state.lockBasicInfo.value.keyRight == 1)
? true ? true
: false, : false,
child: CommonItem( child: CommonItem(

View File

@ -16,8 +16,8 @@ class EditLockNameLogic extends BaseGetXController{
lockId: state.lockSetInfoData.value.lockId.toString(), lockId: state.lockSetInfoData.value.lockId.toString(),
lockName:state.changeLockNameController.text); lockName:state.changeLockNameController.text);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.lockBasicInfo.value.lockAlias = state.changeLockNameController.text;
showToast("修改成功", something: (){ showToast("修改成功", something: (){
state.lockBasicInfo.value.lockAlias = state.changeLockNameController.text;
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(3, state.lockBasicInfo.value.lockAlias!)); eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(3, state.lockBasicInfo.value.lockAlias!));
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
}); });

View File

@ -330,7 +330,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
}))), }))),
// //
Obx(() => Visibility( 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( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.resetButton!.tr, leftTitel: TranslationLoader.lanKeys!.resetButton!.tr,
rightTitle: (state.lockSettingInfo.value.resetSwitch ?? 0) == 1 rightTitle: (state.lockSettingInfo.value.resetSwitch ?? 0) == 1
@ -470,7 +470,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
// //
Obx( Obx(
() => Visibility( () => Visibility(
visible: state.lockFeature.value.attendance == 1 ? true : false, visible: (state.lockBasicInfo.value.isLockOwner == 1 && state.lockFeature.value.attendance == 1) ? true : false,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr, leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
rightTitle: "", rightTitle: "",
@ -481,7 +481,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
// //
Obx( Obx(
() => Visibility( () => Visibility(
visible: state.lockFeature.value.unlockReminder == 1 ? true : false, visible: state.lockBasicInfo.value.isLockOwner == 1 && state.lockFeature.value.unlockReminder == 1 ? true : false,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr, leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr,
rightTitle: "", rightTitle: "",
@ -492,7 +492,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
// APP开锁时是否需联网 // APP开锁时是否需联网
Obx( Obx(
() => Visibility( () => Visibility(
visible: state.lockFeature.value.appUnlockOnline == 1 ? true : false, visible: state.lockBasicInfo.value.isLockOwner == 1 && state.lockFeature.value.appUnlockOnline == 1 ? true : false,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader leftTitel: TranslationLoader
.lanKeys!.whetherInternetRequiredWhenUnlocking!.tr, .lanKeys!.whetherInternetRequiredWhenUnlocking!.tr,

View File

@ -23,13 +23,13 @@ class RemoteUnlockingLogic extends BaseGetXController{
remoteUnlock:state.remoteEnable.value == 1 ? 0 : 1 remoteUnlock:state.remoteEnable.value == 1 ? 0 : 1
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
eventBus.fire(RefreshLockListInfoDataEvent()); showToast("操作成功", something: (){
eventBus.fire(RefreshLockListInfoDataEvent());
state.remoteEnable.value = state.remoteEnable.value == 1 ? 0 : 1; state.remoteEnable.value = state.remoteEnable.value == 1 ? 0 : 1;
state.lockSetInfoData.value.lockSettingInfo!.remoteUnlock = state.remoteEnable.value; state.lockSetInfoData.value.lockSettingInfo!.remoteUnlock = state.remoteEnable.value;
print("state.remoteEnable.value:${state.remoteEnable.value} state.getKeyInfosData.value.remoteEnable:${state.lockSetInfoData.value.lockSettingInfo!.remoteUnlock}"); print("state.remoteEnable.value:${state.remoteEnable.value} state.getKeyInfosData.value.remoteEnable:${state.lockSetInfoData.value.lockSettingInfo!.remoteUnlock}");
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
showToast("操作成功"); });
} }
} }

View File

@ -41,6 +41,7 @@ class PasswordKeyListLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
print("重置电子钥匙成功啦啦啦啦啦"); print("重置电子钥匙成功啦啦啦啦啦");
showToast("重置成功"); showToast("重置成功");
pageNo = 1;
mockNetworkDataRequest(); mockNetworkDataRequest();
} }
} }
@ -52,6 +53,7 @@ class PasswordKeyListLogic extends BaseGetXController {
.deleteKeyboardPwd(lockId, keyboardPwdId, deleteType); .deleteKeyboardPwd(lockId, keyboardPwdId, deleteType);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("删除成功"); showToast("删除成功");
pageNo = 1;
mockNetworkDataRequest(); mockNetworkDataRequest();
} }
} }
@ -146,6 +148,7 @@ class PasswordKeyListLogic extends BaseGetXController {
void _getPasswordListRefreshUIAction() { void _getPasswordListRefreshUIAction() {
// eventBus // eventBus
_getPasswordListRefreshUIEvent = eventBus.on<GetPasswordListRefreshUI>().listen((event) { _getPasswordListRefreshUIEvent = eventBus.on<GetPasswordListRefreshUI>().listen((event) {
pageNo = 1;
mockNetworkDataRequest(); mockNetworkDataRequest();
}); });
} }

View File

@ -1,4 +1,3 @@
import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -6,7 +5,6 @@ import 'package:star_lock/tools/noData.dart';
import '../../../appRouters.dart'; import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart'; import '../../../app_settings/app_colors.dart';
import '../../../network/api_repository.dart';
import '../../../tools/EasyRefreshTool.dart'; import '../../../tools/EasyRefreshTool.dart';
import '../../../tools/dateTool.dart'; import '../../../tools/dateTool.dart';
import '../../../tools/titleAppBar.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}); 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( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
height: 90.h, height: 90.h,
width: 1.sw,
margin: EdgeInsets.only(bottom: 2.h), margin: EdgeInsets.only(bottom: 2.h),
// padding:
// EdgeInsets.only(left: 10.w, right: 20.w, top: 20.h, bottom: 20.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(10.w), borderRadius: BorderRadius.circular(10.w),
), ),
child: Row( child: Container(
children: [ width: 1.sw,
SizedBox( margin: EdgeInsets.only(left: 20.w, right: 20.w),
width: 20.w, child: Column(
), mainAxisAlignment: MainAxisAlignment.center,
Expanded( children: [
child: Column( Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Row( SizedBox(
mainAxisAlignment: MainAxisAlignment.spaceBetween, width: 1.sw - 20.w*2,
children: [ child: Flexible(
Text( child: Text(
messageItemEntity.data!, messageItemEntity.data!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 22.sp, color: messageItemEntity.readAt! == 0 ? AppColors.blackColor : AppColors.placeholderTextColor), 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),
],
),
), ),
), ),
); );

View File

@ -33,7 +33,7 @@ class BaseProvider extends GetConnect with Api {
// print("post: url:${url} body:${body} contentType:${contentType} headers:${headers} query:${query}"); // print("post: url:${url} body:${body} contentType:${contentType} headers:${headers} query:${query}");
if (isUnShowLoading == false) EasyLoading.show(); if (isUnShowLoading == false) EasyLoading.show();
// print('请求url======>$url'); // print('请求url======>$url');
// print('请求body体======>$body'); print('请求body体======>$body');
var res = await super.post(url, body, var res = await super.post(url, body,
contentType: contentType, contentType: contentType,
headers: headers, headers: headers,

View File

@ -125,16 +125,18 @@ class ApiRepository {
// //
Future<ElectronicKeyListEntity> electronicKeyList( Future<ElectronicKeyListEntity> electronicKeyList(
String endDate, {
String keyId, required String endDate,
String keyStatus, required String keyId,
String lockId, required String keyStatus,
String operatorUid, required String lockId,
String pageNo, required String operatorUid,
String pageSize, required String pageNo,
String startDate, required String pageSize,
String keyRight, required String startDate,
String searchStr) async { required String keyRight,
required String searchStr
}) async {
final res = await apiProvider.electronicKeyList(endDate, keyId, keyStatus, final res = await apiProvider.electronicKeyList(endDate, keyId, keyStatus,
lockId, operatorUid, pageNo, pageSize, startDate, keyRight, searchStr); lockId, operatorUid, pageNo, pageSize, startDate, keyRight, searchStr);
return ElectronicKeyListEntity.fromJson(res.body); return ElectronicKeyListEntity.fromJson(res.body);

View File

@ -89,3 +89,8 @@ class GetPasswordListRefreshUI {
class ReadMessageRefreshUI { class ReadMessageRefreshUI {
ReadMessageRefreshUI(); ReadMessageRefreshUI();
} }
///
class ElectronicKeyListRefreshUI {
ElectronicKeyListRefreshUI();
}