Merge branch 'master' of https://gitee.com/weishaoyang/star_lock
# Conflicts: # star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart
This commit is contained in:
commit
cd3f405138
22
star_lock/lib/common/XSConstantMacro/XSConstantMacro.dart
Normal file
22
star_lock/lib/common/XSConstantMacro/XSConstantMacro.dart
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/basicInformation/KeyDetailEntity.dart';
|
||||||
|
import 'package:star_lock/network/api.dart';
|
||||||
|
|
||||||
|
class XSConstantMacro {
|
||||||
|
// 网页的宏定义网址
|
||||||
|
static String baseWebURL = Api.baseAddress; //base地址
|
||||||
|
static String introduceURL = '$baseWebURL/app/introduce'; //介绍页
|
||||||
|
static String userAgreementURL = '$baseWebURL/app/userAgreement'; //用户协议
|
||||||
|
static String privacyPolicyURL = '$baseWebURL/app/privacy'; //隐私政策
|
||||||
|
static String collectionListURL =
|
||||||
|
'$baseWebURL/app/personalInformationCollectionList'; //个人信息收集清单
|
||||||
|
static String thirdPartyInfShareListURL =
|
||||||
|
'$baseWebURL/app/thirdPartyInformationSharingList'; //第三方信息共享清单
|
||||||
|
static String appPermissionDescURL =
|
||||||
|
'$baseWebURL/app/applicationPermissionDescription'; //应用权限说明
|
||||||
|
|
||||||
|
// 钥匙类型 keyType 1-永久 2-限期 3-单次 4-循环
|
||||||
|
static int keyTypeLong = 1;
|
||||||
|
static int keyTypeTime = 2;
|
||||||
|
static int keyTypeOnce = 3;
|
||||||
|
static int keyTypeLoop = 4;
|
||||||
|
}
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_state.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class AuthorizedAdminListLogic extends BaseGetXController {
|
||||||
|
final AuthorizedAdminListState state = AuthorizedAdminListState();
|
||||||
|
|
||||||
|
//请求电子钥匙列表
|
||||||
|
Future<List<ElectronicKeyListItem>> mockNetworkDataRequest() async {
|
||||||
|
ElectronicKeyListEntity entity = await ApiRepository.to.electronicKeyList(
|
||||||
|
'0',
|
||||||
|
state.keyInfo.value.keyId.toString(),
|
||||||
|
'',
|
||||||
|
state.keyInfo.value.lockId.toString(),
|
||||||
|
'',
|
||||||
|
state.pageNum.toString(),
|
||||||
|
state.pageSize.toString(),
|
||||||
|
'0',
|
||||||
|
'0',
|
||||||
|
state.searchStr.value);
|
||||||
|
List<ElectronicKeyListItem> dataList = [];
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
print("电子钥匙列表成功:${entity.data?.itemList}");
|
||||||
|
if (entity.data != null) {
|
||||||
|
dataList = entity.data!.itemList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
state.itemDataList.value = dataList;
|
||||||
|
return dataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
// TODO: implement onReady
|
||||||
|
super.onReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
// TODO: implement onClose
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,11 +1,11 @@
|
|||||||
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/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_logic.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
|
||||||
import 'package:star_lock/tools/noData.dart';
|
import 'package:star_lock/tools/noData.dart';
|
||||||
|
import 'package:star_lock/tools/storage.dart';
|
||||||
|
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
@ -22,97 +22,62 @@ class AuthorizedAdminListPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
||||||
late KeyInfos keyInfo;
|
final logic = Get.put(AuthorizedAdminListLogic());
|
||||||
late LockMainEntity lockMainEntity;
|
final state = Get.find<AuthorizedAdminListLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
mockRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> mockRequest() async {
|
||||||
|
// 获取是否是演示模式 演示模式不获取接口
|
||||||
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
|
if (isDemoMode == false) {
|
||||||
|
logic.mockNetworkDataRequest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
|
||||||
if (obj != null && (obj["lockMainEntity"] != null)) {
|
|
||||||
lockMainEntity = obj["lockMainEntity"];
|
|
||||||
}
|
|
||||||
if (obj != null && (obj["keyInfo"] != null)) {
|
|
||||||
keyInfo = obj["keyInfo"];
|
|
||||||
}
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: TranslationLoader.lanKeys!.authorizedAdmin!.tr,
|
barTitle: TranslationLoader.lanKeys!.authorizedAdmin!.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
),
|
),
|
||||||
body: FutureBuilder<List<ElectronicKeyListItem>>(
|
body: Column(
|
||||||
future: mockNetworkDataRequest(),
|
children: [
|
||||||
builder: (BuildContext context,
|
Expanded(
|
||||||
AsyncSnapshot<List<ElectronicKeyListItem>> snapshot) {
|
child: Obx(() => state.itemDataList.value.isEmpty
|
||||||
//请求结束
|
? const NoData()
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
: _buildMainUI(state.itemDataList.value))),
|
||||||
if (snapshot.hasError) {
|
SizedBox(
|
||||||
//请求失败
|
height: 20.h,
|
||||||
return const Text('请求失败');
|
),
|
||||||
} else {
|
AddBottomWhiteBtn(
|
||||||
//请求成功
|
btnName: TranslationLoader.lanKeys!.addAuthorizedAdmin!.tr,
|
||||||
final List<ElectronicKeyListItem> itemData = snapshot.data!;
|
onClick: () {
|
||||||
|
Navigator.pushNamed(context, Routers.authorizedAdminManagePage,
|
||||||
return Column(
|
arguments: {
|
||||||
children: [
|
"lockMainEntity": state.lockMainEntity.value,
|
||||||
Expanded(child: _buildMainUI(itemData)),
|
"keyInfo": state.keyInfo.value
|
||||||
SizedBox(
|
}).then((val) {
|
||||||
height: 20.h,
|
if (val != null) {
|
||||||
),
|
logic.mockNetworkDataRequest();
|
||||||
AddBottomWhiteBtn(
|
setState(() {});
|
||||||
btnName:
|
}
|
||||||
TranslationLoader.lanKeys!.addAuthorizedAdmin!.tr,
|
});
|
||||||
onClick: () {
|
},
|
||||||
Navigator.pushNamed(
|
),
|
||||||
context, Routers.authorizedAdminManagePage,
|
SizedBox(
|
||||||
arguments: {
|
height: 64.h,
|
||||||
"lockMainEntity": lockMainEntity,
|
)
|
||||||
"keyInfo": keyInfo
|
],
|
||||||
}).then((val) {
|
));
|
||||||
if (val != null) {
|
|
||||||
mockNetworkDataRequest();
|
|
||||||
setState(() {});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 64.h,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//请求未结束 显示loading
|
|
||||||
return Container();
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//请求授权管理员列表 跟电子钥匙列表的接口一样,但必须在参数中加keyRight=1为授权管理员
|
|
||||||
Future<List<ElectronicKeyListItem>> mockNetworkDataRequest() async {
|
|
||||||
ElectronicKeyListEntity entity = await ApiRepository.to.electronicKeyList(
|
|
||||||
'0',
|
|
||||||
keyInfo.keyId.toString(),
|
|
||||||
'',
|
|
||||||
keyInfo.lockId.toString(),
|
|
||||||
'',
|
|
||||||
'1',
|
|
||||||
'20',
|
|
||||||
'0',
|
|
||||||
'1');
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
|
||||||
print("电子钥匙列表成功:${entity.data?.itemList}");
|
|
||||||
}
|
|
||||||
if (entity.data != null) {
|
|
||||||
return entity.data!.itemList;
|
|
||||||
} else {
|
|
||||||
List<ElectronicKeyListItem> dataList = [];
|
|
||||||
return dataList;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMainUI(itemData) {
|
Widget _buildMainUI(itemData) {
|
||||||
@ -142,7 +107,12 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
return _electronicKeyItem('images/controls_user.png',
|
return _electronicKeyItem('images/controls_user.png',
|
||||||
indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
|
indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
|
||||||
Navigator.pushNamed(context, Routers.electronicKeyDetailPage,
|
Navigator.pushNamed(context, Routers.electronicKeyDetailPage,
|
||||||
arguments: {'itemData': indexEntity});
|
arguments: {'itemData': indexEntity}).then((val) {
|
||||||
|
if (val != null) {
|
||||||
|
logic.mockNetworkDataRequest();
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -150,7 +120,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
//使用期限
|
//使用期限
|
||||||
String getUseDateStr(ElectronicKeyListItem indexEntity) {
|
String getUseDateStr(ElectronicKeyListItem indexEntity) {
|
||||||
String useDateStr = '';
|
String useDateStr = '';
|
||||||
if (indexEntity.keyType == 1) {
|
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||||
//限期
|
//限期
|
||||||
DateTime startDateStr =
|
DateTime startDateStr =
|
||||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
||||||
@ -158,15 +128,15 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
||||||
useDateStr =
|
useDateStr =
|
||||||
'${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}';
|
'${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}';
|
||||||
} else if (indexEntity.keyType == 2) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||||
//永久
|
//永久
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 永久';
|
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 永久';
|
||||||
} else if (indexEntity.keyType == 3) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||||
//单次
|
//单次
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
||||||
} else if (indexEntity.keyType == 4) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||||
//循环
|
//循环
|
||||||
useDateStr = '循环';
|
useDateStr = '循环';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,18 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
|
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
|
class AuthorizedAdminListState {
|
||||||
|
final keyInfo = KeyInfos().obs;
|
||||||
|
final lockMainEntity = LockMainEntity().obs;
|
||||||
|
var pageNum = 1.obs; //请求页码
|
||||||
|
final pageSize = 20.obs; //请求每页数据条数
|
||||||
|
final itemDataList = <ElectronicKeyListItem>[].obs;
|
||||||
|
final searchStr = ''.obs;
|
||||||
|
|
||||||
|
AuthorizedAdminListState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
lockMainEntity.value = map["lockMainEntity"];
|
||||||
|
keyInfo.value = map["keyInfo"];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,12 +2,12 @@ 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/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/jh_pop_menus.dart';
|
import 'package:star_lock/tools/jh_pop_menus.dart';
|
||||||
import 'package:star_lock/tools/showCupertinoAlert.dart';
|
|
||||||
import 'package:star_lock/tools/toast.dart';
|
import 'package:star_lock/tools/toast.dart';
|
||||||
|
|
||||||
import '../../../../../appRouters.dart';
|
import '../../../../../appRouters.dart';
|
||||||
@ -141,7 +141,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
//使用期限
|
//使用期限
|
||||||
String getUseDateStr(ElectronicKeyListItem indexEntity) {
|
String getUseDateStr(ElectronicKeyListItem indexEntity) {
|
||||||
String useDateStr = '';
|
String useDateStr = '';
|
||||||
if (indexEntity.keyType == 1) {
|
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||||
//限期
|
//限期
|
||||||
DateTime startDateStr =
|
DateTime startDateStr =
|
||||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
||||||
@ -149,15 +149,15 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
||||||
useDateStr =
|
useDateStr =
|
||||||
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
|
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
|
||||||
} else if (indexEntity.keyType == 2) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||||
//永久
|
//永久
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 永久';
|
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 永久';
|
||||||
} else if (indexEntity.keyType == 3) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||||
//单次
|
//单次
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
||||||
} else if (indexEntity.keyType == 4) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||||
//循环
|
//循环
|
||||||
useDateStr = '循环';
|
useDateStr = '循环';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,16 +18,17 @@ class ElectronicKeyListLogic extends BaseGetXController {
|
|||||||
state.pageNum.toString(),
|
state.pageNum.toString(),
|
||||||
state.pageSize.toString(),
|
state.pageSize.toString(),
|
||||||
'0',
|
'0',
|
||||||
'0');
|
'0',
|
||||||
|
state.searchController.text);
|
||||||
|
List<ElectronicKeyListItem> dataList = [];
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("电子钥匙列表成功:${entity.data?.itemList}");
|
print("电子钥匙列表成功:${entity.data?.itemList}");
|
||||||
|
if (entity.data != null) {
|
||||||
|
dataList = entity.data!.itemList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (entity.data != null) {
|
state.itemDataList.value = dataList;
|
||||||
return entity.data!.itemList;
|
return dataList;
|
||||||
} else {
|
|
||||||
List<ElectronicKeyListItem> dataList = [];
|
|
||||||
return dataList;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//电子钥匙重置请求
|
//电子钥匙重置请求
|
||||||
|
|||||||
@ -3,9 +3,11 @@ 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:pull_to_refresh/pull_to_refresh.dart';
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||||
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_logic.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_logic.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
import 'package:star_lock/tools/noData.dart';
|
import 'package:star_lock/tools/noData.dart';
|
||||||
|
import 'package:star_lock/tools/storage.dart';
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
@ -23,104 +25,79 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
final logic = Get.put(ElectronicKeyListLogic());
|
final logic = Get.put(ElectronicKeyListLogic());
|
||||||
final state = Get.find<ElectronicKeyListLogic>().state;
|
final state = Get.find<ElectronicKeyListLogic>().state;
|
||||||
late RefreshController _refreshController;
|
late RefreshController _refreshController;
|
||||||
late List<ElectronicKeyListItem> itemDataList = [];
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_refreshController = RefreshController(initialRefresh: true);
|
_refreshController = RefreshController(initialRefresh: true);
|
||||||
|
|
||||||
|
mockRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> mockRequest() async {
|
||||||
|
// 获取是否是演示模式 演示模式不获取接口
|
||||||
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
|
if (isDemoMode == false) {
|
||||||
|
logic.mockNetworkDataRequest();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@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!.electronicKey!.tr,
|
barTitle: TranslationLoader.lanKeys!.electronicKey!.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
actionsList: [
|
actionsList: [
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
TranslationLoader.lanKeys!.reset!.tr,
|
TranslationLoader.lanKeys!.reset!.tr,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
_showDialog(context);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onPressed: () {
|
],
|
||||||
_showDialog(context);
|
),
|
||||||
},
|
body: Column(
|
||||||
),
|
children: [
|
||||||
],
|
_searchWidget(),
|
||||||
),
|
SizedBox(
|
||||||
body: FutureBuilder<List<ElectronicKeyListItem>>(
|
height: 20.h,
|
||||||
future: logic.mockNetworkDataRequest(),
|
),
|
||||||
builder: (BuildContext context,
|
Expanded(
|
||||||
AsyncSnapshot<List<ElectronicKeyListItem>> snapshot) {
|
child: Obx(() => state.itemDataList.value.isEmpty
|
||||||
//请求结束
|
? const NoData()
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
: _buildMainUI(state.itemDataList.value))),
|
||||||
if (snapshot.hasError) {
|
AddBottomWhiteBtn(
|
||||||
//请求失败
|
btnName: TranslationLoader.lanKeys!.sendKey!.tr,
|
||||||
return const Text('请求失败');
|
onClick: () {
|
||||||
} else {
|
Navigator.pushNamed(
|
||||||
//请求成功
|
context, Routers.sendElectronicKeyManagePage, arguments: {
|
||||||
itemDataList = snapshot.data!;
|
"lockMainEntity": state.lockMainEntity.value,
|
||||||
|
"keyInfo": state.keyInfo.value
|
||||||
return Column(
|
}).then((val) {
|
||||||
children: [
|
if (val != null) {
|
||||||
_searchWidget(),
|
logic.mockNetworkDataRequest();
|
||||||
SizedBox(
|
setState(() {});
|
||||||
height: 20.h,
|
}
|
||||||
),
|
});
|
||||||
Expanded(
|
},
|
||||||
child: itemDataList.isEmpty
|
),
|
||||||
? const NoData()
|
SizedBox(
|
||||||
: SmartRefresher(
|
height: 64.h,
|
||||||
controller: _refreshController,
|
)
|
||||||
onRefresh: _refresh,
|
],
|
||||||
onLoading: _loadMore,
|
));
|
||||||
header: ClassicHeader(
|
|
||||||
height: 45.h,
|
|
||||||
releaseText: '松开手刷新',
|
|
||||||
refreshingText: '刷新中',
|
|
||||||
completeText: '刷新完成',
|
|
||||||
failedText: '刷新失败',
|
|
||||||
idleText: '下拉刷新',
|
|
||||||
),
|
|
||||||
child: _buildMainUI(itemDataList),
|
|
||||||
)),
|
|
||||||
AddBottomWhiteBtn(
|
|
||||||
btnName: TranslationLoader.lanKeys!.sendKey!.tr,
|
|
||||||
onClick: () {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context, Routers.sendElectronicKeyManagePage,
|
|
||||||
arguments: {
|
|
||||||
"lockMainEntity": state.lockMainEntity.value,
|
|
||||||
"keyInfo": state.keyInfo.value
|
|
||||||
}).then((val) {
|
|
||||||
if (val != null) {
|
|
||||||
logic.mockNetworkDataRequest();
|
|
||||||
setState(() {});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 64.h,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//请求未结束 显示loading
|
|
||||||
return Container();
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///加载更多函数
|
///加载更多函数
|
||||||
Future<void> _loadMore() async {
|
Future<void> _loadMore() async {
|
||||||
if (state.pageNum.value == 1) {
|
if (state.pageNum.value == 1) {
|
||||||
if (itemDataList.length < 10) {
|
if (state.itemDataList.value.length < 10) {
|
||||||
_refreshController.loadComplete();
|
_refreshController.loadComplete();
|
||||||
} else {
|
} else {
|
||||||
state.pageNum.value++;
|
state.pageNum.value++;
|
||||||
@ -152,7 +129,10 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
// controller: _controller,
|
// controller: _controller,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
|
controller: state.searchController,
|
||||||
|
onSubmitted: (value) {
|
||||||
|
logic.mockNetworkDataRequest();
|
||||||
|
},
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
//输入里面输入文字内边距设置
|
//输入里面输入文字内边距设置
|
||||||
contentPadding: const EdgeInsets.only(
|
contentPadding: const EdgeInsets.only(
|
||||||
@ -208,7 +188,6 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
;
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
separatorBuilder: (BuildContext context, int index) {
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
@ -223,7 +202,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
//使用期限
|
//使用期限
|
||||||
String getUseDateStr(ElectronicKeyListItem indexEntity) {
|
String getUseDateStr(ElectronicKeyListItem indexEntity) {
|
||||||
String useDateStr = '';
|
String useDateStr = '';
|
||||||
if (indexEntity.keyType == 1) {
|
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||||
//限期
|
//限期
|
||||||
DateTime startDateStr =
|
DateTime startDateStr =
|
||||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
||||||
@ -231,15 +210,15 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
||||||
useDateStr =
|
useDateStr =
|
||||||
'${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}';
|
'${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}';
|
||||||
} else if (indexEntity.keyType == 2) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||||
//永久
|
//永久
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 永久';
|
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 永久';
|
||||||
} else if (indexEntity.keyType == 3) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||||
//单次
|
//单次
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
||||||
} else if (indexEntity.keyType == 4) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||||
//循环
|
//循环
|
||||||
useDateStr = '循环';
|
useDateStr = '循环';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,15 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
|
||||||
|
|
||||||
class ElectronicKeyListState {
|
class ElectronicKeyListState {
|
||||||
|
TextEditingController searchController = TextEditingController(); //邮箱/手机号输入框
|
||||||
final keyInfo = KeyInfos().obs;
|
final keyInfo = KeyInfos().obs;
|
||||||
final lockMainEntity = LockMainEntity().obs;
|
final lockMainEntity = LockMainEntity().obs;
|
||||||
var pageNum = 1.obs; //请求页码
|
var pageNum = 1.obs; //请求页码
|
||||||
final pageSize = 20.obs; //请求每页数据条数
|
final pageSize = 20.obs; //请求每页数据条数
|
||||||
|
final itemDataList = <ElectronicKeyListItem>[].obs;
|
||||||
|
|
||||||
ElectronicKeyListState() {
|
ElectronicKeyListState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
|
|||||||
@ -13,22 +13,20 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//发送钥匙请求
|
//发送钥匙请求
|
||||||
Future<void> sendElectronicKeyRequest(BuildContext widgetContext) async {
|
Future<void> sendElectronicKeyRequest(BuildContext widgetContext) async {
|
||||||
String getFailureDateTime = '0';
|
|
||||||
String getEffectiveDateTime = '0';
|
|
||||||
String lockID = state.keyInfo.value.lockId.toString();
|
String lockID = state.keyInfo.value.lockId.toString();
|
||||||
String getKeyType = (int.parse(state.type.value) + 1).toString();
|
String getKeyType = (int.parse(state.type.value) + 1).toString();
|
||||||
if (state.type.value == '0') {
|
if (state.type.value == '0') {
|
||||||
getFailureDateTime =
|
state.failureTimestamp.value =
|
||||||
state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
state.failureDateTime.value.millisecondsSinceEpoch;
|
||||||
getEffectiveDateTime =
|
state.effectiveTimestamp.value =
|
||||||
state.effectiveDateTime.value.millisecondsSinceEpoch.toString();
|
state.effectiveDateTime.value.millisecondsSinceEpoch;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entity = await ApiRepository.to.sendElectronicKey(
|
var entity = await ApiRepository.to.sendElectronicKey(
|
||||||
createUser: state.isCreateUser.value ? "1" : "0",
|
createUser: state.isCreateUser.value ? "1" : "0",
|
||||||
countryCode: state.countryCode.value,
|
countryCode: state.countryCode.value,
|
||||||
usernameType: '1',
|
usernameType: '1',
|
||||||
endDate: getFailureDateTime,
|
endDate: state.failureTimestamp.value.toString(),
|
||||||
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
||||||
isCameraEnable: '2',
|
isCameraEnable: '2',
|
||||||
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
||||||
@ -39,7 +37,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
|||||||
operatorUid: '',
|
operatorUid: '',
|
||||||
receiverUsername: state.emailOrPhoneController.text,
|
receiverUsername: state.emailOrPhoneController.text,
|
||||||
remarks: '',
|
remarks: '',
|
||||||
startDate: getEffectiveDateTime,
|
startDate: state.effectiveTimestamp.value.toString(),
|
||||||
weekDays: state.weekdaysList);
|
weekDays: state.weekdaysList);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print('发送电子钥匙成功');
|
print('发送电子钥匙成功');
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_pickers/pickers.dart';
|
import 'package:flutter_pickers/pickers.dart';
|
||||||
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -28,6 +29,7 @@ class SendElectronicKeyPage extends StatefulWidget {
|
|||||||
class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||||
final logic = Get.put(SendElectronicKeyLogic());
|
final logic = Get.put(SendElectronicKeyLogic());
|
||||||
final state = Get.find<SendElectronicKeyLogic>().state;
|
final state = Get.find<SendElectronicKeyLogic>().state;
|
||||||
|
static const methodChannel = MethodChannel('flutter_native_ios');
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -212,9 +214,13 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
Widget keyPeriodValidityWidget() {
|
Widget keyPeriodValidityWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
rightTitle: "",
|
rightTitle: state.weekdaysList.isEmpty
|
||||||
|
? ''
|
||||||
|
: state.weekdaysList
|
||||||
|
.reduce((value, element) => value + ',' + element)
|
||||||
|
.toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var result = await Navigator.pushNamed(
|
var result = await Navigator.pushNamed(
|
||||||
@ -222,10 +228,12 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
if (result != null) {
|
if (result != null) {
|
||||||
result as Map<String, dynamic>;
|
result as Map<String, dynamic>;
|
||||||
state.weekdaysList.value = result['validityValue'];
|
state.weekdaysList.value = result['validityValue'];
|
||||||
state.effectiveDateTime.value = result['starDate'];
|
state.effectiveTimestamp.value =
|
||||||
state.failureDateTime.value = result['endDate'];
|
result['starDate'].millisecondsSinceEpoch;
|
||||||
|
state.failureTimestamp.value =
|
||||||
|
result['endDate'].millisecondsSinceEpoch;
|
||||||
}
|
}
|
||||||
}),
|
})),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
)
|
)
|
||||||
@ -345,21 +353,22 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
OutLineBtn(
|
OutLineBtn(
|
||||||
btnName: '邮件通知',
|
btnName: '分享',
|
||||||
onClick: () {
|
onClick: () {
|
||||||
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
// Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
||||||
|
_openModalBottomSheet();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
OutLineBtn(
|
// OutLineBtn(
|
||||||
btnName: '微信通知',
|
// btnName: '微信通知',
|
||||||
onClick: () {},
|
// onClick: () {},
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 10.h,
|
// height: 10.h,
|
||||||
),
|
// ),
|
||||||
OutLineBtn(
|
OutLineBtn(
|
||||||
btnName: '标记为已入住',
|
btnName: '标记为已入住',
|
||||||
onClick: () {
|
onClick: () {
|
||||||
@ -484,4 +493,126 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
String intToStr(int v) {
|
String intToStr(int v) {
|
||||||
return (v < 10) ? "0$v" : "$v";
|
return (v < 10) ? "0$v" : "$v";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future _openModalBottomSheet() async {
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadiusDirectional.circular(10)),
|
||||||
|
constraints: BoxConstraints(maxHeight: 260.h),
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: ScreenUtil().screenWidth,
|
||||||
|
height: 180.h,
|
||||||
|
child: ListView(
|
||||||
|
scrollDirection: Axis.horizontal, //横向滚动
|
||||||
|
children: initBottomSheetList()),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 8.h,
|
||||||
|
color: AppColors.greyBackgroundColor,
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
style: ButtonStyle(
|
||||||
|
overlayColor:
|
||||||
|
MaterialStateProperty.all<Color>(Colors.white)),
|
||||||
|
child: Text(
|
||||||
|
'取消',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Widget> initBottomSheetList() {
|
||||||
|
List<Widget> widgetList = [];
|
||||||
|
|
||||||
|
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友', 0));
|
||||||
|
widgetList.add(buildCenter3('images/icon_message.png', '短信', 1));
|
||||||
|
widgetList.add(buildCenter3('images/icon_email.png', '邮件', 2));
|
||||||
|
widgetList.add(buildCenter3('images/icon_more.png', '更多', 3));
|
||||||
|
|
||||||
|
return widgetList;
|
||||||
|
}
|
||||||
|
|
||||||
|
GestureDetector buildCenter3(
|
||||||
|
String imageName, String titleStr, int itemIndex) {
|
||||||
|
return GestureDetector(
|
||||||
|
child: Container(
|
||||||
|
width: 120.w,
|
||||||
|
// height: 64.h,
|
||||||
|
margin:
|
||||||
|
EdgeInsets.only(top: 20.w, bottom: 20.w, left: 10.w, right: 10.w),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
imageName,
|
||||||
|
width: 50.w,
|
||||||
|
height: 50.h,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 16.w,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
titleStr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: ScreenUtil().setSp(20), color: Colors.black),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () => _jumpSmartDeviceRoute(itemIndex),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_jumpSmartDeviceRoute(int itemIndex) {
|
||||||
|
switch (itemIndex) {
|
||||||
|
case 0:
|
||||||
|
//微信好友
|
||||||
|
{
|
||||||
|
Navigator.pop(context);
|
||||||
|
String pwdShareStr = '您好,您的电子钥匙生成成功';
|
||||||
|
tokNative('flutter_sharePassword_to_ios',
|
||||||
|
arguments: {'pwdShareStr': pwdShareStr}).then((result) {
|
||||||
|
print('$result');
|
||||||
|
});
|
||||||
|
print('与原生交互');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
//短信
|
||||||
|
{}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
//邮件
|
||||||
|
{
|
||||||
|
Navigator.pop(context);
|
||||||
|
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
//更多
|
||||||
|
{}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<dynamic> tokNative(String method,
|
||||||
|
{required Map arguments}) async {
|
||||||
|
if (arguments == null) {
|
||||||
|
return await methodChannel.invokeMethod(method);
|
||||||
|
} else {
|
||||||
|
return await methodChannel.invokeMethod(method, arguments);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,8 @@ class SendElectronicKeyState {
|
|||||||
DateTime dateTime = DateTime.now();
|
DateTime dateTime = DateTime.now();
|
||||||
final effectiveDateTime = DateTime.now().obs;
|
final effectiveDateTime = DateTime.now().obs;
|
||||||
final failureDateTime = DateTime.now().obs;
|
final failureDateTime = DateTime.now().obs;
|
||||||
|
final effectiveTimestamp = 0.obs;
|
||||||
|
final failureTimestamp = 0.obs;
|
||||||
|
|
||||||
var selectEffectiveDate =
|
var selectEffectiveDate =
|
||||||
'${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}'
|
'${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}'
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
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/common/XSConstantMacro/XSConstantMacro.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/lockMian/entity/lockInfoEntity.dart';
|
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
@ -88,7 +89,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
|||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader
|
leftTitel: TranslationLoader
|
||||||
.lanKeys!.periodValidity!.tr,
|
.lanKeys!.periodValidity!.tr,
|
||||||
rightTitle: getUseDateStr(itemData),
|
rightTitle: getUseDateStr(_lockData),
|
||||||
allHeight: 70.h,
|
allHeight: 70.h,
|
||||||
isHaveLine: false),
|
isHaveLine: false),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -159,7 +160,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
|||||||
//使用期限
|
//使用期限
|
||||||
String getUseDateStr(LockData indexEntity) {
|
String getUseDateStr(LockData indexEntity) {
|
||||||
String useDateStr = '';
|
String useDateStr = '';
|
||||||
if (indexEntity.keyType == 1) {
|
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||||
//限期
|
//限期
|
||||||
if (indexEntity.startDate != null && indexEntity.endDate != null) {
|
if (indexEntity.startDate != null && indexEntity.endDate != null) {
|
||||||
DateTime startDateStr =
|
DateTime startDateStr =
|
||||||
@ -171,13 +172,13 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
|||||||
} else {
|
} else {
|
||||||
useDateStr = '限期';
|
useDateStr = '限期';
|
||||||
}
|
}
|
||||||
} else if (indexEntity.keyType == 2) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||||
//永久
|
//永久
|
||||||
useDateStr = '永久';
|
useDateStr = '永久';
|
||||||
} else if (indexEntity.keyType == 3) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||||
//单次
|
//单次
|
||||||
useDateStr = '单次';
|
useDateStr = '单次';
|
||||||
} else if (indexEntity.keyType == 4) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||||
//循环
|
//循环
|
||||||
useDateStr = '循环';
|
useDateStr = '循环';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -246,18 +246,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
rightWidget: SizedBox(
|
rightWidget: SizedBox(
|
||||||
width: 60.w, child: _otherUnHaveDoneSwitch()))),
|
width: 60.w, child: _otherUnHaveDoneSwitch()))),
|
||||||
// ),
|
// ),
|
||||||
// Obx(() =>
|
|
||||||
Visibility(
|
|
||||||
visible: true,
|
|
||||||
child: CommonItem(
|
|
||||||
leftTitel: '感应距离',
|
|
||||||
rightTitle: "",
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveDirection: true,
|
|
||||||
action: () {
|
|
||||||
Toast.show(msg: "功能暂未开放");
|
|
||||||
})),
|
|
||||||
// ),
|
|
||||||
// Obx(() =>
|
// Obx(() =>
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: true,
|
visible: true,
|
||||||
@ -292,6 +281,18 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
width: 60.w, child: _otherUnHaveDoneSwitch()))),
|
width: 60.w, child: _otherUnHaveDoneSwitch()))),
|
||||||
// ),
|
// ),
|
||||||
// Obx(() =>
|
// Obx(() =>
|
||||||
|
Visibility(
|
||||||
|
visible: true,
|
||||||
|
child: CommonItem(
|
||||||
|
leftTitel: '感应距离',
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Toast.show(msg: "功能暂未开放");
|
||||||
|
})),
|
||||||
|
// ),
|
||||||
|
// Obx(() =>
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: true,
|
visible: true,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
@ -515,29 +516,35 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showCupertinoAlertDialog(
|
//确认弹窗
|
||||||
BuildContext context,
|
void showCupertinoAlertDialog(widgetContext) {
|
||||||
) {
|
showCupertinoDialog(
|
||||||
showDialog(
|
context: widgetContext,
|
||||||
context: context,
|
builder: (context) {
|
||||||
builder: (BuildContext context) {
|
return CupertinoAlertDialog(
|
||||||
return ShowIosTipView(
|
title: const Text('创建公司号,考勤功能才能使用'),
|
||||||
title: "提示",
|
actions: [
|
||||||
tipTitle: "创建公司号,考勤功能才能使用",
|
CupertinoDialogAction(
|
||||||
sureClick: () {
|
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||||
//
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.of(context).pop();
|
||||||
Get.toNamed(Routers.checkInCreatCompanyPage,
|
},
|
||||||
arguments: state.getKeyInfosData.value);
|
),
|
||||||
},
|
CupertinoDialogAction(
|
||||||
cancelClick: () {
|
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||||
Navigator.pop(context);
|
onPressed: () {
|
||||||
},
|
Navigator.pop(context);
|
||||||
|
Get.toNamed(Routers.checkInCreatCompanyPage,
|
||||||
|
arguments: state.getKeyInfosData.value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void showDeletAlertDialog(
|
void showDeletAlertDialog(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
) {
|
) {
|
||||||
@ -559,9 +566,32 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// void showCupertinoAlertDialog(
|
||||||
|
// BuildContext context,
|
||||||
|
// ) {
|
||||||
|
// showDialog(
|
||||||
|
// context: context,
|
||||||
|
// builder: (BuildContext context) {
|
||||||
|
// return ShowIosTipView(
|
||||||
|
// title: "提示",
|
||||||
|
// tipTitle: "创建公司号,考勤功能才能使用",
|
||||||
|
// sureClick: () {
|
||||||
|
// //
|
||||||
|
// Navigator.pop(context);
|
||||||
|
// Get.toNamed(Routers.checkInCreatCompanyPage,
|
||||||
|
// arguments: state.getKeyInfosData.value);
|
||||||
|
// },
|
||||||
|
// cancelClick: () {
|
||||||
|
// Navigator.pop(context);
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
void showDeletPasswordAlertDialog(
|
void showDeletPasswordAlertDialog(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
) {
|
) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import 'package:date_format/date_format.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -193,7 +192,6 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
|||||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
onClick: () {
|
onClick: () {
|
||||||
deletePwdRequest();
|
deletePwdRequest();
|
||||||
Navigator.pop(context, true);
|
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -278,6 +276,9 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
|||||||
itemData.lockId.toString(), itemData.keyboardPwdId.toString(), 1);
|
itemData.lockId.toString(), itemData.keyboardPwdId.toString(), 1);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
Toast.show(msg: "删除成功");
|
Toast.show(msg: "删除成功");
|
||||||
|
setState(() {
|
||||||
|
Navigator.pop(context, true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,6 +410,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
|||||||
case 0:
|
case 0:
|
||||||
//微信好友
|
//微信好友
|
||||||
{
|
{
|
||||||
|
Navigator.pop(context);
|
||||||
String pwdShareStr =
|
String pwdShareStr =
|
||||||
'您好,您的密码是:${itemData.keyboardPwd}\n生效时间:${itemData.startDate}\n类型:永久\n锁名:${itemData.keyboardPwdName}';
|
'您好,您的密码是:${itemData.keyboardPwd}\n生效时间:${itemData.startDate}\n类型:永久\n锁名:${itemData.keyboardPwdName}';
|
||||||
tokNative('flutter_sharePassword_to_ios',
|
tokNative('flutter_sharePassword_to_ios',
|
||||||
@ -425,6 +427,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
|||||||
case 2:
|
case 2:
|
||||||
//邮件
|
//邮件
|
||||||
{
|
{
|
||||||
|
Navigator.pop(context);
|
||||||
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -8,21 +8,16 @@ class PasswordKeyListLogic extends BaseGetXController {
|
|||||||
final PasswordKeyListState state = PasswordKeyListState();
|
final PasswordKeyListState state = PasswordKeyListState();
|
||||||
|
|
||||||
//请求密码钥匙列表
|
//请求密码钥匙列表
|
||||||
Future<List<PasswordKeyListItem>> mockNetworkDataRequest() async {
|
void mockNetworkDataRequest() async {
|
||||||
PasswordKeyListEntity entity = await ApiRepository.to.passwordKeyList(
|
PasswordKeyListEntity entity = await ApiRepository.to.passwordKeyList(
|
||||||
'0',
|
'0',
|
||||||
state.keyInfo.value.lockId.toString(),
|
state.keyInfo.value.lockId.toString(),
|
||||||
'0',
|
'0',
|
||||||
state.pageNum.toString(),
|
state.pageNum.toString(),
|
||||||
state.pageSize.toString());
|
state.pageSize.toString(),
|
||||||
|
state.searchController.text);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("密码钥匙列表成功:${entity.data?.itemList}");
|
state.itemDataList.value = entity.data!.itemList!;
|
||||||
}
|
|
||||||
if (entity.data != null) {
|
|
||||||
return entity.data!.itemList!;
|
|
||||||
} else {
|
|
||||||
List<PasswordKeyListItem> dataList = [];
|
|
||||||
return dataList;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:pull_to_refresh/pull_to_refresh.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/passwordKeyList/passwordKeyList_logic.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_logic.dart';
|
||||||
import 'package:star_lock/tools/noData.dart';
|
import 'package:star_lock/tools/noData.dart';
|
||||||
|
import 'package:star_lock/tools/storage.dart';
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
@ -22,7 +23,6 @@ class PasswordKeyListPage extends StatefulWidget {
|
|||||||
class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
||||||
final logic = Get.put(PasswordKeyListLogic());
|
final logic = Get.put(PasswordKeyListLogic());
|
||||||
final state = Get.find<PasswordKeyListLogic>().state;
|
final state = Get.find<PasswordKeyListLogic>().state;
|
||||||
late List<PasswordKeyListItem> _itemDataList = [];
|
|
||||||
|
|
||||||
late RefreshController _refreshController;
|
late RefreshController _refreshController;
|
||||||
|
|
||||||
@ -30,121 +30,93 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_refreshController = RefreshController(initialRefresh: true);
|
_refreshController = RefreshController(initialRefresh: true);
|
||||||
|
mockRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> mockRequest() async {
|
||||||
|
// 获取是否是演示模式 演示模式不获取接口
|
||||||
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
|
if (isDemoMode == false) {
|
||||||
|
logic.mockNetworkDataRequest();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@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!.password!.tr,
|
barTitle: TranslationLoader.lanKeys!.password!.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
actionsList: [
|
actionsList: [
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
TranslationLoader.lanKeys!.reset!.tr,
|
TranslationLoader.lanKeys!.reset!.tr,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
_showDialog(context);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onPressed: () {
|
],
|
||||||
_showDialog(context);
|
),
|
||||||
},
|
body: Column(
|
||||||
),
|
children: [
|
||||||
],
|
_searchWidget(),
|
||||||
),
|
SizedBox(
|
||||||
body: FutureBuilder<List<PasswordKeyListItem>>(
|
height: 20.h,
|
||||||
future: logic.mockNetworkDataRequest(),
|
),
|
||||||
builder: (BuildContext context,
|
Expanded(
|
||||||
AsyncSnapshot<List<PasswordKeyListItem>> snapshot) {
|
child: Obx(() => state.itemDataList.value.isEmpty
|
||||||
//请求结束
|
? const NoData()
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
: _buildMainUI(state.itemDataList.value))),
|
||||||
if (snapshot.hasError) {
|
SizedBox(
|
||||||
//请求失败
|
height: 20.h,
|
||||||
return const Text('请求失败');
|
),
|
||||||
} else {
|
AddBottomWhiteBtn(
|
||||||
//请求成功
|
btnName: TranslationLoader.lanKeys!.getPassword!.tr,
|
||||||
_itemDataList = snapshot.data!;
|
onClick: () {
|
||||||
|
Navigator.pushNamed(context, Routers.passwordKeyManagePage,
|
||||||
return Column(
|
arguments: {
|
||||||
children: [
|
"lockMainEntity": state.lockMainEntity.value,
|
||||||
_searchWidget(),
|
"keyInfo": state.keyInfo.value
|
||||||
SizedBox(
|
}).then((val) {
|
||||||
height: 20.h,
|
if (val != null) {
|
||||||
),
|
logic.mockNetworkDataRequest();
|
||||||
Expanded(
|
}
|
||||||
child: _itemDataList.isEmpty
|
});
|
||||||
? const NoData()
|
}),
|
||||||
: SmartRefresher(
|
SizedBox(
|
||||||
controller: _refreshController,
|
height: 42.h,
|
||||||
onRefresh: _refresh,
|
)
|
||||||
onLoading: _loadMore,
|
],
|
||||||
enablePullUp: true,
|
));
|
||||||
enablePullDown: true,
|
|
||||||
header: ClassicHeader(
|
|
||||||
height: 45.h,
|
|
||||||
releaseText: '松开手刷新',
|
|
||||||
refreshingText: '刷新中',
|
|
||||||
completeText: '刷新完成',
|
|
||||||
failedText: '刷新失败',
|
|
||||||
idleText: '下拉刷新',
|
|
||||||
),
|
|
||||||
child: _buildMainUI(_itemDataList),
|
|
||||||
)),
|
|
||||||
SizedBox(
|
|
||||||
height: 20.h,
|
|
||||||
),
|
|
||||||
AddBottomWhiteBtn(
|
|
||||||
btnName: TranslationLoader.lanKeys!.getPassword!.tr,
|
|
||||||
onClick: () {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context, Routers.passwordKeyManagePage,
|
|
||||||
arguments: {
|
|
||||||
"lockMainEntity": state.lockMainEntity.value,
|
|
||||||
"keyInfo": state.keyInfo.value
|
|
||||||
}).then((val) {
|
|
||||||
if (val != null) {
|
|
||||||
logic.mockNetworkDataRequest();
|
|
||||||
setState(() {});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
SizedBox(
|
|
||||||
height: 42.h,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//请求未结束 显示loading
|
|
||||||
return Container();
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///加载更多函数
|
// ///加载更多函数
|
||||||
Future<void> _loadMore() async {
|
// Future<void> _loadMore() async {
|
||||||
if (state.pageNum.value == 1) {
|
// if (state.pageNum.value == 1) {
|
||||||
if (_itemDataList.length < 10) {
|
// if (state.itemDataList.length < 10) {
|
||||||
_refreshController.loadComplete();
|
// _refreshController.loadComplete();
|
||||||
} else {
|
// } else {
|
||||||
state.pageNum.value++;
|
// state.pageNum.value++;
|
||||||
await logic.mockNetworkDataRequest();
|
// await logic.mockNetworkDataRequest();
|
||||||
_refreshController.loadComplete();
|
// _refreshController.loadComplete();
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
state.pageNum.value++;
|
// state.pageNum.value++;
|
||||||
await logic.mockNetworkDataRequest();
|
// await logic.mockNetworkDataRequest();
|
||||||
_refreshController.loadComplete();
|
// _refreshController.loadComplete();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
///刷新函数
|
// ///刷新函数
|
||||||
Future<void> _refresh() async {
|
// Future<void> _refresh() async {
|
||||||
state.pageNum.value = 1;
|
// state.pageNum.value = 1;
|
||||||
await logic.mockNetworkDataRequest();
|
// await logic.mockNetworkDataRequest();
|
||||||
_refreshController.refreshCompleted();
|
// _refreshController.refreshCompleted();
|
||||||
}
|
// }
|
||||||
|
|
||||||
Widget _searchWidget() {
|
Widget _searchWidget() {
|
||||||
return Container(
|
return Container(
|
||||||
@ -157,7 +129,10 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
// controller: _controller,
|
// controller: _controller,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
|
controller: state.searchController,
|
||||||
|
onSubmitted: (value) {
|
||||||
|
logic.mockNetworkDataRequest();
|
||||||
|
},
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
//输入里面输入文字内边距设置
|
//输入里面输入文字内边距设置
|
||||||
contentPadding: const EdgeInsets.only(
|
contentPadding: const EdgeInsets.only(
|
||||||
@ -195,7 +170,12 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
|||||||
return _electronicKeyItem('images/controls_user.png',
|
return _electronicKeyItem('images/controls_user.png',
|
||||||
indexEntity.keyboardPwdName!, useDateStr, () {
|
indexEntity.keyboardPwdName!, useDateStr, () {
|
||||||
Navigator.pushNamed(context, Routers.passwordKeyDetailPage,
|
Navigator.pushNamed(context, Routers.passwordKeyDetailPage,
|
||||||
arguments: {"itemData": indexEntity});
|
arguments: {"itemData": indexEntity}).then((val) {
|
||||||
|
if (val != null) {
|
||||||
|
logic.mockNetworkDataRequest();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
separatorBuilder: (BuildContext context, int index) {
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
||||||
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
class PasswordKeyListState {
|
class PasswordKeyListState {
|
||||||
@ -6,6 +8,8 @@ class PasswordKeyListState {
|
|||||||
final lockMainEntity = LockMainEntity().obs;
|
final lockMainEntity = LockMainEntity().obs;
|
||||||
var pageNum = 1.obs; //请求页码
|
var pageNum = 1.obs; //请求页码
|
||||||
final pageSize = 20.obs; //请求每页数据条数
|
final pageSize = 20.obs; //请求每页数据条数
|
||||||
|
final itemDataList = <PasswordKeyListItem>[].obs;
|
||||||
|
final TextEditingController searchController = TextEditingController();
|
||||||
|
|
||||||
PasswordKeyListState() {
|
PasswordKeyListState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
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';
|
||||||
@ -26,7 +25,6 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initState
|
// TODO: implement initState
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -34,25 +32,21 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: "演示模式",
|
barTitle: "演示模式",
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
),
|
),
|
||||||
body: Container(
|
body: Container(
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
height: 1.sh - ScreenUtil().statusBarHeight * 2,
|
height: 1.sh - ScreenUtil().statusBarHeight * 2,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [topTip(), topWidget(), Expanded(child: bottomWidget())],
|
||||||
topTip(),
|
),
|
||||||
topWidget(),
|
));
|
||||||
Expanded(child: bottomWidget())
|
|
||||||
],
|
|
||||||
),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget topTip(){
|
Widget topTip() {
|
||||||
return Container(
|
return Container(
|
||||||
// height: 120.h,
|
// height: 120.h,
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
@ -61,7 +55,10 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
|
|||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: Text("提示:当前界面为展示界面,添加设备后才能继续使用", style: TextStyle(fontSize: 24.sp, color: AppColors.mainColor))),
|
Expanded(
|
||||||
|
child: Text("提示:当前界面为展示界面,添加设备后才能继续使用",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp, color: AppColors.mainColor))),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -82,7 +79,7 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
"TMH_78f16712781a",
|
"TMH_78f16712781a",
|
||||||
style:
|
style:
|
||||||
TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w400),
|
TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w400),
|
||||||
)),
|
)),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
@ -112,12 +109,12 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
|
|||||||
children: [
|
children: [
|
||||||
Center(
|
Center(
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
gotoLogin();
|
gotoLogin();
|
||||||
},
|
},
|
||||||
child: Image.asset('images/main/icon_main_openLockBtn.png',
|
child: Image.asset('images/main/icon_main_openLockBtn.png',
|
||||||
width: 268.w, height: 268.w),
|
width: 268.w, height: 268.w),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -168,12 +165,13 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
|
|||||||
Text(
|
Text(
|
||||||
'超级管理员',
|
'超级管理员',
|
||||||
style:
|
style:
|
||||||
TextStyle(fontSize: 20.sp, color: AppColors.btnDisableColor),
|
TextStyle(fontSize: 20.sp, color: AppColors.btnDisableColor),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 80.w,
|
width: 80.w,
|
||||||
),
|
),
|
||||||
Image.asset('images/main/icon_main_remoteUnlocking_grey.png',
|
Image.asset(
|
||||||
|
'images/main/icon_main_remoteUnlocking_grey.png',
|
||||||
// state.keyInfos.value.remoteEnable == 1
|
// state.keyInfos.value.remoteEnable == 1
|
||||||
// ? 'images/main/icon_main_remoteUnlocking.png'
|
// ? 'images/main/icon_main_remoteUnlocking.png'
|
||||||
// : 'images/main/icon_main_remoteUnlocking_grey.png',
|
// : 'images/main/icon_main_remoteUnlocking_grey.png',
|
||||||
@ -189,7 +187,7 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
|
|||||||
Text(
|
Text(
|
||||||
'网关设备',
|
'网关设备',
|
||||||
style:
|
style:
|
||||||
TextStyle(fontSize: 20.sp, color: AppColors.btnDisableColor),
|
TextStyle(fontSize: 20.sp, color: AppColors.btnDisableColor),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -227,58 +225,57 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
|
|||||||
|
|
||||||
// 考勤
|
// 考勤
|
||||||
// if (state.keyInfos.value.isAttendance == 1) {
|
// if (state.keyInfos.value.isAttendance == 1) {
|
||||||
showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png',
|
showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png',
|
||||||
TranslationLoader.lanKeys!.checkingIn!.tr, () {
|
TranslationLoader.lanKeys!.checkingIn!.tr, () {
|
||||||
// gotoLogin();
|
// gotoLogin();
|
||||||
Get.toNamed(Routers.checkingInListPage, arguments: KeyInfos());
|
Get.toNamed(Routers.checkingInListPage, arguments: KeyInfos());
|
||||||
}));
|
}));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
var defaultWidgetArr = [
|
var defaultWidgetArr = [
|
||||||
// 电子钥匙
|
// 电子钥匙
|
||||||
bottomItem('images/main/icon_main_electronicKey.png',
|
bottomItem('images/main/icon_main_electronicKey.png',
|
||||||
TranslationLoader.lanKeys!.electronicKey!.tr, () {
|
TranslationLoader.lanKeys!.electronicKey!.tr, () {
|
||||||
gotoLogin();
|
// gotoLogin();
|
||||||
|
|
||||||
// Get.toNamed(Routers.electronicKeyListPage, arguments: {
|
Get.toNamed(Routers.electronicKeyListPage, arguments: {
|
||||||
// "lockMainEntity": widget.lockMainEntity,
|
"lockMainEntity": LockMainEntity(),
|
||||||
// "keyInfo": widget.keyInfo
|
"keyInfo": KeyInfos()
|
||||||
// });
|
});
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// 密码
|
// 密码
|
||||||
bottomItem('images/main/icon_main_password.png',
|
bottomItem('images/main/icon_main_password.png',
|
||||||
TranslationLoader.lanKeys!.password!.tr, () {
|
TranslationLoader.lanKeys!.password!.tr, () {
|
||||||
gotoLogin();
|
|
||||||
|
|
||||||
// Get.toNamed(Routers.passwordKeyListPage, arguments: {
|
|
||||||
// "lockMainEntity": widget.lockMainEntity,
|
|
||||||
// "keyInfo": widget.keyInfo
|
|
||||||
// });
|
|
||||||
}),
|
|
||||||
|
|
||||||
// ic卡
|
|
||||||
bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, () {
|
|
||||||
// gotoLogin();
|
// gotoLogin();
|
||||||
|
|
||||||
Get.toNamed(Routers.otherTypeKeyListPage, arguments: {
|
Get.toNamed(Routers.passwordKeyListPage, arguments: {
|
||||||
"lockId": 0,
|
"lockMainEntity": LockMainEntity(),
|
||||||
"fromType": 0
|
"keyInfo": KeyInfos()
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
// ic卡
|
||||||
|
bottomItem('images/main/icon_main_icCard.png',
|
||||||
|
TranslationLoader.lanKeys!.card!.tr, () {
|
||||||
|
// gotoLogin();
|
||||||
|
|
||||||
|
Get.toNamed(Routers.otherTypeKeyListPage,
|
||||||
|
arguments: {"lockId": 0, "fromType": 0});
|
||||||
|
}),
|
||||||
|
|
||||||
// 指纹
|
// 指纹
|
||||||
bottomItem('images/main/icon_main_fingerprint.png', TranslationLoader.lanKeys!.fingerprint!.tr, () {
|
bottomItem('images/main/icon_main_fingerprint.png',
|
||||||
|
TranslationLoader.lanKeys!.fingerprint!.tr, () {
|
||||||
// gotoLogin();
|
// gotoLogin();
|
||||||
|
|
||||||
Get.toNamed(Routers.otherTypeKeyListPage, arguments: {
|
Get.toNamed(Routers.otherTypeKeyListPage,
|
||||||
"lockId": 1,
|
arguments: {"lockId": 1, "fromType": 1});
|
||||||
"fromType": 1
|
|
||||||
});
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// 遥控
|
// 遥控
|
||||||
bottomItem('images/main/icon_main_remoteControl.png', TranslationLoader.lanKeys!.remoteControl!.tr, () {
|
bottomItem('images/main/icon_main_remoteControl.png',
|
||||||
|
TranslationLoader.lanKeys!.remoteControl!.tr, () {
|
||||||
gotoLogin();
|
gotoLogin();
|
||||||
|
|
||||||
// Get.toNamed(Routers.otherTypeKeyListPage, arguments: {
|
// Get.toNamed(Routers.otherTypeKeyListPage, arguments: {
|
||||||
@ -315,25 +312,26 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
|
|||||||
// 授权管理员
|
// 授权管理员
|
||||||
bottomItem('images/main/icon_main_authorizedAdmin.png',
|
bottomItem('images/main/icon_main_authorizedAdmin.png',
|
||||||
TranslationLoader.lanKeys!.authorizedAdmin!.tr, () {
|
TranslationLoader.lanKeys!.authorizedAdmin!.tr, () {
|
||||||
gotoLogin();
|
// gotoLogin();
|
||||||
|
|
||||||
// Get.toNamed(Routers.authorizedAdminListPage, arguments: {
|
Get.toNamed(Routers.authorizedAdminListPage, arguments: {
|
||||||
// "keyInfo": KeyInfos()
|
"lockMainEntity": LockMainEntity(),
|
||||||
// });
|
"keyInfo": KeyInfos()
|
||||||
}),
|
});
|
||||||
|
}),
|
||||||
// 操作记录
|
// 操作记录
|
||||||
bottomItem('images/main/icon_main_operatingRecord.png',
|
bottomItem('images/main/icon_main_operatingRecord.png',
|
||||||
TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
||||||
// gotoLogin();
|
// gotoLogin();
|
||||||
Get.toNamed(Routers.lockOperatingRecordPage, arguments: {
|
Get.toNamed(Routers.lockOperatingRecordPage,
|
||||||
"keyInfo": KeyInfos()
|
arguments: {"keyInfo": KeyInfos()});
|
||||||
});
|
}),
|
||||||
}),
|
|
||||||
// 设置
|
// 设置
|
||||||
bottomItem(
|
bottomItem(
|
||||||
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, () {
|
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr,
|
||||||
Get.toNamed(Routers.demoModeLockSetPage);
|
() {
|
||||||
}),
|
Get.toNamed(Routers.demoModeLockSetPage);
|
||||||
|
}),
|
||||||
];
|
];
|
||||||
showWidgetArr.addAll(endWiddget);
|
showWidgetArr.addAll(endWiddget);
|
||||||
return showWidgetArr;
|
return showWidgetArr;
|
||||||
@ -345,7 +343,7 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: onClick,
|
onTap: onClick,
|
||||||
child: Container(
|
child: Container(
|
||||||
// height: 300.h,
|
// height: 300.h,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
@ -367,7 +365,7 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gotoLogin(){
|
void gotoLogin() {
|
||||||
// Get.toNamed(Routers.seletLockTypePage);
|
// Get.toNamed(Routers.seletLockTypePage);
|
||||||
Toast.show(msg: "演示模式");
|
Toast.show(msg: "演示模式");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
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';
|
||||||
@ -100,15 +99,15 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
|
|||||||
|
|
||||||
Widget unHaveData() {
|
Widget unHaveData() {
|
||||||
return Column(
|
return Column(
|
||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
SizedBox(
|
||||||
width: 330.w,
|
width: 330.w,
|
||||||
height: 330.w,
|
// height: 330.w,
|
||||||
margin: EdgeInsets.only(top: 180.h),
|
// margin: EdgeInsets.only(top: 180.h),
|
||||||
// decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
// border: Border.all(width: 4.w, color: AppColors.mainColor),
|
// border: Border.all(width: 4.w, color: AppColors.mainColor),
|
||||||
// borderRadius: BorderRadius.circular(110.w),
|
// borderRadius: BorderRadius.circular(110.w),
|
||||||
@ -118,8 +117,8 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
|
|||||||
padding: const EdgeInsets.all(30.0),
|
padding: const EdgeInsets.all(30.0),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'images/main/icon_main_unHaveLockData.png',
|
'images/main/icon_main_unHaveLockData.png',
|
||||||
width: 150.w,
|
width: 260.w,
|
||||||
height: 150.w,
|
height: 260.w,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@ -136,7 +135,7 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(top: 10.h),
|
padding: EdgeInsets.all(30.w),
|
||||||
child: Text(
|
child: Text(
|
||||||
TranslationLoader
|
TranslationLoader
|
||||||
.lanKeys!.whenAddingLockThePhoneMustBeNextToTheLock!.tr,
|
.lanKeys!.whenAddingLockThePhoneMustBeNextToTheLock!.tr,
|
||||||
@ -146,11 +145,14 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
|
|||||||
color: Colors.black),
|
color: Colors.black),
|
||||||
)),
|
)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 200.h,
|
height: 160.h,
|
||||||
),
|
),
|
||||||
SubmitBtn(btnName: '演示模式', onClick: (){
|
SubmitBtn(
|
||||||
Get.toNamed(Routers.demoModeLockDetailPage);
|
btnName: '演示模式',
|
||||||
},)
|
onClick: () {
|
||||||
|
Get.toNamed(Routers.demoModeLockDetailPage);
|
||||||
|
},
|
||||||
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ 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/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/network/api.dart';
|
import 'package:star_lock/network/api.dart';
|
||||||
|
|
||||||
import '../../app_settings/app_colors.dart';
|
import '../../app_settings/app_colors.dart';
|
||||||
@ -9,19 +10,6 @@ import '../../tools/commonItem.dart';
|
|||||||
import '../../tools/titleAppBar.dart';
|
import '../../tools/titleAppBar.dart';
|
||||||
import '../../translations/trans_lib.dart';
|
import '../../translations/trans_lib.dart';
|
||||||
|
|
||||||
// 网页的宏定义网址
|
|
||||||
class XSWebviewURLMacro {
|
|
||||||
static String baseWebURL = Api.baseAddress; //base地址
|
|
||||||
static String userAgreementURL = '$baseWebURL/app/userAgreement'; //用户协议
|
|
||||||
static String privacyPolicyURL = '$baseWebURL/app/privacy'; //隐私政策
|
|
||||||
static String collectionListURL =
|
|
||||||
'$baseWebURL/app/personalInformationCollectionList'; //个人信息收集清单
|
|
||||||
static String thirdPartyInfShareListURL =
|
|
||||||
'$baseWebURL/app/thirdPartyInformationSharingList'; //第三方信息共享清单
|
|
||||||
static String appPermissionDescURL =
|
|
||||||
'$baseWebURL/app/applicationPermissionDescription'; //应用权限说明
|
|
||||||
}
|
|
||||||
|
|
||||||
class AbountPage extends StatefulWidget {
|
class AbountPage extends StatefulWidget {
|
||||||
const AbountPage({Key? key}) : super(key: key);
|
const AbountPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@ -72,7 +60,7 @@ class _AbountPageState extends State<AbountPage> {
|
|||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.webviewShowPage,
|
Navigator.pushNamed(context, Routers.webviewShowPage,
|
||||||
arguments: {
|
arguments: {
|
||||||
"url": XSWebviewURLMacro.userAgreementURL,
|
"url": XSConstantMacro.introduceURL,
|
||||||
"title": '介绍'
|
"title": '介绍'
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
@ -90,7 +78,7 @@ class _AbountPageState extends State<AbountPage> {
|
|||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.webviewShowPage,
|
Navigator.pushNamed(context, Routers.webviewShowPage,
|
||||||
arguments: {
|
arguments: {
|
||||||
"url": XSWebviewURLMacro.userAgreementURL,
|
"url": XSConstantMacro.userAgreementURL,
|
||||||
"title": '用户协议'
|
"title": '用户协议'
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
@ -108,7 +96,7 @@ class _AbountPageState extends State<AbountPage> {
|
|||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.webviewShowPage,
|
Navigator.pushNamed(context, Routers.webviewShowPage,
|
||||||
arguments: {
|
arguments: {
|
||||||
"url": XSWebviewURLMacro.privacyPolicyURL,
|
"url": XSConstantMacro.privacyPolicyURL,
|
||||||
"title": '隐私政策'
|
"title": '隐私政策'
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
@ -127,7 +115,7 @@ class _AbountPageState extends State<AbountPage> {
|
|||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.webviewShowPage,
|
Navigator.pushNamed(context, Routers.webviewShowPage,
|
||||||
arguments: {
|
arguments: {
|
||||||
"url": XSWebviewURLMacro.collectionListURL,
|
"url": XSConstantMacro.collectionListURL,
|
||||||
"title": '个人信息收集清单'
|
"title": '个人信息收集清单'
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
@ -146,7 +134,7 @@ class _AbountPageState extends State<AbountPage> {
|
|||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.webviewShowPage,
|
Navigator.pushNamed(context, Routers.webviewShowPage,
|
||||||
arguments: {
|
arguments: {
|
||||||
"url": XSWebviewURLMacro.appPermissionDescURL,
|
"url": XSConstantMacro.appPermissionDescURL,
|
||||||
"title": '应用权限说明'
|
"title": '应用权限说明'
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
@ -165,7 +153,7 @@ class _AbountPageState extends State<AbountPage> {
|
|||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.webviewShowPage,
|
Navigator.pushNamed(context, Routers.webviewShowPage,
|
||||||
arguments: {
|
arguments: {
|
||||||
"url": XSWebviewURLMacro.thirdPartyInfShareListURL,
|
"url": XSConstantMacro.thirdPartyInfShareListURL,
|
||||||
"title": '第三方信息共享清单'
|
"title": '第三方信息共享清单'
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -82,7 +82,7 @@ class _SafeVerifyPageState extends State<SafeVerifyPage> {
|
|||||||
Obx(() => Padding(
|
Obx(() => Padding(
|
||||||
padding: EdgeInsets.only(left: 60.w, right: 60.w),
|
padding: EdgeInsets.only(left: 60.w, right: 60.w),
|
||||||
child: Text(
|
child: Text(
|
||||||
'请点击获取验证码,验证码将发送到${state.loginData.value.mobile}',
|
'请点击获取验证码,验证码将发送到${state.accountStr.value}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.darkGrayTextColor, fontSize: 22.sp),
|
color: AppColors.darkGrayTextColor, fontSize: 22.sp),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -19,6 +19,9 @@ class SafeVerifyState {
|
|||||||
var xWidth = ''.obs; // 滑动验证码滑动位置
|
var xWidth = ''.obs; // 滑动验证码滑动位置
|
||||||
var canSub = false.obs;
|
var canSub = false.obs;
|
||||||
var date = currentTimeMillis().toString().obs;
|
var date = currentTimeMillis().toString().obs;
|
||||||
|
var accountStr = ''.obs;
|
||||||
|
var toggleStr = ''.obs; //可切换字眼
|
||||||
|
var isToggle = false.obs; //是否点击切换
|
||||||
|
|
||||||
bool get codeIsOK => verificationCode.value.isNotEmpty;
|
bool get codeIsOK => verificationCode.value.isNotEmpty;
|
||||||
|
|
||||||
@ -42,6 +45,23 @@ class SafeVerifyState {
|
|||||||
print("getLoginData:$data");
|
print("getLoginData:$data");
|
||||||
if (data != null && data.isNotEmpty) {
|
if (data != null && data.isNotEmpty) {
|
||||||
loginData.value = LoginData.fromJson(jsonDecode(data));
|
loginData.value = LoginData.fromJson(jsonDecode(data));
|
||||||
|
|
||||||
|
//有手机号无邮箱 优先显示手机号 不可切换
|
||||||
|
if (loginData.value.mobile!.isNotEmpty &&
|
||||||
|
loginData.value.email!.isEmpty) {
|
||||||
|
accountStr.value = loginData.value.mobile!;
|
||||||
|
isToggle.value = false;
|
||||||
|
} else if (loginData.value.mobile!.isNotEmpty &&
|
||||||
|
loginData.value.email!.isNotEmpty) {
|
||||||
|
//有手机号有邮箱 优先显示手机号 可切换至邮箱
|
||||||
|
accountStr.value = loginData.value.mobile!;
|
||||||
|
isToggle.value = true;
|
||||||
|
} else if (loginData.value.mobile!.isNotEmpty &&
|
||||||
|
loginData.value.email!.isNotEmpty) {
|
||||||
|
//无手机号有邮箱 优先显示邮箱 不可切换
|
||||||
|
accountStr.value = loginData.value.email!;
|
||||||
|
isToggle.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ 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/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.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/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
@ -133,7 +134,7 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
|||||||
//使用期限
|
//使用期限
|
||||||
String getUseDateStr(AuthorizedAdminListItem indexEntity) {
|
String getUseDateStr(AuthorizedAdminListItem indexEntity) {
|
||||||
String useDateStr = '';
|
String useDateStr = '';
|
||||||
if (indexEntity.keyType == 1) {
|
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||||
//限期
|
//限期
|
||||||
DateTime startDateStr =
|
DateTime startDateStr =
|
||||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
||||||
@ -141,15 +142,15 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
|||||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
||||||
useDateStr =
|
useDateStr =
|
||||||
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
|
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
|
||||||
} else if (indexEntity.keyType == 2) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||||
//永久
|
//永久
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 永久';
|
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 永久';
|
||||||
} else if (indexEntity.keyType == 3) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||||
//单次
|
//单次
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
||||||
} else if (indexEntity.keyType == 4) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||||
//循环
|
//循环
|
||||||
useDateStr = '循环';
|
useDateStr = '循环';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
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/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
@ -69,7 +70,7 @@ class _AuthorizedAdministratorListPageState
|
|||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
_searchWidget(),
|
// _searchWidget(),
|
||||||
Expanded(child: _buildMainUI(itemList)),
|
Expanded(child: _buildMainUI(itemList)),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -212,7 +213,7 @@ class _AuthorizedAdministratorListPageState
|
|||||||
//使用期限
|
//使用期限
|
||||||
String getUseDateStr(AuthorizedAdminListItem indexEntity) {
|
String getUseDateStr(AuthorizedAdminListItem indexEntity) {
|
||||||
String useDateStr = '';
|
String useDateStr = '';
|
||||||
if (indexEntity.keyType == 1) {
|
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||||
//限期
|
//限期
|
||||||
if (indexEntity.startDate != null && indexEntity.endDate != null) {
|
if (indexEntity.startDate != null && indexEntity.endDate != null) {
|
||||||
DateTime startDateStr =
|
DateTime startDateStr =
|
||||||
@ -224,13 +225,13 @@ class _AuthorizedAdministratorListPageState
|
|||||||
} else {
|
} else {
|
||||||
useDateStr = '限期';
|
useDateStr = '限期';
|
||||||
}
|
}
|
||||||
} else if (indexEntity.keyType == 2) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||||
//永久
|
//永久
|
||||||
useDateStr = '永久';
|
useDateStr = '永久';
|
||||||
} else if (indexEntity.keyType == 3) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||||
//单次
|
//单次
|
||||||
useDateStr = '单次';
|
useDateStr = '单次';
|
||||||
} else if (indexEntity.keyType == 4) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||||
//循环
|
//循环
|
||||||
useDateStr = '循环';
|
useDateStr = '循环';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ class LockUserManageListPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
||||||
List<LockUserData> dataList = [];
|
List<LockUserData> dataList = [];
|
||||||
|
final TextEditingController searchController = TextEditingController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -94,8 +95,11 @@ class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
|||||||
child: TextField(
|
child: TextField(
|
||||||
//输入框一行
|
//输入框一行
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
// controller: _controller,
|
controller: searchController,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
|
onSubmitted: (value) {
|
||||||
|
lockUserListRequest();
|
||||||
|
},
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
//输入里面输入文字内边距设置
|
//输入里面输入文字内边距设置
|
||||||
contentPadding: const EdgeInsets.only(
|
contentPadding: const EdgeInsets.only(
|
||||||
@ -140,7 +144,7 @@ class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
|||||||
//请求锁用户列表
|
//请求锁用户列表
|
||||||
Future<List<LockUserData>> lockUserListRequest() async {
|
Future<List<LockUserData>> lockUserListRequest() async {
|
||||||
LockUserListEntity entity =
|
LockUserListEntity entity =
|
||||||
await ApiRepository.to.lockUserList('1', '20', '');
|
await ApiRepository.to.lockUserList('1', '20', searchController.text);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
setState(() {
|
setState(() {
|
||||||
dataList = entity.data!;
|
dataList = entity.data!;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
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_utils/get_utils.dart';
|
import 'package:get/get_utils/get_utils.dart';
|
||||||
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/keyListByUserEntity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/keyListByUserEntity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
@ -100,7 +101,7 @@ class _OwnedKeyListPageState extends State<OwnedKeyListPage> {
|
|||||||
//使用期限
|
//使用期限
|
||||||
String getUseDateStr(KeyListItem indexEntity) {
|
String getUseDateStr(KeyListItem indexEntity) {
|
||||||
String useDateStr = '';
|
String useDateStr = '';
|
||||||
if (indexEntity.keyType == 1) {
|
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||||
//限期
|
//限期
|
||||||
if (indexEntity.startDate != null && indexEntity.endDate != null) {
|
if (indexEntity.startDate != null && indexEntity.endDate != null) {
|
||||||
DateTime startDateStr =
|
DateTime startDateStr =
|
||||||
@ -112,13 +113,13 @@ class _OwnedKeyListPageState extends State<OwnedKeyListPage> {
|
|||||||
} else {
|
} else {
|
||||||
useDateStr = '限期';
|
useDateStr = '限期';
|
||||||
}
|
}
|
||||||
} else if (indexEntity.keyType == 2) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||||
//永久
|
//永久
|
||||||
useDateStr = '永久';
|
useDateStr = '永久';
|
||||||
} else if (indexEntity.keyType == 3) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||||
//单次
|
//单次
|
||||||
useDateStr = '单次';
|
useDateStr = '单次';
|
||||||
} else if (indexEntity.keyType == 4) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||||
//循环
|
//循环
|
||||||
useDateStr = '循环';
|
useDateStr = '循环';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -236,7 +236,7 @@ class _MineSetPageState extends State<MineSetPage> {
|
|||||||
logic.userLogoutRequest();
|
logic.userLogoutRequest();
|
||||||
}),
|
}),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(right: 30.w),
|
padding: EdgeInsets.only(right: 30.w, top: 30.h),
|
||||||
// color: Colors.red,
|
// color: Colors.red,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
|||||||
@ -102,7 +102,8 @@ class ApiProvider extends BaseProvider {
|
|||||||
String pageNo,
|
String pageNo,
|
||||||
String pageSize,
|
String pageSize,
|
||||||
String startDate,
|
String startDate,
|
||||||
String keyRight) =>
|
String keyRight,
|
||||||
|
String searchStr) =>
|
||||||
post(
|
post(
|
||||||
electronicKeyListURL.toUrl,
|
electronicKeyListURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
@ -114,7 +115,8 @@ class ApiProvider extends BaseProvider {
|
|||||||
'pageNo': pageNo,
|
'pageNo': pageNo,
|
||||||
'pageSize': pageSize,
|
'pageSize': pageSize,
|
||||||
'startDate': startDate,
|
'startDate': startDate,
|
||||||
'keyRight': keyRight
|
'keyRight': keyRight,
|
||||||
|
'searchStr': searchStr
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Future<Response> sendElectronicKey(
|
Future<Response> sendElectronicKey(
|
||||||
@ -331,12 +333,12 @@ class ApiProvider extends BaseProvider {
|
|||||||
post(getWifiServiceIpURL.toUrl, jsonEncode({}));
|
post(getWifiServiceIpURL.toUrl, jsonEncode({}));
|
||||||
|
|
||||||
Future<Response> passwordKeyList(
|
Future<Response> passwordKeyList(
|
||||||
String keyStatus,
|
String keyStatus,
|
||||||
String lockId,
|
String lockId,
|
||||||
String operatorUid,
|
String operatorUid,
|
||||||
String pageNo,
|
String pageNo,
|
||||||
String pageSize,
|
String pageSize,
|
||||||
) =>
|
String searchStr) =>
|
||||||
post(
|
post(
|
||||||
passwordKeyListURL.toUrl,
|
passwordKeyListURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
@ -344,7 +346,8 @@ class ApiProvider extends BaseProvider {
|
|||||||
'lockId': lockId,
|
'lockId': lockId,
|
||||||
'operatorUid': operatorUid,
|
'operatorUid': operatorUid,
|
||||||
'pageNo': pageNo,
|
'pageNo': pageNo,
|
||||||
'pageSize': pageSize
|
'pageSize': pageSize,
|
||||||
|
'searchStr': searchStr
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Future<Response> resetPasswordKey(String lockId, String operatorUid) => post(
|
Future<Response> resetPasswordKey(String lockId, String operatorUid) => post(
|
||||||
@ -968,7 +971,7 @@ class ApiProvider extends BaseProvider {
|
|||||||
|
|
||||||
// 更新ICCard序号
|
// 更新ICCard序号
|
||||||
Future<Response> updateIdCardUserNoLoadData(
|
Future<Response> updateIdCardUserNoLoadData(
|
||||||
String lockId, String cardId, String cardUserNo) =>
|
String lockId, String cardId, String cardUserNo) =>
|
||||||
post(
|
post(
|
||||||
updateICCardUserNoURL.toUrl,
|
updateICCardUserNoURL.toUrl,
|
||||||
jsonEncode(
|
jsonEncode(
|
||||||
|
|||||||
@ -128,9 +128,10 @@ class ApiRepository {
|
|||||||
String pageNo,
|
String pageNo,
|
||||||
String pageSize,
|
String pageSize,
|
||||||
String startDate,
|
String startDate,
|
||||||
String keyRight) async {
|
String keyRight,
|
||||||
|
String searchStr) async {
|
||||||
final res = await apiProvider.electronicKeyList(endDate, keyId, keyStatus,
|
final res = await apiProvider.electronicKeyList(endDate, keyId, keyStatus,
|
||||||
lockId, operatorUid, pageNo, pageSize, startDate, keyRight);
|
lockId, operatorUid, pageNo, pageSize, startDate, keyRight, searchStr);
|
||||||
return ElectronicKeyListEntity.fromJson(res.body);
|
return ElectronicKeyListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,14 +302,14 @@ class ApiRepository {
|
|||||||
|
|
||||||
//密码列表
|
//密码列表
|
||||||
Future<PasswordKeyListEntity> passwordKeyList(
|
Future<PasswordKeyListEntity> passwordKeyList(
|
||||||
String keyStatus,
|
String keyStatus,
|
||||||
String lockId,
|
String lockId,
|
||||||
String operatorUid,
|
String operatorUid,
|
||||||
String pageNo,
|
String pageNo,
|
||||||
String pageSize,
|
String pageSize,
|
||||||
) async {
|
String searchStr) async {
|
||||||
final res = await apiProvider.passwordKeyList(
|
final res = await apiProvider.passwordKeyList(
|
||||||
keyStatus, lockId, operatorUid, pageNo, pageSize);
|
keyStatus, lockId, operatorUid, pageNo, pageSize, searchStr);
|
||||||
return PasswordKeyListEntity.fromJson(res.body);
|
return PasswordKeyListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user