fix:修复测试俄语出现的部分国际化bug

This commit is contained in:
liyi 2025-03-24 14:14:12 +08:00
parent af9a4b9ea1
commit ff8bfa8fd0
11 changed files with 235 additions and 210 deletions

View File

@ -1150,5 +1150,6 @@
"暂无最新记录": "There are currently no latest records available",
"请将手机切换至2.4G WiFi进行手动连接": "Please switch your phone to 2.4G WiFi for manual connection",
"请确保网络是2.4GHz Wi-Fi": "Please ensure that the network is 2.4GHz Wi Fi",
"是否要远程开锁": "Do you want to unlock remotely",
"网关添加成功": "Gateway added successfully"
}

View File

@ -1155,5 +1155,6 @@
"请扫描可视门铃码二维码": "请扫描可视门铃码二维码",
"请确保网络是2.4GHz Wi-Fi": "请确保网络是2.4GHz Wi-Fi",
"已选": "已选",
"是否要远程开锁": "是否要远程开锁",
"网关添加成功": "网关添加成功"
}

View File

@ -1152,5 +1152,6 @@
"请扫描可视门铃码二维码": "Сканируйте код вызова",
"请确保网络是2.4GHz Wi-Fi": "Убедитесь, что сеть имеет 2,4 ГГц Wi - Fi",
"已选": "Выбранные",
"是否要远程开锁": "Нужно ли удалённо открывать замок",
"请将手机切换至2.4G WiFi进行手动连接": "Пожалуйста, переключите телефон на 2.4G WiFi для ручного подключения"
}

View File

@ -1155,5 +1155,6 @@
"请扫描可视门铃码二维码": "请扫描可视门铃码二维码",
"请确保网络是2.4GHz Wi-Fi": "请确保网络是2.4GHz Wi-Fi",
"已选": "已选",
"是否要远程开锁": "是否要远程开锁",
"网关添加成功": "网关添加成功"
}

View File

