1、修复从锁设置进入数据上传界面弹框问题
2、修复卡指纹胁迫数据错误问题
This commit is contained in:
parent
ed442e1792
commit
c8dc3b3d47
@ -1,6 +1,5 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
@ -93,9 +92,4 @@ class AddCardTypeLogic extends BaseGetXController{
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
class AddICCardEntity {
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
Data? data;
|
||||
|
||||
AddICCardEntity(
|
||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||
@ -13,6 +9,10 @@ class AddICCardEntity {
|
||||
errorMsg = json['errorMsg'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
Data? data;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
@ -27,13 +27,13 @@ class AddICCardEntity {
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? cardId;
|
||||
|
||||
Data({this.cardId});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
cardId = json['cardId'];
|
||||
}
|
||||
int? cardId;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
|
||||
@ -27,7 +27,7 @@ class _AddICCardPageState extends State<AddICCardPage> with RouteAware {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: "${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.card!.tr}",
|
||||
barTitle: '${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.card!.tr}',
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
|
||||
@ -41,7 +41,7 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
children: <Widget>[
|
||||
Obx(() => CommonItem(
|
||||
leftTitel:
|
||||
"${TranslationLoader.lanKeys!.card!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
||||
'${TranslationLoader.lanKeys!.card!.tr}${TranslationLoader.lanKeys!.number!.tr}',
|
||||
rightTitle: state.typeNumber.value,
|
||||
isHaveDirection: false,
|
||||
isHaveLine: true)),
|
||||
@ -53,7 +53,7 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
action: () {
|
||||
ShowTipView().showTFViewAlertDialog(
|
||||
state.changeNameController,
|
||||
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
|
||||
'${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}',
|
||||
'', () {
|
||||
if (state.changeNameController.text.isEmpty) {
|
||||
logic.showToast('请输入姓名'.tr);
|
||||
@ -65,11 +65,9 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
});
|
||||
})),
|
||||
Obx(() => Visibility(
|
||||
visible: (state.keyType.value == 4 ||
|
||||
visible: state.keyType.value == 4 ||
|
||||
state.keyType.value == 2 ||
|
||||
state.keyType.value == 1)
|
||||
? true
|
||||
: false,
|
||||
state.keyType.value == 1,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||
allHeight: 70.h,
|
||||
@ -109,7 +107,7 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
}
|
||||
}))),
|
||||
Obx(() => Visibility(
|
||||
visible: state.keyType.value == 4 ? true : false,
|
||||
visible: state.keyType.value == 4,
|
||||
child: Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
||||
rightTitle: state.weekDay.value.join(','),
|
||||
@ -131,7 +129,7 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
}
|
||||
})))),
|
||||
Obx(() => Visibility(
|
||||
visible: state.keyType.value == 4 ? true : false,
|
||||
visible: state.keyType.value == 4,
|
||||
child: Obx(() => CommonItem(
|
||||
leftTitel: '有效时间'.tr,
|
||||
rightTitle: '${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}',
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/addFaceType/addFaceType_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
@ -9,31 +10,31 @@ class AddFaceTypeLogic extends BaseGetXController {
|
||||
AddFaceTypeState state = AddFaceTypeState();
|
||||
|
||||
// 添加指纹
|
||||
void addFaceData() async {
|
||||
var faceType = 0; // 永久:1;限时2,单次3,循环:4
|
||||
var startDate = "";
|
||||
var endDate = "";
|
||||
var startTime = "";
|
||||
var endTime = "";
|
||||
if (state.selectType.value == "0") {
|
||||
Future<void> addFaceData() async {
|
||||
int faceType = 0; // 永久:1;限时2,单次3,循环:4
|
||||
String startDate = '';
|
||||
String endDate = '';
|
||||
String startTime = '';
|
||||
String endTime = '';
|
||||
if (state.selectType.value == '0') {
|
||||
faceType = 1;
|
||||
startDate = "0";
|
||||
endDate = "0";
|
||||
startTime = "0";
|
||||
endTime = "0";
|
||||
} else if (state.selectType.value == "1") {
|
||||
startDate = '0';
|
||||
endDate = '0';
|
||||
startTime = '0';
|
||||
endTime = '0';
|
||||
} else if (state.selectType.value == '1') {
|
||||
faceType = 2;
|
||||
startDate = DateTool().dateToTimestamp(state.timeLimitBeginTime.value, 1).toString();
|
||||
endDate = DateTool().dateToTimestamp(state.timeLimitEndTime.value, 1).toString();
|
||||
startTime = "0";
|
||||
endTime = "0";
|
||||
startTime = '0';
|
||||
endTime = '0';
|
||||
|
||||
if (startDate.isEmpty) {
|
||||
showToast("请选择开始时间".tr);
|
||||
showToast('请选择开始时间'.tr);
|
||||
return;
|
||||
}
|
||||
if (endDate.isEmpty) {
|
||||
showToast("请选择结束时间".tr);
|
||||
showToast('请选择结束时间'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -43,12 +44,12 @@ class AddFaceTypeLogic extends BaseGetXController {
|
||||
// }
|
||||
|
||||
if (int.parse(startDate) >= int.parse(endDate)) {
|
||||
showToast("失效时间要大于生效时间".tr);
|
||||
showToast('失效时间要大于生效时间'.tr);
|
||||
return;
|
||||
}
|
||||
} else if (state.selectType.value == "2") {
|
||||
} else if (state.selectType.value == '2') {
|
||||
if (state.cycleBeginTime.value.isEmpty) {
|
||||
showToast("请选择有效期".tr);
|
||||
showToast('请选择有效期'.tr);
|
||||
return;
|
||||
}
|
||||
startDate = DateTool().dateToTimestamp(state.cycleBeginTime.value, 1).toString();
|
||||
@ -59,26 +60,26 @@ class AddFaceTypeLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 人脸
|
||||
Get.toNamed(Routers.addFacePage, arguments: {
|
||||
"lockId": state.lockId.value,
|
||||
"endDate": endDate,
|
||||
"addType": "1",
|
||||
"faceName": state.nameController.text,
|
||||
"faceNumber": "123456",
|
||||
"faceType": faceType,
|
||||
"startDate": startDate,
|
||||
"cyclicConfig": state.weekdaysList.value,
|
||||
"fromType": state.fromType.value,
|
||||
"isAdministrator": state.isAdministrator.value == false ? "1" : "2",
|
||||
"effectiveTime": startTime,
|
||||
"failureTime": endTime,
|
||||
"selectType": state.selectType.value,
|
||||
Get.toNamed(Routers.addFacePage, arguments: <String, Object>{
|
||||
'lockId': state.lockId.value,
|
||||
'endDate': endDate,
|
||||
'addType': '1',
|
||||
'faceName': state.nameController.text,
|
||||
'faceNumber': '123456',
|
||||
'faceType': faceType,
|
||||
'startDate': startDate,
|
||||
'cyclicConfig': state.weekdaysList.value,
|
||||
'fromType': state.fromType.value,
|
||||
'isAdministrator': state.isAdministrator.value == false ? '1' : '2',
|
||||
'effectiveTime': startTime,
|
||||
'failureTime': endTime,
|
||||
'selectType': state.selectType.value,
|
||||
});
|
||||
}
|
||||
|
||||
// 校验指纹名字是否重复
|
||||
void checkFaceNameDuplicated(String faceName) async {
|
||||
var entity = await ApiRepository.to.checkFaceNameDuplicatedData(
|
||||
Future<void> checkFaceNameDuplicated(String faceName) async {
|
||||
final LoginEntity entity = await ApiRepository.to.checkFaceNameDuplicatedData(
|
||||
lockId: state.lockId.value.toString(),
|
||||
faceName: faceName,
|
||||
);
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/addFaceType/addFaceType_state.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
@ -26,14 +28,12 @@ class AddFaceTypePage extends StatefulWidget {
|
||||
State<AddFaceTypePage> createState() => _AddFaceTypePageState();
|
||||
}
|
||||
|
||||
class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
final logic = Get.put(AddFaceTypeLogic());
|
||||
final state = Get.find<AddFaceTypeLogic>().state;
|
||||
class _AddFaceTypePageState extends State<AddFaceTypePage> with SingleTickerProviderStateMixin {
|
||||
final AddFaceTypeLogic logic = Get.put(AddFaceTypeLogic());
|
||||
final AddFaceTypeState state = Get.find<AddFaceTypeLogic>().state;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
|
||||
state.tabController = TabController(
|
||||
@ -59,11 +59,11 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle:
|
||||
"${TranslationLoader.lanKeys!.addTip!.tr}${TranslationLoader.lanKeys!.face!.tr}",
|
||||
'${TranslationLoader.lanKeys!.addTip!.tr}${TranslationLoader.lanKeys!.face!.tr}',
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
_tabBar(),
|
||||
_pageWidget(),
|
||||
],
|
||||
@ -78,7 +78,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
// 永久
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
perpetualKeyWidget(
|
||||
TranslationLoader.lanKeys!.name!.tr,
|
||||
TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
@ -93,7 +93,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
// 限时
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
perpetualKeyWidget(
|
||||
TranslationLoader.lanKeys!.name!.tr,
|
||||
TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
@ -109,7 +109,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
// 循环
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
perpetualKeyWidget(
|
||||
TranslationLoader.lanKeys!.name!.tr,
|
||||
TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
@ -130,11 +130,11 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
Widget perpetualKeyWidget(
|
||||
String titleStr, String rightTitle, TextEditingController controller) {
|
||||
return Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
// Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: titleStr,
|
||||
rightTitle: "",
|
||||
rightTitle: '',
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: getTFWidget(rightTitle)),
|
||||
Container(height: 10.h),
|
||||
@ -145,17 +145,17 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
// 限时顶部选择日期
|
||||
Widget keyTimeLimitWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||
rightTitle: state.timeLimitBeginTime.value,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
PDuration selectDate = PDuration.parse(
|
||||
final PDuration selectDate = PDuration.parse(
|
||||
DateTime.parse(state.timeLimitBeginTime.value));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (PDuration p) {
|
||||
state.timeLimitBeginTime.value =
|
||||
DateTool().getYMDHNDateString(p, 1);
|
||||
});
|
||||
@ -165,10 +165,10 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
rightTitle: state.timeLimitEndTime.value,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
PDuration selectDate = PDuration.parse(
|
||||
final PDuration selectDate = PDuration.parse(
|
||||
DateTime.tryParse(state.timeLimitEndTime.value));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (PDuration p) {
|
||||
state.timeLimitEndTime.value =
|
||||
DateTool().getYMDHNDateString(p, 1);
|
||||
});
|
||||
@ -181,16 +181,16 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
// 循环顶部选择日期
|
||||
Widget keyCyclicDate() {
|
||||
return Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||
rightTitle:
|
||||
"${state.cycleBeginTime.value}\n${state.cycleEndTime.value}",
|
||||
'${state.cycleBeginTime.value}\n${state.cycleEndTime.value}',
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result =
|
||||
await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: {
|
||||
final result =
|
||||
await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: <String, Object>{
|
||||
'validityValue': state.weekdaysList.value,
|
||||
'starDate': state.cycleBeginTime.value,
|
||||
'endDate': state.cycleEndTime.value,
|
||||
@ -206,15 +206,15 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
}
|
||||
})),
|
||||
Obx(() => Visibility(
|
||||
visible: state.weekdaysList.isNotEmpty ? true : false,
|
||||
visible: state.weekdaysList.isNotEmpty,
|
||||
child: CommonItem(
|
||||
leftTitel: "有效日".tr,
|
||||
rightTitle: state.weekdaysList.value.join(",").toString(),
|
||||
leftTitel: '有效日'.tr,
|
||||
rightTitle: state.weekdaysList.value.join(',').toString(),
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||
arguments: {
|
||||
final result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||
arguments: <String, Object>{
|
||||
'validityValue': state.weekdaysList.value,
|
||||
'starDate': state.cycleBeginTime.value,
|
||||
'endDate': state.cycleEndTime.value,
|
||||
@ -232,13 +232,13 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
Obx(() => Visibility(
|
||||
visible: state.effectiveDateTime.value.isNotEmpty,
|
||||
child: CommonItem(
|
||||
leftTitel: "有效时间".tr,
|
||||
leftTitel: '有效时间'.tr,
|
||||
rightTitle:
|
||||
"${state.effectiveDateTime.value}-${state.failureDateTime.value}",
|
||||
'${state.effectiveDateTime.value}-${state.failureDateTime.value}',
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||
arguments: {
|
||||
final result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||
arguments: <String, Object>{
|
||||
'validityValue': state.weekdaysList.value,
|
||||
'starDate': state.cycleBeginTime.value,
|
||||
'endDate': state.cycleEndTime.value,
|
||||
@ -259,14 +259,12 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
|
||||
Widget keyBottomWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Obx(() => Visibility(
|
||||
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
|
||||
? true
|
||||
: false,
|
||||
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1,
|
||||
child: CommonItem(
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
leftTitel: '是否为管理员'.tr,
|
||||
rightTitle: '',
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
@ -275,16 +273,16 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||
onClick: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
if (state.nameController.text.isEmpty) {
|
||||
logic.showToast("请输入姓名");
|
||||
logic.showToast('请输入姓名');
|
||||
return;
|
||||
}
|
||||
logic.checkFaceNameDuplicated(state.nameController.text);
|
||||
} else {
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
logic.showToast('演示模式');
|
||||
}
|
||||
}),
|
||||
],
|
||||
@ -301,7 +299,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: TextField(
|
||||
//输入框一行
|
||||
@ -351,34 +349,34 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isAdministrator.value,
|
||||
onChanged: (value) {
|
||||
onChanged: (bool value) {
|
||||
state.isAdministrator.value = value;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
final List<ItemView> _itemTabs = <ItemView>[
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: '0'),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: '1'),
|
||||
ItemView(
|
||||
title: TranslationLoader.lanKeys!.circulation!.tr, selectType: "2"),
|
||||
title: TranslationLoader.lanKeys!.circulation!.tr, selectType: '2'),
|
||||
];
|
||||
|
||||
final List<ItemView> _fromCheckInTypeItemTabs = <ItemView>[
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: '0'),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: '1'),
|
||||
];
|
||||
|
||||
TabBar _tabBar() {
|
||||
return TabBar(
|
||||
controller: state.tabController,
|
||||
onTap: (index) {
|
||||
onTap: (int index) {
|
||||
FocusScope.of(context).requestFocus(FocusNode());
|
||||
},
|
||||
tabs: state.fromType.value == 1
|
||||
? _itemTabs.map((ItemView item) => _tab(item)).toList()
|
||||
? _itemTabs.map(_tab).toList()
|
||||
: _fromCheckInTypeItemTabs
|
||||
.map((ItemView item) => _tab(item))
|
||||
.map(_tab)
|
||||
.toList(),
|
||||
isScrollable: true,
|
||||
indicatorColor: Colors.red,
|
||||
@ -413,10 +411,10 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
|
||||
controller: state.tabController,
|
||||
children: state.fromType.value == 1
|
||||
? _itemTabs
|
||||
.map((ItemView item) => Obx(() => indexChangeWidget()))
|
||||
.map((ItemView item) => Obx(indexChangeWidget))
|
||||
.toList()
|
||||
: _fromCheckInTypeItemTabs
|
||||
.map((ItemView item) => Obx(() => indexChangeWidget()))
|
||||
.map((ItemView item) => Obx(indexChangeWidget))
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
|
||||
@ -1,39 +1,40 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../tools/dateTool.dart';
|
||||
|
||||
class AddFaceTypeState {
|
||||
final lockId = 0.obs;
|
||||
final selectType = "0".obs; // 0永久 1显示 2循环
|
||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
final isStressFingerprint = false.obs;
|
||||
final isAdministrator = false.obs; // 是否为管理员
|
||||
|
||||
var timeLimitBeginTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
.obs; // 限时开始时间
|
||||
var timeLimitEndTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
.obs; // 限时结束时间
|
||||
|
||||
var cycleBeginTime = "".obs; // 循环开始时间
|
||||
var cycleEndTime = "".obs; // 循环结束时间
|
||||
var effectiveDateTime = "".obs; // 生效时间
|
||||
var failureDateTime = "".obs; // 失效时间
|
||||
var weekdaysList = [].obs;
|
||||
var fromTypeTwoStaffName = "".obs; // 从添加员工进入 传入员工名字
|
||||
|
||||
final TextEditingController nameController = TextEditingController();
|
||||
late TabController tabController;
|
||||
AddFaceTypeState() {
|
||||
Map map = Get.arguments;
|
||||
lockId.value = map["lockId"];
|
||||
fromType.value = map["fromType"];
|
||||
lockId.value = map['lockId'];
|
||||
fromType.value = map['fromType'];
|
||||
// 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
if (fromType.value == 2) {
|
||||
fromTypeTwoStaffName.value =
|
||||
map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字
|
||||
map['fromTypeTwoStaffName']; // 从添加员工进入 传入员工名字
|
||||
}
|
||||
}
|
||||
final RxInt lockId = 0.obs;
|
||||
final RxString selectType = '0'.obs; // 0永久 1显示 2循环
|
||||
final RxInt fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
final RxBool isStressFingerprint = false.obs;
|
||||
final RxBool isAdministrator = false.obs; // 是否为管理员
|
||||
|
||||
RxString timeLimitBeginTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
.obs; // 限时开始时间
|
||||
RxString timeLimitEndTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
.obs; // 限时结束时间
|
||||
|
||||
RxString cycleBeginTime = ''.obs; // 循环开始时间
|
||||
RxString cycleEndTime = ''.obs; // 循环结束时间
|
||||
RxString effectiveDateTime = ''.obs; // 生效时间
|
||||
RxString failureDateTime = ''.obs; // 失效时间
|
||||
RxList weekdaysList = [].obs;
|
||||
RxString fromTypeTwoStaffName = ''.obs; // 从添加员工进入 传入员工名字
|
||||
|
||||
final TextEditingController nameController = TextEditingController();
|
||||
late TabController tabController;
|
||||
}
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/fingerprint/addFingerprint/addFingerprint_state.dart';
|
||||
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
import '../../../../../translations/trans_lib.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../tools/appRouteObserver.dart';
|
||||
import 'addFingerprint_logic.dart';
|
||||
|
||||
@ -16,22 +17,20 @@ class AddFingerprintPage extends StatefulWidget {
|
||||
State<AddFingerprintPage> createState() => _AddFingerprintPageState();
|
||||
}
|
||||
|
||||
class _AddFingerprintPageState extends State<AddFingerprintPage>
|
||||
with RouteAware {
|
||||
final logic = Get.put(AddFingerprintLogic());
|
||||
final state = Get.find<AddFingerprintLogic>().state;
|
||||
class _AddFingerprintPageState extends State<AddFingerprintPage> with RouteAware {
|
||||
final AddFingerprintLogic logic = Get.put(AddFingerprintLogic());
|
||||
final AddFingerprintState state = Get.find<AddFingerprintLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: TitleAppBar(
|
||||
barTitle:
|
||||
"${TranslationLoader.lanKeys!.addTip!.tr}${TranslationLoader.lanKeys!.fingerprint!.tr}",
|
||||
barTitle: '${TranslationLoader.lanKeys!.addTip!.tr}${TranslationLoader.lanKeys!.fingerprint!.tr}',
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: ListView(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 50.h,
|
||||
),
|
||||
@ -40,13 +39,13 @@ class _AddFingerprintPageState extends State<AddFingerprintPage>
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
"请将您的手指按下".tr,
|
||||
'请将您的手指按下'.tr,
|
||||
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: null,
|
||||
@ -58,7 +57,7 @@ class _AddFingerprintPageState extends State<AddFingerprintPage>
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
Text(
|
||||
"(${state.regIndex.value}/${state.maxRegCount.value})",
|
||||
'(${state.regIndex.value}/${state.maxRegCount.value})',
|
||||
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: null,
|
||||
@ -72,10 +71,10 @@ class _AddFingerprintPageState extends State<AddFingerprintPage>
|
||||
visible: !logic.state.ifConnectScuess.value,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
"尝试连接设备...".tr,
|
||||
'尝试连接设备...'.tr,
|
||||
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: null,
|
||||
@ -103,10 +102,10 @@ class _AddFingerprintPageState extends State<AddFingerprintPage>
|
||||
margin: EdgeInsets.all(10.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
"根据提示,抬起手指后再进行下一次指纹采集".tr,
|
||||
'根据提示,抬起手指后再进行下一次指纹采集'.tr,
|
||||
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: null,
|
||||
@ -122,7 +121,7 @@ class _AddFingerprintPageState extends State<AddFingerprintPage>
|
||||
}
|
||||
|
||||
String getIconNumber(int number) {
|
||||
String iconPath = "";
|
||||
String iconPath = '';
|
||||
switch (number) {
|
||||
case 0:
|
||||
iconPath = 'images/main/icon_addFingerprint_fingerprint_one.png';
|
||||
@ -151,7 +150,6 @@ class _AddFingerprintPageState extends State<AddFingerprintPage>
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
// TODO: implement didChangeDependencies
|
||||
super.didChangeDependencies();
|
||||
|
||||
/// 路由订阅
|
||||
@ -160,7 +158,6 @@ class _AddFingerprintPageState extends State<AddFingerprintPage>
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
/// 取消路由订阅
|
||||
AppRouteObserver().routeObserver.unsubscribe(this);
|
||||
super.dispose();
|
||||
|
||||
@ -69,7 +69,7 @@ class AddFingerprintTypeLogic extends BaseGetXController{
|
||||
'fingerprintName': state.nameController.text,
|
||||
'fingerprintNumber': '123456',
|
||||
'fingerprintType': fingerprintType.toString(),
|
||||
'isCoerced': state.isStressFingerprint.value == false ? '1' : '2', // 1:非胁迫指纹 2:胁迫指纹
|
||||
'isCoerced': state.isStressFingerprint.value == true ? '1' : '2', // 1:非胁迫指纹 2:胁迫指纹
|
||||
'startDate': startDate,
|
||||
'weekDay': state.weekdaysList.value,
|
||||
'fromType': state.fromType.value,
|
||||
|
||||
@ -56,7 +56,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle:
|
||||
"${TranslationLoader.lanKeys!.addTip!.tr}${TranslationLoader.lanKeys!.fingerprint!.tr}",
|
||||
'${TranslationLoader.lanKeys!.addTip!.tr}${TranslationLoader.lanKeys!.fingerprint!.tr}',
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
@ -149,7 +149,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
PDuration selectDate =
|
||||
final PDuration selectDate =
|
||||
PDuration.parse(DateTime.tryParse(state.timeLimitBeginTime.value));
|
||||
Pickers.showDatePicker(context,selectDate:selectDate, mode: DateMode.YMDHM,
|
||||
onConfirm: (PDuration p) {
|
||||
@ -161,7 +161,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
rightTitle: state.timeLimitEndTime.value,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
PDuration selectDate =
|
||||
final PDuration selectDate =
|
||||
PDuration.parse(DateTime.tryParse(state.timeLimitEndTime.value));
|
||||
Pickers.showDatePicker(context,selectDate:selectDate, mode: DateMode.YMDHM,
|
||||
onConfirm: (PDuration p) {
|
||||
@ -183,7 +183,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: <String, Object>{
|
||||
final result = await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: <String, Object>{
|
||||
'validityValue': state.weekdaysList.value,
|
||||
'starDate': state.cycleBeginTime.value,
|
||||
'endDate': state.cycleEndTime.value,
|
||||
@ -206,7 +206,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: <String, Object>{
|
||||
final result = await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: <String, Object>{
|
||||
'validityValue': state.weekdaysList.value,
|
||||
'starDate': state.cycleBeginTime.value,
|
||||
'endDate': state.cycleEndTime.value,
|
||||
@ -228,7 +228,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
rightTitle: '${state.effectiveDateTime.value}-${state.failureDateTime.value}',
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: <String, Object>{
|
||||
final result = await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: <String, Object>{
|
||||
'validityValue': state.weekdaysList.value,
|
||||
'starDate': state.cycleBeginTime.value,
|
||||
'endDate': state.cycleEndTime.value,
|
||||
@ -280,7 +280,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||
onClick: () async {
|
||||
bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
if (state.nameController.text.isEmpty) {
|
||||
logic.showToast('请输入姓名'.tr);
|
||||
@ -457,7 +457,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
onTap: (int index) {
|
||||
FocusScope.of(context).requestFocus(FocusNode());
|
||||
},
|
||||
tabs: state.fromType.value == 1 ? _itemTabs.map((ItemView item) => _tab(item)).toList() : _fromCheckInTypeItemTabs.map((ItemView item) => _tab(item)).toList(),
|
||||
tabs: state.fromType.value == 1 ? _itemTabs.map(_tab).toList() : _fromCheckInTypeItemTabs.map(_tab).toList(),
|
||||
isScrollable: true,
|
||||
indicatorColor: Colors.red,
|
||||
unselectedLabelColor: Colors.black,
|
||||
@ -491,8 +491,8 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
controller: state.tabController,
|
||||
children:
|
||||
state.fromType.value == 1
|
||||
? _itemTabs.map((ItemView item) => Obx(() => indexChangeWidget())).toList()
|
||||
: _fromCheckInTypeItemTabs.map((ItemView item) => Obx(() => indexChangeWidget())).toList(),
|
||||
? _itemTabs.map((ItemView item) => Obx(indexChangeWidget)).toList()
|
||||
: _fromCheckInTypeItemTabs.map((ItemView item) => Obx(indexChangeWidget)).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -54,9 +54,6 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
final List<int> token = reply.data.sublist(5, 9);
|
||||
final List<String> saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
@ -165,7 +162,7 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
weekDay: state.weekDay.value,
|
||||
startDate: state.starDate.value,
|
||||
endDate: state.endDate.value,
|
||||
isCoerced: state.isStressFingerprint.value ? '2' : '1',
|
||||
isCoerced: state.isStressFingerprint.value ? '1' : '2',
|
||||
fingerprintName: state.changeNameController.text,
|
||||
changeType: '1',
|
||||
startTime: int.parse(state.startDate.value),
|
||||
|
||||
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_state.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
@ -24,20 +25,20 @@ class FingerprintDetailPage extends StatefulWidget {
|
||||
|
||||
class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
||||
with RouteAware {
|
||||
final logic = Get.put(FingerprintDetailLogic());
|
||||
final state = Get.find<FingerprintDetailLogic>().state;
|
||||
final FingerprintDetailLogic logic = Get.put(FingerprintDetailLogic());
|
||||
final FingerprintDetailState state = Get.find<FingerprintDetailLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: "指纹详情".tr,
|
||||
barTitle: '指纹详情'.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Obx(() => CommonItem(
|
||||
leftTitel:
|
||||
"${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
||||
@ -53,9 +54,9 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
||||
ShowTipView().showTFViewAlertDialog(
|
||||
state.changeNameController,
|
||||
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
|
||||
"", () {
|
||||
'', () {
|
||||
if (state.changeNameController.text.isEmpty) {
|
||||
logic.showToast("请输入姓名".tr);
|
||||
logic.showToast('请输入姓名'.tr);
|
||||
return;
|
||||
}
|
||||
Get.back();
|
||||
@ -81,15 +82,15 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
||||
// 限时
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeDatePage,
|
||||
arguments: {
|
||||
"pushType": 1,
|
||||
"fingerprintItemData":
|
||||
arguments: <String, Object>{
|
||||
'pushType': 1,
|
||||
'fingerprintItemData':
|
||||
state.fingerprintItemData.value,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
state.starDate.value = data["beginTimeTimestamp"];
|
||||
state.endDate.value = data["endTimeTimestamp"];
|
||||
state.starDate.value = data['beginTimeTimestamp'];
|
||||
state.endDate.value = data['endTimeTimestamp'];
|
||||
state.keyType.value = 2;
|
||||
});
|
||||
}
|
||||
@ -97,18 +98,18 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
||||
// 循环
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeValidityDatePage,
|
||||
arguments: {
|
||||
"pushType": 1,
|
||||
"fingerprintItemData":
|
||||
arguments: <String, Object>{
|
||||
'pushType': 1,
|
||||
'fingerprintItemData':
|
||||
state.fingerprintItemData.value,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
state.starDate.value = data["starDate"];
|
||||
state.endDate.value = data["endDate"];
|
||||
state.startDate.value = data["starTime"];
|
||||
state.endTime.value = data["endTime"];
|
||||
state.weekDay.value = data["validityValue"];
|
||||
state.starDate.value = data['starDate'];
|
||||
state.endDate.value = data['endDate'];
|
||||
state.startDate.value = data['starTime'];
|
||||
state.endTime.value = data['endTime'];
|
||||
state.weekDay.value = data['validityValue'];
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -123,42 +124,42 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
||||
action: () async {
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeValidityDatePage,
|
||||
arguments: {
|
||||
"pushType": 1,
|
||||
"fingerprintItemData":
|
||||
arguments: <String, Object>{
|
||||
'pushType': 1,
|
||||
'fingerprintItemData':
|
||||
state.fingerprintItemData.value,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
state.starDate.value = data["starDate"];
|
||||
state.endDate.value = data["endDate"];
|
||||
state.startDate.value = data["starTime"];
|
||||
state.endTime.value = data["endTime"];
|
||||
state.weekDay.value = data["validityValue"];
|
||||
state.starDate.value = data['starDate'];
|
||||
state.endDate.value = data['endDate'];
|
||||
state.startDate.value = data['starTime'];
|
||||
state.endTime.value = data['endTime'];
|
||||
state.weekDay.value = data['validityValue'];
|
||||
});
|
||||
}
|
||||
})))),
|
||||
Obx(() => Visibility(
|
||||
visible: state.keyType.value == 4 ? true : false,
|
||||
child: Obx(() => CommonItem(
|
||||
leftTitel: "有效时间".tr,
|
||||
leftTitel: '有效时间'.tr,
|
||||
rightTitle:
|
||||
"${DateTool().dateToHNString(state.startDate.value)}-${DateTool().dateToHNString(state.endTime.value)}",
|
||||
'${DateTool().dateToHNString(state.startDate.value)}-${DateTool().dateToHNString(state.endTime.value)}',
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeValidityDatePage,
|
||||
arguments: {
|
||||
"pushType": 1,
|
||||
"fingerprintItemData": state.fingerprintItemData.value,
|
||||
arguments: <String, Object>{
|
||||
'pushType': 1,
|
||||
'fingerprintItemData': state.fingerprintItemData.value,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
state.starDate.value = data["starDate"];
|
||||
state.endDate.value = data["endDate"];
|
||||
state.startDate.value = data["starTime"];
|
||||
state.endTime.value = data["endTime"];
|
||||
state.weekDay.value = data["validityValue"];
|
||||
state.starDate.value = data['starDate'];
|
||||
state.endDate.value = data['endDate'];
|
||||
state.startDate.value = data['starTime'];
|
||||
state.endTime.value = data['endTime'];
|
||||
state.weekDay.value = data['validityValue'];
|
||||
});
|
||||
}
|
||||
})))),
|
||||
@ -176,15 +177,15 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
||||
SizedBox(height: 10.h),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.stressFingerprint!.tr,
|
||||
rightTitle: "",
|
||||
rightTitle: '',
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
isHaveLine: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _isStressFingerprint()))),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
leftTitel: '是否为管理员'.tr,
|
||||
rightTitle: '',
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
@ -192,11 +193,11 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||
rightTitle: "",
|
||||
rightTitle: '',
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
// 指纹
|
||||
Get.toNamed(Routers.lockOperatingRecordPage, arguments: {
|
||||
Get.toNamed(Routers.lockOperatingRecordPage, arguments: <String, Object?>{
|
||||
'type': 3,
|
||||
'id': state.fingerprintItemData.value.fingerprintId.toString(),
|
||||
'recordName': state.fingerprintItemData.value.fingerprintName
|
||||
@ -213,7 +214,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
||||
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr,
|
||||
ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr,
|
||||
() async {
|
||||
state.isDeletFingerprint.value = true;
|
||||
logic.senderAddFingerprint();
|
||||
@ -231,7 +232,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isStressFingerprint.value,
|
||||
onChanged: (value) {
|
||||
onChanged: (bool value) {
|
||||
setState(() {
|
||||
state.isStressFingerprint.value = value;
|
||||
state.isDeletFingerprint.value = false;
|
||||
@ -248,7 +249,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isAdministrator.value,
|
||||
onChanged: (value) {
|
||||
onChanged: (bool value) {
|
||||
// state.isAdministrator.value = value;
|
||||
// state.isDeletFingerprint.value = false;
|
||||
// logic.senderAddFingerprint();
|
||||
|
||||
@ -1,35 +1,15 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../fingerprintList/fingerprintListData_entity.dart';
|
||||
|
||||
class FingerprintDetailState {
|
||||
final fingerprintItemData = FingerprintItemData().obs;
|
||||
|
||||
final TextEditingController changeNameController = TextEditingController();
|
||||
|
||||
final typeNumber = "".obs; // 指纹号
|
||||
final typeName = "".obs; // 指纹名字
|
||||
var starDate = "".obs; // 开始时间
|
||||
var endDate = "".obs; // 结束时间
|
||||
var startDate = "".obs; // 生效时间
|
||||
var endTime = "".obs; // 失效时间
|
||||
final keyType = 0.obs; // 永久:1;限时2,单次3,循环:4
|
||||
var weekDay = [].obs; // 有效日
|
||||
var adder = "".obs; // 添加者
|
||||
var addTime = 0.obs; // 添加时间
|
||||
var keyId = 0.obs;
|
||||
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
var sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
||||
var isDeletFingerprint = true.obs; // 是否删除卡
|
||||
final isStressFingerprint = false.obs;
|
||||
var isAdministrator = false.obs; // 是否为管理员
|
||||
class FingerprintDetailState { // 是否为管理员
|
||||
|
||||
FingerprintDetailState() {
|
||||
Map map = Get.arguments;
|
||||
if ((map["fingerprintItemData"] != null)) {
|
||||
fingerprintItemData.value = map["fingerprintItemData"];
|
||||
if (map['fingerprintItemData'] != null) {
|
||||
fingerprintItemData.value = map['fingerprintItemData'];
|
||||
keyId.value = fingerprintItemData.value.fingerprintId!;
|
||||
typeNumber.value = fingerprintItemData.value.fingerprintNumber!;
|
||||
typeName.value = fingerprintItemData.value.fingerprintName!;
|
||||
@ -41,11 +21,30 @@ class FingerprintDetailState {
|
||||
keyType.value = fingerprintItemData.value.fingerprintType!;
|
||||
adder.value = fingerprintItemData.value.senderUsername!;
|
||||
addTime.value = fingerprintItemData.value.createDate!;
|
||||
isStressFingerprint.value =
|
||||
fingerprintItemData.value.isCoerced! == 2 ? true : false;
|
||||
isStressFingerprint.value = fingerprintItemData.value.isCoerced! == 1;
|
||||
weekDay.value = fingerprintItemData.value.weekDay!;
|
||||
isAdministrator.value =
|
||||
fingerprintItemData.value.fingerRight! == 1 ? true : false;
|
||||
isAdministrator.value = fingerprintItemData.value.fingerRight! == 1;
|
||||
}
|
||||
}
|
||||
final Rx<FingerprintItemData> fingerprintItemData = FingerprintItemData().obs;
|
||||
|
||||
final TextEditingController changeNameController = TextEditingController();
|
||||
|
||||
final RxString typeNumber = ''.obs; // 指纹号
|
||||
final RxString typeName = ''.obs; // 指纹名字
|
||||
RxString starDate = ''.obs; // 开始时间
|
||||
RxString endDate = ''.obs; // 结束时间
|
||||
RxString startDate = ''.obs; // 生效时间
|
||||
RxString endTime = ''.obs; // 失效时间
|
||||
final RxInt keyType = 0.obs; // 永久:1;限时2,单次3,循环:4
|
||||
RxList weekDay = [].obs; // 有效日
|
||||
RxString adder = ''.obs; // 添加者
|
||||
RxInt addTime = 0.obs; // 添加时间
|
||||
RxInt keyId = 0.obs;
|
||||
|
||||
RxBool ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
RxInt sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
||||
RxBool isDeletFingerprint = true.obs; // 是否删除卡
|
||||
final RxBool isStressFingerprint = false.obs;
|
||||
RxBool isAdministrator = false.obs;
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
||||
import 'package:star_lock/tools/showTipView.dart';
|
||||
@ -112,11 +112,11 @@ class LockSetLogic extends BaseGetXController {
|
||||
|
||||
// 恢复出厂设置数据解析
|
||||
Future<void> _replyFactoryDataResetKey(Reply reply) async {
|
||||
List<int> token = reply.data.sublist(2, 6);
|
||||
List<String> saveStrList = changeIntListToStringList(token);
|
||||
final List<int> token = reply.data.sublist(2, 6);
|
||||
final List<String> saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
int status = reply.data[6];
|
||||
final int status = reply.data[6];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
@ -126,16 +126,16 @@ class LockSetLogic extends BaseGetXController {
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
List<String>? privateKey =
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
List<String>? publicKey =
|
||||
final List<String>? publicKey =
|
||||
await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
final List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderFactoryDataReset(
|
||||
lockID: BlueManage().connectDeviceName,
|
||||
@ -174,7 +174,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
|
||||
// 锁设置数据解析
|
||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
final int status = reply.data[2];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
@ -292,16 +292,16 @@ class LockSetLogic extends BaseGetXController {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
List<String>? privateKey =
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
List<String>? publicKey =
|
||||
final List<String>? publicKey =
|
||||
await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
final List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderFactoryDataReset(
|
||||
lockID: BlueManage().connectDeviceName,
|
||||
@ -356,16 +356,16 @@ class LockSetLogic extends BaseGetXController {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
List<String>? privateKey =
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
List<String>? publicKey =
|
||||
final List<String>? publicKey =
|
||||
await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
state.settingUpSupportFeatures = type;
|
||||
|
||||
@ -404,7 +404,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
|
||||
// 获取锁设置信息
|
||||
Future<LockSetInfoEntity> getLockSettingInfoData() async {
|
||||
LockSetInfoEntity entity = await ApiRepository.to.getLockSettingInfoData(
|
||||
final LockSetInfoEntity entity = await ApiRepository.to.getLockSettingInfoData(
|
||||
lockId: state.lockId.toString(),
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
@ -432,7 +432,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
// 开启考勤获取是否有公司
|
||||
Future<void> openCheckingInData(
|
||||
BlockSetCheckInCallback blockSetCheckInCallback) async {
|
||||
CheckingInInfoDataEntity entity = await ApiRepository.to.openCheckingInData(
|
||||
final CheckingInInfoDataEntity entity = await ApiRepository.to.openCheckingInData(
|
||||
lockId: state.lockSetInfoData.value.lockId.toString(),
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
@ -442,7 +442,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
|
||||
// 设置是否打开考勤
|
||||
Future<void> setLockSetGeneralSetting() async {
|
||||
LoginEntity entity = await ApiRepository.to.setCheckInData(
|
||||
final LoginEntity entity = await ApiRepository.to.setCheckInData(
|
||||
lockId: state.lockSetInfoData.value.lockId!,
|
||||
attendance: state.isAttendance.value == 1 ? 0 : 1,
|
||||
);
|
||||
@ -459,7 +459,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
|
||||
// 设置是否打开开锁提醒
|
||||
Future<void> setLockPickingReminder() async {
|
||||
LoginEntity entity = await ApiRepository.to.setLockPickingReminderData(
|
||||
final LoginEntity entity = await ApiRepository.to.setLockPickingReminderData(
|
||||
lockId: state.lockSetInfoData.value.lockId!,
|
||||
unlockReminder: state.isLockPickingReminder.value == 1 ? 0 : 1,
|
||||
);
|
||||
@ -476,7 +476,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
|
||||
// 设置是否打开开锁时是否需联网
|
||||
Future<void> setLockSetOpenLockNeedOnline() async {
|
||||
LoginEntity entity = await ApiRepository.to.setOpenLockNeedOnlineData(
|
||||
final LoginEntity entity = await ApiRepository.to.setOpenLockNeedOnlineData(
|
||||
lockId: state.lockSetInfoData.value.lockId!,
|
||||
appUnlockOnline: state.isOpenLockNeedOnline.value == 1 ? 0 : 1,
|
||||
);
|
||||
@ -496,7 +496,6 @@ class LockSetLogic extends BaseGetXController {
|
||||
|
||||
// 下级界面修改成功后传递数据
|
||||
StreamSubscription? _passCurrentLockInformationEvent;
|
||||
|
||||
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
_passCurrentLockInformationEvent = eventBus
|
||||
@ -507,7 +506,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
void showDeletAlertTipDialog({String? showContent = ''}) {
|
||||
String content = showContent!.isEmpty
|
||||
final String content = showContent!.isEmpty
|
||||
? "${"删除设备失败,请确保在设备附近,设备未被连接,设备已打开".tr}${BlueManage().connectDeviceName!.contains("T9A") == true ? "。如果是全自动锁,请使屏幕变亮".tr : ""}"
|
||||
: showContent;
|
||||
ShowTipView().showSureAlertDialog(content);
|
||||
@ -520,10 +519,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
ShowTipView().showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr,
|
||||
() {
|
||||
// 删除锁
|
||||
ShowTipView().showTFViewAlertDialog(
|
||||
state.passwordTF, '请输入登录密码'.tr, '请输入登录密码'.tr, () {
|
||||
checkLoginPassword();
|
||||
});
|
||||
ShowTipView().showTFViewAlertDialog(state.passwordTF, '请输入登录密码'.tr, '请输入登录密码'.tr, checkLoginPassword);
|
||||
});
|
||||
} else if (state.lockBasicInfo.value.keyRight == 1) {
|
||||
// 授权管理员弹框提示
|
||||
@ -535,15 +531,13 @@ class LockSetLogic extends BaseGetXController {
|
||||
});
|
||||
} else {
|
||||
// 普通用户直接删除
|
||||
ShowTipView().showIosTipWithContentDialog('是否删除钥匙?'.tr, () {
|
||||
deletKeyData();
|
||||
});
|
||||
ShowTipView().showIosTipWithContentDialog('是否删除钥匙?'.tr, deletKeyData);
|
||||
}
|
||||
}
|
||||
|
||||
// 查询账户密码
|
||||
Future<void> checkLoginPassword() async {
|
||||
LockListInfoEntity entity = await ApiRepository.to.checkLoginPassword(
|
||||
final LockListInfoEntity entity = await ApiRepository.to.checkLoginPassword(
|
||||
password: state.passwordTF.text,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
@ -554,7 +548,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
|
||||
// 当是锁拥有者的时候,删除锁
|
||||
Future<void> deletLockInfoData() async {
|
||||
LockListInfoEntity entity = await ApiRepository.to.deletOwnerLockData(
|
||||
final LockListInfoEntity entity = await ApiRepository.to.deletOwnerLockData(
|
||||
lockId: state.lockSetInfoData.value.lockId!,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
|
||||
@ -54,7 +54,7 @@ class UploadDataLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 上传数据获取锁设置
|
||||
if (reply is UpdataLockSetReply && (state.ifCurrentScreen.value == true)) {
|
||||
if (reply is UpdataLockSetReply && (state.ifCurrentScreen.value == true) && (state.ifSeletUpdataBtnState == true)) {
|
||||
_replyUpdataLockSetReply(reply);
|
||||
}
|
||||
});
|
||||
@ -545,7 +545,6 @@ class UploadDataLogic extends BaseGetXController{
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// 上传数据获取设置
|
||||
Future<void> getUpdataLockSet() async {
|
||||
showEasyLoading();
|
||||
|
||||
@ -44,6 +44,8 @@ class _UploadDataPageState extends State<UploadDataPage> with RouteAware{
|
||||
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||
onClick: () {
|
||||
state.ifSeletUpdataBtnState = true;
|
||||
|
||||
state.uploadPasswordPage = 0;
|
||||
state.uploadPasswordDataList.clear();
|
||||
state.uploadCardPage = 0;
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:get/get.dart';
|
||||
class UploadDataState{
|
||||
RxBool ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
RxInt sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
||||
bool ifSeletUpdataBtnState = false;// 0未点击过上传数据按钮 1是点击过上传数据按钮
|
||||
|
||||
int countReq = 10;// 每次请求的数量
|
||||
RxInt indexCount = 0.obs;// 用来显示按钮的索引 0/5
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/message/messageList/messageList_state.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
@ -23,10 +24,9 @@ class MessageListXHJPage extends StatefulWidget {
|
||||
State<MessageListXHJPage> createState() => _MessageListXHJPageState();
|
||||
}
|
||||
|
||||
class _MessageListXHJPageState extends State<MessageListXHJPage>
|
||||
with TickerProviderStateMixin {
|
||||
final logic = Get.put(MessageListLogic());
|
||||
final state = Get.find<MessageListLogic>().state;
|
||||
class _MessageListXHJPageState extends State<MessageListXHJPage> with TickerProviderStateMixin {
|
||||
final MessageListLogic logic = Get.put(MessageListLogic());
|
||||
final MessageListState state = Get.find<MessageListLogic>().state;
|
||||
|
||||
void getHttpData() {
|
||||
logic.messageListDataRequest().then((MessageListEntity value) {
|
||||
@ -49,21 +49,21 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
|
||||
? TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.message!.tr,
|
||||
haveBack: true,
|
||||
actionsList: [
|
||||
actionsList: <Widget>[
|
||||
TextButton(
|
||||
child: Text(
|
||||
"清空".tr,
|
||||
'清空'.tr,
|
||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
ShowTipView().showIosTipWithContentDialog("是否清空?".tr,
|
||||
ShowTipView().showIosTipWithContentDialog('是否清空?'.tr,
|
||||
() async {
|
||||
logic.deletAllMessageDataRequest();
|
||||
});
|
||||
} else {
|
||||
logic.showToast("演示模式".tr);
|
||||
logic.showToast('演示模式'.tr);
|
||||
}
|
||||
},
|
||||
),
|
||||
@ -71,7 +71,7 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
|
||||
backgroundColor: AppColors.mainColor)
|
||||
: null,
|
||||
body: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 15.h,
|
||||
),
|
||||
@ -86,7 +86,7 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20.r),
|
||||
boxShadow: [
|
||||
boxShadow: <BoxShadow>[
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.15),
|
||||
offset: const Offset(0, 0),
|
||||
@ -98,7 +98,7 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'智能分析'.tr,
|
||||
style: TextStyle(
|
||||
@ -131,15 +131,15 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
|
||||
child: ListView.builder(
|
||||
itemCount: state.itemDataList.length,
|
||||
padding: EdgeInsets.only(top: 20.h),
|
||||
itemBuilder: (c, index) {
|
||||
MessageItemEntity messageItemEntity =
|
||||
itemBuilder: (BuildContext c, int index) {
|
||||
final MessageItemEntity messageItemEntity =
|
||||
state.itemDataList[index];
|
||||
return Slidable(
|
||||
key: ValueKey(messageItemEntity.id),
|
||||
endActionPane: ActionPane(
|
||||
extentRatio: 0.2,
|
||||
motion: const ScrollMotion(),
|
||||
children: [
|
||||
children: <Widget>[
|
||||
SlidableAction(
|
||||
onPressed: (BuildContext context) {
|
||||
logic.deletMessageDataRequest(
|
||||
@ -158,8 +158,8 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
|
||||
),
|
||||
child: _messageListItem(messageItemEntity, () {
|
||||
Get.toNamed(Routers.messageDetailPage,
|
||||
arguments: {
|
||||
"messageItemEntity": messageItemEntity
|
||||
arguments: <String, MessageItemEntity>{
|
||||
'messageItemEntity': messageItemEntity
|
||||
});
|
||||
}),
|
||||
);
|
||||
@ -174,7 +174,7 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
|
||||
|
||||
Widget _messageListItem(
|
||||
MessageItemEntity messageItemEntity, Function() action) {
|
||||
bool isNotRead = messageItemEntity.readAt! == 0;
|
||||
final bool isNotRead = messageItemEntity.readAt! == 0;
|
||||
return GestureDetector(
|
||||
onTap: action,
|
||||
child: Container(
|
||||
@ -183,7 +183,7 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(20.w),
|
||||
boxShadow: [
|
||||
boxShadow: <BoxShadow>[
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.15),
|
||||
offset: const Offset(0, 0),
|
||||
@ -195,7 +195,7 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Image.asset(
|
||||
isNotRead ? 'images/news_not_read.png' : 'images/news_read.png',
|
||||
width: 48.r,
|
||||
@ -204,7 +204,7 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text(
|
||||
messageItemEntity.data!,
|
||||
maxLines: 1,
|
||||
|
||||
@ -165,7 +165,7 @@ dependencies:
|
||||
|
||||
#网络图片缓存
|
||||
cached_network_image: ^3.2.0
|
||||
webview_flutter: ^4.4.2
|
||||
webview_flutter: ^4.5.0
|
||||
|
||||
jpush_flutter: ^2.5.1
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user