新增授权管理员模块实名认证相关流程及逻辑处理
This commit is contained in:
parent
5f0840a9f3
commit
cfa309c0ba
@ -1,9 +1,13 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
|
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
@ -136,6 +140,45 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//如果打开了实名认证,需要弹出输入身份证信息框
|
||||||
|
if (state.isAuthentication.value == true) {
|
||||||
|
if (state.realNameController.text.isEmpty) {
|
||||||
|
showToast("请输入真实姓名".tr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.idCardController.text.isEmpty) {
|
||||||
|
showToast("请输入身份证号".tr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//弹出身份证信息确认框
|
||||||
|
ShowCupertinoAlertView().realNameIDCardInfoComfirmAlert(
|
||||||
|
getNameStr: state.realNameController.text,
|
||||||
|
getIDCardStr: state.idCardController.text,
|
||||||
|
onConfirm: () {
|
||||||
|
goSendElectronicKey(
|
||||||
|
endDate: endDate,
|
||||||
|
getKeyType: getKeyType,
|
||||||
|
startDate: startDate,
|
||||||
|
startTime: startTime,
|
||||||
|
endTime: endTime);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
goSendElectronicKey(
|
||||||
|
endDate: endDate,
|
||||||
|
getKeyType: getKeyType,
|
||||||
|
startDate: startDate,
|
||||||
|
startTime: startTime,
|
||||||
|
endTime: endTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> goSendElectronicKey(
|
||||||
|
{required String endDate,
|
||||||
|
required String getKeyType,
|
||||||
|
required String startDate,
|
||||||
|
required String startTime,
|
||||||
|
required String endTime}) async {
|
||||||
var entity = await ApiRepository.to.sendElectronicKey(
|
var entity = await ApiRepository.to.sendElectronicKey(
|
||||||
createUser: state.isCreateUser.value ? "1" : "0",
|
createUser: state.isCreateUser.value ? "1" : "0",
|
||||||
countryCode: state.countryCode.value,
|
countryCode: state.countryCode.value,
|
||||||
@ -156,8 +199,12 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
startTime: int.parse(startTime),
|
startTime: int.parse(startTime),
|
||||||
endTime: int.parse(endTime),
|
endTime: int.parse(endTime),
|
||||||
isOnlyManageSelf: state.onlyManageYouCreatesUser.value ? 1 : 0,
|
isOnlyManageSelf: state.onlyManageYouCreatesUser.value ? 1 : 0,
|
||||||
realName: '',
|
realName: state.isRequireAuth.value == true
|
||||||
idCardNumber: '');
|
? state.realNameController.text
|
||||||
|
: "",
|
||||||
|
idCardNumber: state.isRequireAuth.value == true
|
||||||
|
? state.idCardController.text
|
||||||
|
: "");
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.isCreateUser.value = false;
|
state.isCreateUser.value = false;
|
||||||
state.isSendSuccess.value = true;
|
state.isSendSuccess.value = true;
|
||||||
@ -169,7 +216,6 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
if (entity.errorCode == 425) {
|
if (entity.errorCode == 425) {
|
||||||
//用户未注册
|
//用户未注册
|
||||||
state.isCreateUser.value = true;
|
state.isCreateUser.value = true;
|
||||||
// _showDialog('${entity.errorMsg}');
|
|
||||||
ShowTipView().showIosTipWithContentDialog(
|
ShowTipView().showIosTipWithContentDialog(
|
||||||
'${"是否发送授权管理员给未注册账号".tr}\n${state.emailOrPhoneController.text}',
|
'${"是否发送授权管理员给未注册账号".tr}\n${state.emailOrPhoneController.text}',
|
||||||
() {
|
() {
|
||||||
@ -179,6 +225,24 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//检测实名认证是否支持开启
|
||||||
|
Future<void> keyCheckFace() async {
|
||||||
|
AdvancedFunctionRecordEntity entity = await ApiRepository.to.keyCheckFace(
|
||||||
|
countryCode: int.parse(state.countryCode.value),
|
||||||
|
account: state.emailOrPhoneController.text);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
//打开实名认证,需要弹出输入身份证信息框
|
||||||
|
state.isRequireAuth.value = true;
|
||||||
|
} else {
|
||||||
|
ShowTipView().showBuyTipWithContentAlert(
|
||||||
|
titleStr: '实名认证为付费功能,请购买后再使用'.tr,
|
||||||
|
sureClick: () {
|
||||||
|
Get.toNamed(Routers.advancedFeaturesWebPage,
|
||||||
|
arguments: {'isShop': false});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
||||||
Future<void> updateRoomCheckIn() async {
|
Future<void> updateRoomCheckIn() async {
|
||||||
var entity = await ApiRepository.to.setRoomStatusData(
|
var entity = await ApiRepository.to.setRoomStatusData(
|
||||||
@ -190,40 +254,25 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//用户未注册确认弹窗
|
TextEditingController getCurrentController(int lineIndex) {
|
||||||
// void _showDialog(String errMsg) {
|
TextEditingController currentController = TextEditingController();
|
||||||
// showCupertinoDialog(
|
switch (lineIndex) {
|
||||||
// context: Get.context!,
|
case 1:
|
||||||
// builder: (context) {
|
currentController = state.emailOrPhoneController;
|
||||||
// return CupertinoAlertDialog(
|
break;
|
||||||
// title: const Text('接收者号码未注册,请重新发送'),
|
case 2:
|
||||||
// actions: [
|
currentController = state.keyNameController;
|
||||||
// CupertinoDialogAction(
|
break;
|
||||||
// child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
case 3:
|
||||||
// onPressed: () {
|
currentController = state.realNameController;
|
||||||
// Get.back();
|
break;
|
||||||
// },
|
case 4:
|
||||||
// ),
|
currentController = state.idCardController;
|
||||||
// CupertinoDialogAction(
|
break;
|
||||||
// child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
default:
|
||||||
// onPressed: () async {
|
}
|
||||||
// //选择国家代码
|
return currentController;
|
||||||
// Get.back();
|
}
|
||||||
//
|
|
||||||
// // var result = await Get.toNamed(Routers.selectCountryRegionPage);
|
|
||||||
// // if (result != null) {
|
|
||||||
// // result as Map<String, dynamic>;
|
|
||||||
// // state.countryCode.value = result['code'];
|
|
||||||
// // state.countryName.value = result['countryName'];
|
|
||||||
// // }
|
|
||||||
// sendElectronicKeyRequest();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
|
|||||||
@ -36,7 +36,6 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initState
|
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
state.tabController =
|
state.tabController =
|
||||||
@ -82,7 +81,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
children: [
|
children: [
|
||||||
keyInfoWidget(),
|
keyInfoWidget(),
|
||||||
keyTimeWidget(),
|
keyTimeWidget(),
|
||||||
keyRealNameWidget(),
|
keyOnlyManageWidget(),
|
||||||
keyBottomWidget(
|
keyBottomWidget(
|
||||||
TranslationLoader.lanKeys!.authorizedAdminTip!.tr)
|
TranslationLoader.lanKeys!.authorizedAdminTip!.tr)
|
||||||
],
|
],
|
||||||
@ -95,7 +94,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
keyInfoWidget(),
|
keyInfoWidget(),
|
||||||
keyRealNameWidget(),
|
keyOnlyManageWidget(),
|
||||||
keyBottomWidget(
|
keyBottomWidget(
|
||||||
TranslationLoader.lanKeys!.authorizedAdminTip!.tr)
|
TranslationLoader.lanKeys!.authorizedAdminTip!.tr)
|
||||||
],
|
],
|
||||||
@ -189,7 +188,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 实名认证
|
// 实名认证
|
||||||
Widget keyRealNameWidget() {
|
Widget keyOnlyManageWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
CommonItem(
|
||||||
@ -205,17 +204,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
height: 50.h,
|
height: 50.h,
|
||||||
child: _onlyManageYouCreatesUserSwitch())),
|
child: _onlyManageYouCreatesUserSwitch())),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
CommonItem(
|
keyRealNameWidget(),
|
||||||
leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
|
||||||
rightTitle: "",
|
|
||||||
isTipsImg: true,
|
|
||||||
tipsImgAction: () {
|
|
||||||
ShowTipView().showSureAlertDialog(
|
|
||||||
"人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。");
|
|
||||||
},
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _switch()),
|
|
||||||
action: () {}),
|
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -227,7 +216,6 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.all(20.w),
|
padding: EdgeInsets.all(20.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -255,7 +243,6 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
}),
|
}),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(right: 30.w),
|
padding: EdgeInsets.only(right: 30.w),
|
||||||
// color: Colors.red,
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
@ -264,7 +251,6 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
Get.toNamed(Routers.volumeAuthorizationLockManagePage);
|
Get.toNamed(Routers.volumeAuthorizationLockManagePage);
|
||||||
// Navigator.pushNamed(context, Routers.volumeAuthorizationLockManagePage);
|
|
||||||
} else {
|
} else {
|
||||||
logic.showToast("演示模式");
|
logic.showToast("演示模式");
|
||||||
}
|
}
|
||||||
@ -281,6 +267,43 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 实名认证
|
||||||
|
Widget keyRealNameWidget() {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||||
|
rightTitle: "",
|
||||||
|
isTipsImg: true,
|
||||||
|
isHaveLine:
|
||||||
|
logic.state.isRequireAuth.value == true ? true : false,
|
||||||
|
tipsImgAction: () {
|
||||||
|
ShowTipView().showSureAlertDialog(
|
||||||
|
"人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。".tr);
|
||||||
|
},
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: SizedBox(
|
||||||
|
width: 60.w, height: 50.h, child: _realNameAuthSwitch()),
|
||||||
|
)),
|
||||||
|
Obx(() => Visibility(
|
||||||
|
visible: logic.state.isRequireAuth.value,
|
||||||
|
child: CommonItem(
|
||||||
|
leftTitel: '真实姓名'.tr,
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
isHaveLine: true,
|
||||||
|
rightWidget: getTFWidget(false, '请输入真实姓名'.tr, 3)))),
|
||||||
|
Obx(() => Visibility(
|
||||||
|
visible: logic.state.isRequireAuth.value,
|
||||||
|
child: CommonItem(
|
||||||
|
leftTitel: '身份证号'.tr,
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: getTFWidget(false, '请输入身份证号'.tr, 4)))),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// 发送电子钥匙成功
|
// 发送电子钥匙成功
|
||||||
Widget sendElectronicKeySucceed() {
|
Widget sendElectronicKeySucceed() {
|
||||||
return Column(
|
return Column(
|
||||||
@ -336,11 +359,9 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
if (state.emailOrPhoneController.text.contains("@")) {
|
if (state.emailOrPhoneController.text.contains("@")) {
|
||||||
Get.toNamed(Routers.sendEmailNotificationPage);
|
Get.toNamed(Routers.sendEmailNotificationPage);
|
||||||
} else {
|
} else {
|
||||||
// _openModalBottomSheet();
|
|
||||||
NativeInteractionTool()
|
NativeInteractionTool()
|
||||||
.loadNativeShare(shareText: state.pwdShareStr);
|
.loadNativeShare(shareText: state.pwdShareStr);
|
||||||
}
|
}
|
||||||
// Get.toNamed(state.emailOrPhoneController.text.contains("@")? Routers.sendEmailNotificationPage:Routers.sendEmailNotificationPage);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -349,7 +370,6 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
OutLineBtn(
|
OutLineBtn(
|
||||||
btnName: '微信通知',
|
btnName: '微信通知',
|
||||||
onClick: () {
|
onClick: () {
|
||||||
// _openModalBottomSheet();
|
|
||||||
NativeInteractionTool()
|
NativeInteractionTool()
|
||||||
.loadNativeShare(shareText: state.pwdShareStr);
|
.loadNativeShare(shareText: state.pwdShareStr);
|
||||||
},
|
},
|
||||||
@ -357,12 +377,6 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
// OutLineBtn(
|
|
||||||
// btnName: '标记为:已入住',
|
|
||||||
// onClick: () {
|
|
||||||
// logic.updateRoomCheckIn();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -384,9 +398,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
],
|
],
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||||
controller: lineIndex == 1
|
controller: logic.getCurrentController(lineIndex),
|
||||||
? state.emailOrPhoneController
|
|
||||||
: state.keyNameController,
|
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
textAlign: TextAlign.end,
|
textAlign: TextAlign.end,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@ -408,15 +420,6 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
BorderSide(width: 0, color: Colors.transparent)),
|
BorderSide(width: 0, color: Colors.transparent)),
|
||||||
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
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(
|
||||||
@ -460,7 +463,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
//实名认证
|
//实名认证
|
||||||
CupertinoSwitch _switch() {
|
CupertinoSwitch _realNameAuthSwitch() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
@ -469,6 +472,11 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.isAuthentication.value = !state.isAuthentication.value;
|
state.isAuthentication.value = !state.isAuthentication.value;
|
||||||
|
if (state.isAuthentication.value == true) {
|
||||||
|
logic.keyCheckFace();
|
||||||
|
} else {
|
||||||
|
state.isRequireAuth.value = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -631,11 +639,9 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
|
|
||||||
Tab _tab(ItemView item) {
|
Tab _tab(ItemView item) {
|
||||||
return Tab(
|
return Tab(
|
||||||
// text: item.title,
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 1.sw / 4,
|
width: 1.sw / 4,
|
||||||
margin: EdgeInsets.all(10.w),
|
margin: EdgeInsets.all(10.w),
|
||||||
// color: Colors.red,
|
|
||||||
child: Text(
|
child: Text(
|
||||||
item.title,
|
item.title,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
|
|||||||
@ -3,23 +3,27 @@ import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
|
|
||||||
import '../../../lockMian/entity/lockListInfo_entity.dart';
|
|
||||||
|
|
||||||
class AuthorizedAdminState {
|
class AuthorizedAdminState {
|
||||||
final TextEditingController emailOrPhoneController = TextEditingController(); //邮箱/手机号输入框
|
final TextEditingController emailOrPhoneController =
|
||||||
final TextEditingController keyNameController = TextEditingController(); //钥匙名输入框
|
TextEditingController(); //邮箱/手机号输入框
|
||||||
|
final TextEditingController keyNameController =
|
||||||
|
TextEditingController(); //钥匙名输入框
|
||||||
late TabController tabController;
|
late TabController tabController;
|
||||||
|
TextEditingController realNameController = TextEditingController(); //真实姓名输入框
|
||||||
|
TextEditingController idCardController = TextEditingController(); //身份证号输入框
|
||||||
|
|
||||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||||
late Contact contact;
|
late Contact contact;
|
||||||
|
|
||||||
// final keyInfo = LockListInfoItemEntity().obs;
|
var isAuthentication = false.obs; //是否可以实名认证
|
||||||
// final lockMainEntity = LockMainEntity().obs;
|
|
||||||
final isAuthentication = false.obs; //是否可以实名认证
|
|
||||||
final onlyManageYouCreatesUser = false.obs; // 只能管理自己创建的用户
|
final onlyManageYouCreatesUser = false.obs; // 只能管理自己创建的用户
|
||||||
|
|
||||||
var beginDate = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs; //默认为当前时间 开始时间
|
var beginDate = DateTool()
|
||||||
var endDate = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;//默认为当前时间 结束时间
|
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||||
|
.obs; //默认为当前时间 开始时间
|
||||||
|
var endDate = DateTool()
|
||||||
|
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||||
|
.obs; //默认为当前时间 结束时间
|
||||||
|
|
||||||
var isSendSuccess = false.obs;
|
var isSendSuccess = false.obs;
|
||||||
var countryName = '中国'.obs;
|
var countryName = '中国'.obs;
|
||||||
@ -31,9 +35,5 @@ class AuthorizedAdminState {
|
|||||||
String pwdShareStr = '您好,您的授权管理员生成成功';
|
String pwdShareStr = '您好,您的授权管理员生成成功';
|
||||||
|
|
||||||
var addUserId = ''.obs;
|
var addUserId = ''.obs;
|
||||||
// AuthorizedAdminState() {
|
var isRequireAuth = false.obs; //是否需要实名认证的必填项
|
||||||
// Map map = Get.arguments;
|
|
||||||
// // lockMainEntity.value = map["lockMainEntity"];
|
|
||||||
// keyInfo.value = map["keyInfo"];
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,14 +22,14 @@ class AuthorizedAdminListLogic extends BaseGetXController {
|
|||||||
pageNo: pageNo.toString(),
|
pageNo: pageNo.toString(),
|
||||||
pageSize: pageSize.toString(),
|
pageSize: pageSize.toString(),
|
||||||
startDate: '0',
|
startDate: '0',
|
||||||
searchStr:state.searchStr.value);
|
searchStr: state.searchStr.value);
|
||||||
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;
|
||||||
pageNo++;
|
pageNo++;
|
||||||
} else {
|
} else {
|
||||||
if (entity.data!.itemList!.isNotEmpty) {
|
if (entity.data!.itemList.isNotEmpty) {
|
||||||
state.itemDataList.value.addAll(entity.data!.itemList!);
|
state.itemDataList.addAll(entity.data!.itemList);
|
||||||
pageNo++;
|
pageNo++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -39,11 +39,8 @@ class AuthorizedAdminListLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//删除电子钥匙名称请求
|
//删除电子钥匙名称请求
|
||||||
Future<void> deleteKeyRequest(String keyId, int includeUnderlings) async {
|
Future<void> deleteKeyRequest(String keyId, int includeUnderlings) async {
|
||||||
ElectronicKeyListEntity entity =
|
ElectronicKeyListEntity entity = await ApiRepository.to.deleteElectronicKey(
|
||||||
await ApiRepository.to.deleteElectronicKey(
|
keyId: keyId, includeUnderlings: includeUnderlings);
|
||||||
keyId:keyId,
|
|
||||||
includeUnderlings: includeUnderlings
|
|
||||||
);
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast("删除成功");
|
showToast("删除成功");
|
||||||
pageNo = 1;
|
pageNo = 1;
|
||||||
@ -55,7 +52,8 @@ class AuthorizedAdminListLogic extends BaseGetXController {
|
|||||||
StreamSubscription? _getAuthorizedAdminPageRefreshUIEvent;
|
StreamSubscription? _getAuthorizedAdminPageRefreshUIEvent;
|
||||||
void _getAuthorizedAdminPageRefreshUIAction() {
|
void _getAuthorizedAdminPageRefreshUIAction() {
|
||||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||||
_getAuthorizedAdminPageRefreshUIEvent = eventBus.on<AuthorizedAdminPageRefreshUI>().listen((event) {
|
_getAuthorizedAdminPageRefreshUIEvent =
|
||||||
|
eventBus.on<AuthorizedAdminPageRefreshUI>().listen((event) {
|
||||||
pageNo = 1;
|
pageNo = 1;
|
||||||
mockNetworkDataRequest();
|
mockNetworkDataRequest();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import 'package:star_lock/tools/storage.dart';
|
|||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../tools/EasyRefreshTool.dart';
|
import '../../../../tools/EasyRefreshTool.dart';
|
||||||
import '../../../../tools/showIosTipView.dart';
|
|
||||||
import '../../../../tools/showTipView.dart';
|
import '../../../../tools/showTipView.dart';
|
||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
@ -40,7 +39,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
// 获取是否是演示模式 演示模式不获取接口
|
// 获取是否是演示模式 演示模式不获取接口
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
logic.mockNetworkDataRequest().then((ElectronicKeyListEntity value){
|
logic.mockNetworkDataRequest().then((ElectronicKeyListEntity value) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -56,24 +55,24 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
),
|
),
|
||||||
body: EasyRefreshTool(
|
body: EasyRefreshTool(
|
||||||
onRefresh: (){
|
onRefresh: () {
|
||||||
logic.pageNo = 1;
|
logic.pageNo = 1;
|
||||||
mockRequest();
|
mockRequest();
|
||||||
},
|
},
|
||||||
onLoad: (){
|
onLoad: () {
|
||||||
mockRequest();
|
mockRequest();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(child: _buildMainUI()),
|
||||||
child:_buildMainUI()),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
AddBottomWhiteBtn(
|
AddBottomWhiteBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.addAuthorizedAdmin!.tr,
|
btnName: TranslationLoader.lanKeys!.addAuthorizedAdmin!.tr,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
Navigator.pushNamed(context, Routers.authorizedAdminPage).then((val) {
|
Navigator.pushNamed(context, Routers.authorizedAdminPage)
|
||||||
|
.then((val) {
|
||||||
if (val != null) {
|
if (val != null) {
|
||||||
logic.pageNo = 1;
|
logic.pageNo = 1;
|
||||||
mockRequest();
|
mockRequest();
|
||||||
@ -93,116 +92,80 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
return Obx(() => state.itemDataList.value.isEmpty
|
return Obx(() => state.itemDataList.value.isEmpty
|
||||||
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - 90)
|
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - 90)
|
||||||
: SlidableAutoCloseBehavior(
|
: SlidableAutoCloseBehavior(
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
itemCount: state.itemDataList.value.length,
|
itemCount: state.itemDataList.value.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (c, index) {
|
||||||
ElectronicKeyListItem indexEntity = state.itemDataList.value[index];
|
ElectronicKeyListItem indexEntity =
|
||||||
String useDateStr = ''; //使用期限
|
state.itemDataList.value[index];
|
||||||
String keyStatus = ''; //钥匙状态
|
String useDateStr = ''; //使用期限
|
||||||
|
String keyStatus = ''; //钥匙状态
|
||||||
|
|
||||||
//使用期限
|
//使用期限
|
||||||
useDateStr = getUseDateStr(indexEntity);
|
useDateStr = getUseDateStr(indexEntity);
|
||||||
|
|
||||||
//钥匙状态
|
//钥匙状态
|
||||||
keyStatus = XSConstantMacro.getKeyStatusStr(indexEntity.keyStatus!);
|
keyStatus =
|
||||||
|
XSConstantMacro.getKeyStatusStr(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(
|
|
||||||
key:ValueKey(indexEntity.keyId),
|
|
||||||
endActionPane: ActionPane(
|
|
||||||
extentRatio: 0.2,
|
|
||||||
motion: const ScrollMotion(),
|
|
||||||
children: [
|
|
||||||
SlidableAction(
|
|
||||||
onPressed: (BuildContext context){
|
|
||||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
|
||||||
logic.deleteKeyRequest(indexEntity.keyId.toString(), isAllData ? 1 : 0);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
backgroundColor: Colors.red,
|
|
||||||
foregroundColor: Colors.white,
|
|
||||||
label: '删除',
|
|
||||||
padding: EdgeInsets.only(left: 5.w, right: 5.w),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: _electronicKeyItem('images/controls_user.png', indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
|
|
||||||
Navigator.pushNamed(context, Routers.electronicKeyDetailPage, arguments: {
|
|
||||||
"itemData": indexEntity,
|
|
||||||
}).then((val) {
|
|
||||||
if (val != null) {
|
|
||||||
logic.mockNetworkDataRequest();
|
|
||||||
setState(() {});
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
// if (index < state.itemDataList.value.length) {
|
return Slidable(
|
||||||
// return LeftSlideActions(
|
key: ValueKey(indexEntity.keyId),
|
||||||
// // key: Key(indexEntity.lockId!.toString()),
|
endActionPane: ActionPane(
|
||||||
// actionsWidth: 60,
|
extentRatio: 0.2,
|
||||||
// actions: [
|
motion: const ScrollMotion(),
|
||||||
// _buildDeleteBtn(indexEntity),
|
children: [
|
||||||
// ],
|
SlidableAction(
|
||||||
// decoration: const BoxDecoration(
|
onPressed: (BuildContext context) {
|
||||||
// borderRadius: BorderRadius.all(Radius.circular(1)),
|
ShowTipView()
|
||||||
// ),
|
.showDeleteAdministratorIsHaveAllDataDialog(
|
||||||
// child: _electronicKeyItem(
|
'同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
||||||
// 'images/controls_user.png',
|
logic.deleteKeyRequest(indexEntity.keyId.toString(),
|
||||||
// indexEntity.keyName!,
|
isAllData ? 1 : 0);
|
||||||
// useDateStr,
|
});
|
||||||
// keyStatus,
|
},
|
||||||
// isAdminKey, () {
|
backgroundColor: Colors.red,
|
||||||
// Navigator.pushNamed(
|
foregroundColor: Colors.white,
|
||||||
// context, Routers.electronicKeyDetailPage,
|
label: '删除',
|
||||||
// arguments: {'itemData': indexEntity}).then((val) {
|
padding: EdgeInsets.only(left: 5.w, right: 5.w),
|
||||||
// if (val != null) {
|
),
|
||||||
// logic.mockNetworkDataRequest();
|
],
|
||||||
// setState(() {});
|
),
|
||||||
// }
|
child: _electronicKeyItem(
|
||||||
// });
|
'images/controls_user.png',
|
||||||
// }),
|
indexEntity.keyName!,
|
||||||
// );
|
useDateStr,
|
||||||
// }
|
keyStatus,
|
||||||
return const SizedBox.shrink();
|
isAdminKey, () {
|
||||||
},
|
Navigator.pushNamed(
|
||||||
separatorBuilder: (BuildContext context, int index) {
|
context, Routers.electronicKeyDetailPage,
|
||||||
return Divider(
|
arguments: {
|
||||||
height: 1.h,
|
"itemData": indexEntity,
|
||||||
color: AppColors.greyLineColor,
|
}).then((val) {
|
||||||
);
|
if (val != null) {
|
||||||
},
|
logic.mockNetworkDataRequest();
|
||||||
),
|
setState(() {});
|
||||||
));
|
}
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return Divider(
|
||||||
|
height: 1.h,
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// void showIosTipViewDialog(
|
|
||||||
// BuildContext context, String keyId) {
|
|
||||||
// showDialog(
|
|
||||||
// context: context,
|
|
||||||
// builder: (BuildContext context) {
|
|
||||||
// return ShowIosTipView(
|
|
||||||
// title: "提示",
|
|
||||||
// tipTitle: "确定要删除吗?",
|
|
||||||
// sureClick: () {
|
|
||||||
// Get.back();
|
|
||||||
// logic.deleteKeyRequest(keyId);
|
|
||||||
// },
|
|
||||||
// cancelClick: () {
|
|
||||||
// Get.back();
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
//使用期限
|
//使用期限
|
||||||
String getUseDateStr(ElectronicKeyListItem indexEntity) {
|
String getUseDateStr(ElectronicKeyListItem indexEntity) {
|
||||||
String useDateStr = '';
|
String useDateStr = '';
|
||||||
@ -216,48 +179,11 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
useDateStr =
|
useDateStr =
|
||||||
'${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}';
|
'${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}';
|
||||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||||
//永久
|
|
||||||
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
|
||||||
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 永久';
|
|
||||||
useDateStr = "永久";
|
useDateStr = "永久";
|
||||||
}
|
}
|
||||||
// else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
|
||||||
// //单次
|
|
||||||
// // DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
|
||||||
// // useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
|
||||||
// useDateStr = "单次";
|
|
||||||
// } else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
|
||||||
// //循环
|
|
||||||
// useDateStr = '循环';
|
|
||||||
// }
|
|
||||||
|
|
||||||
return useDateStr;
|
return useDateStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//钥匙状态
|
|
||||||
// String getKeyStatus(int? keyStatusFlag) {
|
|
||||||
// String keyStatus = '';
|
|
||||||
//
|
|
||||||
// if (keyStatusFlag == 110401) {
|
|
||||||
// //正常使用
|
|
||||||
// keyStatus = '';
|
|
||||||
// } else if (keyStatusFlag == 110402) {
|
|
||||||
// //待接收
|
|
||||||
// keyStatus = '待接收';
|
|
||||||
// } else if (keyStatusFlag == 110405) {
|
|
||||||
// //已冻结
|
|
||||||
// keyStatus = '已冻结';
|
|
||||||
// } else if (keyStatusFlag == 110408) {
|
|
||||||
// //已删除
|
|
||||||
// keyStatus = '已删除';
|
|
||||||
// } else if (keyStatusFlag == 110410) {
|
|
||||||
// //已重置
|
|
||||||
// keyStatus = '已重置';
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return keyStatus;
|
|
||||||
// }
|
|
||||||
|
|
||||||
Widget _electronicKeyItem(String avatarURL, String receiveUser,
|
Widget _electronicKeyItem(String avatarURL, String receiveUser,
|
||||||
String useDate, String keyStatus, bool isAdminKey, Function() action) {
|
String useDate, String keyStatus, bool isAdminKey, Function() action) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
@ -268,7 +194,11 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width: 30.w),
|
SizedBox(width: 30.w),
|
||||||
Image.asset(avatarURL, width: 60.w, height: 60.w,),
|
Image.asset(
|
||||||
|
avatarURL,
|
||||||
|
width: 60.w,
|
||||||
|
height: 60.w,
|
||||||
|
),
|
||||||
SizedBox(width: 20.w),
|
SizedBox(width: 20.w),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -281,14 +211,13 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(receiveUser,
|
||||||
receiveUser,
|
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
style: TextStyle(
|
||||||
),
|
fontSize: 24.sp,
|
||||||
|
color: AppColors.blackColor)),
|
||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -321,80 +250,4 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Widget _electronicKeyItem(String avatarURL, String receiveUser,
|
|
||||||
// String useDate, String keyStatus, bool isAdminKey, Function() action) {
|
|
||||||
// return GestureDetector(
|
|
||||||
// onTap: action,
|
|
||||||
// child: Container(
|
|
||||||
// height: 100.h,
|
|
||||||
// // margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
|
||||||
// // decoration: BoxDecoration(
|
|
||||||
// // color: Colors.white,
|
|
||||||
// // borderRadius: BorderRadius.circular(10.w),
|
|
||||||
// // ),
|
|
||||||
// child: Row(
|
|
||||||
// children: [
|
|
||||||
// SizedBox(
|
|
||||||
// width: 30.w,
|
|
||||||
// ),
|
|
||||||
// Image.asset(
|
|
||||||
// avatarURL,
|
|
||||||
// width: 60.w,
|
|
||||||
// height: 60.w,
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// width: 20.w,
|
|
||||||
// ),
|
|
||||||
// Expanded(
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// receiveUser,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 24.sp, color: AppColors.blackColor),
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// width: 8.w,
|
|
||||||
// ),
|
|
||||||
// Container(
|
|
||||||
// padding: EdgeInsets.only(
|
|
||||||
// left: 4.w, right: 4.w, top: 1.w, bottom: 1.w),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: AppColors.toBeReceiveBgColor,
|
|
||||||
// borderRadius: BorderRadius.circular(5.0),
|
|
||||||
// ),
|
|
||||||
// child: Text(
|
|
||||||
// keyStatus,
|
|
||||||
// style: TextStyle(color: Colors.red, fontSize: 16.sp),
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 5.h),
|
|
||||||
// Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// useDate,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 18.sp,
|
|
||||||
// color: AppColors.placeholderTextColor),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// SizedBox(width: 20.h),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// SizedBox(width: 20.h),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -270,8 +270,6 @@ class _VolumeAuthorizationLockPageState
|
|||||||
autofocus: false,
|
autofocus: false,
|
||||||
textAlign: TextAlign.end,
|
textAlign: TextAlign.end,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
//输入里面输入文字内边距设置
|
|
||||||
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
|
||||||
hintText: tfStr,
|
hintText: tfStr,
|
||||||
hintStyle: TextStyle(fontSize: 22.sp),
|
hintStyle: TextStyle(fontSize: 22.sp),
|
||||||
focusedBorder: const OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
@ -288,14 +286,6 @@ class _VolumeAuthorizationLockPageState
|
|||||||
BorderSide(width: 0, color: Colors.transparent)),
|
BorderSide(width: 0, color: Colors.transparent)),
|
||||||
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||||
),
|
),
|
||||||
// decoration: InputDecoration(
|
|
||||||
// //输入里面输入文字内边距设置
|
|
||||||
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
|
||||||
// hintText: tfStr,
|
|
||||||
// hintStyle: TextStyle(fontSize: 22.sp),
|
|
||||||
// //不需要输入框下划线
|
|
||||||
// border: InputBorder.none,
|
|
||||||
// ),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|||||||
@ -142,7 +142,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
|||||||
? '1'
|
? '1'
|
||||||
: '2',
|
: '2',
|
||||||
endDate: int.parse(endDate),
|
endDate: int.parse(endDate),
|
||||||
faceAuthentication: state.isAuthentication == true ? '1' : '2',
|
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
||||||
isCameraEnable: '2',
|
isCameraEnable: '2',
|
||||||
isRemoteUnlock: state.isRemoteUnlock == true ? '1' : '2',
|
isRemoteUnlock: state.isRemoteUnlock == true ? '1' : '2',
|
||||||
keyNameForAdmin: state.keyNameController.text,
|
keyNameForAdmin: state.keyNameController.text,
|
||||||
|
|||||||
@ -43,18 +43,6 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
// JhPopMenus.showLinePop(context, clickCallback: (index, selText) {
|
|
||||||
// if (index == 0) {
|
|
||||||
// logic.mockNetworkDataRequest();
|
|
||||||
// } else if (index == 1) {
|
|
||||||
// logic.clearOperationRecordRequest();
|
|
||||||
// }
|
|
||||||
// }, listData: [
|
|
||||||
// {'text': '读取记录'},
|
|
||||||
// {'text': '清空记录'},
|
|
||||||
// {'text': '导出记录'},
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
_openModalBottomSheet();
|
_openModalBottomSheet();
|
||||||
} else {
|
} else {
|
||||||
// Get.toNamed(Routers.selectLockTypePage);
|
// Get.toNamed(Routers.selectLockTypePage);
|
||||||
@ -67,20 +55,22 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
(state.keyInfos.value.isLockOwner == 1 || state.keyInfos.value.keyRight == 1) ?
|
(state.keyInfos.value.isLockOwner == 1 ||
|
||||||
Column(
|
state.keyInfos.value.keyRight == 1)
|
||||||
children: [
|
? Column(
|
||||||
Container(
|
children: [
|
||||||
padding: EdgeInsets.all(20.h),
|
Container(
|
||||||
child: Text(
|
padding: EdgeInsets.all(20.h),
|
||||||
TranslationLoader.lanKeys!.lockOperatingRecordTip!.tr,
|
child: Text(
|
||||||
textAlign: TextAlign.start,
|
TranslationLoader.lanKeys!.lockOperatingRecordTip!.tr,
|
||||||
style: TextStyle(fontSize: 20.sp),
|
textAlign: TextAlign.start,
|
||||||
),
|
style: TextStyle(fontSize: 20.sp),
|
||||||
),
|
),
|
||||||
_searchWidget(),
|
),
|
||||||
],
|
_searchWidget(),
|
||||||
) : Container(),
|
],
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
Expanded(child: _buildMainUI()),
|
Expanded(child: _buildMainUI()),
|
||||||
],
|
],
|
||||||
@ -148,22 +138,6 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
: NoData());
|
: NoData());
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _dateItem(String lockDate) {
|
|
||||||
return Container(
|
|
||||||
height: 60.h,
|
|
||||||
// color: Colors.red,
|
|
||||||
padding: EdgeInsets.only(left: 20.h, right: 20.h),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
lockDate,
|
|
||||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
String getTypeIcon(int type) {
|
String getTypeIcon(int type) {
|
||||||
String title = 'images/controls_user.png';
|
String title = 'images/controls_user.png';
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class CatEyeWorkModeLogic extends BaseGetXController {
|
|||||||
catEyeConfig: [
|
catEyeConfig: [
|
||||||
{
|
{
|
||||||
'catEyeMode':
|
'catEyeMode':
|
||||||
state.boolList.value.indexWhere((element) => element == true) + 1,
|
state.boolList.indexWhere((element) => element == true) + 1,
|
||||||
'catEyeModeConfig': {
|
'catEyeModeConfig': {
|
||||||
'recordMode': state.lockSetInfoData.value.lockSettingInfo!
|
'recordMode': state.lockSetInfoData.value.lockSettingInfo!
|
||||||
.catEyeConfig!.isNotEmpty
|
.catEyeConfig!.isNotEmpty
|
||||||
@ -63,24 +63,17 @@ class CatEyeWorkModeLogic extends BaseGetXController {
|
|||||||
state.catEyeConfigData.value =
|
state.catEyeConfigData.value =
|
||||||
entity.data!.lockSettingInfo!.catEyeConfig![0];
|
entity.data!.lockSettingInfo!.catEyeConfig![0];
|
||||||
|
|
||||||
// state.selectCatEyeWorkMode.value =
|
|
||||||
// state.catEyeConfigData.value.catEyeMode!;
|
|
||||||
|
|
||||||
if (state.catEyeConfigData.value.catEyeMode ==
|
if (state.catEyeConfigData.value.catEyeMode ==
|
||||||
XSConstantMacro.catEyeWorkModePowerSaving) {
|
XSConstantMacro.catEyeWorkModePowerSaving) {
|
||||||
// state.boolList.value[0] = true;
|
|
||||||
state.boolList.value = [true, false, false, false];
|
state.boolList.value = [true, false, false, false];
|
||||||
} else if (state.catEyeConfigData.value.catEyeMode ==
|
} else if (state.catEyeConfigData.value.catEyeMode ==
|
||||||
XSConstantMacro.catEyeWorkModeStayCapture) {
|
XSConstantMacro.catEyeWorkModeStayCapture) {
|
||||||
// state.boolList.value[1] = true;
|
|
||||||
state.boolList.value = [false, true, false, false];
|
state.boolList.value = [false, true, false, false];
|
||||||
} else if (state.catEyeConfigData.value.catEyeMode ==
|
} else if (state.catEyeConfigData.value.catEyeMode ==
|
||||||
XSConstantMacro.catEyeWorkModeRealTimeMonitoring) {
|
XSConstantMacro.catEyeWorkModeRealTimeMonitoring) {
|
||||||
// state.boolList.value[2] = true;
|
|
||||||
state.boolList.value = [false, false, true, false];
|
state.boolList.value = [false, false, true, false];
|
||||||
} else if (state.catEyeConfigData.value.catEyeMode ==
|
} else if (state.catEyeConfigData.value.catEyeMode ==
|
||||||
XSConstantMacro.catEyeWorkModeCustom) {
|
XSConstantMacro.catEyeWorkModeCustom) {
|
||||||
// state.boolList.value[3] = true;
|
|
||||||
state.boolList.value = [false, false, false, true];
|
state.boolList.value = [false, false, false, true];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -137,24 +137,6 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
|
|||||||
for (int i = 0; i < state.boolList.value.length; i++) {
|
for (int i = 0; i < state.boolList.value.length; i++) {
|
||||||
if (clickIndex == i) {
|
if (clickIndex == i) {
|
||||||
state.boolList.value[clickIndex] = true;
|
state.boolList.value[clickIndex] = true;
|
||||||
// switch (clickIndex) {
|
|
||||||
// case 0:
|
|
||||||
// state.selectCatEyeWorkMode.value =
|
|
||||||
// XSConstantMacro.catEyeWorkModePowerSaving;
|
|
||||||
// break;
|
|
||||||
// case 1:
|
|
||||||
// state.selectCatEyeWorkMode.value =
|
|
||||||
// XSConstantMacro.catEyeWorkModeStayCapture;
|
|
||||||
// break;
|
|
||||||
// case 2:
|
|
||||||
// state.selectCatEyeWorkMode.value =
|
|
||||||
// XSConstantMacro.catEyeWorkModeRealTimeMonitoring;
|
|
||||||
// break;
|
|
||||||
// case 3:
|
|
||||||
// state.selectCatEyeWorkMode.value =
|
|
||||||
// XSConstantMacro.catEyeWorkModeCustom;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
logic.updateCatEyeModeConfig();
|
logic.updateCatEyeModeConfig();
|
||||||
} else {
|
} else {
|
||||||
state.boolList.value[i] = false;
|
state.boolList.value[i] = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user