@ -1,4 +1,3 @@
import 'dart:async';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
@ -26,10 +25,13 @@ class AddFingerprintLogic extends BaseGetXController {
//
late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() {
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
_replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
//
if((reply is SenderAddFingerprintWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
if ((reply is SenderAddFingerprintWithTimeCycleCoercionReply) &&
(state.ifCurrentScreen.value == true)) {
_replyAddFingerprintBegin(reply);
}
@ -49,8 +51,7 @@ class AddFingerprintLogic extends BaseGetXController {
BuglyTool.uploadException(
message: '添加指纹开始,解析数据',
detail: '添加指纹开始,解析数据 _replyAddFingerprintBegin:${reply.data}',
upload: false
);
upload: false);
final int status = reply.data[2];
switch (status) {
@ -67,10 +68,13 @@ class AddFingerprintLogic extends BaseGetXController {
break;
case 0x06:
//
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
final List<String>? privateKey =
await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList =
changeStringListToIntList(privateKey!);
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
final List<String>? signKey =
await Storage.getStringList(saveBlueSignKey);
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
final List<int> token = reply.data.sublist(5, 9);
@ -82,11 +86,15 @@ class AddFingerprintLogic extends BaseGetXController {
userID: await Storage.getUid(),
fingerNo: 0,
useCountLimit: 0xffff,
isForce:state.isCoerced.value == '1' ? 1 : 0, //
isForce: state.isCoerced.value == '1' ? 1 : 0,
//
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
operate: 0,
isRound:state.selectType.value == '2' ? 1: 0, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), //
isRound: state.selectType.value == '2' ? 1 : 0,
//
weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
state.weekDay.value),
//
startDate: int.parse(state.startDate.value) ~/ 1000,
endDate: int.parse(state.endDate.value) ~/ 1000,
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
@ -95,8 +103,7 @@ class AddFingerprintLogic extends BaseGetXController {
signKey: signKeyDataList,
privateKey: getPrivateKeyList,
token: token,
isBeforeAddUser: false
);
isBeforeAddUser: false);
break;
default:
//
@ -112,8 +119,7 @@ class AddFingerprintLogic extends BaseGetXController {
BuglyTool.uploadException(
message: '添加指纹过程,解析数据',
detail: '添加指纹过程,解析数据 _replyAddFingerprintProcess:${reply.data}',
upload: false
);
upload: false);
final int status = reply.data[2];
switch (status) {
case 0x00:
@ -172,18 +178,20 @@ class AddFingerprintLogic extends BaseGetXController {
// var fingerprintNum = listChangInt(reply.data.sublist(9, 11)).toString();
ApmHelper.instance.trackEvent('add_fingerprint', {
'lock_name': BlueManage().connectDeviceName,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'add_fingerprint_result': '成功',
});
BuglyTool.uploadException(
message: '添加指纹确认结果,解析数据',
detail: '添加指纹确认结果,解析数据 _replyAddFingerprintConfirmation:${reply.data}',
upload: false
);
detail:
'添加指纹确认结果,解析数据 _replyAddFingerprintConfirmation:${reply.data}',
upload: false);
final List<int> fingerprintList = reply.data.sublist(reply.data.length - 2);
final List<int> fingerprintList =
reply.data.sublist(reply.data.length - 2);
final String fingerprintNum = listChangInt(fingerprintList).toString();
state.regIndex.value++;
if (state.fingerprintNumber.value == fingerprintNum) {
@ -194,7 +202,7 @@ class AddFingerprintLogic extends BaseGetXController {
// if(state.isCoerced.value == "1"){
//
state.ifAddState.value = false;
addFingerprintsData();
await addFingerprintsData();
// }else{
// //
// senderAddStressFingerprint();
@ -204,17 +212,18 @@ class AddFingerprintLogic extends BaseGetXController {
//
ApmHelper.instance.trackEvent('add_fingerprint', {
'lock_name': BlueManage().connectDeviceName,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'add_fingerprint_result': '失败-${reply.data}',
});
BuglyTool.uploadException(
message: '添加指纹确认结果,解析数据',
detail: '添加指纹确认结果蓝牙返回失败结果,解析数据 _replyAddFingerprintConfirmation:${reply.data}',
detail:
'添加指纹确认结果蓝牙返回失败结果,解析数据 _replyAddFingerprintConfirmation:${reply.data}',
eventStr: '添加指纹事件蓝牙返回失败结果',
upload: true
);
upload: true);
state.ifAddState.value = false;
break;
}
@ -222,7 +231,8 @@ class AddFingerprintLogic extends BaseGetXController {
//
Future<void> senderAddFingerprint() 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<String>? signKey = await Storage.getStringList(saveBlueSignKey);
@ -236,11 +246,15 @@ class AddFingerprintLogic extends BaseGetXController {
userID: await Storage.getUid(),
fingerNo: 0,
useCountLimit: 0xffff,
isForce:state.isCoerced.value == '1' ? 1 : 0, //
isForce: state.isCoerced.value == '1' ? 1 : 0,
//
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
operate: 0,
isRound:state.selectType.value == '2' ? 1: 0, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), //
isRound: state.selectType.value == '2' ? 1 : 0,
//
weekRound: DateTool()
.accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value),
//
startDate: int.parse(state.startDate.value) ~/ 1000,
endDate: int.parse(state.endDate.value) ~/ 1000,
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
@ -255,25 +269,30 @@ class AddFingerprintLogic extends BaseGetXController {
final String getMobile = (await Storage.getMobile())!;
ApmHelper.instance.trackEvent('add_fingerprint', {
'lock_name': BlueManage().connectDeviceName,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'add_fingerprint_result': '超时',
});
BuglyTool.uploadException(
message: '添加指纹超时处理-添加指纹失败',
detail: '添加指纹超时处理,断开连接,添加指纹失败--SenderAddFingerprintWithTimeCycleCoercionCommand:$command',
detail:
'添加指纹超时处理,断开连接,添加指纹失败--SenderAddFingerprintWithTimeCycleCoercionCommand:$command',
eventStr: '添加指纹事件超时',
upload: true
);
upload: true);
Get.close(1);
});
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState deviceConnectionState) async {
if (deviceConnectionState == BluetoothConnectionState.connected) {
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
final List<String>? privateKey =
await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList =
changeStringListToIntList(privateKey!);
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
final List<String>? signKey =
await Storage.getStringList(saveBlueSignKey);
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
final List<String>? token = await Storage.getStringList(saveBlueToken);
@ -284,11 +303,15 @@ class AddFingerprintLogic extends BaseGetXController {
userID: await Storage.getUid(),
fingerNo: 0,
useCountLimit: 0xffff,
isForce:state.isCoerced.value == '1' ? 1 : 0, //
isForce: state.isCoerced.value == '1' ? 1 : 0,
//
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
operate: 0,
isRound:state.selectType.value == '2' ? 1: 0, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), //
isRound: state.selectType.value == '2' ? 1 : 0,
//
weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
state.weekDay.value),
//
startDate: int.parse(state.startDate.value) ~/ 1000,
endDate: int.parse(state.endDate.value) ~/ 1000,
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
@ -297,23 +320,24 @@ class AddFingerprintLogic extends BaseGetXController {
signKey: signKeyDataList,
privateKey: getPrivateKeyList,
token: getTokenList,
isBeforeAddUser: false
);
}else if (deviceConnectionState == BluetoothConnectionState.disconnected){
isBeforeAddUser: false);
} else if (deviceConnectionState ==
BluetoothConnectionState.disconnected) {
final String getMobile = (await Storage.getMobile())!;
ApmHelper.instance.trackEvent('add_fingerprint', {
'lock_name': BlueManage().connectDeviceName,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'add_fingerprint_result': '断开',
});
BuglyTool.uploadException(
message: '添加指纹断开连接-添加指纹失败',
detail: '添加指纹断开连接-添加指纹失败--SenderAddFingerprintWithTimeCycleCoercionCommand:$command',
detail:
'添加指纹断开连接-添加指纹失败--SenderAddFingerprintWithTimeCycleCoercionCommand:$command',
eventStr: '添加指纹事件断开连接',
upload: true
);
upload: true);
if (state.ifCurrentScreen.value == true) {
showBlueConnetctToast();
@ -326,12 +350,16 @@ class AddFingerprintLogic extends BaseGetXController {
//
Future<void> senderCancelAddFingerprintCommand() async {
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState deviceConnectionState) async {
if (deviceConnectionState == BluetoothConnectionState.connected) {
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
final List<String>? privateKey =
await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList =
changeStringListToIntList(privateKey!);
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
final List<String>? signKey =
await Storage.getStringList(saveBlueSignKey);
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
final List<String>? token = await Storage.getStringList(saveBlueToken);
@ -345,7 +373,8 @@ class AddFingerprintLogic extends BaseGetXController {
privateKey: getPrivateKeyList,
token: getTokenList,
);
}else if (deviceConnectionState == BluetoothConnectionState.disconnected){
} else if (deviceConnectionState ==
BluetoothConnectionState.disconnected) {
if (state.ifCurrentScreen.value == true) {
showBlueConnetctToast();
}
@ -357,7 +386,8 @@ class AddFingerprintLogic extends BaseGetXController {
//
Future<void> addFingerprintsData() async {
final AddFingerprintEntity entity = await ApiRepository.to.addFingerprintsData(
final AddFingerprintEntity entity =
await ApiRepository.to.addFingerprintsData(
lockId: state.lockId.value.toString(),
endDate: state.endDate.value,
addType: state.addType.value,
@ -377,22 +407,21 @@ class AddFingerprintLogic extends BaseGetXController {
message: '添加指纹调用接口成功',
detail: '添加指纹调用接口成功',
eventStr: '添加指纹事件用接口成功',
upload: true
);
upload: true);
} else {
updateFingerprintUserNoLoadData(entity.data!.fingerprintId.toString());
BuglyTool.uploadException(
message: '添加指纹调用接口失败',
detail: '添加指纹调用接口添加指纹调用接口失败 - ${entity.errorMsg}',
eventStr: '添加指纹事件接口失败',
upload: true
);
upload: true);
}
}
//
Future<void> updateFingerprintUserNoLoadData(String fingerprintId) async {
final LoginEntity entity = await ApiRepository.to.updateFingerprintUserNoLoadData(
final LoginEntity entity =
await ApiRepository.to.updateFingerprintUserNoLoadData(
fingerprintId: fingerprintId,
lockId: state.lockId.value.toString(),
fingerprintUserNo: state.fingerprintNumber.value,
@ -401,7 +430,8 @@ class AddFingerprintLogic extends BaseGetXController {
showToast('添加成功'.tr, something: () {
if (state.fromType.value == 2) {
//
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(state.fingerprintNumber.value));
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(
state.fingerprintNumber.value));
} else if (state.fromType.value == 1) {
eventBus.fire(OtherTypeRefreshListEvent());
}
@ -430,5 +460,4 @@ class AddFingerprintLogic extends BaseGetXController {
_replySubscription.cancel();
}
}

View File

@ -23,6 +23,7 @@ class FingerprintListLogic extends BaseGetXController {
//
late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() {
_replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
@ -74,11 +75,15 @@ class FingerprintListLogic extends BaseGetXController {
userID: (await Storage.getUid())!,
fingerNo: state.deletFingerNo,
useCountLimit: 0xffff,
operate: state.isDeletAll == true ? 3 : 2, // 0: 1 2: 3
operate: state.isDeletAll == true ? 3 : 2,
// 0: 1 2: 3
isAdmin: 0,
isForce: 0, //
isRound: 0, //
weekRound: 0, //
isForce: 0,
//
isRound: 0,
//
weekRound: 0,
//
startDate: 0x11223344,
endDate: 0x11223344,
startTime: '0',
@ -275,11 +280,15 @@ class FingerprintListLogic extends BaseGetXController {
userID: (await Storage.getUid())!,
fingerNo: state.deletFingerNo,
useCountLimit: 0xffff,
operate: state.isDeletAll == true ? 3 : 2, // 0: 1 2: 3
operate: state.isDeletAll == true ? 3 : 2,
// 0: 1 2: 3
isAdmin: 0,
isForce: 0, //
isRound: 0, //
weekRound: 0, //
isForce: 0,
//
isRound: 0,
//
weekRound: 0,
//
startDate: 0x11223344,
endDate: 0x11223344,
startTime: '0',
@ -299,6 +308,7 @@ class FingerprintListLogic extends BaseGetXController {
}
});
}
/**
* //
Future<PasswordKeyListEntity> mockNetworkDataRequest(
@ -390,6 +400,7 @@ class FingerprintListLogic extends BaseGetXController {
//
late StreamSubscription _teamEvent;
void _initRefreshAction() {
_teamEvent = eventBus
.on<OtherTypeRefreshListEvent>()
@ -450,6 +461,7 @@ class FingerprintListLogic extends BaseGetXController {
_initReplySubscription();
_initRefreshAction();
getFingerprintsListData(isRefresh: true);
}
}

View File

@ -31,24 +31,9 @@ class _FingerprintListPageState extends State<FingerprintListPage>
final FingerprintListLogic logic = Get.put(FingerprintListLogic());
final FingerprintListState state = Get.find<FingerprintListLogic>().state;
Future<void> getHttpData({required bool isRefresh}) async {
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) {
logic
.getFingerprintsListData(isRefresh: isRefresh)
.then((FingerprintListDataEntity value) {
if (mounted) {
setState(() {});
}
});
}
}
@override
void initState() {
super.initState();
getHttpData(isRefresh: true);
}
@override
@ -91,17 +76,17 @@ class _FingerprintListPageState extends State<FingerprintListPage>
),
body: EasyRefreshTool(
onRefresh: () {
getHttpData(isRefresh: true);
logic.getFingerprintsListData(isRefresh: true);
},
onLoad: () {
getHttpData(isRefresh: false);
logic.getFingerprintsListData(isRefresh: false);
},
child: Column(
children: <Widget>[
KeySearchWidget(
editingController: state.searchController,
onSubmittedAction: () {
getHttpData(isRefresh: true);
onSubmittedAction: () async {
await logic.getFingerprintsListData(isRefresh: true);
},
),
SizedBox(
@ -116,7 +101,8 @@ class _FingerprintListPageState extends State<FingerprintListPage>
'lockId': state.lockId.value,
'fromType': 1 // 1 2
})!
.then((value) => getHttpData(isRefresh: true));
.then((value) =>
logic.getFingerprintsListData(isRefresh: true));
// if (data != null) {
// getHttpData(isRefresh: true);
// }
@ -179,7 +165,7 @@ class _FingerprintListPageState extends State<FingerprintListPage>
'fingerprintItemData': fingerprintItemData,
})!
.then((value) {
getHttpData(isRefresh: true);
logic.getFingerprintsListData(isRefresh: true);
});
// if (data == 'deletScuess') {
// // state.fingerprintItemListData.removeWhere((FingerprintItemData item) => item.fingerprintId == fingerprintItemData.fingerprintId!);

View File

@ -55,7 +55,19 @@ class _LockDetailPageState extends State<LockDetailPage>
void initState() {
super.initState();
listeningAnimations();
state.animationController =
AnimationController(duration: const Duration(seconds: 1), vsync: this);
state.animationController!.repeat();
//StatusListener
state.animationController!.addStatusListener((AnimationStatus status) {
if (status == AnimationStatus.completed) {
state.animationController!.reset();
state.animationController!.forward();
} else if (status == AnimationStatus.dismissed) {
state.animationController!.reset();
state.animationController!.forward();
}
});
state.pageController.addListener(() {
state.currentPage.value = state.pageController.page!.round();
@ -1321,24 +1333,6 @@ class _LockDetailPageState extends State<LockDetailPage>
);
}
Future<void> listeningAnimations() async {
await Future<void>.delayed(Duration.zero, () {
state.animationController = AnimationController(
duration: const Duration(seconds: 1), vsync: this);
state.animationController!.repeat();
//StatusListener
state.animationController!.addStatusListener((AnimationStatus status) {
if (status == AnimationStatus.completed) {
state.animationController!.reset();
state.animationController!.forward();
} else if (status == AnimationStatus.dismissed) {
state.animationController!.reset();
state.animationController!.forward();
}
});
});
}
String showElectricIcon(int electricnumber) {
if (electricnumber >= 100) {
return 'images/main/icon_lockElectricLevel_5.png';

View File

@ -202,7 +202,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
break;
case 2:
// 2 24使
useDateStr = '永久';
useDateStr = '永久'.tr;
state.isCirculation.value = false;
break;
case 3:

View File

@ -205,7 +205,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
children: <Widget>[
Expanded(
child: Text(
'密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。'.tr,
'密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。'.tr,
textAlign: TextAlign.start,
style: TextStyle(fontSize: 20.sp),
)),

View File

@ -297,7 +297,7 @@ class ShowCupertinoAlertView {
builder: (BuildContext context) {
return CupertinoAlertDialog(
title: Container(),
content: Text('是否要远程开锁'.tr),
content: Text('是否要远程开锁'.tr),
actions: <Widget>[
CupertinoDialogAction(
onPressed: Get.back,