fix: 合并bugly分支到当前分支
This commit is contained in:
parent
202c97e0d3
commit
debb1bfd40
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import '../../../tools/storage.dart';
|
|||||||
import '../lockOperatingRecord/keyOperationRecord_entity.dart';
|
import '../lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
class DoorLockLogLogic extends BaseGetXController {
|
class DoorLockLogLogic extends BaseGetXController {
|
||||||
DoorLockLogState state = DoorLockLogState();
|
final DoorLockLogState state = DoorLockLogState();
|
||||||
|
|
||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
@ -47,8 +47,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
message: '查询锁记录结果,解析数据',
|
message: '查询锁记录结果,解析数据',
|
||||||
detail: '查询锁记录结果,解析数据:${reply.data}',
|
detail: '查询锁记录结果,解析数据:${reply.data}',
|
||||||
eventStr: '查询锁记录事件结果',
|
eventStr: '查询锁记录事件结果',
|
||||||
upload: true
|
upload: true);
|
||||||
);
|
|
||||||
|
|
||||||
state.isLockReceiveResponse = true;
|
state.isLockReceiveResponse = true;
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
@ -121,13 +120,15 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 查询事件记录(时间查询)
|
// 查询事件记录(时间查询)
|
||||||
Future<void> senderReferEventRecordTime() async {
|
Future<void> senderReferEventRecordTime() 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>? 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!);
|
||||||
|
|
||||||
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey =
|
||||||
|
await Storage.getStringList(saveBluePublicKey);
|
||||||
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
final String command = SenderReferEventRecordTimeCommand(
|
final String command = SenderReferEventRecordTimeCommand(
|
||||||
@ -144,37 +145,45 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
).toString();
|
).toString();
|
||||||
|
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(isShowBlueConnetctToast:true, action: () async {
|
showBlueConnetctToastTimer(
|
||||||
|
isShowBlueConnetctToast: true,
|
||||||
|
action: () async {
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
|
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||||
'lockName': state.keyInfos.value.lockName!,
|
'lockName': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'open_lock_result': '超时',
|
'open_lock_result': '超时',
|
||||||
});
|
});
|
||||||
|
|
||||||
BuglyTool.uploadException(
|
BuglyTool.uploadException(
|
||||||
message: '查询锁记录超时-查询锁记录失败',
|
message: '查询锁记录超时-查询锁记录失败',
|
||||||
detail: '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
|
detail:
|
||||||
|
'添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
|
||||||
eventStr: '查询锁记录事件超时',
|
eventStr: '查询锁记录事件超时',
|
||||||
upload: true
|
upload: true);
|
||||||
);
|
|
||||||
if (state.isLockReceiveResponse == false) {
|
if (state.isLockReceiveResponse == false) {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionStateState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState connectionStateState) async {
|
||||||
if (connectionStateState == BluetoothConnectionState.connected) {
|
if (connectionStateState == BluetoothConnectionState.connected) {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
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!);
|
||||||
|
|
||||||
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey =
|
||||||
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
await Storage.getStringList(saveBluePublicKey);
|
||||||
|
final List<int> getPublicKeyList =
|
||||||
|
changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
IoSenderManage.senderReferEventRecordTimeCommand(
|
IoSenderManage.senderReferEventRecordTimeCommand(
|
||||||
keyID: BlueManage().connectDeviceName,
|
keyID: BlueManage().connectDeviceName,
|
||||||
@ -188,7 +197,8 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
publicKey: getPublicKeyList,
|
publicKey: getPublicKeyList,
|
||||||
privateKey: getPrivateKeyList,
|
privateKey: getPrivateKeyList,
|
||||||
);
|
);
|
||||||
} else if (connectionStateState == BluetoothConnectionState.disconnected) {
|
} else if (connectionStateState ==
|
||||||
|
BluetoothConnectionState.disconnected) {
|
||||||
if (state.ifCurrentScreen.value == true) {
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
@ -197,17 +207,18 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||||
'lockName': state.keyInfos.value.lockName!,
|
'lockName': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'open_lock_result': '断开连接',
|
'open_lock_result': '断开连接',
|
||||||
});
|
});
|
||||||
|
|
||||||
BuglyTool.uploadException(
|
BuglyTool.uploadException(
|
||||||
message: '查询锁记录超时-查询锁记录失败',
|
message: '查询锁记录超时-查询锁记录失败',
|
||||||
detail: '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
|
detail:
|
||||||
|
'添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
|
||||||
eventStr: '查询锁记录事件断开连接',
|
eventStr: '查询锁记录事件断开连接',
|
||||||
upload: true
|
upload: true);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -238,7 +249,9 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
/// 刷新门锁日志列表
|
/// 刷新门锁日志列表
|
||||||
StreamSubscription? _getDoorLockLogListRefreshUIEvent;
|
StreamSubscription? _getDoorLockLogListRefreshUIEvent;
|
||||||
void _getDoorLockLogListRefreshUIAction() {
|
void _getDoorLockLogListRefreshUIAction() {
|
||||||
_getDoorLockLogListRefreshUIEvent = eventBus.on<DoorLockLogListRefreshUI>().listen((DoorLockLogListRefreshUI event) {
|
_getDoorLockLogListRefreshUIEvent = eventBus
|
||||||
|
.on<DoorLockLogListRefreshUI>()
|
||||||
|
.listen((DoorLockLogListRefreshUI event) {
|
||||||
state.currentSelectDate.value = event.getDoorLockLogTime;
|
state.currentSelectDate.value = event.getDoorLockLogTime;
|
||||||
|
|
||||||
// 设置startDate为当天的0点
|
// 设置startDate为当天的0点
|
||||||
@ -281,7 +294,9 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
if (list.isEmpty) {
|
if (list.isEmpty) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordUploadData(lockId: state.keyInfos.value.lockId.toString(), records: list);
|
final KeyOperationRecordEntity entity = await ApiRepository.to
|
||||||
|
.lockRecordUploadData(
|
||||||
|
lockId: state.keyInfos.value.lockId.toString(), records: list);
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
if (state.ifHaveNext == true) {
|
if (state.ifHaveNext == true) {
|
||||||
@ -290,7 +305,8 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||||
'lockName': state.keyInfos.value.lockName!,
|
'lockName': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'open_lock_result': '成功',
|
'open_lock_result': '成功',
|
||||||
});
|
});
|
||||||
@ -300,7 +316,8 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||||
'lockName': state.keyInfos.value.lockName!,
|
'lockName': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'open_lock_result': '上传数据接口失败',
|
'open_lock_result': '上传数据接口失败',
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -53,7 +52,9 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
|||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
ShowTipView().showSureAlertDialog(
|
ShowTipView().showSureAlertDialog(
|
||||||
'1.锁没有联网,密码、IC卡、指纹等开门记录无法实时上传,可以点击右上角按钮,然后读取记录。'.tr +'\n' + '2.如果您需要保留历史记录,可以点击右上角按钮,然后导出记录'.tr,
|
'1.锁没有联网,密码、IC卡、指纹等开门记录无法实时上传,可以点击右上角按钮,然后读取记录。'.tr +
|
||||||
|
'\n' +
|
||||||
|
'2.如果您需要保留历史记录,可以点击右上角按钮,然后导出记录'.tr,
|
||||||
tipTitle: '看不到操作记录,可能原因有'.tr,
|
tipTitle: '看不到操作记录,可能原因有'.tr,
|
||||||
sureStr: '我知道了'.tr);
|
sureStr: '我知道了'.tr);
|
||||||
},
|
},
|
||||||
@ -124,19 +125,7 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
|||||||
if (value == '读取记录'.tr) {
|
if (value == '读取记录'.tr) {
|
||||||
logic.mockNetworkDataRequest(isRefresh: true);
|
logic.mockNetworkDataRequest(isRefresh: true);
|
||||||
} else if (value == '清空记录'.tr) {
|
} else if (value == '清空记录'.tr) {
|
||||||
ShowCupertinoAlertView().showClearOperationRecordAlert(
|
ShowCupertinoAlertView().showClearOperationRecordAlert(clearClick: () {
|
||||||
clearClick: () {
|
|
||||||
switch (value) {
|
|
||||||
case '读取记录':
|
|
||||||
{
|
|
||||||
state.isLockReceiveResponse = false;
|
|
||||||
logic.getLockRecordLastUploadDataTime();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case '清空记录':
|
|
||||||
{
|
|
||||||
ShowCupertinoAlertView().showClearOperationRecordAlert(
|
|
||||||
clearClick: () {
|
|
||||||
logic.clearOperationRecordRequest();
|
logic.clearOperationRecordRequest();
|
||||||
});
|
});
|
||||||
} else if (value == '导出记录'.tr) {
|
} else if (value == '导出记录'.tr) {
|
||||||
@ -152,7 +141,7 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// switch (value) {
|
// switch (value) {
|
||||||
// case "读取记录".tr:
|
// case "读取记录".tr:
|
||||||
// {
|
// {
|
||||||
@ -183,7 +172,7 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
|||||||
// }
|
// }
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
//顶部日历小部件
|
//顶部日历小部件
|
||||||
Widget topAdvancedCalendarWidget() {
|
Widget topAdvancedCalendarWidget() {
|
||||||
|
|||||||
@ -73,7 +73,8 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('open_lock', {
|
UmengCommonSdk.onEvent('open_lock', {
|
||||||
'lock_name': state.keyInfos.value.lockName!,
|
'lock_name': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'open_lock_result': '${reply.data}',
|
'open_lock_result': '${reply.data}',
|
||||||
});
|
});
|
||||||
@ -379,7 +380,8 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('open_lock', {
|
UmengCommonSdk.onEvent('open_lock', {
|
||||||
'lock_name': state.keyInfos.value.lockName!,
|
'lock_name': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'open_lock_result': '超时',
|
'open_lock_result': '超时',
|
||||||
});
|
});
|
||||||
@ -419,12 +421,11 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
message: '蓝牙连接失败-开锁失败',
|
message: '蓝牙连接失败-开锁失败',
|
||||||
detail: '蓝牙连接失败,断开连接, 开锁失败--OpenLockCommand:$command',
|
detail: '蓝牙连接失败,断开连接, 开锁失败--OpenLockCommand:$command',
|
||||||
upload: true);
|
upload: true);
|
||||||
upload: true
|
|
||||||
);
|
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('open_lock', {
|
UmengCommonSdk.onEvent('open_lock', {
|
||||||
'lock_name': state.keyInfos.value.lockName!,
|
'lock_name': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'open_lock_result': '断开连接',
|
'open_lock_result': '断开连接',
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -19,12 +18,15 @@ class LockOperatingRecordPage extends StatefulWidget {
|
|||||||
const LockOperatingRecordPage({Key? key}) : super(key: key);
|
const LockOperatingRecordPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<LockOperatingRecordPage> createState() => _LockOperatingRecordPageState();
|
State<LockOperatingRecordPage> createState() =>
|
||||||
|
_LockOperatingRecordPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with RouteAware{
|
class _LockOperatingRecordPageState extends State<LockOperatingRecordPage>
|
||||||
|
with RouteAware {
|
||||||
final LockOperatingRecordLogic logic = Get.put(LockOperatingRecordLogic());
|
final LockOperatingRecordLogic logic = Get.put(LockOperatingRecordLogic());
|
||||||
final LockOperatingRecordState state = Get.find<LockOperatingRecordLogic>().state;
|
final LockOperatingRecordState state =
|
||||||
|
Get.find<LockOperatingRecordLogic>().state;
|
||||||
|
|
||||||
Future<void> getHttpData() async {
|
Future<void> getHttpData() async {
|
||||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
@ -49,7 +51,9 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: state.recordName.value.isNotEmpty? state.recordName.value : '操作记录'.tr,
|
barTitle: state.recordName.value.isNotEmpty
|
||||||
|
? state.recordName.value
|
||||||
|
: '操作记录'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
// actionsList: [
|
// actionsList: [
|
||||||
@ -138,7 +142,10 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
: NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight));
|
: NoData(
|
||||||
|
noDataHeight: 1.sh -
|
||||||
|
ScreenUtil().statusBarHeight -
|
||||||
|
ScreenUtil().bottomBarHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
String getTypeIcon(int type) {
|
String getTypeIcon(int type) {
|
||||||
@ -166,7 +173,8 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _operatingOneRecordItem(String userAvatarStr, String userNameStr, String unlockDescStr, Function() action) {
|
Widget _operatingOneRecordItem(String userAvatarStr, String userNameStr,
|
||||||
|
String unlockDescStr, Function() action) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: action,
|
onTap: action,
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -181,13 +189,14 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(Icons.access_time, size: 35.w),
|
Icon(Icons.access_time, size: 35.w),
|
||||||
SizedBox(width: 10.w,),
|
SizedBox(
|
||||||
|
width: 10.w,
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
unlockDescStr,
|
unlockDescStr,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.sp,
|
fontSize: 24.sp, color: AppColors.darkGrayTextColor),
|
||||||
color: AppColors.darkGrayTextColor),
|
|
||||||
),
|
),
|
||||||
SizedBox(width: 10.h),
|
SizedBox(width: 10.h),
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -196,8 +205,7 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(userNameStr,
|
||||||
userNameStr,
|
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@ -298,6 +306,7 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
@override
|
@override
|
||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
|
|
||||||
/// 路由订阅
|
/// 路由订阅
|
||||||
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
||||||
}
|
}
|
||||||
@ -344,5 +353,4 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
}
|
}
|
||||||
state.ifCurrentScreen.value = false;
|
state.ifCurrentScreen.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
@ -126,11 +125,15 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey =
|
||||||
final List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
await Storage.getStringList(saveBluePublicKey);
|
||||||
|
final List<int> publicKeyDataList =
|
||||||
|
changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
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!);
|
||||||
@ -293,7 +296,8 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
UmengCommonSdk.onEvent('delet_lock', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'delet_type': 'lock',
|
'delet_type': 'lock',
|
||||||
'delet_lock_result': '删除锁超时',
|
'delet_lock_result': '删除锁超时',
|
||||||
@ -330,7 +334,8 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
UmengCommonSdk.onEvent('delet_lock', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'delet_type': 'lock',
|
'delet_type': 'lock',
|
||||||
'delet_lock_result': '删除锁断开',
|
'delet_lock_result': '删除锁断开',
|
||||||
@ -553,10 +558,12 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
void deleyLockLogicOfRoles() {
|
void deleyLockLogicOfRoles() {
|
||||||
if (state.lockBasicInfo.value.isLockOwner == 1) {
|
if (state.lockBasicInfo.value.isLockOwner == 1) {
|
||||||
// 超级管理员必须通过连接蓝牙删除q
|
// 超级管理员必须通过连接蓝牙删除q
|
||||||
state.showTipView.showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () {
|
state.showTipView
|
||||||
|
.showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () {
|
||||||
// 删除锁
|
// 删除锁
|
||||||
state.showTipView.resetGetController();
|
state.showTipView.resetGetController();
|
||||||
state.showTipView.showTFViewAlertDialog(state.passwordTF, '请输入登录密码'.tr, '请输入登录密码'.tr, checkLoginPassword);
|
state.showTipView.showTFViewAlertDialog(
|
||||||
|
state.passwordTF, '请输入登录密码'.tr, '请输入登录密码'.tr, checkLoginPassword);
|
||||||
});
|
});
|
||||||
} else if (state.lockBasicInfo.value.keyRight == 1) {
|
} else if (state.lockBasicInfo.value.keyRight == 1) {
|
||||||
// 授权管理员弹框提示
|
// 授权管理员弹框提示
|
||||||
@ -592,7 +599,8 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
UmengCommonSdk.onEvent('delet_lock', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'delet_type': 'lock',
|
'delet_type': 'lock',
|
||||||
'delet_lock_result': '成功',
|
'delet_lock_result': '成功',
|
||||||
@ -610,7 +618,8 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
UmengCommonSdk.onEvent('delet_lock', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'delet_type': 'lock',
|
'delet_type': 'lock',
|
||||||
'delet_lock_result': '${entity.errorCode}--${entity.errorMsg}',
|
'delet_lock_result': '${entity.errorCode}--${entity.errorMsg}',
|
||||||
@ -629,7 +638,8 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
UmengCommonSdk.onEvent('delet_lock', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'delet_type': 'key',
|
'delet_type': 'key',
|
||||||
'delet_lock_result': '成功',
|
'delet_lock_result': '成功',
|
||||||
@ -647,7 +657,8 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
UmengCommonSdk.onEvent('delet_lock', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'delet_type': 'key',
|
'delet_type': 'key',
|
||||||
'delet_lock_result': '${entity.errorCode}--${entity.errorMsg}',
|
'delet_lock_result': '${entity.errorCode}--${entity.errorMsg}',
|
||||||
|
|||||||
@ -136,7 +136,8 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('logout', {
|
UmengCommonSdk.onEvent('logout', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'logout_result': '成功',
|
'logout_result': '成功',
|
||||||
});
|
});
|
||||||
@ -153,7 +154,8 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('logout', {
|
UmengCommonSdk.onEvent('logout', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'logout_result': '${entity.errorCode}--${entity.errorMsg}',
|
'logout_result': '${entity.errorCode}--${entity.errorMsg}',
|
||||||
});
|
});
|
||||||
|
|||||||
@ -218,7 +218,15 @@ class _AdvancedCalendarState extends State<AdvancedCalendar>
|
|||||||
keepLineSize: widget.keepLineSize,
|
keepLineSize: widget.keepLineSize,
|
||||||
weekNames: _weekNames != null
|
weekNames: _weekNames != null
|
||||||
? _weekNames!
|
? _weekNames!
|
||||||
: <String>['简写周日'.tr, '简写周一'.tr, '简写周二'.tr, '简写周三'.tr, '简写周四'.tr, '简写周五'.tr, '简写周六'.tr],
|
: <String>[
|
||||||
|
'简写周日'.tr,
|
||||||
|
'简写周一'.tr,
|
||||||
|
'简写周二'.tr,
|
||||||
|
'简写周三'.tr,
|
||||||
|
'简写周四'.tr,
|
||||||
|
'简写周五'.tr,
|
||||||
|
'简写周六'.tr
|
||||||
|
],
|
||||||
),
|
),
|
||||||
AnimatedBuilder(
|
AnimatedBuilder(
|
||||||
animation: _animationController,
|
animation: _animationController,
|
||||||
@ -324,7 +332,8 @@ class _AdvancedCalendarState extends State<AdvancedCalendar>
|
|||||||
controller: _weekPageController,
|
controller: _weekPageController,
|
||||||
itemCount: _weekRangeList.length,
|
itemCount: _weekRangeList.length,
|
||||||
physics: _closeMonthScroll(),
|
physics: _closeMonthScroll(),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context,
|
||||||
|
int index) {
|
||||||
return WeekView(
|
return WeekView(
|
||||||
innerDot: widget.innerDot,
|
innerDot: widget.innerDot,
|
||||||
dates: _weekRangeList[index],
|
dates: _weekRangeList[index],
|
||||||
@ -384,8 +393,8 @@ class _AdvancedCalendarState extends State<AdvancedCalendar>
|
|||||||
void _handleWeekDateChanged(DateTime date) {
|
void _handleWeekDateChanged(DateTime date) {
|
||||||
_handleDateChanged(date);
|
_handleDateChanged(date);
|
||||||
|
|
||||||
_monthViewCurrentPage.value = _monthRangeList
|
_monthViewCurrentPage.value = _monthRangeList.lastIndexWhere(
|
||||||
.lastIndexWhere((ViewRange monthRange) => monthRange.dates.contains(date));
|
(ViewRange monthRange) => monthRange.dates.contains(date));
|
||||||
}
|
}
|
||||||
|
|
||||||
void _handleDateChanged(DateTime date) {
|
void _handleDateChanged(DateTime date) {
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@ -13,7 +12,6 @@ import 'package:star_lock/tools/storage.dart';
|
|||||||
///
|
///
|
||||||
///
|
///
|
||||||
class BuglyTool {
|
class BuglyTool {
|
||||||
|
|
||||||
static int time = 0;
|
static int time = 0;
|
||||||
|
|
||||||
static Future<void> init() async {
|
static Future<void> init() async {
|
||||||
@ -69,7 +67,8 @@ class BuglyTool {
|
|||||||
bool begin = false,
|
bool begin = false,
|
||||||
Map? data,
|
Map? data,
|
||||||
}) async {
|
}) async {
|
||||||
String getMessage = '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- message:$message detail:$detail';
|
String getMessage =
|
||||||
|
'${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- message:$message detail:$detail';
|
||||||
if (begin == true) {
|
if (begin == true) {
|
||||||
// 开始
|
// 开始
|
||||||
uploadStr = '';
|
uploadStr = '';
|
||||||
@ -85,11 +84,10 @@ class BuglyTool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Future<void> uploadExceptionWithEvent({
|
static Future<void> uploadExceptionWithEvent({
|
||||||
required String eventStr,
|
required String eventStr,
|
||||||
required String detail,
|
required String detail,
|
||||||
}) async {
|
}) async {
|
||||||
FlutterBugly.uploadException(message: '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+${time == 0 ? DateTime.now().millisecondsSinceEpoch : 0}--- $eventStr', detail: detail);
|
// FlutterBugly.uploadException(message: '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+${time == 0 ? DateTime.now().millisecondsSinceEpoch : 0}--- $eventStr', detail: detail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user