bug:1001991 没有获取锁信息成功时,不允许对锁进行设置操作
This commit is contained in:
parent
e22a510307
commit
49d2797619
@ -75,6 +75,10 @@ class LockSetInfoData {
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
bool isValid() {
|
||||
return lockId != null;
|
||||
}
|
||||
}
|
||||
|
||||
class LockStatus {
|
||||
@ -717,11 +721,19 @@ class CatEyeModeConfig {
|
||||
// 从 JSON 数据构造对象
|
||||
factory CatEyeModeConfig.fromJson(Map<String, dynamic> json) {
|
||||
return CatEyeModeConfig(
|
||||
recordMode: json['recordMode'] != null ? int.tryParse(json['recordMode'].toString()) : null,
|
||||
recordMode: json['recordMode'] != null
|
||||
? int.tryParse(json['recordMode'].toString())
|
||||
: null,
|
||||
recordTime: json['recordTime'],
|
||||
realTimeMode: json['realTimeMode'] != null ? int.tryParse(json['realTimeMode'].toString()) : null,
|
||||
recordEndTime: json['recordEndTime'] != null ? int.tryParse(json['recordEndTime'].toString()) : null,
|
||||
recordStartTime: json['recordStartTime'] != null ? int.tryParse(json['recordStartTime'].toString()) : null,
|
||||
realTimeMode: json['realTimeMode'] != null
|
||||
? int.tryParse(json['realTimeMode'].toString())
|
||||
: null,
|
||||
recordEndTime: json['recordEndTime'] != null
|
||||
? int.tryParse(json['recordEndTime'].toString())
|
||||
: null,
|
||||
recordStartTime: json['recordStartTime'] != null
|
||||
? int.tryParse(json['recordStartTime'].toString())
|
||||
: null,
|
||||
detectionDistance: json['detectionDistance'],
|
||||
);
|
||||
}
|
||||
|
||||
@ -102,6 +102,10 @@ class _LockSetPageState extends State<LockSetPage>
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
if (!state.lockSetInfoData.value.isValid()) {
|
||||
EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr);
|
||||
return;
|
||||
}
|
||||
Get.toNamed(Routers.basicInformationPage,
|
||||
arguments: <String, LockSetInfoData>{
|
||||
'lockSetInfoData': state.lockSetInfoData.value
|
||||
@ -154,6 +158,10 @@ class _LockSetPageState extends State<LockSetPage>
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
if (!state.lockSetInfoData.value.isValid()) {
|
||||
EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr);
|
||||
return;
|
||||
}
|
||||
Get.toNamed(Routers.lockTimePage,
|
||||
arguments: <String, LockSetInfoData>{
|
||||
'lockSetInfoData': state.lockSetInfoData.value
|
||||
@ -166,6 +174,10 @@ class _LockSetPageState extends State<LockSetPage>
|
||||
btnName: '删除'.tr,
|
||||
isDelete: true,
|
||||
onClick: () async {
|
||||
if (!state.lockSetInfoData.value.isValid()) {
|
||||
EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr);
|
||||
return;
|
||||
}
|
||||
// logic.deletUserAction();
|
||||
// logic.deletLockInfoData();
|
||||
// showDeletAlertDialog(context);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user