Merge remote-tracking branch 'origin/master'
|
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 openPassageModeColor = const Color(0xFFEB2A3B);// 首页开启常开模式颜色(红色)
|
||||||
static Color listTimeYellowColor = const Color(0xFFF3BA37);// 首页时间过期颜色(黄色)
|
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/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(
|
||||||
|
|||||||
@ -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}");
|
||||||
|
|||||||
@ -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),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -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);
|
||||||
|
}),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -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();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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; //默认为当前时间
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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"];
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
@ -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),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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(
|
||||||
|
|||||||
@ -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(
|
||||||
|
|||||||
@ -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());
|
||||||
});
|
});
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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("操作成功");
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -89,3 +89,8 @@ class GetPasswordListRefreshUI {
|
|||||||
class ReadMessageRefreshUI {
|
class ReadMessageRefreshUI {
|
||||||
ReadMessageRefreshUI();
|
ReadMessageRefreshUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 刷新电子钥匙列表
|
||||||
|
class ElectronicKeyListRefreshUI {
|
||||||
|
ElectronicKeyListRefreshUI();
|
||||||
|
}
|
||||||
|
|||||||