This commit is contained in:
Daisy 2023-10-19 09:26:51 +08:00
commit 3c1f60e3e6
30 changed files with 144 additions and 41 deletions

View File

@ -42,7 +42,7 @@
<application <application
android:label="star_lock" android:label="star_lock"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_logo">
<!-- 配置定位Service --> <!-- 配置定位Service -->
<service android:name="com.amap.api.location.APSService"/> <service android:name="com.amap.api.location.APSService"/>
<activity <activity

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 336 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 182 KiB

View File

@ -106,7 +106,7 @@ class _ImportOtherLockDataPageState extends State<ImportOtherLockDataPage> {
itemCount: 2, itemCount: 2,
itemBuilder: (c, index) { itemBuilder: (c, index) {
return _electronicKeyItem('images/icon_round_unSelet.png', "张三", return _electronicKeyItem('images/icon_round_unSelet.png', "张三",
"2023.6.21 11.15", "2023.6.21 11.15", () { "2023.6.21 11.15", "2023.6.21 11.15", index,() {
// Navigator.pushNamed(context, Routers.electronicKeyDetailPage); // Navigator.pushNamed(context, Routers.electronicKeyDetailPage);
}); });
}, },
@ -120,7 +120,7 @@ class _ImportOtherLockDataPageState extends State<ImportOtherLockDataPage> {
} }
Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle, Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle,
String beginTime, String endTime, Function() action) { String beginTime, String endTime, int index,Function() action) {
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
@ -144,7 +144,7 @@ class _ImportOtherLockDataPageState extends State<ImportOtherLockDataPage> {
width: 10.w, width: 10.w,
), ),
Text( Text(
'test', '${index+1}',
style: TextStyle( style: TextStyle(
color: AppColors.blackColor, color: AppColors.blackColor,
fontSize: 22.sp, fontSize: 22.sp,

View File

@ -57,7 +57,7 @@ class LockSetLogic extends BaseGetXController {
case 0x00: case 0x00:
// //
print("${reply.commandType}解析成功"); print("${reply.commandType}解析成功");
deletLockInfoData(); deletKeyData();
break; break;
case 0x06: case 0x06:
// //
@ -113,7 +113,7 @@ class LockSetLogic extends BaseGetXController {
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功"); print("${reply.commandType!.typeValue} 数据解析成功");
deletLockInfoData();
break; break;
case 0x06: case 0x06:
// //
@ -155,7 +155,7 @@ class LockSetLogic extends BaseGetXController {
} }
} }
// //
Future<void> deletUserAction() async { Future<void> deletUserAction() async {
BlueManage().judgeReconnect( BlueManage().judgeReconnect(
BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName,
@ -209,9 +209,9 @@ class LockSetLogic extends BaseGetXController {
}); });
} }
// //
void deletLockInfoData() async { void deletLockInfoData() async {
var entity = await ApiRepository.to.deletLockData( var entity = await ApiRepository.to.deletOwnerLockData(
lockId: state.getKeyInfosData.value.lockId.toString(), lockId: state.getKeyInfosData.value.lockId.toString(),
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
@ -219,13 +219,28 @@ class LockSetLogic extends BaseGetXController {
} }
} }
//
void deletKeyData() async {
var entity = await ApiRepository.to.deletOwnerKeyData(
lockId: state.getKeyInfosData.value.lockId.toString(),
keyId: state.getKeyInfosData.value.keyId.toString(),
);
if (entity.errorCode!.codeIsSuccessful) {
Get.offAllNamed(Routers.starLockMain);
}
}
// //
void checkLoginPassword() async { void checkLoginPassword() async {
var entity = await ApiRepository.to.checkLoginPassword( var entity = await ApiRepository.to.checkLoginPassword(
password: state.passwordTF.text, password: state.passwordTF.text,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
if(state.getKeyInfosData.value.isLockOwner == 1){
factoryDataResetAction();
}else{
deletKeyData();
}
} }
} }

View File

@ -449,7 +449,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
onClick: () { onClick: () {
// logic.deletUserAction(); // logic.deletUserAction();
logic.deletLockInfoData(); // logic.deletLockInfoData();
showDeletAlertDialog(context);
// showDeletPasswordAlertDialog(context); // showDeletPasswordAlertDialog(context);
}), }),
), ),
@ -521,7 +522,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
context: widgetContext, context: widgetContext,
builder: (context) { builder: (context) {
return CupertinoAlertDialog( return CupertinoAlertDialog(
title: const Text('创建公司号,考勤功能才能使用'), title: const Text("提示"),
content: const Text('创建公司号,考勤功能才能使用'),
actions: [ actions: [
CupertinoDialogAction( CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr), child: Text(TranslationLoader.lanKeys!.cancel!.tr),
@ -543,6 +545,52 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
); );
} }
void showDeletAlertDialog(
BuildContext context,
) {
// showDialog(
// context: context,
// builder: (BuildContext context) {
// return ShowIosTipView(
// title: "提示",
// tipTitle: "删除锁后,所有信息都会一起删除,确定删除锁吗?",
// sureClick: () {
// Navigator.pop(context);
// showDeletPasswordAlertDialog(context);
// },
// cancelClick: () {
// Navigator.pop(context);
// },
// );
// },
// );
showCupertinoDialog(
context: context,
builder: (context) {
return CupertinoAlertDialog(
title: const Text("提示"),
content: const Text('删除锁后,所有信息都会一起删除,确定删除锁吗?'),
actions: [
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
onPressed: () {
Navigator.pop(context);
},
),
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.sure!.tr),
onPressed: () {
Navigator.pop(context);
showDeletPasswordAlertDialog(context);
},
),
],
);
},
);
}
// void showCupertinoAlertDialog( // void showCupertinoAlertDialog(
// BuildContext context, // BuildContext context,
// ) { // ) {
@ -577,8 +625,12 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
tipTitle: "", tipTitle: "",
controller: state.passwordTF, controller: state.passwordTF,
sureClick: () { sureClick: () {
// //
if (state.passwordTF.text.isNotEmpty) {} if (state.passwordTF.text.isEmpty) {
Toast.show(msg: "请输入登录密码");
return;
}
logic.checkLoginPassword();
}, },
cancelClick: () { cancelClick: () {
Navigator.pop(context); Navigator.pop(context);

View File

@ -423,7 +423,7 @@ class LockDetailLogic extends BaseGetXController{
privateKey:getPrivateKeyList, privateKey:getPrivateKeyList,
); );
} }
}, isShowLoading: true); }, isShowLoading: false);
} }
void startScanAction(){ void startScanAction(){

View File

@ -126,7 +126,7 @@ class AddFingerprintLogic extends BaseGetXController {
// //
print("${reply.commandType!.typeValue} 注册指纹失败"); print("${reply.commandType!.typeValue} 注册指纹失败");
Toast.show(msg: "添加失败"); Toast.show(msg: "添加失败");
Get.close(3); Get.close(2);
}else{ }else{
state.addFingerprintProcessNumber.value++; state.addFingerprintProcessNumber.value++;
print("state.addFingerprintProcessNumber.value:${state.addFingerprintProcessNumber.value}"); print("state.addFingerprintProcessNumber.value:${state.addFingerprintProcessNumber.value}");
@ -334,7 +334,7 @@ class AddFingerprintLogic extends BaseGetXController {
}else if(state.fromType.value == 1){ }else if(state.fromType.value == 1){
eventBus.fire(OtherTypeRefreshListEvent()); eventBus.fire(OtherTypeRefreshListEvent());
} }
Get.close(3); Get.close(2);
} }
} }

