Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock
This commit is contained in:
commit
04c5b703e5
@ -137,6 +137,7 @@ class LockFeature {
|
|||||||
int? wirelessKeyboard;
|
int? wirelessKeyboard;
|
||||||
int? lightingTime;
|
int? lightingTime;
|
||||||
int? passageMode;
|
int? passageMode;
|
||||||
|
int? isSupportCatEye;
|
||||||
int? hotelLockCardSystem;
|
int? hotelLockCardSystem;
|
||||||
int? appUnlockOnline;
|
int? appUnlockOnline;
|
||||||
int? bluetoothBroadcast;
|
int? bluetoothBroadcast;
|
||||||
@ -191,6 +192,7 @@ class LockFeature {
|
|||||||
this.wirelessKeyboard,
|
this.wirelessKeyboard,
|
||||||
this.lightingTime,
|
this.lightingTime,
|
||||||
this.passageMode,
|
this.passageMode,
|
||||||
|
this.isSupportCatEye,
|
||||||
this.hotelLockCardSystem,
|
this.hotelLockCardSystem,
|
||||||
this.appUnlockOnline,
|
this.appUnlockOnline,
|
||||||
this.bluetoothBroadcast,
|
this.bluetoothBroadcast,
|
||||||
@ -246,6 +248,7 @@ class LockFeature {
|
|||||||
wirelessKeyboard = json['wirelessKeyboard'];
|
wirelessKeyboard = json['wirelessKeyboard'];
|
||||||
lightingTime = json['lightingTime'];
|
lightingTime = json['lightingTime'];
|
||||||
passageMode = json['passageMode'];
|
passageMode = json['passageMode'];
|
||||||
|
isSupportCatEye = json['isSupportCatEye'];
|
||||||
hotelLockCardSystem = json['hotelLockCardSystem'];
|
hotelLockCardSystem = json['hotelLockCardSystem'];
|
||||||
appUnlockOnline = json['appUnlockOnline'];
|
appUnlockOnline = json['appUnlockOnline'];
|
||||||
bluetoothBroadcast = json['bluetoothBroadcast'];
|
bluetoothBroadcast = json['bluetoothBroadcast'];
|
||||||
@ -302,6 +305,7 @@ class LockFeature {
|
|||||||
data['wirelessKeyboard'] = wirelessKeyboard;
|
data['wirelessKeyboard'] = wirelessKeyboard;
|
||||||
data['lightingTime'] = lightingTime;
|
data['lightingTime'] = lightingTime;
|
||||||
data['passageMode'] = passageMode;
|
data['passageMode'] = passageMode;
|
||||||
|
data['isSupportCatEye'] = isSupportCatEye;
|
||||||
data['hotelLockCardSystem'] = hotelLockCardSystem;
|
data['hotelLockCardSystem'] = hotelLockCardSystem;
|
||||||
data['appUnlockOnline'] = appUnlockOnline;
|
data['appUnlockOnline'] = appUnlockOnline;
|
||||||
data['bluetoothBroadcast'] = bluetoothBroadcast;
|
data['bluetoothBroadcast'] = bluetoothBroadcast;
|
||||||
|
|||||||
@ -377,8 +377,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
//猫眼设置
|
//猫眼设置
|
||||||
Visibility(
|
Obx(() => Visibility(
|
||||||
visible: true,
|
visible: state.lockFeature.value.isSupportCatEye == 1 ? true : false,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.catEyeSet!.tr,
|
leftTitel: TranslationLoader.lanKeys!.catEyeSet!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
@ -388,7 +388,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
Get.toNamed(Routers.catEyeSetPage, arguments: {
|
Get.toNamed(Routers.catEyeSetPage, arguments: {
|
||||||
'lockSetInfoData': state.lockSetInfoData.value
|
'lockSetInfoData': state.lockSetInfoData.value
|
||||||
});
|
});
|
||||||
})),
|
}))),
|
||||||
// Obx(() =>
|
// Obx(() =>
|
||||||
//自动亮屏已包括至面容开锁模块
|
//自动亮屏已包括至面容开锁模块
|
||||||
// Visibility(
|
// Visibility(
|
||||||
@ -644,11 +644,10 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
logic.openCheckingInData((checkingInInfoDataEntity) {
|
logic.openCheckingInData((checkingInInfoDataEntity) {
|
||||||
if (checkingInInfoDataEntity.data!.companyId == 0) {
|
if (checkingInInfoDataEntity.data!.companyId == 0) {
|
||||||
// logic.showCupertinoAlertDialog(context);
|
// logic.showCupertinoAlertDialog(context);
|
||||||
ShowTipView().showIosTipWithContentDialog("创建公司后,考勤功能才能使用".tr, (){
|
ShowTipView().showIosTipWithContentDialog("创建公司后,考勤功能才能使用".tr, () {
|
||||||
// 删除锁
|
// 删除锁
|
||||||
Get.toNamed(Routers.checkInCreatCompanyPage, arguments: {
|
Get.toNamed(Routers.checkInCreatCompanyPage,
|
||||||
'lockSetInfoData': state.lockSetInfoData.value
|
arguments: {'lockSetInfoData': state.lockSetInfoData.value});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
logic.setLockSetGeneralSetting();
|
logic.setLockSetGeneralSetting();
|
||||||
|
|||||||
@ -20,12 +20,13 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
final NearbyLockState state = NearbyLockState();
|
final NearbyLockState state = NearbyLockState();
|
||||||
|
|
||||||
// 点击连接设备
|
// 点击连接设备
|
||||||
void connect(String deviceName){
|
void connect(String deviceName) {
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
BlueManage().bludSendData(deviceName, (BluetoothConnectionState state) async {
|
BlueManage().bludSendData(deviceName,
|
||||||
|
(BluetoothConnectionState state) async {
|
||||||
if (state == BluetoothConnectionState.connected) {
|
if (state == BluetoothConnectionState.connected) {
|
||||||
IoSenderManage.getPublicKey(lockId: deviceName);
|
IoSenderManage.getPublicKey(lockId: deviceName);
|
||||||
}else if (state == BluetoothConnectionState.disconnected) {
|
} else if (state == BluetoothConnectionState.disconnected) {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
}
|
}
|
||||||
}, isAddEquipment: true);
|
}, isAddEquipment: true);
|
||||||
@ -34,7 +35,8 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
_replySubscription =
|
||||||
|
EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||||
if (reply is GetPublicKeyReply) {
|
if (reply is GetPublicKeyReply) {
|
||||||
_replyGetPublicKey(reply);
|
_replyGetPublicKey(reply);
|
||||||
}
|
}
|
||||||
@ -141,8 +143,8 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
// 厂商名称
|
// 厂商名称
|
||||||
var vendor = reply.data.sublist(3, 23);
|
var vendor = reply.data.sublist(3, 23);
|
||||||
var vendorStr = utf8String(vendor);
|
var vendorStr = utf8String(vendor);
|
||||||
// state.lockInfo["vendor"] = vendorStr;
|
state.lockInfo["vendor"] = vendorStr;
|
||||||
state.lockInfo["vendor"] = "XL";
|
// state.lockInfo["vendor"] = "XL";
|
||||||
Get.log("vendor:$vendor vendorStr:$vendorStr reply.data:${reply.data}");
|
Get.log("vendor:$vendor vendorStr:$vendorStr reply.data:${reply.data}");
|
||||||
|
|
||||||
// 锁设备类型
|
// 锁设备类型
|
||||||
@ -173,7 +175,8 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
var serialNum0Str = utf8String(serialNum0);
|
var serialNum0Str = utf8String(serialNum0);
|
||||||
state.lockInfo["serialNum0"] = serialNum0Str;
|
state.lockInfo["serialNum0"] = serialNum0Str;
|
||||||
// state.lockInfo["serialNum0"] = "${DateTime.now().millisecondsSinceEpoch ~/ 10}";
|
// state.lockInfo["serialNum0"] = "${DateTime.now().millisecondsSinceEpoch ~/ 10}";
|
||||||
Get.log("serialNum0Str:$serialNum0Str serialNum0Str:${serialNum0Str.length}");
|
Get.log(
|
||||||
|
"serialNum0Str:$serialNum0Str serialNum0Str:${serialNum0Str.length}");
|
||||||
|
|
||||||
// 成品商序列号
|
// 成品商序列号
|
||||||
var serialNum1 = reply.data.sublist(100, 116);
|
var serialNum1 = reply.data.sublist(100, 116);
|
||||||
@ -236,11 +239,12 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
// 锁特征值说明(本机能支持的功能)
|
// 锁特征值说明(本机能支持的功能)
|
||||||
// 获取到锁给的字符数组
|
// 获取到锁给的字符数组
|
||||||
var featureNetxLength = index + featureValueLength + 1;
|
var featureNetxLength = index + featureValueLength + 1;
|
||||||
if(reply.data.length < featureNetxLength){
|
if (reply.data.length < featureNetxLength) {
|
||||||
showToast("锁数据异常,请重试");
|
showToast("锁数据异常,请重试");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var featureValue = reply.data.sublist(index + 1, index + featureValueLength + 1);
|
var featureValue =
|
||||||
|
reply.data.sublist(index + 1, index + featureValueLength + 1);
|
||||||
String featureValueStr = asciiString(featureValue);
|
String featureValueStr = asciiString(featureValue);
|
||||||
state.featureValue = featureValueStr;
|
state.featureValue = featureValueStr;
|
||||||
// List allFeatureValueTwoList = charListChangeIntList(featureValue);
|
// List allFeatureValueTwoList = charListChangeIntList(featureValue);
|
||||||
@ -251,11 +255,12 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
var featureEnValLength = reply.data[index];
|
var featureEnValLength = reply.data[index];
|
||||||
// 使能锁特征值说明(本机启用的功能)
|
// 使能锁特征值说明(本机启用的功能)
|
||||||
var featureEnNextLength = index + featureEnValLength + 1;
|
var featureEnNextLength = index + featureEnValLength + 1;
|
||||||
if(reply.data.length < featureEnNextLength){
|
if (reply.data.length < featureEnNextLength) {
|
||||||
showToast("锁数据异常,请重试");
|
showToast("锁数据异常,请重试");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var featureEnVal = reply.data.sublist(index + 1, index + featureEnValLength + 1);
|
var featureEnVal =
|
||||||
|
reply.data.sublist(index + 1, index + featureEnValLength + 1);
|
||||||
String featureEnValStr = asciiString(featureEnVal);
|
String featureEnValStr = asciiString(featureEnVal);
|
||||||
state.featureSettingValue = featureEnValStr;
|
state.featureSettingValue = featureEnValStr;
|
||||||
// List allFeatureEnValTwoList = charListChangeIntList(featureEnVal);
|
// List allFeatureEnValTwoList = charListChangeIntList(featureEnVal);
|
||||||
@ -317,7 +322,8 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
Future<void> _getStarLockStatus() async {
|
Future<void> _getStarLockStatus() async {
|
||||||
// print("connectDeviceMacAddress:${BlueManage().connectDeviceMacAddress} connectDeviceName:${BlueManage().connectDeviceName}");
|
// print("connectDeviceMacAddress:${BlueManage().connectDeviceMacAddress} connectDeviceName:${BlueManage().connectDeviceName}");
|
||||||
// 进来之后首先连接
|
// 进来之后首先连接
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState state) async {
|
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState state) async {
|
||||||
if (state == BluetoothConnectionState.connected) {
|
if (state == BluetoothConnectionState.connected) {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
@ -351,19 +357,23 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
void startScanBlueList(){
|
void startScanBlueList() {
|
||||||
BlueManage().startScan(2000, (List<ScanResult> list){
|
BlueManage().startScan(2000, (List<ScanResult> list) {
|
||||||
state.devices.clear();
|
state.devices.clear();
|
||||||
for (int i = 0; i < list.length; i++) {
|
for (int i = 0; i < list.length; i++) {
|
||||||
ScanResult device = list[i];
|
ScanResult device = list[i];
|
||||||
if (((device.advertisementData.serviceUuids.isNotEmpty ? device.advertisementData.serviceUuids[0] : "").toString()[31] != "1")) {
|
if (((device.advertisementData.serviceUuids.isNotEmpty
|
||||||
|
? device.advertisementData.serviceUuids[0]
|
||||||
|
: "")
|
||||||
|
.toString()[31] !=
|
||||||
|
"1")) {
|
||||||
state.devices.add(list[i]);
|
state.devices.add(list[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void stopScanBlueList(){
|
void stopScanBlueList() {
|
||||||
BlueManage().disconnect();
|
BlueManage().disconnect();
|
||||||
BlueManage().stopScan();
|
BlueManage().stopScan();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user