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
android:label="star_lock"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_logo">
<!-- 配置定位Service -->
<service android:name="com.amap.api.location.APSService"/>
<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,
itemBuilder: (c, index) {
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);
});
},
@ -120,7 +120,7 @@ class _ImportOtherLockDataPageState extends State<ImportOtherLockDataPage> {
}
Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle,
String beginTime, String endTime, Function() action) {
String beginTime, String endTime, int index,Function() action) {
return GestureDetector(
onTap: action,
child: Container(
@ -144,7 +144,7 @@ class _ImportOtherLockDataPageState extends State<ImportOtherLockDataPage> {
width: 10.w,
),
Text(
'test',
'${index+1}',
style: TextStyle(
color: AppColors.blackColor,
fontSize: 22.sp,

View File

@ -57,7 +57,7 @@ class LockSetLogic extends BaseGetXController {
case 0x00:
//
print("${reply.commandType}解析成功");
deletLockInfoData();
deletKeyData();
break;
case 0x06:
//
@ -113,7 +113,7 @@ class LockSetLogic extends BaseGetXController {
case 0x00:
//
print("${reply.commandType!.typeValue} 数据解析成功");
deletLockInfoData();
break;
case 0x06:
//
@ -155,7 +155,7 @@ class LockSetLogic extends BaseGetXController {
}
}
//
//
Future<void> deletUserAction() async {
BlueManage().judgeReconnect(
BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName,
@ -209,9 +209,9 @@ class LockSetLogic extends BaseGetXController {
});
}
//
//
void deletLockInfoData() async {
var entity = await ApiRepository.to.deletLockData(
var entity = await ApiRepository.to.deletOwnerLockData(
lockId: state.getKeyInfosData.value.lockId.toString(),
);
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 {
var entity = await ApiRepository.to.checkLoginPassword(
password: state.passwordTF.text,
);
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: () {
// logic.deletUserAction();
logic.deletLockInfoData();
// logic.deletLockInfoData();
showDeletAlertDialog(context);
// showDeletPasswordAlertDialog(context);
}),
),
@ -521,7 +522,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
context: widgetContext,
builder: (context) {
return CupertinoAlertDialog(
title: const Text('创建公司号,考勤功能才能使用'),
title: const Text("提示"),
content: const Text('创建公司号,考勤功能才能使用'),
actions: [
CupertinoDialogAction(
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(
// BuildContext context,
// ) {
@ -577,8 +625,12 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
tipTitle: "",
controller: state.passwordTF,
sureClick: () {
//
if (state.passwordTF.text.isNotEmpty) {}
//
if (state.passwordTF.text.isEmpty) {
Toast.show(msg: "请输入登录密码");
return;
}
logic.checkLoginPassword();
},
cancelClick: () {
Navigator.pop(context);

View File

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

View File

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

View File

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

View File

@ -57,7 +57,7 @@ class AddICCardLogic extends BaseGetXController{
case 0x00:
//
print("${reply.commandType!.typeValue} 数据解析成功");
state.cardNumber.value = reply.data.last.toString();
// state.cardNumber.value = reply.data.last.toString();
state.ifConnectScuess.value = true;
break;
case 0x06:
@ -116,7 +116,15 @@ class AddICCardLogic extends BaseGetXController{
// print("添加指纹确认成功,调用添加指纹接口");
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{
//
senderAddStressICCard();
@ -264,7 +272,7 @@ class AddICCardLogic extends BaseGetXController{
var entity = await ApiRepository.to.updateIdCardUserNoLoadData(
lockId: state.lockId.value.toString(),
cardId: cardId,
cardUserNo: "0",
cardUserNo: state.cardNumber.value,
);
if(entity.errorCode!.codeIsSuccessful){
Toast.show(msg: "添加成功");

View File

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

View File

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

View File

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

View File

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

View File

@ -313,6 +313,14 @@ class ApiProvider extends BaseProvider {
'lockId': lockId,
}));
//
Future<Response> deletOwnerKeyInfo(String lockId, String keyId) => post(
deletLockURL.toUrl,
jsonEncode({
'lockId': lockId,
'keyId': keyId
}));
//
Future<Response> checkLoginPassword(String password) => post(
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);
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 {
final res = await apiProvider.checkLoginPassword(password);