48 lines
1.4 KiB
Dart
Executable File
48 lines
1.4 KiB
Dart
Executable File
|
|
import '../../../network/api_repository.dart';
|
|
import '../../../tools/baseGetXController.dart';
|
|
import 'appUnlockNeedMobileNetworkingLock_state.dart';
|
|
import 'selectLockListEntity.dart';
|
|
|
|
class AppUnlockNeedMobileNetworkingLockLogic extends BaseGetXController{
|
|
final AppUnlockNeedMobileNetworkingLockState state = AppUnlockNeedMobileNetworkingLockState();
|
|
|
|
//请求锁列表
|
|
Future<SelectLockListEntity> mockNetworkDataRequest() async {
|
|
final SelectLockListEntity entity = await ApiRepository.to.selectLockList(searchStr: state.searchController.text);
|
|
List<LockItemData> dataList = <LockItemData>[];
|
|
if (entity.errorCode!.codeIsSuccessful) {
|
|
dataList = entity.data!.list!;
|
|
state.lockItemList.value = dataList;
|
|
for (int i = 0; i < dataList.length; i++) {
|
|
final LockItemData itemData = dataList[i];
|
|
if (itemData.appUnlockOnline == 1) {
|
|
state.selectLockIdList.add(itemData.lockId);
|
|
}
|
|
}
|
|
}
|
|
return entity;
|
|
}
|
|
|
|
//APP开锁时需手机联网的锁
|
|
Future<void> setAppUnlockMustOnlineRequest() async {
|
|
final SelectLockListEntity entity =
|
|
await ApiRepository.to.setAppUnlockMustOnline(state.selectLockIdList);
|
|
if (entity.errorCode!.codeIsSuccessful) {
|
|
showToast('操作成功');
|
|
}
|
|
}
|
|
|
|
@override
|
|
void onReady() {
|
|
super.onReady();
|
|
|
|
// mockNetworkDataRequest();
|
|
}
|
|
|
|
@override
|
|
void onInit() {
|
|
super.onInit();
|
|
}
|
|
|
|
} |