Merge branch 'master' of https://gitee.com/weishaoyang/star_lock
This commit is contained in:
commit
326e5e9ef7
@ -1,6 +1,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import '../../mine/mine/starLockMine_logic.dart';
|
||||
@ -22,7 +23,8 @@ class StarLockLoginLogic extends BaseGetXController{
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
// await StoreService.to.saveLogInInfo(entity);
|
||||
stateMyLogic.saveLoginData(entity);
|
||||
Get.back();
|
||||
// Get.back();
|
||||
Get.toNamed(Routers.starLockMain);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.login!.tr,
|
||||
haveBack: true,
|
||||
haveBack: false,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
actionsList: [
|
||||
TextButton(
|
||||
|
||||
@ -16,7 +16,8 @@ import 'baseWidget.dart';
|
||||
import 'tools/store_service.dart';
|
||||
|
||||
void main() async {
|
||||
_setCommonServices();
|
||||
|
||||
await _setCommonServices();
|
||||
|
||||
// 设置国际化信息
|
||||
await _initTranslation();
|
||||
@ -138,5 +139,5 @@ Future _setCommonServices() async {
|
||||
await Get.putAsync(() => StoreService().init());
|
||||
await Get.putAsync(() => PlatformInfoService().init());
|
||||
await Get.putAsync(() => DeviceInfoService().init());
|
||||
Get.log(PlatformInfoService.to.info.version);
|
||||
// Get.log(PlatformInfoService.to.info.version);
|
||||
}
|
||||
478
star_lock/lib/main/lockMian/entity/lockInfoEntity.dart
Normal file
478
star_lock/lib/main/lockMian/entity/lockInfoEntity.dart
Normal file
@ -0,0 +1,478 @@
|
||||
class LockMainEntity {
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
LockInfoEntity? data;
|
||||
|
||||
LockMainEntity(
|
||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
LockMainEntity.fromJson(Map<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
data = json['data'] != null
|
||||
? LockInfoEntity.fromJson(json['data'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['errorCode'] = errorCode;
|
||||
data['description'] = description;
|
||||
data['errorMsg'] = errorMsg;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class LockInfoEntity {
|
||||
UserSettings? userSettings;
|
||||
bool? hasXmeyeLock;
|
||||
bool? hasMoreService;
|
||||
int? pages;
|
||||
List<KeyGroups>? keyGroups;
|
||||
bool? isReply;
|
||||
int? paidUserStatus;
|
||||
bool? hasAdvert;
|
||||
bool? hasAlexa;
|
||||
bool? isUserSettingCompleted;
|
||||
List<KeyInfos>? keyInfos;
|
||||
bool? hasPaidFeature;
|
||||
bool? hasCameraLock;
|
||||
bool? hasGoogleHome;
|
||||
int? pageNo;
|
||||
int? lastUpdateDate;
|
||||
|
||||
LockInfoEntity(
|
||||
{this.userSettings,
|
||||
this.hasXmeyeLock,
|
||||
this.hasMoreService,
|
||||
this.pages,
|
||||
this.keyGroups,
|
||||
this.isReply,
|
||||
this.paidUserStatus,
|
||||
this.hasAdvert,
|
||||
this.hasAlexa,
|
||||
this.isUserSettingCompleted,
|
||||
this.keyInfos,
|
||||
this.hasPaidFeature,
|
||||
this.hasCameraLock,
|
||||
this.hasGoogleHome,
|
||||
this.pageNo,
|
||||
this.lastUpdateDate});
|
||||
|
||||
LockInfoEntity.fromJson(Map<String, dynamic> json) {
|
||||
userSettings = json['userSettings'] != null
|
||||
? UserSettings.fromJson(json['userSettings'])
|
||||
: null;
|
||||
hasXmeyeLock = json['hasXmeyeLock'];
|
||||
hasMoreService = json['hasMoreService'];
|
||||
pages = json['pages'];
|
||||
if (json['keyGroups'] != null) {
|
||||
keyGroups = <KeyGroups>[];
|
||||
json['keyGroups'].forEach((v) {
|
||||
keyGroups!.add(KeyGroups.fromJson(v));
|
||||
});
|
||||
}
|
||||
isReply = json['isReply'];
|
||||
paidUserStatus = json['paidUserStatus'];
|
||||
hasAdvert = json['hasAdvert'];
|
||||
hasAlexa = json['hasAlexa'];
|
||||
isUserSettingCompleted = json['isUserSettingCompleted'];
|
||||
if (json['keyInfos'] != null) {
|
||||
keyInfos = <KeyInfos>[];
|
||||
json['keyInfos'].forEach((v) {
|
||||
keyInfos!.add(KeyInfos.fromJson(v));
|
||||
});
|
||||
}
|
||||
hasPaidFeature = json['hasPaidFeature'];
|
||||
hasCameraLock = json['hasCameraLock'];
|
||||
hasGoogleHome = json['hasGoogleHome'];
|
||||
pageNo = json['pageNo'];
|
||||
lastUpdateDate = json['lastUpdateDate'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (userSettings != null) {
|
||||
data['userSettings'] = userSettings!.toJson();
|
||||
}
|
||||
data['hasXmeyeLock'] = hasXmeyeLock;
|
||||
data['hasMoreService'] = hasMoreService;
|
||||
data['pages'] = pages;
|
||||
if (keyGroups != null) {
|
||||
data['keyGroups'] = keyGroups!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['isReply'] = isReply;
|
||||
data['paidUserStatus'] = paidUserStatus;
|
||||
data['hasAdvert'] = hasAdvert;
|
||||
data['hasAlexa'] = hasAlexa;
|
||||
data['isUserSettingCompleted'] = isUserSettingCompleted;
|
||||
if (keyInfos != null) {
|
||||
data['keyInfos'] = keyInfos!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['hasPaidFeature'] = hasPaidFeature;
|
||||
data['hasCameraLock'] = hasCameraLock;
|
||||
data['hasGoogleHome'] = hasGoogleHome;
|
||||
data['pageNo'] = pageNo;
|
||||
data['lastUpdateDate'] = lastUpdateDate;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class UserSettings {
|
||||
int? touchUnlockFlag;
|
||||
int? modifyManagePwdFlag;
|
||||
String? gesturePassword;
|
||||
int? resetFlag;
|
||||
int? delManagerFlag;
|
||||
int? hideExpiredAccessFlag;
|
||||
int? sendKeyFlag;
|
||||
int? viberateFlag;
|
||||
int? lockScreen;
|
||||
int? authorizeFlag;
|
||||
int? sendPwdFlag;
|
||||
int? alertToneFlag;
|
||||
int? status;
|
||||
|
||||
UserSettings(
|
||||
{this.touchUnlockFlag,
|
||||
this.modifyManagePwdFlag,
|
||||
this.gesturePassword,
|
||||
this.resetFlag,
|
||||
this.delManagerFlag,
|
||||
this.hideExpiredAccessFlag,
|
||||
this.sendKeyFlag,
|
||||
this.viberateFlag,
|
||||
this.lockScreen,
|
||||
this.authorizeFlag,
|
||||
this.sendPwdFlag,
|
||||
this.alertToneFlag,
|
||||
this.status});
|
||||
|
||||
UserSettings.fromJson(Map<String, dynamic> json) {
|
||||
touchUnlockFlag = json['touchUnlockFlag'];
|
||||
modifyManagePwdFlag = json['modifyManagePwdFlag'];
|
||||
gesturePassword = json['gesturePassword'];
|
||||
resetFlag = json['resetFlag'];
|
||||
delManagerFlag = json['delManagerFlag'];
|
||||
hideExpiredAccessFlag = json['hideExpiredAccessFlag'];
|
||||
sendKeyFlag = json['sendKeyFlag'];
|
||||
viberateFlag = json['viberateFlag'];
|
||||
lockScreen = json['lockScreen'];
|
||||
authorizeFlag = json['authorizeFlag'];
|
||||
sendPwdFlag = json['sendPwdFlag'];
|
||||
alertToneFlag = json['alertToneFlag'];
|
||||
status = json['status'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['touchUnlockFlag'] = touchUnlockFlag;
|
||||
data['modifyManagePwdFlag'] = modifyManagePwdFlag;
|
||||
data['gesturePassword'] = gesturePassword;
|
||||
data['resetFlag'] = resetFlag;
|
||||
data['delManagerFlag'] = delManagerFlag;
|
||||
data['hideExpiredAccessFlag'] = hideExpiredAccessFlag;
|
||||
data['sendKeyFlag'] = sendKeyFlag;
|
||||
data['viberateFlag'] = viberateFlag;
|
||||
data['lockScreen'] = lockScreen;
|
||||
data['authorizeFlag'] = authorizeFlag;
|
||||
data['sendPwdFlag'] = sendPwdFlag;
|
||||
data['alertToneFlag'] = alertToneFlag;
|
||||
data['status'] = status;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class KeyGroups {
|
||||
String? groupName;
|
||||
int? groupId;
|
||||
|
||||
KeyGroups({this.groupName, this.groupId});
|
||||
|
||||
KeyGroups.fromJson(Map<String, dynamic> json) {
|
||||
groupName = json['groupName'];
|
||||
groupId = json['groupId'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['groupName'] = groupName;
|
||||
data['groupId'] = groupId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class KeyInfos {
|
||||
int? lightingTime;
|
||||
int? privacyLock;
|
||||
int? keyGroupId;
|
||||
String? remarks;
|
||||
int? autoUnlock;
|
||||
String? noKeyPwd;
|
||||
int? isAttendance;
|
||||
String? keyStatus;
|
||||
int? faceAuthentication;
|
||||
int? sensitivity;
|
||||
int? date;
|
||||
int? appUnlockMustOnline;
|
||||
String? lockKey;
|
||||
int? resetButton;
|
||||
int? endDate;
|
||||
int? keyRight;
|
||||
int? electricQuantity;
|
||||
int? lockSound;
|
||||
int? specialValue;
|
||||
int? displayPasscode;
|
||||
int? lockId;
|
||||
int? doubleVerification;
|
||||
String? keyName;
|
||||
LockVersion? lockVersion;
|
||||
String? lockName;
|
||||
int? monitorFlag;
|
||||
Null? bondPassword;
|
||||
int? soundVolume;
|
||||
String? lockAlias;
|
||||
int? isFrozen;
|
||||
int? isRemoteUnlock;
|
||||
int? lockFlagPos;
|
||||
int? autoUnlockRssi;
|
||||
int? unlockDirection;
|
||||
int? isCameraEnable;
|
||||
int? startDate;
|
||||
String? keyGroupName;
|
||||
String? aesKeyStr;
|
||||
int? uid;
|
||||
int? passageMode;
|
||||
String? admin;
|
||||
int? keyId;
|
||||
String? adminPwd;
|
||||
String? deletePwd;
|
||||
int? timezoneRawOffSet;
|
||||
String? userType;
|
||||
int? validPwdNum;
|
||||
String? featureValue;
|
||||
int? adminUid;
|
||||
String? lockMac;
|
||||
String? wirelessKeypadFeatureValue;
|
||||
int? autoLockTime;
|
||||
int? tamperAlert;
|
||||
|
||||
KeyInfos(
|
||||
{this.lightingTime,
|
||||
this.privacyLock,
|
||||
this.keyGroupId,
|
||||
this.remarks,
|
||||
this.autoUnlock,
|
||||
this.noKeyPwd,
|
||||
this.isAttendance,
|
||||
this.keyStatus,
|
||||
this.faceAuthentication,
|
||||
this.sensitivity,
|
||||
this.date,
|
||||
this.appUnlockMustOnline,
|
||||
this.lockKey,
|
||||
this.resetButton,
|
||||
this.endDate,
|
||||
this.keyRight,
|
||||
this.electricQuantity,
|
||||
this.lockSound,
|
||||
this.specialValue,
|
||||
this.displayPasscode,
|
||||
this.lockId,
|
||||
this.doubleVerification,
|
||||
this.keyName,
|
||||
this.lockVersion,
|
||||
this.lockName,
|
||||
this.monitorFlag,
|
||||
this.bondPassword,
|
||||
this.soundVolume,
|
||||
this.lockAlias,
|
||||
this.isFrozen,
|
||||
this.isRemoteUnlock,
|
||||
this.lockFlagPos,
|
||||
this.autoUnlockRssi,
|
||||
this.unlockDirection,
|
||||
this.isCameraEnable,
|
||||
this.startDate,
|
||||
this.keyGroupName,
|
||||
this.aesKeyStr,
|
||||
this.uid,
|
||||
this.passageMode,
|
||||
this.admin,
|
||||
this.keyId,
|
||||
this.adminPwd,
|
||||
this.deletePwd,
|
||||
this.timezoneRawOffSet,
|
||||
this.userType,
|
||||
this.validPwdNum,
|
||||
this.featureValue,
|
||||
this.adminUid,
|
||||
this.lockMac,
|
||||
this.wirelessKeypadFeatureValue,
|
||||
this.autoLockTime,
|
||||
this.tamperAlert});
|
||||
|
||||
KeyInfos.fromJson(Map<String, dynamic> json) {
|
||||
lightingTime = json['lightingTime'];
|
||||
privacyLock = json['privacyLock'];
|
||||
keyGroupId = json['keyGroupId'];
|
||||
remarks = json['remarks'];
|
||||
autoUnlock = json['autoUnlock'];
|
||||
noKeyPwd = json['noKeyPwd'];
|
||||
isAttendance = json['isAttendance'];
|
||||
keyStatus = json['keyStatus'];
|
||||
faceAuthentication = json['faceAuthentication'];
|
||||
sensitivity = json['sensitivity'];
|
||||
date = json['date'];
|
||||
appUnlockMustOnline = json['appUnlockMustOnline'];
|
||||
lockKey = json['lockKey'];
|
||||
resetButton = json['resetButton'];
|
||||
endDate = json['endDate'];
|
||||
keyRight = json['keyRight'];
|
||||
electricQuantity = json['electricQuantity'];
|
||||
lockSound = json['lockSound'];
|
||||
specialValue = json['specialValue'];
|
||||
displayPasscode = json['displayPasscode'];
|
||||
lockId = json['lockId'];
|
||||
doubleVerification = json['doubleVerification'];
|
||||
keyName = json['keyName'];
|
||||
lockVersion = json['lockVersion'] != null
|
||||
? LockVersion.fromJson(json['lockVersion'])
|
||||
: null;
|
||||
lockName = json['lockName'];
|
||||
monitorFlag = json['monitorFlag'];
|
||||
bondPassword = json['bondPassword'];
|
||||
soundVolume = json['soundVolume'];
|
||||
lockAlias = json['lockAlias'];
|
||||
isFrozen = json['isFrozen'];
|
||||
isRemoteUnlock = json['isRemoteUnlock'];
|
||||
lockFlagPos = json['lockFlagPos'];
|
||||
autoUnlockRssi = json['autoUnlockRssi'];
|
||||
unlockDirection = json['unlockDirection'];
|
||||
isCameraEnable = json['isCameraEnable'];
|
||||
startDate = json['startDate'];
|
||||
keyGroupName = json['keyGroupName'];
|
||||
aesKeyStr = json['aesKeyStr'];
|
||||
uid = json['uid'];
|
||||
passageMode = json['passageMode'];
|
||||
admin = json['admin'];
|
||||
keyId = json['keyId'];
|
||||
adminPwd = json['adminPwd'];
|
||||
deletePwd = json['deletePwd'];
|
||||
timezoneRawOffSet = json['timezoneRawOffSet'];
|
||||
userType = json['userType'];
|
||||
validPwdNum = json['validPwdNum'];
|
||||
featureValue = json['featureValue'];
|
||||
adminUid = json['adminUid'];
|
||||
lockMac = json['lockMac'];
|
||||
wirelessKeypadFeatureValue = json['wirelessKeypadFeatureValue'];
|
||||
autoLockTime = json['autoLockTime'];
|
||||
tamperAlert = json['tamperAlert'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['lightingTime'] = lightingTime;
|
||||
data['privacyLock'] = privacyLock;
|
||||
data['keyGroupId'] = keyGroupId;
|
||||
data['remarks'] = remarks;
|
||||
data['autoUnlock'] = autoUnlock;
|
||||
data['noKeyPwd'] = noKeyPwd;
|
||||
data['isAttendance'] = isAttendance;
|
||||
data['keyStatus'] = keyStatus;
|
||||
data['faceAuthentication'] = faceAuthentication;
|
||||
data['sensitivity'] = sensitivity;
|
||||
data['date'] = date;
|
||||
data['appUnlockMustOnline'] = appUnlockMustOnline;
|
||||
data['lockKey'] = lockKey;
|
||||
data['resetButton'] = resetButton;
|
||||
data['endDate'] = endDate;
|
||||
data['keyRight'] = keyRight;
|
||||
data['electricQuantity'] = electricQuantity;
|
||||
data['lockSound'] = lockSound;
|
||||
data['specialValue'] = specialValue;
|
||||
data['displayPasscode'] = displayPasscode;
|
||||
data['lockId'] = lockId;
|
||||
data['doubleVerification'] = doubleVerification;
|
||||
data['keyName'] = keyName;
|
||||
if (lockVersion != null) {
|
||||
data['lockVersion'] = lockVersion!.toJson();
|
||||
}
|
||||
data['lockName'] = lockName;
|
||||
data['monitorFlag'] = monitorFlag;
|
||||
data['bondPassword'] = bondPassword;
|
||||
data['soundVolume'] = soundVolume;
|
||||
data['lockAlias'] = lockAlias;
|
||||
data['isFrozen'] = isFrozen;
|
||||
data['isRemoteUnlock'] = isRemoteUnlock;
|
||||
data['lockFlagPos'] = lockFlagPos;
|
||||
data['autoUnlockRssi'] = autoUnlockRssi;
|
||||
data['unlockDirection'] = unlockDirection;
|
||||
data['isCameraEnable'] = isCameraEnable;
|
||||
data['startDate'] = startDate;
|
||||
data['keyGroupName'] = keyGroupName;
|
||||
data['aesKeyStr'] = aesKeyStr;
|
||||
data['uid'] = uid;
|
||||
data['passageMode'] = passageMode;
|
||||
data['admin'] = admin;
|
||||
data['keyId'] = keyId;
|
||||
data['adminPwd'] = adminPwd;
|
||||
data['deletePwd'] = deletePwd;
|
||||
data['timezoneRawOffSet'] = timezoneRawOffSet;
|
||||
data['userType'] = userType;
|
||||
data['validPwdNum'] = validPwdNum;
|
||||
data['featureValue'] = featureValue;
|
||||
data['adminUid'] = adminUid;
|
||||
data['lockMac'] = lockMac;
|
||||
data['wirelessKeypadFeatureValue'] = wirelessKeypadFeatureValue;
|
||||
data['autoLockTime'] = autoLockTime;
|
||||
data['tamperAlert'] = tamperAlert;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class LockVersion {
|
||||
int? scene;
|
||||
int? protocolVersion;
|
||||
String? logoUrl;
|
||||
int? orgId;
|
||||
bool? showAdminKbpwdFlag;
|
||||
int? protocolType;
|
||||
int? groupId;
|
||||
|
||||
LockVersion(
|
||||
{this.scene,
|
||||
this.protocolVersion,
|
||||
this.logoUrl,
|
||||
this.orgId,
|
||||
this.showAdminKbpwdFlag,
|
||||
this.protocolType,
|
||||
this.groupId});
|
||||
|
||||
LockVersion.fromJson(Map<String, dynamic> json) {
|
||||
scene = json['scene'];
|
||||
protocolVersion = json['protocolVersion'];
|
||||
logoUrl = json['logoUrl'];
|
||||
orgId = json['orgId'];
|
||||
showAdminKbpwdFlag = json['showAdminKbpwdFlag'];
|
||||
protocolType = json['protocolType'];
|
||||
groupId = json['groupId'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['scene'] = scene;
|
||||
data['protocolVersion'] = protocolVersion;
|
||||
data['logoUrl'] = logoUrl;
|
||||
data['orgId'] = orgId;
|
||||
data['showAdminKbpwdFlag'] = showAdminKbpwdFlag;
|
||||
data['protocolType'] = protocolType;
|
||||
data['groupId'] = groupId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'lockMain_logic.dart';
|
||||
|
||||
class LockMainBinding extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.lazyPut(() => LockMainLogic());
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,41 @@
|
||||
import '../../network/api_repository.dart';
|
||||
import '../../tools/baseGetXController.dart';
|
||||
import 'lockMain_state.dart';
|
||||
|
||||
class LockMainLogic extends BaseGetXController {
|
||||
final LockMainState state = LockMainState();
|
||||
|
||||
void getLockInfo() async{
|
||||
var entity = await ApiRepository.to.getLockInfo(
|
||||
lastUpdateDate:DateTime.now().millisecondsSinceEpoch.toString(),
|
||||
pageNo:"1",
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
print("onReady()");
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
|
||||
getLockInfo();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,11 +1,8 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet_page.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
import '../../baseWidget.dart';
|
||||
@ -20,15 +17,15 @@ class StarLockMainPage extends StatefulWidget {
|
||||
@override
|
||||
State<StarLockMainPage> createState() => _StarLockMainPageState();
|
||||
}
|
||||
GlobalKey<_StarLockMainPageState> starLockMainKey = GlobalKey();
|
||||
|
||||
// GlobalKey<_StarLockMainPageState> starLockMainKey = GlobalKey();
|
||||
class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
|
||||
|
||||
final GlobalKey<ScaffoldState> _globalKey = GlobalKey();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
final logic = Get.put(LockMainLogic());
|
||||
final state = Get.find<LockMainLogic>().state;
|
||||
// final state = Get.find<LockMainLogic>().state;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF5F5F5),
|
||||
|
||||
@ -217,17 +217,15 @@ class SaveLockLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
void bindBlueAdmin() async{
|
||||
var lockData = "";
|
||||
var lockDataMap = {};
|
||||
lockDataMap['lockId'] = BlueManage().connectDeviceName;
|
||||
lockDataMap['lockMac'] = BlueManage().connectDeviceId;
|
||||
lockData = json.encode(lockDataMap);
|
||||
|
||||
var entity = await ApiRepository.to.bindingBlueAdmin(
|
||||
bindingDate:DateTime.now().millisecondsSinceEpoch.toString(),
|
||||
hotelMode:"2",
|
||||
lockAlias:state.aliName.value,
|
||||
lockData:lockData,
|
||||
lockData:lockDataMap,
|
||||
nbInitSuccess:"0",
|
||||
position:"113.918912, 22.653670",
|
||||
deviceNo:"123456"
|
||||
|
||||
@ -225,8 +225,4 @@ class _StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void onShow() {}
|
||||
|
||||
void onHide() {}
|
||||
}
|
||||
|
||||
@ -25,6 +25,9 @@ abstract class Api {
|
||||
'/key/modifyKeyNameForAdmin'; //编辑电子钥匙名字
|
||||
final String passwordKeyListURL = '/keyboardPwd/listSendRecords'; //密码钥匙列表
|
||||
final String passwordKeyResetURL = '/keyboardPwd/reset'; //密码钥匙重置
|
||||
|
||||
final String getLockInfoURL = '/lock/syncDataPage'; // 获取锁信息
|
||||
|
||||
final String passwordKeyGetURL = '/keyboardPwd/get'; //获取密码
|
||||
final String lockRecordsListURL = '/lockRecords/list'; //操作记录列表
|
||||
}
|
||||
|
||||
@ -231,7 +231,7 @@ class ApiProvider extends BaseProvider {
|
||||
String bindingDate,
|
||||
String hotelMode,
|
||||
String lockAlias,
|
||||
String lockData,
|
||||
Map lockData,
|
||||
String nbInitSuccess,
|
||||
String position,
|
||||
String deviceNo) =>
|
||||
@ -246,6 +246,18 @@ class ApiProvider extends BaseProvider {
|
||||
'position': position,
|
||||
'deviceNo': deviceNo
|
||||
}));
|
||||
|
||||
// 获取锁信息
|
||||
Future<Response> getLockInfo(
|
||||
String lastUpdateDate,
|
||||
String pageNo) =>
|
||||
post(
|
||||
getLockInfoURL.toUrl,
|
||||
jsonEncode({
|
||||
'lastUpdateDate': lastUpdateDate,
|
||||
"pageNo": pageNo,
|
||||
}));
|
||||
|
||||
Future<Response> passwordKeyList(
|
||||
String keyStatus,
|
||||
String lockId,
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import '../../tools/toast.dart';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import '../appRouters.dart';
|
||||
import 'api.dart';
|
||||
import 'request_interceptor.dart';
|
||||
import 'request_interceptor_log.dart';
|
||||
@ -53,7 +56,30 @@ class BaseProvider extends GetConnect with Api {
|
||||
statusText: res.statusText,
|
||||
);
|
||||
}
|
||||
print('得到的数据======>${res.bodyString}');
|
||||
print('得到的数据======>bodyString:${res.bodyString} body:${res.body} bodyBytes:${res.bodyBytes} status:${res.status} statusText:${res.statusText} statusCode:${res.statusCode}');
|
||||
getDataResult(res.body);
|
||||
return res;
|
||||
}
|
||||
|
||||
getDataResult(T){
|
||||
switch(T["errorCode"]){
|
||||
case 403:
|
||||
Get.offNamedUntil(Routers.starLockLoginPage, (route) => false);
|
||||
break;
|
||||
case 500:
|
||||
Toast.show(msg: "服务器错误");
|
||||
break;
|
||||
case 421:
|
||||
case 422:
|
||||
case 430:
|
||||
Toast.show(msg: T["errorMsg"]);
|
||||
break;
|
||||
case 425:
|
||||
Toast.show(msg: "用户不存在");
|
||||
break;
|
||||
case 10001:
|
||||
Toast.show(msg: "数据不存在");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
||||
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
||||
import '../login/login/entity/LoginEntity.dart';
|
||||
import '../login/register/entity/SendValidationCodeEntity.dart';
|
||||
import '../main/lockMian/entity/lockInfoEntity.dart';
|
||||
import '../mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
||||
import 'api_provider.dart';
|
||||
|
||||
@ -175,16 +176,22 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
// 绑定蓝牙管理员
|
||||
Future<SaveLockEntity> bindingBlueAdmin(
|
||||
{required String bindingDate,
|
||||
required String hotelMode,
|
||||
required String lockAlias,
|
||||
required String lockData,
|
||||
required String nbInitSuccess,
|
||||
required String position,
|
||||
required String deviceNo}) async {
|
||||
final res = await apiProvider.bindingBlueAdmin(bindingDate, hotelMode,
|
||||
lockAlias, lockData, nbInitSuccess, position, deviceNo);
|
||||
Future<SaveLockEntity> bindingBlueAdmin({
|
||||
required String bindingDate,
|
||||
required String hotelMode,
|
||||
required String lockAlias,
|
||||
required Map lockData,
|
||||
required String nbInitSuccess,
|
||||
required String position,
|
||||
required String deviceNo}) async {
|
||||
final res = await apiProvider.bindingBlueAdmin(
|
||||
bindingDate,
|
||||
hotelMode,
|
||||
lockAlias,
|
||||
lockData,
|
||||
nbInitSuccess,
|
||||
position,
|
||||
deviceNo);
|
||||
return SaveLockEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -239,6 +246,16 @@ class ApiRepository {
|
||||
return PasswordKeyListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取锁信息
|
||||
Future<LockMainEntity> getLockInfo({
|
||||
required String lastUpdateDate,
|
||||
required String pageNo}) async {
|
||||
final res = await apiProvider.getLockInfo(
|
||||
lastUpdateDate,
|
||||
pageNo);
|
||||
return LockMainEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
//获取密码
|
||||
Future<PasswordKeyEntity> getPasswordKey(
|
||||
String endDate,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user