Merge branch 'master' of https://gitee.com/weishaoyang/star_lock
# Conflicts: # star_lock/lib/appRouters.dart
This commit is contained in:
commit
5e106bec64
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
|
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
|
||||||
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
||||||
@ -15,6 +13,7 @@ import 'package:star_lock/mine/mineSet/authorizedAdministrator/addAuthorizedAdmi
|
|||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/adminDetailChangeDate_page.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/adminDetailChangeDate_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_page.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart';
|
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockChangeDate_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockList_page.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockList_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList_Page.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList_Page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_page.dart';
|
import 'package:star_lock/mine/mineSet/mineSet/mineSet_page.dart';
|
||||||
@ -164,10 +163,14 @@ abstract class Routers {
|
|||||||
static const passwordKeyManagePage = '/PasswordKeyManagePage'; // 密码钥匙
|
static const passwordKeyManagePage = '/PasswordKeyManagePage'; // 密码钥匙
|
||||||
static const passwordKeyDetailPage = '/PasswordKeyDetailPage'; // 密码钥匙详情
|
static const passwordKeyDetailPage = '/PasswordKeyDetailPage'; // 密码钥匙详情
|
||||||
static const otherTypeKeyListPage = '/OtherTypeKeyListPage'; // 卡、指纹、遥控钥匙列表
|
static const otherTypeKeyListPage = '/OtherTypeKeyListPage'; // 卡、指纹、遥控钥匙列表
|
||||||
static const otherTypeKeyDetailPage = '/OtherTypeKeyDetailPage'; // 卡、指纹、遥控钥匙详情
|
static const otherTypeKeyDetailPage =
|
||||||
static const otherTypeKeyManagePage = '/OtherTypeKeyManagePage'; // 卡、指纹、遥控钥匙添加
|
'/OtherTypeKeyDetailPage'; // 卡、指纹、遥控钥匙详情
|
||||||
static const otherTypeKeyChangeDatePage = '/OtherTypeKeyChangeDatePage'; // 卡、指纹、遥控钥匙详情修改日期
|
static const otherTypeKeyManagePage =
|
||||||
static const otherTypeKeyChangeValidityDatePage = '/OtherTypeKeyChangeValidityDatePage'; // 卡、指纹、遥控钥匙详情修改有效期
|
'/OtherTypeKeyManagePage'; // 卡、指纹、遥控钥匙添加
|
||||||
|
static const otherTypeKeyChangeDatePage =
|
||||||
|
'/OtherTypeKeyChangeDatePage'; // 卡、指纹、遥控钥匙详情修改日期
|
||||||
|
static const otherTypeKeyChangeValidityDatePage =
|
||||||
|
'/OtherTypeKeyChangeValidityDatePage'; // 卡、指纹、遥控钥匙详情修改有效期
|
||||||
|
|
||||||
static const addFingerprintTipPage = '/AddFingerprintTipPage'; // 添加指纹提示
|
static const addFingerprintTipPage = '/AddFingerprintTipPage'; // 添加指纹提示
|
||||||
static const addFingerprintPage = '/AddFingerprintPage'; // 添加指纹
|
static const addFingerprintPage = '/AddFingerprintPage'; // 添加指纹
|
||||||
@ -225,7 +228,8 @@ abstract class Routers {
|
|||||||
'/CheckingInSetHolidaysPage'; // 节假日设置
|
'/CheckingInSetHolidaysPage'; // 节假日设置
|
||||||
static const checkingInAddHolidaysPage = '/CheckingInAddHolidaysPage'; // 添加假日
|
static const checkingInAddHolidaysPage = '/CheckingInAddHolidaysPage'; // 添加假日
|
||||||
static const checkingInDetailPage = '/CheckingInDetailPage'; // 考勤详情
|
static const checkingInDetailPage = '/CheckingInDetailPage'; // 考勤详情
|
||||||
static const checkingInDeletHolidaysPage = '/CheckingInDeletHolidaysPage'; // 删除考勤
|
static const checkingInDeletHolidaysPage =
|
||||||
|
'/CheckingInDeletHolidaysPage'; // 删除考勤
|
||||||
|
|
||||||
static const mineSetPage = '/MineSetPage'; // 我的设置
|
static const mineSetPage = '/MineSetPage'; // 我的设置
|
||||||
static const mineMultiLanguagePage = '/MineMultiLanguagePage'; // 我的设置
|
static const mineMultiLanguagePage = '/MineMultiLanguagePage'; // 我的设置
|
||||||
@ -319,6 +323,8 @@ abstract class Routers {
|
|||||||
static const adminDetailChangeDatePage =
|
static const adminDetailChangeDatePage =
|
||||||
'/adminDetailChangeDatePage'; //管理员详情修改生效时间
|
'/adminDetailChangeDatePage'; //管理员详情修改生效时间
|
||||||
static const adminLockListPage = '/adminLockListPage'; //管理员详情的锁列表
|
static const adminLockListPage = '/adminLockListPage'; //管理员详情的锁列表
|
||||||
|
static const expireLockChangeDatePage =
|
||||||
|
'/expireLockChangeDatePage'; //即将到期列表有效期修改
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class AppRouters {
|
abstract class AppRouters {
|
||||||
@ -804,5 +810,8 @@ abstract class AppRouters {
|
|||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.lockAddressGaoDePage,
|
name: Routers.lockAddressGaoDePage,
|
||||||
page: () => const LockAddressGaoDePage())
|
page: () => const LockAddressGaoDePage())
|
||||||
|
GetPage(
|
||||||
|
name: Routers.expireLockChangeDatePage,
|
||||||
|
page: () => const ExpireLockChangeDatePage())
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../tools/store_service.dart';
|
import '../../tools/store_service.dart';
|
||||||
|
|
||||||
class StarLockLoginState{
|
class StarLockLoginState {
|
||||||
|
|
||||||
var passwordShow = true.obs;
|
var passwordShow = true.obs;
|
||||||
var agree = false.obs;
|
var agree = false.obs;
|
||||||
|
|
||||||
@ -23,8 +21,7 @@ class StarLockLoginState{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onClose() {
|
void onClose() {
|
||||||
emailOrPhoneController.dispose();
|
// emailOrPhoneController.dispose();
|
||||||
pwdController.dispose();
|
// pwdController.dispose();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/appUnlockNeedMobileNetworkingLock/selectLockListEntity.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/toast.dart';
|
||||||
|
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
import '../../../tools/commonItem.dart';
|
import '../../../tools/commonItem.dart';
|
||||||
@ -18,6 +22,16 @@ class APPUnlockNeedMobileNetworkingLockPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _APPUnlockNeedMobileNetworkingLockPageState
|
class _APPUnlockNeedMobileNetworkingLockPageState
|
||||||
extends State<APPUnlockNeedMobileNetworkingLockPage> {
|
extends State<APPUnlockNeedMobileNetworkingLockPage> {
|
||||||
|
List<LockItemData> lockItemList = [];
|
||||||
|
List selectLockIdList = [];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
mockNetworkDataRequest();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -73,19 +87,22 @@ class _APPUnlockNeedMobileNetworkingLockPageState
|
|||||||
SizedBox(height: 15.h),
|
SizedBox(height: 15.h),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: 10,
|
itemCount: lockItemList.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (c, index) {
|
||||||
return _gatewatListItem(
|
LockItemData itemData = lockItemList[index];
|
||||||
'images/mine/icon_mine_gatewayListMainIcon.png',
|
// itemData.isCheck = false;
|
||||||
"星锁网关",
|
return _gatewatListItem(itemData);
|
||||||
"在线",
|
|
||||||
"2", () {
|
|
||||||
// Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
|
||||||
});
|
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.sure!.tr, onClick: () {}),
|
btnName: TranslationLoader.lanKeys!.sure!.tr,
|
||||||
|
onClick: () {
|
||||||
|
if (selectLockIdList.isNotEmpty) {
|
||||||
|
setAppUnlockMustOnlineRequest();
|
||||||
|
} else {
|
||||||
|
Toast.show(msg: '请选择需设置的锁');
|
||||||
|
}
|
||||||
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
)
|
)
|
||||||
@ -93,10 +110,18 @@ class _APPUnlockNeedMobileNetworkingLockPageState
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _gatewatListItem(String lockTypeIcon, String gateWayName,
|
Widget _gatewatListItem(LockItemData itemData) {
|
||||||
String isOnline, String lockNumber, Function() action) {
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: action,
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
itemData.isCheck = !itemData.isCheck;
|
||||||
|
if (itemData.isCheck == true) {
|
||||||
|
selectLockIdList.add(itemData.lockId);
|
||||||
|
} else {
|
||||||
|
selectLockIdList.remove(itemData.lockId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 80.h,
|
height: 80.h,
|
||||||
margin: const EdgeInsets.only(bottom: 2),
|
margin: const EdgeInsets.only(bottom: 2),
|
||||||
@ -112,7 +137,9 @@ class _APPUnlockNeedMobileNetworkingLockPageState
|
|||||||
width: 15.w,
|
width: 15.w,
|
||||||
),
|
),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'images/icon_round_unSelet.png',
|
itemData.isCheck == true
|
||||||
|
? 'images/icon_round_selet.png'
|
||||||
|
: 'images/icon_round_unSelet.png',
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
height: 30.w,
|
height: 30.w,
|
||||||
),
|
),
|
||||||
@ -120,7 +147,7 @@ class _APPUnlockNeedMobileNetworkingLockPageState
|
|||||||
width: 10.w,
|
width: 10.w,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"MCBN01_8f3106",
|
itemData.lockAlias ?? "",
|
||||||
style: TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w600),
|
style: TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w600),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -128,4 +155,26 @@ class _APPUnlockNeedMobileNetworkingLockPageState
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//请求锁列表
|
||||||
|
Future<List<LockItemData>> mockNetworkDataRequest() async {
|
||||||
|
SelectLockListEntity entity = await ApiRepository.to.selectLockList();
|
||||||
|
List<LockItemData> dataList = [];
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
dataList = entity.data!.list!;
|
||||||
|
setState(() {
|
||||||
|
lockItemList = dataList;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return dataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
//APP开锁时需手机联网的锁
|
||||||
|
Future<void> setAppUnlockMustOnlineRequest() async {
|
||||||
|
SelectLockListEntity entity =
|
||||||
|
await ApiRepository.to.setAppUnlockMustOnline(selectLockIdList);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
Toast.show(msg: '操作成功');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,70 @@
|
|||||||
|
class SelectLockListEntity {
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
SelectLockListEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
SelectLockListEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
data = json['data'] != null ? Data.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 Data {
|
||||||
|
List<LockItemData>? list;
|
||||||
|
|
||||||
|
Data({this.list});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['list'] != null) {
|
||||||
|
list = <LockItemData>[];
|
||||||
|
json['list'].forEach((v) {
|
||||||
|
list!.add(LockItemData.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
if (list != null) {
|
||||||
|
data['list'] = list!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class LockItemData {
|
||||||
|
int? lockId;
|
||||||
|
String? lockAlias;
|
||||||
|
bool isCheck = false;
|
||||||
|
|
||||||
|
LockItemData({this.lockId, this.lockAlias, required this.isCheck});
|
||||||
|
|
||||||
|
LockItemData.fromJson(Map<String, dynamic> json) {
|
||||||
|
lockId = json['lockId'];
|
||||||
|
lockAlias = json['lockAlias'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['lockId'] = lockId;
|
||||||
|
data['lockAlias'] = lockAlias;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -113,46 +113,6 @@ class _AdminDetailChangeDatePage extends State<AdminDetailChangeDatePage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
//修改钥匙名称请求
|
|
||||||
Future<void> updateKeyDateRequest() async {
|
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate(
|
|
||||||
itemData.keyId.toString(),
|
|
||||||
itemData.lockId.toString(),
|
|
||||||
_failureDateTime.millisecondsSinceEpoch.toString(),
|
|
||||||
endDay,
|
|
||||||
'',
|
|
||||||
_effectiveDateTime.millisecondsSinceEpoch.toString(),
|
|
||||||
startDay,
|
|
||||||
weekDays);
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
|
||||||
print("修改要是名称成功啦啦啦啦啦");
|
|
||||||
Toast.show(msg: "修改成功");
|
|
||||||
setState(() {
|
|
||||||
Navigator.pop(context);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//更新密码请求
|
|
||||||
Future<void> updatePwdRequest() async {
|
|
||||||
PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey(
|
|
||||||
lockId,
|
|
||||||
pwdId,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
_effectiveDateTime.millisecondsSinceEpoch.toString(),
|
|
||||||
_failureDateTime.millisecondsSinceEpoch.toString(),
|
|
||||||
'');
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
|
||||||
Toast.show(msg: "修改成功");
|
|
||||||
setState(() {
|
|
||||||
Navigator.pop(context);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
String intToStr(int v) {
|
String intToStr(int v) {
|
||||||
return (v < 10) ? "0$v" : "$v";
|
return (v < 10) ? "0$v" : "$v";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -229,7 +229,7 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
|||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isOnRemote = !_isOnRemote;
|
_isOnRemote = !_isOnRemote;
|
||||||
updateAdministratorRequest();
|
updateAdministratorRequest(true);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -247,7 +247,7 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//更新管理员信息请求
|
//更新管理员信息请求
|
||||||
Future<void> updateAdministratorRequest() async {
|
Future<void> updateAdministratorRequest(bool isRemote) async {
|
||||||
String isRemoteUnlock = _isOnRemote == true ? '1' : '2';
|
String isRemoteUnlock = _isOnRemote == true ? '1' : '2';
|
||||||
ElectronicKeyListEntity entity = await ApiRepository.to.updateAdministrator(
|
ElectronicKeyListEntity entity = await ApiRepository.to.updateAdministrator(
|
||||||
itemData.uid.toString(),
|
itemData.uid.toString(),
|
||||||
@ -259,7 +259,9 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
|||||||
print("修改管理员信息成功啦啦啦啦啦");
|
print("修改管理员信息成功啦啦啦啦啦");
|
||||||
Toast.show(msg: "修改成功");
|
Toast.show(msg: "修改成功");
|
||||||
setState(() {
|
setState(() {
|
||||||
Navigator.pop(context);
|
if (isRemote) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -289,7 +291,7 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
|||||||
sureClick: () {
|
sureClick: () {
|
||||||
//发送编辑钥匙名称请求
|
//发送编辑钥匙名称请求
|
||||||
if (_changeNameController.text.isNotEmpty) {
|
if (_changeNameController.text.isNotEmpty) {
|
||||||
updateAdministratorRequest();
|
updateAdministratorRequest(false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cancelClick: () {
|
cancelClick: () {
|
||||||
|
|||||||
@ -0,0 +1,121 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_pickers/pickers.dart';
|
||||||
|
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/toast.dart';
|
||||||
|
|
||||||
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../../tools/commonItem.dart';
|
||||||
|
import '../../../../../tools/titleAppBar.dart';
|
||||||
|
import '../../../../../translations/trans_lib.dart';
|
||||||
|
|
||||||
|
class ExpireLockChangeDatePage extends StatefulWidget {
|
||||||
|
const ExpireLockChangeDatePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<ExpireLockChangeDatePage> createState() =>
|
||||||
|
_ExpireLockChangeDatePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ExpireLockChangeDatePageState extends State<ExpireLockChangeDatePage> {
|
||||||
|
ExpireLockItem itemData = ExpireLockItem();
|
||||||
|
|
||||||
|
String _selectEffectiveDate = ''; //生效时间
|
||||||
|
String _selectFailureDate = ''; //失效时间
|
||||||
|
late DateTime _effectiveDateTime;
|
||||||
|
late DateTime _failureDateTime;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
||||||
|
if (obj != null && (obj["itemData"] != null)) {
|
||||||
|
itemData = obj["itemData"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle:
|
||||||
|
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.periodValidity!.tr}",
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor,
|
||||||
|
actionsList: [
|
||||||
|
TextButton(
|
||||||
|
child: Text(
|
||||||
|
TranslationLoader.lanKeys!.sure!.tr,
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
updateKeyDateRequest();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: buildMainUI(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildMainUI() {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||||
|
rightTitle: _selectEffectiveDate,
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
|
onConfirm: (p) {
|
||||||
|
setState(() {
|
||||||
|
_selectEffectiveDate =
|
||||||
|
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
||||||
|
_effectiveDateTime = DateTime.parse(_selectEffectiveDate);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||||
|
rightTitle: _selectFailureDate,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
|
onConfirm: (p) {
|
||||||
|
setState(() {
|
||||||
|
_selectFailureDate =
|
||||||
|
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
||||||
|
_failureDateTime = DateTime.parse(_selectFailureDate);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改有效期请求
|
||||||
|
Future<void> updateKeyDateRequest() async {
|
||||||
|
KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate(
|
||||||
|
itemData.keyId.toString(),
|
||||||
|
itemData.lockId.toString(),
|
||||||
|
_failureDateTime.millisecondsSinceEpoch.toString(),
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
_effectiveDateTime.millisecondsSinceEpoch.toString(),
|
||||||
|
'', []);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
print("修改要是名称成功啦啦啦啦啦");
|
||||||
|
Toast.show(msg: "修改成功");
|
||||||
|
setState(() {
|
||||||
|
Navigator.pop(context);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String intToStr(int v) {
|
||||||
|
return (v < 10) ? "0$v" : "$v";
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -83,8 +83,8 @@ class _ExpireLockListPageState extends State<ExpireLockListPage> {
|
|||||||
Widget _electronicKeyItem(ExpireLockItem itemData) {
|
Widget _electronicKeyItem(ExpireLockItem itemData) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushNamed(context, Routers.ownedKeyListPage,
|
Navigator.pushNamed(context, Routers.expireLockChangeDatePage,
|
||||||
arguments: {'uid': itemData.uid});
|
arguments: {"itemData": itemData});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 90.h,
|
height: 90.h,
|
||||||
|
|||||||
86
star_lock/lib/mine/mineSet/mineSet/mineSet_logic.dart
Normal file
86
star_lock/lib/mine/mineSet/mineSet/mineSet_logic.dart
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/appRouters.dart';
|
||||||
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
||||||
|
import 'package:star_lock/tools/storage.dart';
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
|
import '../../../../tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class MineSetLogic extends BaseGetXController {
|
||||||
|
final MineSetState state = MineSetState();
|
||||||
|
//用户信息
|
||||||
|
Future<void> userSettingsInfoRequest() async {
|
||||||
|
var entity = await ApiRepository.to.userSettingsInfo();
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
state.userInfoData.value = entity.data!;
|
||||||
|
state.userSetting.value = entity.data!.userSettings!;
|
||||||
|
state.lockScreen.value = entity.data!.userSettings!.lockScreen!;
|
||||||
|
state.hideExpiredAccessFlag.value =
|
||||||
|
entity.data!.userSettings!.hideExpiredAccessFlag!;
|
||||||
|
|
||||||
|
//提示音
|
||||||
|
if (entity.data!.alertMode == 1) {
|
||||||
|
state.isPrompTone.value = true;
|
||||||
|
} else {
|
||||||
|
state.isPrompTone.value = false;
|
||||||
|
}
|
||||||
|
//触摸开锁
|
||||||
|
if (entity.data!.userSettings!.touchUnlockFlag! == 1) {
|
||||||
|
state.isTouchUnlock.value = true;
|
||||||
|
} else {
|
||||||
|
state.isTouchUnlock.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新提示音
|
||||||
|
Future<void> updatePrompToneRequest() async {
|
||||||
|
ExpireLockListEntity entity = await ApiRepository.to
|
||||||
|
.setAlertMode('1', state.isPrompTone.value == true ? '1' : '2');
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
userSettingsInfoRequest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//退出登录请求
|
||||||
|
Future<void> userLogoutRequest() async {
|
||||||
|
LoginEntity entity = await ApiRepository.to.userLogout();
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
logOut();
|
||||||
|
Get.offNamedUntil(Routers.starLockLoginPage, (route) => false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
///退出登录
|
||||||
|
void logOut() async {
|
||||||
|
await Storage.setString('userLoginData', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新触摸开锁
|
||||||
|
Future<void> updateTouchUnlockRequest() async {
|
||||||
|
ExpireLockListEntity entity = await ApiRepository.to
|
||||||
|
.setTouchUnlockFlag(state.isTouchUnlock.value == true ? '1' : '2');
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
userSettingsInfoRequest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
// TODO: implement onReady
|
||||||
|
super.onReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
// TODO: implement onClose
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,17 +2,13 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
|
||||||
|
|
||||||
import '../../../appRouters.dart';
|
import '../../../appRouters.dart';
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
import '../../../tools/commonItem.dart';
|
import '../../../tools/commonItem.dart';
|
||||||
import '../../../tools/submitBtn.dart';
|
import '../../../tools/submitBtn.dart';
|
||||||
import '../../../tools/titleAppBar.dart';
|
import '../../../tools/titleAppBar.dart';
|
||||||
import '../../../translations/trans_lib.dart';
|
import '../../../translations/trans_lib.dart';
|
||||||
import 'entity/userSettingInfoEntity.dart';
|
|
||||||
|
|
||||||
class MineSetPage extends StatefulWidget {
|
class MineSetPage extends StatefulWidget {
|
||||||
const MineSetPage({Key? key}) : super(key: key);
|
const MineSetPage({Key? key}) : super(key: key);
|
||||||
@ -22,219 +18,204 @@ class MineSetPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _MineSetPageState extends State<MineSetPage> {
|
class _MineSetPageState extends State<MineSetPage> {
|
||||||
late bool _isPrompTone = false; //提示音
|
final logic = Get.put(MineSetLogic());
|
||||||
late bool _isTouchUnlock = false; //触摸开锁
|
final state = Get.find<MineSetLogic>().state;
|
||||||
late bool _isPushNotification = false; //消息推送
|
|
||||||
late UserSettingInfoData _userInfoData;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
_userInfoData = UserSettingInfoData();
|
logic.userSettingsInfoRequest();
|
||||||
userSettingsInfoRequest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: TranslationLoader.lanKeys!.moreSet!.tr,
|
barTitle: TranslationLoader.lanKeys!.moreSet!.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Column(
|
body: SingleChildScrollView(
|
||||||
children: [
|
child: getListDataView(),
|
||||||
Expanded(
|
),
|
||||||
child: ListView(
|
);
|
||||||
children: [
|
}
|
||||||
CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.prompTone!.tr,
|
Widget getListDataView() {
|
||||||
rightTitle: "",
|
return Column(
|
||||||
isHaveLine: true,
|
children: [
|
||||||
isHaveRightWidget: true,
|
CommonItem(
|
||||||
rightWidget: SizedBox(
|
leftTitel: TranslationLoader.lanKeys!.prompTone!.tr,
|
||||||
width: 60.w, height: 50.h, child: _switch(0))),
|
rightTitle: "",
|
||||||
CommonItem(
|
isHaveLine: true,
|
||||||
leftTitel: TranslationLoader.lanKeys!.touchUnlock!.tr,
|
isHaveRightWidget: true,
|
||||||
rightTitle: "",
|
rightWidget: SizedBox(
|
||||||
isHaveLine: true,
|
width: 60.w,
|
||||||
isHaveRightWidget: true,
|
height: 50.h,
|
||||||
rightWidget: SizedBox(
|
child: Obx(() => _isPrompToneSwitch()))),
|
||||||
width: 60.w, height: 50.h, child: _switch(1))),
|
CommonItem(
|
||||||
CommonItem(
|
leftTitel: TranslationLoader.lanKeys!.touchUnlock!.tr,
|
||||||
leftTitel:
|
rightTitle: "",
|
||||||
TranslationLoader.lanKeys!.pushNotification!.tr,
|
isHaveLine: true,
|
||||||
rightTitle: "",
|
isHaveRightWidget: true,
|
||||||
isHaveRightWidget: true,
|
rightWidget: SizedBox(
|
||||||
rightWidget: SizedBox(
|
width: 60.w,
|
||||||
width: 60.w, height: 50.h, child: _switch(2))),
|
height: 50.h,
|
||||||
SizedBox(
|
child: Obx(() => _isTouchUnlockSwitch()))),
|
||||||
height: 10.h,
|
CommonItem(
|
||||||
),
|
leftTitel: TranslationLoader.lanKeys!.pushNotification!.tr,
|
||||||
CommonItem(
|
rightTitle: "",
|
||||||
leftTitel:
|
isHaveRightWidget: true,
|
||||||
TranslationLoader.lanKeys!.lockUserManagement!.tr,
|
rightWidget: SizedBox(
|
||||||
rightTitle: "",
|
width: 60.w,
|
||||||
isHaveLine: true,
|
height: 50.h,
|
||||||
isHaveDirection: true,
|
child: Obx(() => _isPushNotificationSwitch()))),
|
||||||
action: () {
|
SizedBox(
|
||||||
Navigator.pushNamed(
|
height: 10.h,
|
||||||
context, Routers.lockUserManageLisPage);
|
),
|
||||||
}),
|
CommonItem(
|
||||||
CommonItem(
|
leftTitel: TranslationLoader.lanKeys!.lockUserManagement!.tr,
|
||||||
leftTitel: TranslationLoader.lanKeys!.authorizedAdmin!.tr,
|
rightTitle: "",
|
||||||
rightTitle: "",
|
isHaveLine: true,
|
||||||
isHaveLine: true,
|
isHaveDirection: true,
|
||||||
isHaveDirection: true,
|
action: () {
|
||||||
action: () {
|
Navigator.pushNamed(context, Routers.lockUserManageLisPage);
|
||||||
Navigator.pushNamed(
|
}),
|
||||||
context, Routers.authorizedAdministratorListPage);
|
CommonItem(
|
||||||
}),
|
leftTitel: TranslationLoader.lanKeys!.authorizedAdmin!.tr,
|
||||||
//by DaisyWu 新增--权限管理
|
rightTitle: "",
|
||||||
CommonItem(
|
isHaveLine: true,
|
||||||
leftTitel:
|
isHaveDirection: true,
|
||||||
TranslationLoader.lanKeys!.authorityManagement!.tr,
|
action: () {
|
||||||
rightTitle: "",
|
Navigator.pushNamed(
|
||||||
isHaveLine: true,
|
context, Routers.authorizedAdministratorListPage);
|
||||||
isHaveDirection: true,
|
}),
|
||||||
action: () {
|
//by DaisyWu 新增--权限管理
|
||||||
Navigator.pushNamed(
|
CommonItem(
|
||||||
context, Routers.authorityManagementPage);
|
leftTitel: TranslationLoader.lanKeys!.authorityManagement!.tr,
|
||||||
}),
|
rightTitle: "",
|
||||||
CommonItem(
|
isHaveLine: true,
|
||||||
leftTitel: TranslationLoader.lanKeys!.lockGroup!.tr,
|
isHaveDirection: true,
|
||||||
rightTitle: "",
|
action: () {
|
||||||
isHaveLine: true,
|
Navigator.pushNamed(context, Routers.authorityManagementPage);
|
||||||
isHaveDirection: true,
|
}),
|
||||||
action: () {
|
CommonItem(
|
||||||
Navigator.pushNamed(context, Routers.lockGroupListPage);
|
leftTitel: TranslationLoader.lanKeys!.lockGroup!.tr,
|
||||||
}),
|
rightTitle: "",
|
||||||
CommonItem(
|
isHaveLine: true,
|
||||||
leftTitel:
|
isHaveDirection: true,
|
||||||
TranslationLoader.lanKeys!.transferSmartLock!.tr,
|
action: () {
|
||||||
rightTitle: "",
|
Navigator.pushNamed(context, Routers.lockGroupListPage);
|
||||||
isHaveLine: true,
|
}),
|
||||||
isHaveDirection: true,
|
CommonItem(
|
||||||
action: () {
|
leftTitel: TranslationLoader.lanKeys!.transferSmartLock!.tr,
|
||||||
Navigator.pushNamed(
|
rightTitle: "",
|
||||||
context, Routers.transferSmartLockPage);
|
isHaveLine: true,
|
||||||
}),
|
isHaveDirection: true,
|
||||||
CommonItem(
|
action: () {
|
||||||
leftTitel: TranslationLoader.lanKeys!.transferGateway!.tr,
|
Navigator.pushNamed(context, Routers.transferSmartLockPage);
|
||||||
rightTitle: "",
|
}),
|
||||||
isHaveDirection: true,
|
CommonItem(
|
||||||
action: () {
|
leftTitel: TranslationLoader.lanKeys!.transferGateway!.tr,
|
||||||
Navigator.pushNamed(
|
rightTitle: "",
|
||||||
context, Routers.selectGetewayListPage);
|
isHaveDirection: true,
|
||||||
}),
|
action: () {
|
||||||
SizedBox(
|
Navigator.pushNamed(context, Routers.selectGetewayListPage);
|
||||||
height: 10.h,
|
}),
|
||||||
),
|
SizedBox(
|
||||||
CommonItem(
|
height: 10.h,
|
||||||
leftTitel: TranslationLoader.lanKeys!.multiLanguage!.tr,
|
),
|
||||||
rightTitle: "简体中文",
|
CommonItem(
|
||||||
isHaveLine: true,
|
leftTitel: TranslationLoader.lanKeys!.multiLanguage!.tr,
|
||||||
isHaveDirection: true,
|
rightTitle: "简体中文",
|
||||||
action: () {
|
isHaveLine: true,
|
||||||
Navigator.pushNamed(
|
isHaveDirection: true,
|
||||||
context, Routers.mineMultiLanguagePage);
|
action: () {
|
||||||
}),
|
Navigator.pushNamed(context, Routers.mineMultiLanguagePage);
|
||||||
CommonItem(
|
}),
|
||||||
leftTitel: TranslationLoader.lanKeys!.lockScreen!.tr,
|
Obx(() => CommonItem(
|
||||||
rightTitle: _userInfoData.userSettings != null
|
leftTitel: TranslationLoader.lanKeys!.lockScreen!.tr,
|
||||||
? (_userInfoData.userSettings!.lockScreen == 1
|
rightTitle: (state.lockScreen.value == 1
|
||||||
? TranslationLoader.lanKeys!.opened!.tr
|
? TranslationLoader.lanKeys!.opened!.tr
|
||||||
: TranslationLoader.lanKeys!.closed!.tr)
|
: TranslationLoader.lanKeys!.closed!.tr),
|
||||||
: TranslationLoader.lanKeys!.closed!.tr,
|
isHaveLine: true,
|
||||||
isHaveLine: true,
|
isHaveDirection: true,
|
||||||
isHaveDirection: true,
|
action: () {
|
||||||
action: () {
|
Navigator.pushNamed(context, Routers.lockScreenPage,
|
||||||
Navigator.pushNamed(context, Routers.lockScreenPage,
|
arguments: {'isOn': state.lockScreen.value}).then((value) {
|
||||||
arguments: {
|
logic.userSettingsInfoRequest();
|
||||||
'isOn': _userInfoData.userSettings!.lockScreen
|
});
|
||||||
}).then((value) {
|
})),
|
||||||
userSettingsInfoRequest();
|
Obx(() => CommonItem(
|
||||||
});
|
leftTitel:
|
||||||
}),
|
TranslationLoader.lanKeys!.hideInvalidUnlockPermissions!.tr,
|
||||||
CommonItem(
|
rightTitle: (state.hideExpiredAccessFlag.value == 1
|
||||||
leftTitel: TranslationLoader
|
? TranslationLoader.lanKeys!.opened!.tr
|
||||||
.lanKeys!.hideInvalidUnlockPermissions!.tr,
|
: TranslationLoader.lanKeys!.closed!.tr),
|
||||||
rightTitle: _userInfoData.userSettings != null
|
isHaveLine: true,
|
||||||
? (_userInfoData
|
isHaveDirection: true,
|
||||||
.userSettings!.hideExpiredAccessFlag ==
|
action: () {
|
||||||
1
|
Navigator.pushNamed(
|
||||||
? TranslationLoader.lanKeys!.opened!.tr
|
context, Routers.hideInvalidUnlockPermissionsPage,
|
||||||
: TranslationLoader.lanKeys!.closed!.tr)
|
arguments: {'isOn': state.hideExpiredAccessFlag.value})
|
||||||
: TranslationLoader.lanKeys!.closed!.tr,
|
.then((value) {
|
||||||
isHaveLine: true,
|
logic.userSettingsInfoRequest();
|
||||||
isHaveDirection: true,
|
});
|
||||||
action: () {
|
})),
|
||||||
Navigator.pushNamed(
|
CommonItem(
|
||||||
context, Routers.hideInvalidUnlockPermissionsPage,
|
leftTitel: TranslationLoader
|
||||||
arguments: {
|
.lanKeys!.appUnlockRequiresMobilePhoneAccessToTheLock!.tr,
|
||||||
'isOn': _userInfoData
|
rightTitle: "",
|
||||||
.userSettings!.hideExpiredAccessFlag
|
isHaveLine: true,
|
||||||
}).then((value) {
|
isHaveDirection: true,
|
||||||
userSettingsInfoRequest();
|
action: () {
|
||||||
});
|
Navigator.pushNamed(
|
||||||
}),
|
context, Routers.aPPUnlockNeedMobileNetworkingLockPage);
|
||||||
CommonItem(
|
}),
|
||||||
leftTitel: TranslationLoader.lanKeys!
|
SizedBox(
|
||||||
.appUnlockRequiresMobilePhoneAccessToTheLock!.tr,
|
height: 10.h,
|
||||||
rightTitle: "",
|
),
|
||||||
isHaveLine: true,
|
CommonItem(
|
||||||
isHaveDirection: true,
|
leftTitel: "Amazon Alexa",
|
||||||
action: () {
|
rightTitle: "",
|
||||||
Navigator.pushNamed(context,
|
isHaveLine: true,
|
||||||
Routers.aPPUnlockNeedMobileNetworkingLockPage);
|
isHaveDirection: true,
|
||||||
}),
|
action: () {}),
|
||||||
SizedBox(
|
CommonItem(
|
||||||
height: 10.h,
|
leftTitel: "Google Home",
|
||||||
),
|
rightTitle: "",
|
||||||
CommonItem(
|
isHaveLine: true,
|
||||||
leftTitel: "Amazon Alexa",
|
isHaveDirection: true,
|
||||||
rightTitle: "",
|
action: () {}),
|
||||||
isHaveLine: true,
|
// CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){
|
||||||
isHaveDirection: true,
|
//
|
||||||
action: () {}),
|
// }),
|
||||||
CommonItem(
|
SizedBox(
|
||||||
leftTitel: "Google Home",
|
height: 50.h,
|
||||||
rightTitle: "",
|
),
|
||||||
isHaveLine: true,
|
// CommonItem(leftTitel:TranslationLoader.lanKeys!.about!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
|
||||||
isHaveDirection: true,
|
//
|
||||||
action: () {}),
|
// }),
|
||||||
// CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){
|
// SizedBox(height: 10.h,),
|
||||||
//
|
// CommonItem(leftTitel:TranslationLoader.lanKeys!.userAgreement!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
|
||||||
// }),
|
//
|
||||||
SizedBox(
|
// }),
|
||||||
height: 50.h,
|
// CommonItem(leftTitel:TranslationLoader.lanKeys!.privacyPolicy!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
|
||||||
),
|
//
|
||||||
// CommonItem(leftTitel:TranslationLoader.lanKeys!.about!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
|
// }),
|
||||||
//
|
// CommonItem(leftTitel:TranslationLoader.lanKeys!.personalInformationCollectionList!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
|
||||||
// }),
|
//
|
||||||
// SizedBox(height: 10.h,),
|
// }),
|
||||||
// CommonItem(leftTitel:TranslationLoader.lanKeys!.userAgreement!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
|
// CommonItem(leftTitel:TranslationLoader.lanKeys!.applicationPermissionDescription!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
|
||||||
//
|
//
|
||||||
// }),
|
// }),
|
||||||
// CommonItem(leftTitel:TranslationLoader.lanKeys!.privacyPolicy!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
|
// CommonItem(leftTitel:TranslationLoader.lanKeys!.thirdPartyInformationSharingList!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
|
||||||
//
|
//
|
||||||
// }),
|
// }),
|
||||||
// CommonItem(leftTitel:TranslationLoader.lanKeys!.personalInformationCollectionList!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
|
keyBottomWidget()
|
||||||
//
|
],
|
||||||
// }),
|
);
|
||||||
// CommonItem(leftTitel:TranslationLoader.lanKeys!.applicationPermissionDescription!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
|
|
||||||
//
|
|
||||||
// }),
|
|
||||||
// CommonItem(leftTitel:TranslationLoader.lanKeys!.thirdPartyInformationSharingList!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
|
|
||||||
//
|
|
||||||
// }),
|
|
||||||
keyBottomWidget()
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget keyBottomWidget() {
|
Widget keyBottomWidget() {
|
||||||
@ -243,7 +224,10 @@ class _MineSetPageState extends State<MineSetPage> {
|
|||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.logout!.tr,
|
btnName: TranslationLoader.lanKeys!.logout!.tr,
|
||||||
isDelete: true,
|
isDelete: true,
|
||||||
onClick: () {}),
|
onClick: () {
|
||||||
|
//退出登录
|
||||||
|
logic.userLogoutRequest();
|
||||||
|
}),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(right: 30.w),
|
padding: EdgeInsets.only(right: 30.w),
|
||||||
// color: Colors.red,
|
// color: Colors.red,
|
||||||
@ -268,76 +252,40 @@ class _MineSetPageState extends State<MineSetPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//用户信息
|
CupertinoSwitch _isPrompToneSwitch() {
|
||||||
Future<void> userSettingsInfoRequest() async {
|
|
||||||
UserSettingInfoEntity entity = await ApiRepository.to.userSettingsInfo();
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
|
||||||
setState(() {
|
|
||||||
_userInfoData = entity.data!;
|
|
||||||
//提示音
|
|
||||||
if (_userInfoData.alertMode == 1) {
|
|
||||||
_isPrompTone = true;
|
|
||||||
} else {
|
|
||||||
_isPrompTone = false;
|
|
||||||
}
|
|
||||||
//触摸开锁
|
|
||||||
if (_userInfoData.userSettings!.touchUnlockFlag! == 1) {
|
|
||||||
_isTouchUnlock = true;
|
|
||||||
} else {
|
|
||||||
_isTouchUnlock = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//更新提示音
|
|
||||||
Future<void> updatePrompToneRequest() async {
|
|
||||||
ExpireLockListEntity entity = await ApiRepository.to
|
|
||||||
.setAlertMode('1', _isPrompTone == true ? '1' : '2');
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
|
||||||
setState(() {
|
|
||||||
userSettingsInfoRequest();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//更新触摸开锁
|
|
||||||
Future<void> updateTouchUnlockRequest() async {
|
|
||||||
ExpireLockListEntity entity = await ApiRepository.to
|
|
||||||
.setTouchUnlockFlag(_isTouchUnlock == true ? '1' : '2');
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
|
||||||
setState(() {
|
|
||||||
userSettingsInfoRequest();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CupertinoSwitch _switch(int switchIndex) {
|
|
||||||
bool isOn = false;
|
|
||||||
if (switchIndex == 0) {
|
|
||||||
isOn = _isPrompTone;
|
|
||||||
} else if (switchIndex == 1) {
|
|
||||||
isOn = _isTouchUnlock;
|
|
||||||
} else if (switchIndex == 2) {
|
|
||||||
isOn = _isPushNotification;
|
|
||||||
}
|
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: isOn,
|
value: state.isPrompTone.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
state.isPrompTone.value = !state.isPrompTone.value;
|
||||||
if (switchIndex == 0) {
|
logic.updatePrompToneRequest();
|
||||||
_isPrompTone = !_isPrompTone;
|
},
|
||||||
updatePrompToneRequest();
|
);
|
||||||
} else if (switchIndex == 1) {
|
}
|
||||||
_isTouchUnlock = !_isTouchUnlock;
|
|
||||||
updateTouchUnlockRequest();
|
CupertinoSwitch _isTouchUnlockSwitch() {
|
||||||
} else if (switchIndex == 2) {
|
return CupertinoSwitch(
|
||||||
_isPushNotification = !_isPushNotification;
|
activeColor: CupertinoColors.activeBlue,
|
||||||
}
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
});
|
thumbColor: CupertinoColors.white,
|
||||||
|
value: state.isTouchUnlock.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
state.isTouchUnlock.value = !state.isTouchUnlock.value;
|
||||||
|
logic.updateTouchUnlockRequest();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
CupertinoSwitch _isPushNotificationSwitch() {
|
||||||
|
return CupertinoSwitch(
|
||||||
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
|
thumbColor: CupertinoColors.white,
|
||||||
|
value: state.isPushNotification.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
state.isPushNotification.value = !state.isPushNotification.value;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
14
star_lock/lib/mine/mineSet/mineSet/mineSet_state.dart
Normal file
14
star_lock/lib/mine/mineSet/mineSet/mineSet_state.dart
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
||||||
|
|
||||||
|
class MineSetState {
|
||||||
|
final userInfoData = UserSettingInfoData().obs;
|
||||||
|
final userSetting = UserSettings().obs;
|
||||||
|
|
||||||
|
var isPrompTone = false.obs; //提示音
|
||||||
|
var isTouchUnlock = false.obs; //触摸开锁
|
||||||
|
var isPushNotification = false.obs; //消息推送
|
||||||
|
|
||||||
|
var lockScreen = 2.obs; //锁屏
|
||||||
|
var hideExpiredAccessFlag = 2.obs; //隐藏无效开锁
|
||||||
|
}
|
||||||
@ -116,4 +116,8 @@ abstract class Api {
|
|||||||
final String setAlertModeURL = '/user/setAlertMode'; //提示音
|
final String setAlertModeURL = '/user/setAlertMode'; //提示音
|
||||||
final String setTouchUnlockFlagURL = '/user/setTouchUnlockFlag'; //触摸开锁
|
final String setTouchUnlockFlagURL = '/user/setTouchUnlockFlag'; //触摸开锁
|
||||||
final String changeSettingsURL = '/user/changeSettings'; //锁屏/隐藏无效开锁权限
|
final String changeSettingsURL = '/user/changeSettings'; //锁屏/隐藏无效开锁权限
|
||||||
|
final String selectLockListURL = '/room/listForTransfer'; //选择锁列表
|
||||||
|
final String setAppUnlockMustOnlineURL =
|
||||||
|
'/room/setAppUnlockMustOnline'; //APP开锁时需手机联网的锁
|
||||||
|
final String userLogoutURL = '/user/logout'; //退出登录
|
||||||
}
|
}
|
||||||
|
|||||||
@ -422,6 +422,13 @@ class ApiProvider extends BaseProvider {
|
|||||||
Future<Response> lockGroupList(String type) =>
|
Future<Response> lockGroupList(String type) =>
|
||||||
post(lockGroupListURL.toUrl, jsonEncode({'type': type}));
|
post(lockGroupListURL.toUrl, jsonEncode({'type': type}));
|
||||||
|
|
||||||
|
Future<Response> selectLockList() =>
|
||||||
|
post(selectLockListURL.toUrl, jsonEncode({}));
|
||||||
|
|
||||||
|
//APP开锁时需手机联网的锁
|
||||||
|
Future<Response> setAppUnlockMustOnline(List lockIdList) => post(
|
||||||
|
setAppUnlockMustOnlineURL.toUrl, jsonEncode({'lockIdList': lockIdList}));
|
||||||
|
|
||||||
Future<Response> deleteElectronicKey(String keyId) =>
|
Future<Response> deleteElectronicKey(String keyId) =>
|
||||||
post(deleteElectronicKeyURL.toUrl, jsonEncode({'keyId': keyId}));
|
post(deleteElectronicKeyURL.toUrl, jsonEncode({'keyId': keyId}));
|
||||||
|
|
||||||
@ -1150,6 +1157,9 @@ class ApiProvider extends BaseProvider {
|
|||||||
'countryCode': countryCode,
|
'countryCode': countryCode,
|
||||||
'usernameType': usernameType
|
'usernameType': usernameType
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
//退出登录
|
||||||
|
Future<Response> userLogout() => get(userLogoutURL.toUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ExtensionString on String {
|
extension ExtensionString on String {
|
||||||
|
|||||||
@ -5,13 +5,14 @@ import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity
|
|||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/basicInformation/KeyDetailEntity.dart';
|
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/basicInformation/KeyDetailEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/LockGroupListEntity.dart';
|
|
||||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/appUnlockNeedMobileNetworkingLock/selectLockListEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetailEntity.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetailEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/keyListByUserEntity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/keyListByUserEntity.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
||||||
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
||||||
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
||||||
import '../login/login/entity/LoginEntity.dart';
|
import '../login/login/entity/LoginEntity.dart';
|
||||||
@ -34,7 +35,6 @@ import '../main/lockDetail/otherTypeKey/addICCard/addICCard_entity.dart';
|
|||||||
import '../main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart';
|
import '../main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart';
|
||||||
import '../main/lockMian/entity/lockInfoEntity.dart';
|
import '../main/lockMian/entity/lockInfoEntity.dart';
|
||||||
import '../mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
import '../mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
||||||
import '../mine/mineSet/mineSet/entity/userSettingInfoEntity.dart';
|
|
||||||
import '../mine/mineSet/transferGateway/selectGetewayList_entity.dart';
|
import '../mine/mineSet/transferGateway/selectGetewayList_entity.dart';
|
||||||
import '../mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_entity.dart';
|
import '../mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_entity.dart';
|
||||||
import '../mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_entity.dart';
|
import '../mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_entity.dart';
|
||||||
@ -417,6 +417,18 @@ class ApiRepository {
|
|||||||
return MassSendLockGroupListEntity.fromJson(res.body);
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//选择锁列表
|
||||||
|
Future<SelectLockListEntity> selectLockList() async {
|
||||||
|
final res = await apiProvider.selectLockList();
|
||||||
|
return SelectLockListEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
//APP开锁时需手机联网的锁
|
||||||
|
Future<SelectLockListEntity> setAppUnlockMustOnline(List lockIdList) async {
|
||||||
|
final res = await apiProvider.setAppUnlockMustOnline(lockIdList);
|
||||||
|
return SelectLockListEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
//删除电子钥匙
|
//删除电子钥匙
|
||||||
Future<ElectronicKeyListEntity> deleteElectronicKey(String keyId) async {
|
Future<ElectronicKeyListEntity> deleteElectronicKey(String keyId) async {
|
||||||
final res = await apiProvider.deleteElectronicKey(keyId);
|
final res = await apiProvider.deleteElectronicKey(keyId);
|
||||||
@ -1062,6 +1074,12 @@ class ApiRepository {
|
|||||||
return LoginEntity.fromJson(res.body);
|
return LoginEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 退出登录
|
||||||
|
Future<LoginEntity> userLogout() async {
|
||||||
|
final res = await apiProvider.userLogout();
|
||||||
|
return LoginEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
// 获取转移锁锁列表
|
// 获取转移锁锁列表
|
||||||
Future<TransferSmartLockEntity> getTransferLockListData() async {
|
Future<TransferSmartLockEntity> getTransferLockListData() async {
|
||||||
final res = await apiProvider.getTransferLockListData();
|
final res = await apiProvider.getTransferLockListData();
|
||||||
@ -1098,8 +1116,8 @@ class ApiRepository {
|
|||||||
// 转移网关确认
|
// 转移网关确认
|
||||||
Future<RecipientInformationEntity> transferGatewayConfirmInfoData(
|
Future<RecipientInformationEntity> transferGatewayConfirmInfoData(
|
||||||
{required String receiverUserid,
|
{required String receiverUserid,
|
||||||
required String type,
|
required String type,
|
||||||
required String countryCode}) async {
|
required String countryCode}) async {
|
||||||
final res = await apiProvider.transferGatewayConfirmInfoData(
|
final res = await apiProvider.transferGatewayConfirmInfoData(
|
||||||
receiverUserid, type, countryCode);
|
receiverUserid, type, countryCode);
|
||||||
return RecipientInformationEntity.fromJson(res.body);
|
return RecipientInformationEntity.fromJson(res.body);
|
||||||
@ -1108,8 +1126,8 @@ class ApiRepository {
|
|||||||
// 转移智能锁
|
// 转移智能锁
|
||||||
Future<RecipientInformationEntity> transferGatewayInfoData(
|
Future<RecipientInformationEntity> transferGatewayInfoData(
|
||||||
{required String receiverUserid,
|
{required String receiverUserid,
|
||||||
required List plugIdList,
|
required List plugIdList,
|
||||||
required String countryCode}) async {
|
required String countryCode}) async {
|
||||||
final res = await apiProvider.transferGatewayInfoData(
|
final res = await apiProvider.transferGatewayInfoData(
|
||||||
receiverUserid, plugIdList, countryCode);
|
receiverUserid, plugIdList, countryCode);
|
||||||
return RecipientInformationEntity.fromJson(res.body);
|
return RecipientInformationEntity.fromJson(res.body);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user