Merge branch 'develop_sync_record' into 'release'
Develop sync record See merge request StarlockTeam/app-starlock!98
This commit is contained in:
commit
d31dfd509e
@ -76,7 +76,6 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
Container(
|
Container(
|
||||||
width: 340.w,
|
width: 340.w,
|
||||||
height: 60.h,
|
height: 60.h,
|
||||||
// color: Colors.red,
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(30.h)),
|
borderRadius: BorderRadius.all(Radius.circular(30.h)),
|
||||||
border:
|
border:
|
||||||
@ -119,28 +118,22 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
child: Obx(
|
child: Obx(
|
||||||
() => Container(
|
() => Container(
|
||||||
height: 60.h,
|
height: 60.h,
|
||||||
// color: Colors.red,
|
decoration: !state.isIphoneType.value
|
||||||
decoration: state.isIphoneType.value
|
? BoxDecoration(
|
||||||
? null
|
|
||||||
: BoxDecoration(
|
|
||||||
color: AppColors.mainColor,
|
color: AppColors.mainColor,
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius:
|
||||||
Radius.circular(
|
BorderRadius.all(Radius.circular(30.h)),
|
||||||
30.h,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
color: AppColors.greyLineColor,
|
color: AppColors.greyLineColor))
|
||||||
),
|
: null,
|
||||||
),
|
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'邮箱'.tr,
|
'邮箱'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: state.isIphoneType.value
|
color: !state.isIphoneType.value
|
||||||
? Colors.black
|
? Colors.white
|
||||||
: Colors.white,
|
: Colors.black,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -3,8 +3,11 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class StarLockRegisterState {
|
class StarLockRegisterState {
|
||||||
|
|
||||||
StarLockRegisterState() {
|
StarLockRegisterState() {
|
||||||
|
// 根据系统语言设置默认选中的tab
|
||||||
|
final Locale? systemLocale = Get.deviceLocale;
|
||||||
|
isIphoneType.value = systemLocale?.languageCode == 'zh';
|
||||||
|
|
||||||
resetResend();
|
resetResend();
|
||||||
}
|
}
|
||||||
final TextEditingController phoneOrEmailController = TextEditingController();
|
final TextEditingController phoneOrEmailController = TextEditingController();
|
||||||
@ -22,16 +25,21 @@ class StarLockRegisterState {
|
|||||||
RxString verificationCode = ''.obs;
|
RxString verificationCode = ''.obs;
|
||||||
RxString xWidth = ''.obs; // 滑动验证码滑动位置
|
RxString xWidth = ''.obs; // 滑动验证码滑动位置
|
||||||
RxBool isIphoneType = true.obs;
|
RxBool isIphoneType = true.obs;
|
||||||
RxBool canSub = false.obs;// 是否能提交
|
RxBool canSub = false.obs; // 是否能提交
|
||||||
RxBool agree = false.obs;
|
RxBool agree = false.obs;
|
||||||
RxBool canSendCode = false.obs;// 是否能发送验证码
|
RxBool canSendCode = false.obs; // 是否能发送验证码
|
||||||
|
|
||||||
// bool get isEmail => RegexUtil.isEmail(phoneOrEmailStr.value);
|
// bool get isEmail => RegexUtil.isEmail(phoneOrEmailStr.value);
|
||||||
// bool get isIphone => RegexUtil.isMobileSimple(phoneOrEmailStr.value);
|
// bool get isIphone => RegexUtil.isMobileSimple(phoneOrEmailStr.value);
|
||||||
bool get pwdIsOK => pwd.value.isNotEmpty && surePwd.value.isNotEmpty && pwd.value.length >= 8 && surePwd.value.length >= 8;
|
bool get pwdIsOK =>
|
||||||
bool get codeIsOK => verificationCode.value.isNotEmpty && verificationCode.value.length >= 6 ;
|
pwd.value.isNotEmpty &&
|
||||||
|
surePwd.value.isNotEmpty &&
|
||||||
|
pwd.value.length >= 8 &&
|
||||||
|
surePwd.value.length >= 8;
|
||||||
|
bool get codeIsOK =>
|
||||||
|
verificationCode.value.isNotEmpty && verificationCode.value.length >= 6;
|
||||||
|
|
||||||
RxBool canResend = false.obs;// 是否能重新发送,就是验证码倒计时之后的重新发送
|
RxBool canResend = false.obs; // 是否能重新发送,就是验证码倒计时之后的重新发送
|
||||||
RxString btnText = ''.obs;
|
RxString btnText = ''.obs;
|
||||||
int totalSeconds = 120;
|
int totalSeconds = 120;
|
||||||
int currentSecond = 120;
|
int currentSecond = 120;
|
||||||
@ -39,9 +47,8 @@ class StarLockRegisterState {
|
|||||||
|
|
||||||
void resetResend() {
|
void resetResend() {
|
||||||
canResend.value = totalSeconds == currentSecond;
|
canResend.value = totalSeconds == currentSecond;
|
||||||
btnText.value = !canResend.value
|
btnText.value =
|
||||||
? '$currentSecond s'
|
!canResend.value ? '$currentSecond s' : btnText.value = '获取验证码'.tr;
|
||||||
: btnText.value = '获取验证码'.tr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onClose() {
|
void onClose() {
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -74,6 +73,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterXHJPage> {
|
|||||||
height: 80.h,
|
height: 80.h,
|
||||||
child: DefaultTabController(
|
child: DefaultTabController(
|
||||||
length: 2,
|
length: 2,
|
||||||
|
initialIndex: state.isIphoneType.value ? 0 : 1,
|
||||||
child: TabBar(
|
child: TabBar(
|
||||||
onTap: (int index) {
|
onTap: (int index) {
|
||||||
state.isIphoneType.value = index == 0;
|
state.isIphoneType.value = index == 0;
|
||||||
@ -84,10 +84,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterXHJPage> {
|
|||||||
}),
|
}),
|
||||||
dividerHeight: 0,
|
dividerHeight: 0,
|
||||||
indicatorSize: TabBarIndicatorSize.tab,
|
indicatorSize: TabBarIndicatorSize.tab,
|
||||||
tabs: <Widget>[
|
tabs: <Widget>[Text('手机'.tr), Text('邮箱'.tr)],
|
||||||
Text('手机'.tr),
|
|
||||||
Text('邮箱'.tr)
|
|
||||||
],
|
|
||||||
indicatorColor: AppColors.mainColor,
|
indicatorColor: AppColors.mainColor,
|
||||||
labelStyle:
|
labelStyle:
|
||||||
TextStyle(color: AppColors.mainColor, fontSize: 26.sp),
|
TextStyle(color: AppColors.mainColor, fontSize: 26.sp),
|
||||||
@ -144,7 +141,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterXHJPage> {
|
|||||||
logic.checkNext(state.phoneOrEmailController);
|
logic.checkNext(state.phoneOrEmailController);
|
||||||
},
|
},
|
||||||
leftWidget: SizedBox(),
|
leftWidget: SizedBox(),
|
||||||
label:state.isIphoneType.value ? '请输入手机号'.tr : '请输入邮箱'.tr,
|
label: state.isIphoneType.value ? '请输入手机号'.tr : '请输入邮箱'.tr,
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
inputFormatters: <TextInputFormatter>[
|
inputFormatters: <TextInputFormatter>[
|
||||||
LengthLimitingTextInputFormatter(30),
|
LengthLimitingTextInputFormatter(30),
|
||||||
@ -163,7 +160,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterXHJPage> {
|
|||||||
Text(
|
Text(
|
||||||
'密码必须是8-20位,至少包括数字/字母/符号中的2种'.tr,
|
'密码必须是8-20位,至少包括数字/字母/符号中的2种'.tr,
|
||||||
style:
|
style:
|
||||||
TextStyle(color: AppColors.placeholderTextColor, fontSize: 20.sp),
|
TextStyle(color: AppColors.placeholderTextColor, fontSize: 20.sp),
|
||||||
),
|
),
|
||||||
LoginInput(
|
LoginInput(
|
||||||
controller: state.sureController,
|
controller: state.sureController,
|
||||||
@ -235,32 +232,31 @@ class _StarLockRegisterPageState extends State<StarLockRegisterXHJPage> {
|
|||||||
|
|
||||||
Widget _buildBottomAgreement() {
|
Widget _buildBottomAgreement() {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom:20.w),
|
padding: EdgeInsets.only(bottom: 20.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Obx(() => GestureDetector(
|
Obx(() => GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
state.agree.value = !state.agree.value;
|
state.agree.value = !state.agree.value;
|
||||||
logic.changeAgreeState();
|
logic.changeAgreeState();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 40.w,
|
width: 40.w,
|
||||||
height: 40.w,
|
height: 40.w,
|
||||||
// color: Colors.red,
|
// color: Colors.red,
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
left: 5.w,
|
left: 5.w,
|
||||||
right: 10.w,
|
right: 10.w,
|
||||||
),
|
),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
state.agree.value
|
state.agree.value
|
||||||
? 'images/icon_round_select.png'
|
? 'images/icon_round_select.png'
|
||||||
: 'images/icon_round_unSelect.png',
|
: 'images/icon_round_unSelect.png',
|
||||||
width: 20.w,
|
width: 20.w,
|
||||||
height: 20.w,
|
height: 20.w,
|
||||||
),
|
),
|
||||||
)
|
))),
|
||||||
)),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 10.w,
|
width: 10.w,
|
||||||
),
|
),
|
||||||
@ -268,14 +264,12 @@ class _StarLockRegisterPageState extends State<StarLockRegisterXHJPage> {
|
|||||||
child: RichText(
|
child: RichText(
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
text: '我已阅读并同意'.tr,
|
text: '我已阅读并同意'.tr,
|
||||||
style:
|
style: TextStyle(color: const Color(0xff333333), fontSize: 20.sp),
|
||||||
TextStyle(color: const Color(0xff333333), fontSize: 20.sp),
|
|
||||||
children: <InlineSpan>[
|
children: <InlineSpan>[
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
alignment: PlaceholderAlignment.middle,
|
alignment: PlaceholderAlignment.middle,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
child: Text(
|
child: Text('《${'用户协议'.tr}》',
|
||||||
'《${'用户协议'.tr}》',
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.mainColor, fontSize: 20.sp)),
|
color: AppColors.mainColor, fontSize: 20.sp)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@ -289,8 +283,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterXHJPage> {
|
|||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
alignment: PlaceholderAlignment.middle,
|
alignment: PlaceholderAlignment.middle,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
child: Text(
|
child: Text('《${'隐私政策'.tr}》',
|
||||||
'《${'隐私政策'.tr}》',
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.mainColor, fontSize: 20.sp)),
|
color: AppColors.mainColor, fontSize: 20.sp)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|||||||
@ -405,6 +405,7 @@ class FingerprintListLogic extends BaseGetXController {
|
|||||||
_teamEvent = eventBus
|
_teamEvent = eventBus
|
||||||
.on<OtherTypeRefreshListEvent>()
|
.on<OtherTypeRefreshListEvent>()
|
||||||
.listen((OtherTypeRefreshListEvent event) async {
|
.listen((OtherTypeRefreshListEvent event) async {
|
||||||
|
// 立即刷新数据
|
||||||
await getFingerprintsListData(isRefresh: true);
|
await getFingerprintsListData(isRefresh: true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -459,8 +460,10 @@ class FingerprintListLogic extends BaseGetXController {
|
|||||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
_initReplySubscription();
|
_initReplySubscription();
|
||||||
|
_initRefreshAction();
|
||||||
|
|
||||||
// _initRefreshAction();
|
// 初始加载数据
|
||||||
|
await getFingerprintsListData(isRefresh: true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
@ -7,6 +6,8 @@ import 'package:star_lock/blue/io_protocol/io_updataLockRemoteControlList.dart';
|
|||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/commonDataManage.dart';
|
import 'package:star_lock/tools/commonDataManage.dart';
|
||||||
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
|
import 'package:star_lock/tools/storage.dart';
|
||||||
|
|
||||||
import '../../../../app_settings/app_settings.dart';
|
import '../../../../app_settings/app_settings.dart';
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
@ -21,48 +22,56 @@ import '../../../../blue/io_tool/io_tool.dart';
|
|||||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
import '../../../../blue/sender_manage.dart';
|
import '../../../../blue/sender_manage.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/storage.dart';
|
|
||||||
import 'uploadData_state.dart';
|
import 'uploadData_state.dart';
|
||||||
|
|
||||||
class UploadDataLogic extends BaseGetXController{
|
class UploadDataLogic extends BaseGetXController {
|
||||||
UploadDataState state = UploadDataState();
|
final UploadDataState state = UploadDataState();
|
||||||
|
|
||||||
// 监听蓝牙协议返回结果
|
// 监听蓝牙协议返回结果
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
_replySubscription =
|
||||||
|
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||||
// 上传数据获取锁密码列表
|
// 上传数据获取锁密码列表
|
||||||
if (reply is UpdataLockPasswordListReply && (state.ifCurrentScreen.value == true)) {
|
if (reply is UpdataLockPasswordListReply &&
|
||||||
|
(state.ifCurrentScreen.value == true)) {
|
||||||
_replyUpdataLockPasswordListReply(reply);
|
_replyUpdataLockPasswordListReply(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传数据获取锁卡列表
|
// 上传数据获取锁卡列表
|
||||||
if (reply is UpdataLockCardListReply && (state.ifCurrentScreen.value == true)) {
|
if (reply is UpdataLockCardListReply &&
|
||||||
|
(state.ifCurrentScreen.value == true)) {
|
||||||
_replyUpdataLockCardListReply(reply);
|
_replyUpdataLockCardListReply(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传数据获取锁指纹列表
|
// 上传数据获取锁指纹列表
|
||||||
if (reply is UpdataLockFingerprintListReply && (state.ifCurrentScreen.value == true)) {
|
if (reply is UpdataLockFingerprintListReply &&
|
||||||
|
(state.ifCurrentScreen.value == true)) {
|
||||||
_replyUpdataLockFingerprintListReply(reply);
|
_replyUpdataLockFingerprintListReply(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传数据获取锁人脸列表
|
// 上传数据获取锁人脸列表
|
||||||
if (reply is UpdataLockFaceListReply && (state.ifCurrentScreen.value == true)) {
|
if (reply is UpdataLockFaceListReply &&
|
||||||
|
(state.ifCurrentScreen.value == true)) {
|
||||||
_replyUpdataLockFaceListReply(reply);
|
_replyUpdataLockFaceListReply(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传数据获取锁掌静脉列表
|
// 上传数据获取锁掌静脉列表
|
||||||
if (reply is UpdataLockPalmVeinListReply && (state.ifCurrentScreen.value == true)) {
|
if (reply is UpdataLockPalmVeinListReply &&
|
||||||
|
(state.ifCurrentScreen.value == true)) {
|
||||||
_replyUpdataLockPalmVeinListReply(reply);
|
_replyUpdataLockPalmVeinListReply(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传数据获取锁遥控
|
// 上传数据获取锁遥控
|
||||||
if (reply is UpdataLockRemoteControlListReply && (state.ifCurrentScreen.value == true)) {
|
if (reply is UpdataLockRemoteControlListReply &&
|
||||||
|
(state.ifCurrentScreen.value == true)) {
|
||||||
_replyUpdataLockRemoteControlListReply(reply);
|
_replyUpdataLockRemoteControlListReply(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传数据获取锁设置
|
// 上传数据获取锁设置
|
||||||
if (reply is UpdataLockSetReply && (state.ifCurrentScreen.value == true) && (state.ifSeletUpdataBtnState == true)) {
|
if (reply is UpdataLockSetReply &&
|
||||||
|
(state.ifCurrentScreen.value == true) &&
|
||||||
|
(state.ifSeletUpdataBtnState == true)) {
|
||||||
_replyUpdataLockSetReply(reply);
|
_replyUpdataLockSetReply(reply);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -71,21 +80,22 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
// 上传数据获取锁密码列表
|
// 上传数据获取锁密码列表
|
||||||
Future<void> _replyUpdataLockPasswordListReply(Reply reply) async {
|
Future<void> _replyUpdataLockPasswordListReply(Reply reply) async {
|
||||||
final int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
switch(status){
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
|
|
||||||
final int dataLength = reply.data[8];
|
final int dataLength = reply.data[8];
|
||||||
state.uploadPasswordDataList.addAll(reply.data.sublist(9, reply.data.length));
|
state.uploadPasswordDataList
|
||||||
if(dataLength == 10){
|
.addAll(reply.data.sublist(9, reply.data.length));
|
||||||
|
if (dataLength == 10) {
|
||||||
// 当数据是10的时候继续请求
|
// 当数据是10的时候继续请求
|
||||||
state.uploadPasswordPage = state.uploadPasswordPage + 1;
|
state.uploadPasswordPage = state.uploadPasswordPage + 1;
|
||||||
|
|
||||||
final List<int> token = reply.data.sublist(3, 7);
|
final List<int> token = reply.data.sublist(3, 7);
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
updataLockPasswordList(token, state.uploadPasswordPage);
|
updataLockPasswordList(token, state.uploadPasswordPage);
|
||||||
}else{
|
} else {
|
||||||
// dismissEasyLoading();
|
// dismissEasyLoading();
|
||||||
|
|
||||||
// 当数据不是10的时候解析数据上传
|
// 当数据不是10的时候解析数据上传
|
||||||
@ -95,12 +105,15 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
// }else{
|
// }else{
|
||||||
// // 如果不是空的解析数据上传
|
// // 如果不是空的解析数据上传
|
||||||
state.indexCount.value = state.indexCount.value + 1;
|
state.indexCount.value = state.indexCount.value + 1;
|
||||||
_lockDataUpload(uploadType:2, recordType:2, records:state.uploadPasswordDataList);
|
_lockDataUpload(
|
||||||
|
uploadType: 2,
|
||||||
|
recordType: 2,
|
||||||
|
records: state.uploadPasswordDataList);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
final List<int> token = reply.data.sublist(3, 7);
|
final List<int> token = reply.data.sublist(3, 7);
|
||||||
final List<String> saveStrList = changeIntListToStringList(token);
|
final List<String> saveStrList = changeIntListToStringList(token);
|
||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
@ -120,14 +133,15 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
// 上传数据获取锁卡列表
|
// 上传数据获取锁卡列表
|
||||||
Future<void> _replyUpdataLockCardListReply(Reply reply) async {
|
Future<void> _replyUpdataLockCardListReply(Reply reply) async {
|
||||||
final int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
switch(status){
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
|
|
||||||
final int dataLength = reply.data[8];
|
final int dataLength = reply.data[8];
|
||||||
state.uploadCardDataList.addAll(reply.data.sublist(9, reply.data.length));
|
state.uploadCardDataList
|
||||||
if(dataLength == 10){
|
.addAll(reply.data.sublist(9, reply.data.length));
|
||||||
|
if (dataLength == 10) {
|
||||||
// 当数据是10的时候继续请求
|
// 当数据是10的时候继续请求
|
||||||
state.uploadCardPage = state.uploadCardPage + 1;
|
state.uploadCardPage = state.uploadCardPage + 1;
|
||||||
|
|
||||||
@ -135,7 +149,7 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
updataLockCardList(token, state.uploadCardPage);
|
updataLockCardList(token, state.uploadCardPage);
|
||||||
}else{
|
} else {
|
||||||
// // 当数据不是10的时候解析数据上传
|
// // 当数据不是10的时候解析数据上传
|
||||||
// if(state.uploadCardDataList.isEmpty){
|
// if(state.uploadCardDataList.isEmpty){
|
||||||
// // 如果是空的直接上传下一个
|
// // 如果是空的直接上传下一个
|
||||||
@ -143,12 +157,13 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
// }else{
|
// }else{
|
||||||
// // 如果不是空的解析数据上传
|
// // 如果不是空的解析数据上传
|
||||||
state.indexCount.value = state.indexCount.value + 1;
|
state.indexCount.value = state.indexCount.value + 1;
|
||||||
_lockDataUpload(uploadType:2, recordType:3, records:state.uploadCardDataList);
|
_lockDataUpload(
|
||||||
|
uploadType: 2, recordType: 3, records: state.uploadCardDataList);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
final List<int> token = reply.data.sublist(3, 7);
|
final List<int> token = reply.data.sublist(3, 7);
|
||||||
final List<String> saveStrList = changeIntListToStringList(token);
|
final List<String> saveStrList = changeIntListToStringList(token);
|
||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
@ -167,14 +182,15 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
// 上传数据获取锁指纹列表
|
// 上传数据获取锁指纹列表
|
||||||
Future<void> _replyUpdataLockFingerprintListReply(Reply reply) async {
|
Future<void> _replyUpdataLockFingerprintListReply(Reply reply) async {
|
||||||
final int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
switch(status){
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
|
|
||||||
final int dataLength = reply.data[8];
|
final int dataLength = reply.data[8];
|
||||||
state.uploadFingerprintDataList.addAll(reply.data.sublist(9, reply.data.length));
|
state.uploadFingerprintDataList
|
||||||
if(dataLength == 10){
|
.addAll(reply.data.sublist(9, reply.data.length));
|
||||||
|
if (dataLength == 10) {
|
||||||
// 当数据是10的时候继续请求
|
// 当数据是10的时候继续请求
|
||||||
state.uploadFingerprintPage = state.uploadFingerprintPage + 1;
|
state.uploadFingerprintPage = state.uploadFingerprintPage + 1;
|
||||||
|
|
||||||
@ -182,7 +198,7 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
updataLockFingerprintList(token, state.uploadFingerprintPage);
|
updataLockFingerprintList(token, state.uploadFingerprintPage);
|
||||||
}else{
|
} else {
|
||||||
// // 当数据不是10的时候解析数据上传
|
// // 当数据不是10的时候解析数据上传
|
||||||
// if(state.uploadFingerprintDataList.isEmpty){
|
// if(state.uploadFingerprintDataList.isEmpty){
|
||||||
// // 如果是空的直接上传下一个
|
// // 如果是空的直接上传下一个
|
||||||
@ -190,12 +206,15 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
// }else{
|
// }else{
|
||||||
// // 如果不是空的解析数据上传
|
// // 如果不是空的解析数据上传
|
||||||
state.indexCount.value = state.indexCount.value + 1;
|
state.indexCount.value = state.indexCount.value + 1;
|
||||||
_lockDataUpload(uploadType:2, recordType:4, records:state.uploadFingerprintDataList);
|
_lockDataUpload(
|
||||||
|
uploadType: 2,
|
||||||
|
recordType: 4,
|
||||||
|
records: state.uploadFingerprintDataList);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
final List<int> token = reply.data.sublist(3, 7);
|
final List<int> token = reply.data.sublist(3, 7);
|
||||||
final List<String> saveStrList = changeIntListToStringList(token);
|
final List<String> saveStrList = changeIntListToStringList(token);
|
||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
@ -214,14 +233,15 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
// 上传数据获取锁人脸列表解析
|
// 上传数据获取锁人脸列表解析
|
||||||
Future<void> _replyUpdataLockFaceListReply(Reply reply) async {
|
Future<void> _replyUpdataLockFaceListReply(Reply reply) async {
|
||||||
final int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
switch(status){
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
|
|
||||||
final int dataLength = reply.data[8];
|
final int dataLength = reply.data[8];
|
||||||
state.uploadFaceDataList.addAll(reply.data.sublist(9, reply.data.length));
|
state.uploadFaceDataList
|
||||||
if(dataLength == 10){
|
.addAll(reply.data.sublist(9, reply.data.length));
|
||||||
|
if (dataLength == 10) {
|
||||||
// 当数据是10的时候继续请求
|
// 当数据是10的时候继续请求
|
||||||
state.uploadFacePage = state.uploadFacePage + 1;
|
state.uploadFacePage = state.uploadFacePage + 1;
|
||||||
|
|
||||||
@ -229,20 +249,21 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
updataLockFaceList(token, state.uploadFacePage);
|
updataLockFaceList(token, state.uploadFacePage);
|
||||||
}else{
|
} else {
|
||||||
// // 当数据不是10的时候解析数据上传
|
// // 当数据不是10的时候解析数据上传
|
||||||
// if(state.uploadFaceDataList.isEmpty){
|
// if(state.uploadFaceDataList.isEmpty){
|
||||||
// // 如果是空的直接上传下一个
|
// // 如果是空的直接上传下一个
|
||||||
// getUpdataLockPalmVeinList();
|
// getUpdataLockPalmVeinList();
|
||||||
// }else{
|
// }else{
|
||||||
// 如果不是空的解析数据上传
|
// 如果不是空的解析数据上传
|
||||||
state.indexCount.value = state.indexCount.value + 1;
|
state.indexCount.value = state.indexCount.value + 1;
|
||||||
_lockDataUpload(uploadType:2, recordType:5, records:state.uploadFaceDataList);
|
_lockDataUpload(
|
||||||
|
uploadType: 2, recordType: 5, records: state.uploadFaceDataList);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
final List<int> token = reply.data.sublist(3, 7);
|
final List<int> token = reply.data.sublist(3, 7);
|
||||||
final List<String> saveStrList = changeIntListToStringList(token);
|
final List<String> saveStrList = changeIntListToStringList(token);
|
||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
@ -261,14 +282,15 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
// 上传数据获取锁掌静脉列表解析
|
// 上传数据获取锁掌静脉列表解析
|
||||||
Future<void> _replyUpdataLockPalmVeinListReply(Reply reply) async {
|
Future<void> _replyUpdataLockPalmVeinListReply(Reply reply) async {
|
||||||
final int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
switch(status){
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
|
|
||||||
final int dataLength = reply.data[8];
|
final int dataLength = reply.data[8];
|
||||||
state.uploadPalmVeinDataList.addAll(reply.data.sublist(9, reply.data.length));
|
state.uploadPalmVeinDataList
|
||||||
if(dataLength == 10){
|
.addAll(reply.data.sublist(9, reply.data.length));
|
||||||
|
if (dataLength == 10) {
|
||||||
// 当数据是10的时候继续请求
|
// 当数据是10的时候继续请求
|
||||||
state.uploadPalmVeinPage = state.uploadPalmVeinPage + 1;
|
state.uploadPalmVeinPage = state.uploadPalmVeinPage + 1;
|
||||||
|
|
||||||
@ -276,7 +298,7 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
updataLockPalmVeinList(token, state.uploadPalmVeinPage);
|
updataLockPalmVeinList(token, state.uploadPalmVeinPage);
|
||||||
}else{
|
} else {
|
||||||
// // 当数据不是10的时候解析数据上传
|
// // 当数据不是10的时候解析数据上传
|
||||||
// if(state.uploadPalmVeinDataList.isEmpty){
|
// if(state.uploadPalmVeinDataList.isEmpty){
|
||||||
// // 不需要上传 如果是空的直接上传下一个
|
// // 不需要上传 如果是空的直接上传下一个
|
||||||
@ -284,12 +306,15 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
// }else{
|
// }else{
|
||||||
// // 如果不是空的解析数据上传
|
// // 如果不是空的解析数据上传
|
||||||
state.indexCount.value = state.indexCount.value + 1;
|
state.indexCount.value = state.indexCount.value + 1;
|
||||||
_lockDataUpload(uploadType:2, recordType:6, records:state.uploadPalmVeinDataList);
|
_lockDataUpload(
|
||||||
|
uploadType: 2,
|
||||||
|
recordType: 6,
|
||||||
|
records: state.uploadPalmVeinDataList);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
final List<int> token = reply.data.sublist(3, 7);
|
final List<int> token = reply.data.sublist(3, 7);
|
||||||
final List<String> saveStrList = changeIntListToStringList(token);
|
final List<String> saveStrList = changeIntListToStringList(token);
|
||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
@ -308,14 +333,15 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
// 上传数据获取锁遥控列表解析
|
// 上传数据获取锁遥控列表解析
|
||||||
Future<void> _replyUpdataLockRemoteControlListReply(Reply reply) async {
|
Future<void> _replyUpdataLockRemoteControlListReply(Reply reply) async {
|
||||||
final int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
switch(status){
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
|
|
||||||
final int dataLength = reply.data[8];
|
final int dataLength = reply.data[8];
|
||||||
state.uploadRemoteControlDataList.addAll(reply.data.sublist(9, reply.data.length));
|
state.uploadRemoteControlDataList
|
||||||
if(dataLength == 10){
|
.addAll(reply.data.sublist(9, reply.data.length));
|
||||||
|
if (dataLength == 10) {
|
||||||
// 当数据是10的时候继续请求
|
// 当数据是10的时候继续请求
|
||||||
state.uploadRemoteControlPage = state.uploadRemoteControlPage + 1;
|
state.uploadRemoteControlPage = state.uploadRemoteControlPage + 1;
|
||||||
|
|
||||||
@ -323,7 +349,7 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
updataLockRemoteControlList(token, state.uploadRemoteControlPage);
|
updataLockRemoteControlList(token, state.uploadRemoteControlPage);
|
||||||
}else{
|
} else {
|
||||||
// // 当数据不是10的时候解析数据上传
|
// // 当数据不是10的时候解析数据上传
|
||||||
// if(state.uploadPalmVeinDataList.isEmpty){
|
// if(state.uploadPalmVeinDataList.isEmpty){
|
||||||
// // 不需要上传 如果是空的直接上传下一个
|
// // 不需要上传 如果是空的直接上传下一个
|
||||||
@ -331,12 +357,15 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
// }else{
|
// }else{
|
||||||
// // 如果不是空的解析数据上传
|
// // 如果不是空的解析数据上传
|
||||||
state.indexCount.value = state.indexCount.value + 1;
|
state.indexCount.value = state.indexCount.value + 1;
|
||||||
_lockDataUpload(uploadType:2, recordType:7, records:state.uploadRemoteControlDataList);
|
_lockDataUpload(
|
||||||
|
uploadType: 2,
|
||||||
|
recordType: 7,
|
||||||
|
records: state.uploadRemoteControlDataList);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
final List<int> token = reply.data.sublist(3, 7);
|
final List<int> token = reply.data.sublist(3, 7);
|
||||||
final List<String> saveStrList = changeIntListToStringList(token);
|
final List<String> saveStrList = changeIntListToStringList(token);
|
||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
@ -355,17 +384,19 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
// 上传数据获取锁设置解析
|
// 上传数据获取锁设置解析
|
||||||
Future<void> _replyUpdataLockSetReply(Reply reply) async {
|
Future<void> _replyUpdataLockSetReply(Reply reply) async {
|
||||||
final int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
switch(status){
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
state.indexCount.value = state.indexCount.value + 1;
|
state.indexCount.value = state.indexCount.value + 1;
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
|
|
||||||
state.uploadLockSetDataList.addAll(reply.data.sublist(7, reply.data.length));
|
state.uploadLockSetDataList
|
||||||
_lockDataUpload(uploadType:1, recordType:0, records:state.uploadLockSetDataList);
|
.addAll(reply.data.sublist(7, reply.data.length));
|
||||||
|
_lockDataUpload(
|
||||||
|
uploadType: 1, recordType: 0, records: state.uploadLockSetDataList);
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
final List<int> token = reply.data.sublist(3, 7);
|
final List<int> token = reply.data.sublist(3, 7);
|
||||||
final List<String> saveStrList = changeIntListToStringList(token);
|
final List<String> saveStrList = changeIntListToStringList(token);
|
||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
@ -383,18 +414,19 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// 上传数据获取锁密码列表
|
// 上传数据获取锁密码列表
|
||||||
Future<void> getUpdataLockPasswordList() async {
|
Future<void> getUpdataLockPasswordList() async {
|
||||||
if(state.sureBtnState.value == 1){
|
if (state.sureBtnState.value == 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.sureBtnState.value = 1;
|
state.sureBtnState.value = 1;
|
||||||
|
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: (){
|
showBlueConnetctToastTimer(action: () {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
AppLog.log('上传密码列表获取超时 关闭加载菊花');
|
AppLog.log('上传密码列表获取超时 关闭加载菊花');
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected) {
|
if (connectionState == BluetoothConnectionState.connected) {
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
@ -405,7 +437,7 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -414,7 +446,8 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// 公共的获取密码列表
|
// 公共的获取密码列表
|
||||||
Future<void> updataLockPasswordList(List<int> token, int page) async {
|
Future<void> updataLockPasswordList(List<int> token, int page) async {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
@ -428,19 +461,19 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
token: token,
|
token: token,
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
signKey: signKeyDataList,
|
signKey: signKeyDataList,
|
||||||
privateKey: getPrivateKeyList
|
privateKey: getPrivateKeyList);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传数据获取锁Card列表
|
// 上传数据获取锁Card列表
|
||||||
Future<void> getUpdataLockCardList() async {
|
Future<void> getUpdataLockCardList() async {
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: (){
|
showBlueConnetctToastTimer(action: () {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected) {
|
if (connectionState == BluetoothConnectionState.connected) {
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
@ -451,7 +484,7 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -460,7 +493,8 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// 公共的获取Card列表
|
// 公共的获取Card列表
|
||||||
Future<void> updataLockCardList(List<int> token, int page) async {
|
Future<void> updataLockCardList(List<int> token, int page) async {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
@ -474,19 +508,19 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
token: token,
|
token: token,
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
signKey: signKeyDataList,
|
signKey: signKeyDataList,
|
||||||
privateKey: getPrivateKeyList
|
privateKey: getPrivateKeyList);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传数据获取锁指纹列表
|
// 上传数据获取锁指纹列表
|
||||||
Future<void> getUpdataLockFingerprintList() async {
|
Future<void> getUpdataLockFingerprintList() async {
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: (){
|
showBlueConnetctToastTimer(action: () {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected) {
|
if (connectionState == BluetoothConnectionState.connected) {
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
@ -497,7 +531,7 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -506,7 +540,8 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// 公共的获取指纹列表
|
// 公共的获取指纹列表
|
||||||
Future<void> updataLockFingerprintList(List<int> token, int page) async {
|
Future<void> updataLockFingerprintList(List<int> token, int page) async {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
@ -520,19 +555,19 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
token: token,
|
token: token,
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
signKey: signKeyDataList,
|
signKey: signKeyDataList,
|
||||||
privateKey: getPrivateKeyList
|
privateKey: getPrivateKeyList);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传数据获取锁人脸列表
|
// 上传数据获取锁人脸列表
|
||||||
Future<void> getUpdataLockFaceList() async {
|
Future<void> getUpdataLockFaceList() async {
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: (){
|
showBlueConnetctToastTimer(action: () {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected) {
|
if (connectionState == BluetoothConnectionState.connected) {
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
@ -543,7 +578,7 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -552,7 +587,8 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// 公共的获取人脸列表
|
// 公共的获取人脸列表
|
||||||
Future<void> updataLockFaceList(List<int> token, int page) async {
|
Future<void> updataLockFaceList(List<int> token, int page) async {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
@ -566,20 +602,19 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
token: token,
|
token: token,
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
signKey: signKeyDataList,
|
signKey: signKeyDataList,
|
||||||
privateKey: getPrivateKeyList
|
privateKey: getPrivateKeyList);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 上传数据获取锁掌静脉列表
|
// 上传数据获取锁掌静脉列表
|
||||||
Future<void> getUpdataLockPalmVeinList() async {
|
Future<void> getUpdataLockPalmVeinList() async {
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: (){
|
showBlueConnetctToastTimer(action: () {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected) {
|
if (connectionState == BluetoothConnectionState.connected) {
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
@ -590,7 +625,7 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -599,7 +634,8 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// 公共的获取掌静脉列表
|
// 公共的获取掌静脉列表
|
||||||
Future<void> updataLockPalmVeinList(List<int> token, int page) async {
|
Future<void> updataLockPalmVeinList(List<int> token, int page) async {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
@ -613,30 +649,31 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
token: token,
|
token: token,
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
signKey: signKeyDataList,
|
signKey: signKeyDataList,
|
||||||
privateKey: getPrivateKeyList
|
privateKey: getPrivateKeyList);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传数据获取锁遥控列表
|
// 上传数据获取锁遥控列表
|
||||||
Future<void> getUpdataLockRemoteControlList() async {
|
Future<void> getUpdataLockRemoteControlList() async {
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: (){
|
showBlueConnetctToastTimer(action: () {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected) {
|
if (connectionState == BluetoothConnectionState.connected) {
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
updataLockRemoteControlList(getTokenList, state.uploadRemoteControlPage);
|
updataLockRemoteControlList(
|
||||||
|
getTokenList, state.uploadRemoteControlPage);
|
||||||
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -645,7 +682,8 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// 公共的获取遥控列表
|
// 公共的获取遥控列表
|
||||||
Future<void> updataLockRemoteControlList(List<int> token, int page) async {
|
Future<void> updataLockRemoteControlList(List<int> token, int page) async {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
@ -659,19 +697,19 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
token: token,
|
token: token,
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
signKey: signKeyDataList,
|
signKey: signKeyDataList,
|
||||||
privateKey: getPrivateKeyList
|
privateKey: getPrivateKeyList);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传数据获取设置
|
// 上传数据获取设置
|
||||||
Future<void> getUpdataLockSet() async {
|
Future<void> getUpdataLockSet() async {
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: (){
|
showBlueConnetctToastTimer(action: () {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected) {
|
if (connectionState == BluetoothConnectionState.connected) {
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
@ -682,7 +720,7 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -691,7 +729,8 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// 公共的上传锁设置
|
// 公共的上传锁设置
|
||||||
Future<void> updataLockSet(List<int> token) async {
|
Future<void> updataLockSet(List<int> token) async {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
@ -703,32 +742,29 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
token: token,
|
token: token,
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
signKey: signKeyDataList,
|
signKey: signKeyDataList,
|
||||||
privateKey: getPrivateKeyList
|
privateKey: getPrivateKeyList);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 锁数据上传服务器
|
// 锁数据上传服务器
|
||||||
Future<void> _lockDataUpload({
|
Future<void> _lockDataUpload(
|
||||||
required int uploadType,
|
{required int uploadType,
|
||||||
required int recordType,
|
required int recordType,
|
||||||
required List records
|
required List records}) async {
|
||||||
}) async{
|
|
||||||
final LoginEntity entity = await ApiRepository.to.lockDataUpload(
|
final LoginEntity entity = await ApiRepository.to.lockDataUpload(
|
||||||
lockId: CommonDataManage().currentKeyInfo.lockId!,
|
lockId: CommonDataManage().currentKeyInfo.lockId!,
|
||||||
uploadType:uploadType,
|
uploadType: uploadType,
|
||||||
recordType: recordType,
|
recordType: recordType,
|
||||||
records:records,
|
records: records,
|
||||||
isUnShowLoading: false
|
isUnShowLoading: false);
|
||||||
);
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if (uploadType == 1) {
|
||||||
if(uploadType == 1){
|
|
||||||
// 1设置
|
// 1设置
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
showToast('上传成功'.tr);
|
showToast('上传成功'.tr);
|
||||||
}else{
|
} else {
|
||||||
// 2开门方式
|
// 2开门方式
|
||||||
switch(recordType){
|
switch (recordType) {
|
||||||
// case 1:
|
// case 1:
|
||||||
// // 电子钥匙
|
// // 电子钥匙
|
||||||
//
|
//
|
||||||
@ -761,13 +797,38 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
state.indexCount.value = 0;
|
state.indexCount.value = 0;
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 上传数据成功后的回调
|
||||||
|
void onUploadSuccess() {
|
||||||
|
// 发送事件通知指纹列表刷新
|
||||||
|
eventBus.fire(OtherTypeRefreshListEvent());
|
||||||
|
// 返回上一页
|
||||||
|
Get.back();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 在上传数据成功的地方调用
|
||||||
|
Future<void> uploadData() async {
|
||||||
|
try {
|
||||||
|
// ... existing upload code ...
|
||||||
|
|
||||||
|
// 假设这是上传成功的标志
|
||||||
|
bool uploadSuccess = true; // 这里需要根据实际的上传结果来设置
|
||||||
|
|
||||||
|
if (uploadSuccess) {
|
||||||
|
onUploadSuccess();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// 处理错误
|
||||||
|
print('Upload failed: $e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
@ -783,5 +844,4 @@ class UploadDataLogic extends BaseGetXController{
|
|||||||
|
|
||||||
_replySubscription.cancel();
|
_replySubscription.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user