1、添加锁基本信息里面的厂商、型号、配网wifi名字、绑定地址。2、添加卡、指纹修改协议
This commit is contained in:
parent
f4e3ac03af
commit
8371893100
@ -700,6 +700,8 @@
|
||||
"重命名": "Rename",
|
||||
"分组下的锁将被移到未分组里": "The locks under the group will be moved to ungrouped",
|
||||
"编辑成功": "Edit success",
|
||||
"厂商": "Manufacturer",
|
||||
"型号": "Model",
|
||||
|
||||
"相机": "camera",
|
||||
"相册": "photos",
|
||||
@ -719,6 +721,7 @@
|
||||
"去设置": "Go set it up",
|
||||
"当前网络": "Current network",
|
||||
"位置信息": "Location information",
|
||||
"请输入wifi名称": "Please enter the wifi name",
|
||||
|
||||
"虹膜":"iris",
|
||||
"手掌":"palm",
|
||||
|
||||
@ -701,6 +701,9 @@
|
||||
"编辑成功": "编辑成功",
|
||||
"当前网络": "当前网络",
|
||||
"位置信息": "位置信息",
|
||||
"请输入wifi名称": "请输入wifi名称",
|
||||
"厂商": "厂商",
|
||||
"型号": "型号",
|
||||
|
||||
"相机": "相机",
|
||||
"相册": "相册",
|
||||
|
||||
@ -703,6 +703,9 @@
|
||||
"编辑成功": "编辑成功",
|
||||
"当前网络": "当前网络",
|
||||
"位置信息": "位置信息",
|
||||
"请输入wifi名称": "请输入wifi名称",
|
||||
"厂商": "厂商",
|
||||
"型号": "型号",
|
||||
|
||||
"相机": "相机",
|
||||
"相册": "相册",
|
||||
|
||||
@ -42,7 +42,11 @@ class CardDetailLogic extends BaseGetXController{
|
||||
Get.log("${reply.commandType!.typeValue} 数据解析成功");
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
deletICCardData();
|
||||
if(state.isDeletCard.value == true){
|
||||
deletICCardData();
|
||||
}else{
|
||||
editICCardData();
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
@ -64,7 +68,7 @@ class CardDetailLogic extends BaseGetXController{
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:state.isDeletCard.value == true ? 0 : 0xff,
|
||||
isForce:state.isStressFingerprint.value == true ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -115,7 +119,7 @@ class CardDetailLogic extends BaseGetXController{
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:state.isDeletCard.value == true ? 0 : 0xff,
|
||||
isForce:state.isStressFingerprint.value == true ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
|
||||
@ -173,6 +173,7 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
||||
state.isDeletCard.value = true;
|
||||
logic.senderAddICCard();
|
||||
});
|
||||
}),
|
||||
@ -191,7 +192,8 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
state.isStressFingerprint.value = value;
|
||||
logic.editICCardData();
|
||||
state.isDeletCard.value = false;
|
||||
logic.senderAddICCard();
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@ -42,7 +42,11 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
state.sureBtnState.value = 0;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
deletFingerprintsData();
|
||||
if(state.isDeletFingerprint.value == true){
|
||||
deletFingerprintsData();
|
||||
}else{
|
||||
editFingerprintsData();
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
@ -64,7 +68,7 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:state.isDeletFingerprint.value == true ? 0 : 0xff,
|
||||
isForce:state.isStressFingerprint.value == true ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -115,7 +119,7 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:state.isDeletFingerprint.value == true ? 0 : 0xff,
|
||||
isForce:state.isStressFingerprint.value == true ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
|
||||
@ -23,8 +23,9 @@ class FingerprintDetailState{
|
||||
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
var sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
||||
|
||||
var isDeletFingerprint = true.obs;// 是否删除卡
|
||||
final isStressFingerprint = false.obs;
|
||||
|
||||
FingerprintDetailState() {
|
||||
Map map = Get.arguments;
|
||||
if ((map["fingerprintItemData"] != null)) {
|
||||
|
||||
@ -52,6 +52,16 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
||||
rightTitle:
|
||||
"${state.lockBasicInfo.value.mac??""}/${state.lockBasicInfo.value.lockId??""}",
|
||||
allHeight: 70.h,
|
||||
isHaveLine: true)),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "厂商".tr,
|
||||
rightTitle: state.lockBasicInfo.value.vendor ??"",
|
||||
allHeight: 70.h,
|
||||
isHaveLine: true)),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "型号".tr,
|
||||
rightTitle: state.lockBasicInfo.value.model ??"",
|
||||
allHeight: 70.h,
|
||||
isHaveLine: false)),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
@ -153,9 +163,20 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
||||
)),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "位置信息".tr,
|
||||
rightTitle: state.lockBasicInfo.value.address ?? "-",
|
||||
allHeight: 70.h,
|
||||
isHaveLine: true)),
|
||||
// rightTitle: state.lockBasicInfo.value.address ?? "-",
|
||||
allHeight: 80.h,
|
||||
isHaveLine: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: Container(
|
||||
width: 300.w,
|
||||
child: Text(state.lockBasicInfo.value.address ?? "-",
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.darkGrayTextColor)),
|
||||
),)),
|
||||
/* 2024-01-12 会议确定去掉“微信二维码” by DaisyWu
|
||||
CommonItem(
|
||||
leftTitel:
|
||||
|
||||
@ -16,6 +16,7 @@ import '../../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../../../blue/sender_manage.dart';
|
||||
import '../../../../../network/api_repository.dart';
|
||||
import '../../../../../tools/eventBusEventManage.dart';
|
||||
import '../../../../../tools/storage.dart';
|
||||
import 'configuringWifi_state.dart';
|
||||
|
||||
@ -26,23 +27,19 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
||||
var entity = await ApiRepository.to.getWifiLockServiceIpAndPort();
|
||||
if(entity.errorCode! == 0){
|
||||
state.configuringWifiEntity.value = entity;
|
||||
}
|
||||
}
|
||||
|
||||
// var serversList = <int>[];
|
||||
// for(int i = 0; i<state.configuringWifiEntity.value.data!.serviceList!.length; i++){
|
||||
// var item = state.configuringWifiEntity.value.data!.serviceList![i];
|
||||
// var itemList = item.serviceIp!.split(".");
|
||||
// itemList.forEach((element) {
|
||||
// serversList.add(int.parse(element));
|
||||
// });
|
||||
// // serversList.add(int.parse(item.port!));
|
||||
//
|
||||
// double typeDouble = int.parse(item.port!) / 256;
|
||||
// int type1 = typeDouble.toInt();
|
||||
// int type2 = int.parse(item.port!) % 256;
|
||||
// serversList.add(type1);
|
||||
// serversList.add(type2);
|
||||
// }
|
||||
// print("serversListserversList:$serversList");
|
||||
void updateNetworkInfo() async{
|
||||
var entity = await ApiRepository.to.updateNetworkInfo(
|
||||
lockId: state.lockSetInfoData.value.lockId!,
|
||||
network:state.wifiNameController.text,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast("配网成功", something:(){
|
||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||
Get.close(2);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,9 +65,7 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
||||
state.sureBtnState.value = 0;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
showToast("配网成功", something:(){
|
||||
Get.close(2);
|
||||
});
|
||||
updateNetworkInfo();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
@ -131,6 +126,11 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
||||
|
||||
// 点击配置wifi
|
||||
Future<void> senderConfiguringWifiAction() async {
|
||||
if(state.wifiNameController.text.isEmpty){
|
||||
showToast("请输入wifi名称");
|
||||
return;
|
||||
}
|
||||
|
||||
if(state.sureBtnState.value == 1){
|
||||
return;
|
||||
}
|
||||
|
||||
@ -341,6 +341,7 @@ class LockBasicInfo {
|
||||
List? weekDays;
|
||||
String? address;
|
||||
String? network;
|
||||
String? vendor;
|
||||
|
||||
LockBasicInfo(
|
||||
{this.lockId,
|
||||
@ -365,7 +366,8 @@ class LockBasicInfo {
|
||||
this.lockUserNo,
|
||||
this.weekDays,
|
||||
this.address,
|
||||
this.network});
|
||||
this.network,
|
||||
this.vendor});
|
||||
|
||||
LockBasicInfo.fromJson(Map<String, dynamic> json) {
|
||||
lockId = json['lockId'];
|
||||
@ -396,6 +398,7 @@ class LockBasicInfo {
|
||||
weekDays = json['weekDays'];
|
||||
address = json['address'];
|
||||
network = json['network'];
|
||||
vendor = json['vendor'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -425,6 +428,7 @@ class LockBasicInfo {
|
||||
data['weekDays'] = weekDays;
|
||||
data['address'] = address;
|
||||
data['network'] = network;
|
||||
data['vendor'] = vendor;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,7 +143,8 @@ class NearbyLockLogic extends BaseGetXController {
|
||||
// 厂商名称
|
||||
var vendor = reply.data.sublist(3, 23);
|
||||
var vendorStr = utf8String(vendor);
|
||||
state.lockInfo["vendor"] = vendorStr;
|
||||
// state.lockInfo["vendor"] = vendorStr;
|
||||
state.lockInfo["vendor"] = "XL";
|
||||
Get.log("vendor:$vendor vendorStr:$vendorStr reply.data:${reply.data}");
|
||||
|
||||
// 锁设备类型
|
||||
@ -154,7 +155,8 @@ class NearbyLockLogic extends BaseGetXController {
|
||||
// 产品名称
|
||||
var model = reply.data.sublist(24, 44);
|
||||
var modelStr = utf8String(model);
|
||||
state.lockInfo["model"] = modelStr;
|
||||
// state.lockInfo["model"] = modelStr;
|
||||
state.lockInfo["model"] = "JL-BLE-01";
|
||||
// Get.log("model:$model modelStr:$modelStr modelStr:${modelStr.length}");
|
||||
|
||||
// 软件版本
|
||||
|
||||
@ -670,6 +670,15 @@ class ApiProvider extends BaseProvider {
|
||||
'autoLockSecond': autoLockSecond,
|
||||
}));
|
||||
|
||||
/// 更新网络信息 配网之后把网络信息提交到服务器保存
|
||||
Future<Response> updateNetworkInfo(int lockId, String network) =>
|
||||
post(
|
||||
updateLockSettingUrl.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
'network': network,
|
||||
}));
|
||||
|
||||
// 锁声音
|
||||
Future<Response> setLockSoundData(
|
||||
int lockId, int lockSound, int lockSoundVolume) =>
|
||||
|
||||
@ -709,6 +709,17 @@ class ApiRepository {
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 更新网络信息 配网之后把网络信息提交到服务器保存
|
||||
Future<LoginEntity> updateNetworkInfo({
|
||||
required int lockId,
|
||||
required String network,
|
||||
}) async {
|
||||
final res = await apiProvider.updateNetworkInfo(lockId, network);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 锁声音
|
||||
Future<LoginEntity> setLockSound({
|
||||
required int lockId,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user