View File

@ -86,29 +86,32 @@ class _AddFingerprintPageState extends State<AddFingerprintPage> {
), ),
)), )),
SizedBox( SizedBox(
height: 50.h, height: 100.h,
), ),
Obx(() => Image.asset( Obx(() => Image.asset(
getIconNumber(state.addFingerprintProcessNumber.value), getIconNumber(state.addFingerprintProcessNumber.value),
width: 270.w, width: 185.w,
height: 457.h, height: 295.h,
),), ),),
SizedBox( SizedBox(
height: 120.h, height: 120.h,
), ),
Row( Container(
mainAxisAlignment: MainAxisAlignment.center, margin: EdgeInsets.all(10.w),
children: [ child: Row(
Expanded( mainAxisAlignment: MainAxisAlignment.center,
child: Text( children: [
"根据提示抬起手指后再进行下一次指纹采集共4次", Expanded(
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr, child: Text(
textAlign: TextAlign.center, "根据提示,抬起手指后再进行下一次指纹采集",
maxLines:null, // TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
style: TextStyle(fontSize: 24.sp), textAlign: TextAlign.center,
maxLines:null,
style: TextStyle(fontSize: 24.sp),
),
), ),
), ],
], ),
), ),
], ],
), ),
@ -126,9 +129,9 @@ class _AddFingerprintPageState extends State<AddFingerprintPage> {
case 3: case 3:
return 'images/main/icon_addFingerprint_fingerprint_four.png'; return 'images/main/icon_addFingerprint_fingerprint_four.png';
break; break;
// case 4: case 4:
// return 'images/main/icon_addFingerprint_fingerprint_four.png'; return 'images/main/icon_addFingerprint_fingerprint_five.png';
// break; break;
default: default:
return 'images/main/icon_addFingerprint_fingerprint_one.png'; return 'images/main/icon_addFingerprint_fingerprint_one.png';
break; break;

View File

@ -57,7 +57,7 @@ class AddICCardLogic extends BaseGetXController{
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功"); print("${reply.commandType!.typeValue} 数据解析成功");
state.cardNumber.value = reply.data.last.toString(); // state.cardNumber.value = reply.data.last.toString();
state.ifConnectScuess.value = true; state.ifConnectScuess.value = true;
break; break;
case 0x06: case 0x06:
@ -116,7 +116,15 @@ class AddICCardLogic extends BaseGetXController{
// print("添加指纹确认成功,调用添加指纹接口"); // print("添加指纹确认成功,调用添加指纹接口");
if(state.isCoerced.value == "2"){ if(state.isCoerced.value == "2"){
// //
addICCardData(); int addResultStatus = reply.data[5];
if(addResultStatus == 0){
//
state.cardNumber.value = (reply.data[6]+1).toString();
addICCardData();
}else if(addResultStatus == 255){
// 255 退
Get.close(2);
}
}else{ }else{
// //
senderAddStressICCard(); senderAddStressICCard();
@ -264,7 +272,7 @@ class AddICCardLogic extends BaseGetXController{
var entity = await ApiRepository.to.updateIdCardUserNoLoadData( var entity = await ApiRepository.to.updateIdCardUserNoLoadData(
lockId: state.lockId.value.toString(), lockId: state.lockId.value.toString(),
cardId: cardId, cardId: cardId,
cardUserNo: "0", cardUserNo: state.cardNumber.value,
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
Toast.show(msg: "添加成功"); Toast.show(msg: "添加成功");

View File

@ -29,7 +29,7 @@ class OtherTypeKeyListLogic extends BaseGetXController{
void _initReplySubscription() { void _initReplySubscription() {
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) { _replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
// () // ()
if(reply is SenderAddFingerprintReply) { if((reply is SenderAddFingerprintReply) && (state.isDeletFingerprintData.value == true)) {
_replyAddFingerprintBegin(reply); _replyAddFingerprintBegin(reply);
} }
@ -62,6 +62,7 @@ class OtherTypeKeyListLogic extends BaseGetXController{
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功"); print("${reply.commandType!.typeValue} 数据解析成功");
state.isDeletFingerprintData.value = false;
deletAllFingerprintsData(); deletAllFingerprintsData();
break; break;
case 0x06: case 0x06:
@ -346,7 +347,7 @@ class OtherTypeKeyListLogic extends BaseGetXController{
IoSenderManage.senderAddFingerprintCommand( IoSenderManage.senderAddFingerprintCommand(
keyID:"1", keyID:"1",
userID:"Delete All !@#", userID:"DeleteAll!@#",
fingerNo:255, fingerNo:255,
useCountLimit:0, useCountLimit:0,
startTime:0x11223344, startTime:0x11223344,
@ -385,6 +386,7 @@ class OtherTypeKeyListLogic extends BaseGetXController{
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
Toast.show(msg: "重置成功"); Toast.show(msg: "重置成功");
state.isDeletFingerprintData.value = false;
getFingerprintsListData(); getFingerprintsListData();
} }
} }

View File

@ -45,11 +45,13 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
switch (state.fromType.value) { switch (state.fromType.value) {
case 0: case 0:
// //
state.isDeletICCardData.value = true;
logic.deletICCardData(); logic.deletICCardData();
break; break;
case 1: case 1:
// //
// logic.deletAllFingerprintsData(); // logic.deletAllFingerprintsData();
state.isDeletFingerprintData.value = true;
logic.senderAddFingerprint(); logic.senderAddFingerprint();
break; break;
case 2: case 2:

View File

@ -8,6 +8,9 @@ class OtherTypeKeyListState{
final lockId = 0.obs; final lockId = 0.obs;
final fromType = 0.obs; final fromType = 0.obs;
var isDeletFingerprintData = false.obs;
var isDeletICCardData = false.obs;
final fingerprintItemListData = <FingerprintItemData>[].obs; final fingerprintItemListData = <FingerprintItemData>[].obs;
final TextEditingController searchController = TextEditingController(); final TextEditingController searchController = TextEditingController();

View File

@ -228,6 +228,7 @@ class KeyInfos {
int? displayPasscode; int? displayPasscode;
int? lockId; int? lockId;
int? doubleVerification; int? doubleVerification;
int? isLockOwner;
String? keyName; String? keyName;
LockVersion? lockVersion; LockVersion? lockVersion;
Bluetooth? bluetooth; Bluetooth? bluetooth;
@ -283,6 +284,7 @@ class KeyInfos {
this.displayPasscode, this.displayPasscode,
this.lockId, this.lockId,
this.doubleVerification, this.doubleVerification,
this.isLockOwner,
this.keyName, this.keyName,
this.lockVersion, this.lockVersion,
this.lockName, this.lockName,
@ -339,6 +341,7 @@ class KeyInfos {
displayPasscode = json['displayPasscode']; displayPasscode = json['displayPasscode'];
lockId = json['lockId']; lockId = json['lockId'];
doubleVerification = json['doubleVerification']; doubleVerification = json['doubleVerification'];
isLockOwner = json['isLockOwner'];
keyName = json['keyName']; keyName = json['keyName'];
lockVersion = json['lockVersion'] != null lockVersion = json['lockVersion'] != null
? LockVersion.fromJson(json['lockVersion']) ? LockVersion.fromJson(json['lockVersion'])
@ -401,6 +404,7 @@ class KeyInfos {
data['displayPasscode'] = displayPasscode; data['displayPasscode'] = displayPasscode;
data['lockId'] = lockId; data['lockId'] = lockId;
data['doubleVerification'] = doubleVerification; data['doubleVerification'] = doubleVerification;
data['isLockOwner'] = isLockOwner;
data['keyName'] = keyName; data['keyName'] = keyName;
if (lockVersion != null) { if (lockVersion != null) {
data['lockVersion'] = lockVersion!.toJson(); data['lockVersion'] = lockVersion!.toJson();

View File

@ -313,6 +313,14 @@ class ApiProvider extends BaseProvider {
'lockId': lockId, 'lockId': lockId,
})); }));
//
Future<Response> deletOwnerKeyInfo(String lockId, String keyId) => post(
deletLockURL.toUrl,
jsonEncode({
'lockId': lockId,
'keyId': keyId
}));
// //
Future<Response> checkLoginPassword(String password) => post( Future<Response> checkLoginPassword(String password) => post(
checkPasswordURL.toUrl, checkPasswordURL.toUrl,

View File

@ -328,11 +328,17 @@ class ApiRepository {
} }
// //
Future<LockMainEntity> deletLockData({required String lockId}) async { Future<LockMainEntity> deletOwnerLockData({required String lockId}) async {
final res = await apiProvider.deletLockInfo(lockId); final res = await apiProvider.deletLockInfo(lockId);
return LockMainEntity.fromJson(res.body); return LockMainEntity.fromJson(res.body);
} }
//
Future<LockMainEntity> deletOwnerKeyData({required String lockId, required String keyId}) async {
final res = await apiProvider.deletOwnerKeyInfo(lockId, keyId);
return LockMainEntity.fromJson(res.body);
}
// //
Future<LockMainEntity> checkLoginPassword({required String password}) async { Future<LockMainEntity> checkLoginPassword({required String password}) async {
final res = await apiProvider.checkLoginPassword(password); final res = await apiProvider.checkLoginPassword(password);