1,群发钥匙新增部分逻辑判断
2,更换、新增部分图片
@ -134,7 +134,7 @@
|
||||
"lockEscalation":"锁升级",
|
||||
"markedHouseState":"标记房态",
|
||||
"unlockReminder":"开锁提醒",
|
||||
"unlockQRCode":"开锁二维码",
|
||||
"unlockQRCode":"微信二维码",
|
||||
"lockNumber":"锁编号",
|
||||
"electricQuantity":"电量",
|
||||
"lockName":"名称",
|
||||
|
||||
BIN
star_lock/images/lockType/lockType_NFCLock.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 20 KiB |
BIN
star_lock/images/lockType/lockType_entranceGuardLock.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
star_lock/images/lockType/lockType_gatewayLock.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
star_lock/images/main/icon_catEyes.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
star_lock/images/main/icon_face.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 112 KiB |
@ -1,13 +1,10 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
|
||||
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserList_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart';
|
||||
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart';
|
||||
@ -75,7 +72,6 @@ import 'main/lockDetail/electronicKey/electronicKeyPeriodValidity/electronicKeyP
|
||||
import 'main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_page.dart';
|
||||
import 'main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_page.dart';
|
||||
import 'main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_page.dart';
|
||||
import 'main/lockDetail/lockDetail/lockDetail_page.dart';
|
||||
import 'main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart';
|
||||
import 'main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart';
|
||||
import 'main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart';
|
||||
@ -746,7 +742,7 @@ abstract class AppRouters {
|
||||
GetPage(
|
||||
name: Routers.configuringWifiPage,
|
||||
page: () => const ConfiguringWifiPage()),
|
||||
GetPage(
|
||||
GetPage(
|
||||
name: Routers.massSendLockGroupPage,
|
||||
page: () => const MassSendLockGroupListPage()),
|
||||
GetPage(
|
||||
@ -754,6 +750,5 @@ abstract class AppRouters {
|
||||
page: () => const MassSendReceiverPage()),
|
||||
GetPage(
|
||||
name: Routers.lockUserListPage, page: () => const LockUserListPage())
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_pickers/pickers.dart';
|
||||
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
||||
@ -22,6 +24,13 @@ class MassSendElectronicKeyPage extends StatefulWidget {
|
||||
class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||
final FlutterContactPicker _contactPicker = FlutterContactPicker();
|
||||
late Contact _contact;
|
||||
var _selectEffectiveDate = ''; //生效时间
|
||||
var _selectFailureDate = ''; //失效时间
|
||||
late DateTime _effectiveDateTime;
|
||||
late DateTime _failureDateTime;
|
||||
late bool _isSendSuccess;
|
||||
late bool _isRemote; //是否远程开锁
|
||||
List _receiverList = [];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -31,6 +40,16 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
DateTime dateTime = DateTime.now();
|
||||
_effectiveDateTime = dateTime;
|
||||
_failureDateTime = dateTime;
|
||||
_selectEffectiveDate =
|
||||
'${dateTime.year}-${dateTime.month}-${dateTime.day} ${dateTime.hour}:${dateTime.minute}'; //默认为当前时间
|
||||
_selectFailureDate =
|
||||
'${dateTime.year}-${dateTime.month}-${dateTime.day} ${dateTime.hour}:${dateTime.minute}'; //默认为当前时间
|
||||
_isSendSuccess = false;
|
||||
_isRemote = false;
|
||||
}
|
||||
|
||||
Widget indexChangeWidget() {
|
||||
@ -82,11 +101,21 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
|
||||
rightTitle: TranslationLoader.lanKeys!.pleaseAdd!.tr,
|
||||
rightTitle: _receiverList.isEmpty
|
||||
? TranslationLoader.lanKeys!.pleaseAdd!.tr
|
||||
: _receiverList.length.toString(),
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Navigator.pushNamed(context, Routers.massSendReceiverPage);
|
||||
Navigator.pushNamed(context, Routers.massSendReceiverPage)
|
||||
.then((value) {
|
||||
if (value != null) {
|
||||
value as Map<String, dynamic>;
|
||||
_receiverList = value['lockUserList'];
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
});
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.lock!.tr,
|
||||
@ -106,12 +135,33 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||
rightTitle: "2020.06.20 11:49",
|
||||
isHaveLine: true),
|
||||
rightTitle: _selectEffectiveDate,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||
onConfirm: (p) {
|
||||
setState(() {
|
||||
_selectEffectiveDate =
|
||||
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
||||
_effectiveDateTime = DateTime.parse(_selectEffectiveDate);
|
||||
});
|
||||
});
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||
rightTitle: "2020.06.20 11:49",
|
||||
),
|
||||
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||
rightTitle: _selectFailureDate,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||
onConfirm: (p) {
|
||||
setState(() {
|
||||
_selectFailureDate =
|
||||
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
||||
_failureDateTime = DateTime.parse(_selectFailureDate);
|
||||
});
|
||||
});
|
||||
}),
|
||||
Container(height: 10.h),
|
||||
],
|
||||
);
|
||||
@ -162,17 +212,20 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||
}
|
||||
|
||||
CupertinoSwitch _switch() {
|
||||
bool _isOn = false;
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: _isOn,
|
||||
value: _isRemote,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_isOn = value;
|
||||
_isRemote = !_isRemote;
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
String intToStr(int v) {
|
||||
return (v < 10) ? "0$v" : "$v";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/utils.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
@ -0,0 +1,92 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
|
||||
class massSendLockGroupCell extends StatelessWidget {
|
||||
final int currentIndex;
|
||||
// LockListItem itemData;
|
||||
List lockListByGroup;
|
||||
final VoidCallback selectLockAction;
|
||||
|
||||
massSendLockGroupCell(int index,
|
||||
{Key? key,
|
||||
required this.currentIndex,
|
||||
required this.lockListByGroup,
|
||||
// required this.itemData,
|
||||
required this.selectLockAction})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.separated(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: lockListByGroup.length,
|
||||
itemBuilder: (_, itemIndex) {
|
||||
LockListItem itemData = lockListByGroup[itemIndex];
|
||||
return _itemBuilder(itemData);
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _itemBuilder(LockListItem itemData) {
|
||||
return GestureDetector(
|
||||
child: Container(
|
||||
height: 60.h,
|
||||
color: Colors.white,
|
||||
width: ScreenUtil().screenWidth,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 30.w,
|
||||
),
|
||||
Image.asset(
|
||||
'images/mine/icon_mine_gatewaySignal_prompt.png',
|
||||
width: 36.w,
|
||||
height: 36.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
Text(
|
||||
itemData.lockAlias!,
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
width: 20.w,
|
||||
)),
|
||||
Image.asset(
|
||||
itemData.isCheck!
|
||||
? "images/icon_round_selet.png"
|
||||
: "images/icon_round_unSelet.png",
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 30.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
selectLockAction();
|
||||
// selectNameIndex = index;
|
||||
// setState(() {
|
||||
// if (selectNameIndex == index) {
|
||||
// isNameSelect = !isNameSelect;
|
||||
// }
|
||||
// });
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -52,9 +52,10 @@ class LockListData {
|
||||
class LockListItem {
|
||||
int? lockId;
|
||||
String? lockAlias;
|
||||
bool? isCheck = false;
|
||||
bool? isRefresh = false;
|
||||
|
||||
LockListItem({this.lockId, this.lockAlias, this.isRefresh});
|
||||
LockListItem({this.lockId, this.lockAlias, this.isRefresh, this.isCheck});
|
||||
|
||||
LockListItem.fromJson(Map<String, dynamic> json) {
|
||||
lockId = json['lockId'];
|
||||
|
||||
@ -2,11 +2,13 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/utils.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupCell.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/LockGroupListEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/ExpandedListView.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
class MassSendLockGroupListPage extends StatefulWidget {
|
||||
@ -22,6 +24,7 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
|
||||
List lockListByGroup = [];
|
||||
List lockGroupList = [];
|
||||
List clickIndexList = [];
|
||||
int clickIndex = -1;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -66,6 +69,12 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
|
||||
height: 10.h,
|
||||
),
|
||||
Expanded(child: _buildListView(context, lockGroupList)),
|
||||
SubmitBtn(
|
||||
btnName: '确定',
|
||||
onClick: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 40.h,
|
||||
)
|
||||
@ -97,9 +106,10 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
|
||||
dataList = entity.data!.lockList!;
|
||||
}
|
||||
}
|
||||
lockListByGroup = dataList;
|
||||
|
||||
setState(() {});
|
||||
setState(() {
|
||||
lockListByGroup = dataList;
|
||||
});
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@ -125,68 +135,15 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
|
||||
onTap: () {
|
||||
listLockByGroup(itemData.keyGroupId.toString());
|
||||
clickIndexList.add(index);
|
||||
clickIndex = index;
|
||||
},
|
||||
title: itemData.keyGroupName!,
|
||||
imgName: '',
|
||||
typeImgList: const [],
|
||||
child: ListView.separated(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: lockListByGroup.length,
|
||||
itemBuilder: (_, itemIndex) {
|
||||
LockListItem itemData = lockListByGroup[itemIndex];
|
||||
return _buildNameWidget(context, itemIndex,
|
||||
'images/icon_password.png', itemData.lockAlias);
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
//单个姓名行
|
||||
Widget _buildNameWidget(context, index, imageName, getName) {
|
||||
return GestureDetector(
|
||||
child: Container(
|
||||
height: 60.h,
|
||||
color: Colors.white,
|
||||
width: ScreenUtil().screenWidth,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 30.w,
|
||||
),
|
||||
Image.asset(
|
||||
'images/mine/icon_mine_gatewaySignal_prompt.png',
|
||||
width: 36.w,
|
||||
height: 36.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
Text(
|
||||
getName,
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
SizedBox(
|
||||
width: 30.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
// selectNameIndex = index;
|
||||
// setState(() {
|
||||
// if (selectNameIndex == index) {
|
||||
// isNameSelect = !isNameSelect;
|
||||
// }
|
||||
// });
|
||||
},
|
||||
child: massSendLockGroupCell(index,
|
||||
currentIndex: index,
|
||||
lockListByGroup: lockListByGroup,
|
||||
selectLockAction: () {}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,155 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get_utils/get_utils.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/tools/commonItem.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
class MassSendReceiverCell extends StatelessWidget {
|
||||
final int currentIndex;
|
||||
LockUserData userData;
|
||||
final VoidCallback clickDeleteUser;
|
||||
|
||||
MassSendReceiverCell(int index,
|
||||
{Key? key,
|
||||
required this.currentIndex,
|
||||
required this.userData,
|
||||
required this.clickDeleteUser})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
TextEditingController emailOrPhoneController = TextEditingController();
|
||||
TextEditingController keyNameController = TextEditingController();
|
||||
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
child: SizedBox(
|
||||
width: 40.w,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
Image.asset(
|
||||
'images/icon_massSend_delete.png',
|
||||
width: 26.w,
|
||||
height: 26.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
clickDeleteUser();
|
||||
// _lockUserList.removeAt(index - 1);
|
||||
// setState(() {});
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
|
||||
rightTitle: userData.userid ?? ' ',
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: getTFWidget(
|
||||
true,
|
||||
TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
|
||||
1,
|
||||
userData)),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
||||
rightTitle: userData.nickname ?? ' ',
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: getTFWidget(
|
||||
false,
|
||||
TranslationLoader.lanKeys!.enterYourName!.tr,
|
||||
2,
|
||||
userData)),
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
TextEditingController _receiverController(String getStr) {
|
||||
TextEditingController controller = TextEditingController(text: getStr);
|
||||
controller.addListener(() {
|
||||
print(controller.text);
|
||||
});
|
||||
|
||||
return controller;
|
||||
}
|
||||
|
||||
TextEditingController _nickNameController(String getStr) {
|
||||
TextEditingController controller = TextEditingController(text: getStr);
|
||||
controller.addListener(() {
|
||||
print(controller.text);
|
||||
});
|
||||
|
||||
return controller;
|
||||
}
|
||||
|
||||
// 接受者信息输入框
|
||||
Widget getTFWidget(
|
||||
bool isHaveBtn, String tfStr, int lineIndex, LockUserData userData) {
|
||||
return SizedBox(
|
||||
height: 50.h,
|
||||
width: 320.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
controller: lineIndex == 1
|
||||
? _receiverController(userData.userid ?? '')
|
||||
: _nickNameController(userData.nickname ?? ''),
|
||||
//输入框一行
|
||||
maxLines: 1,
|
||||
autofocus: false,
|
||||
textAlign: TextAlign.end,
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
hintText: tfStr,
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
isHaveBtn
|
||||
? Container(
|
||||
width: 32.w,
|
||||
height: 32.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
image: DecorationImage(
|
||||
image: AssetImage('images/icon_addressBook.png'),
|
||||
fit: BoxFit.fill),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
// Contact? currentContact =
|
||||
// await _contactPicker.selectContact();
|
||||
// setState(() {
|
||||
// _contact = currentContact!;
|
||||
// // print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}");
|
||||
// });
|
||||
},
|
||||
),
|
||||
)
|
||||
: Container()
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -3,7 +3,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/utils.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiverCell.dart';
|
||||
import 'package:star_lock/tools/commonItem.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
@ -49,6 +50,19 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
|
||||
icon: const Icon(Icons.arrow_back_ios, color: Colors.white),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.save!.tr,
|
||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () {
|
||||
Map<String, dynamic> resultMap = {};
|
||||
resultMap['lockUserList'] = _lockUserList;
|
||||
Navigator.pop(context, resultMap);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
@ -83,6 +97,9 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
|
||||
child: ListView.separated(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
LockUserData data = _lockUserList[index];
|
||||
emailOrPhoneController.text = data.userid ?? '';
|
||||
keyNameController.text = data.nickname ?? '';
|
||||
|
||||
return _itemBuilder(index, data);
|
||||
},
|
||||
itemCount: _lockUserList.length,
|
||||
@ -149,110 +166,14 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
|
||||
}
|
||||
|
||||
Widget _itemBuilder(int index, LockUserData userData) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
child: SizedBox(
|
||||
width: 40.w,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
Image.asset(
|
||||
'images/icon_massSend_delete.png',
|
||||
width: 26.w,
|
||||
height: 26.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
_lockUserList.removeAt(index - 1);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
|
||||
rightTitle: userData.userid ?? ' ',
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: getTFWidget(
|
||||
true,
|
||||
TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
|
||||
1)),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
||||
rightTitle: userData.nickname ?? ' ',
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: getTFWidget(
|
||||
false, TranslationLoader.lanKeys!.enterYourName!.tr, 2)),
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 接受者信息输入框
|
||||
Widget getTFWidget(bool isHaveBtn, String tfStr, int lineIndex) {
|
||||
return SizedBox(
|
||||
height: 50.h,
|
||||
width: 320.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
controller:
|
||||
lineIndex == 1 ? emailOrPhoneController : keyNameController,
|
||||
//输入框一行
|
||||
maxLines: 1,
|
||||
// controller: _controller,
|
||||
autofocus: false,
|
||||
textAlign: TextAlign.end,
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||
hintText: tfStr,
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
isHaveBtn
|
||||
? Container(
|
||||
width: 32.w,
|
||||
height: 32.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
image: DecorationImage(
|
||||
image: AssetImage('images/icon_addressBook.png'),
|
||||
fit: BoxFit.fill),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
// Contact? currentContact =
|
||||
// await _contactPicker.selectContact();
|
||||
// setState(() {
|
||||
// _contact = currentContact!;
|
||||
// // print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}");
|
||||
// });
|
||||
},
|
||||
),
|
||||
)
|
||||
: Container()
|
||||
],
|
||||
),
|
||||
return MassSendReceiverCell(
|
||||
index,
|
||||
currentIndex: index,
|
||||
userData: userData,
|
||||
clickDeleteUser: () {
|
||||
_lockUserList.removeAt(index - 1);
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,12 +128,21 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
||||
leftTitel: TranslationLoader
|
||||
.lanKeys!.adminOpenLockPassword!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: false,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Navigator.pushNamed(context,
|
||||
Routers.adminOpenLockPasswordPage);
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.unlockQRCode!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.unlockQRCodePage);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@ -65,57 +65,43 @@ class _LockSetPageState extends State<LockSetPage> {
|
||||
height: 10.h,
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.wirelessKeyboard!.tr,
|
||||
leftTitel: TranslationLoader.lanKeys!.doorMagnetic!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
// Get.toNamed(Routers.wirelessKeyboardPage);
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
Get.toNamed(Routers.doorMagneticPage);
|
||||
// Toast.show(msg: "功能暂未开放");
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.doorMagnetic!.tr,
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.wirelessKeyboard!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
// Get.toNamed(Routers.doorMagneticPage);
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
Get.toNamed(Routers.wirelessKeyboardPage);
|
||||
// Toast.show(msg: "功能暂未开放");
|
||||
}),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
Obx(()=> CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.remoteEnable == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.remoteUnlockingPage, arguments: state.getKeyInfosData.value);
|
||||
})),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.automaticBlocking!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.autoLockTime! > -1 ? "${state.getKeyInfosData.value.autoLockTime!.toString()}s" : TranslationLoader.lanKeys!.closed!.tr,
|
||||
TranslationLoader.lanKeys!.automaticBlocking!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.autoLockTime! > -1
|
||||
? "${state.getKeyInfosData.value.autoLockTime!.toString()}s"
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.automaticBlockingPage, arguments: state.getKeyInfosData.value);
|
||||
Get.toNamed(Routers.automaticBlockingPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
})),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.passageMode == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.normallyOpenModePage, arguments: state.getKeyInfosData.value);
|
||||
}),),
|
||||
Obx(() {
|
||||
var titleStr = "";
|
||||
if(state.getKeyInfosData.value.lockSound == 1){
|
||||
switch(state.getKeyInfosData.value.volume){
|
||||
if (state.getKeyInfosData.value.lockSound == 1) {
|
||||
switch (state.getKeyInfosData.value.volume) {
|
||||
case 1:
|
||||
titleStr = TranslationLoader.lanKeys!.low!.tr;
|
||||
break;
|
||||
@ -132,7 +118,7 @@ class _LockSetPageState extends State<LockSetPage> {
|
||||
titleStr = TranslationLoader.lanKeys!.higher!.tr;
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
titleStr = TranslationLoader.lanKeys!.closed!.tr;
|
||||
}
|
||||
return CommonItem(
|
||||
@ -141,51 +127,113 @@ class _LockSetPageState extends State<LockSetPage> {
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.lockSoundSetPage, arguments: state.getKeyInfosData.value);
|
||||
Get.toNamed(Routers.lockSoundSetPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
});
|
||||
}),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.burglarAlarm!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.tamperAlert == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.tamperAlert == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.burglarAlarmPage, arguments: state.getKeyInfosData.value);
|
||||
Get.toNamed(Routers.burglarAlarmPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
})),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
Obx(
|
||||
() => CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.passageMode == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.normallyOpenModePage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
}),
|
||||
),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.remoteEnable == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.remoteUnlockingPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
})),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.resetButton!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.resetButton == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.resetButton == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.resetButtonPage, arguments: state.getKeyInfosData.value);
|
||||
Get.toNamed(Routers.resetButtonPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
})),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
Obx(() {
|
||||
var title = "";
|
||||
if (state.getKeyInfosData.value.roomStatus == 1) {
|
||||
title = TranslationLoader.lanKeys!.checkedIn!.tr;
|
||||
} else if (state.getKeyInfosData.value.roomStatus == 2) {
|
||||
title = TranslationLoader.lanKeys!.leisure!.tr;
|
||||
}
|
||||
return CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.markedHouseState!.tr,
|
||||
rightTitle: title,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.markedHouseStatePage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
});
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.unlockQRCode!.tr,
|
||||
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.unlockQRCodePage);
|
||||
}),
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, child: _switch())),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.wifiDistributionNetwork!.tr,
|
||||
leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, child: _switch())),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader
|
||||
.lanKeys!.wifiDistributionNetwork!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.configuringWifiPage);
|
||||
}),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.lockTime!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.lockTimePage, arguments: state.getKeyInfosData.value);
|
||||
Get.toNamed(Routers.lockTimePage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.diagnose!.tr,
|
||||
@ -220,53 +268,6 @@ class _LockSetPageState extends State<LockSetPage> {
|
||||
action: () {
|
||||
Get.toNamed(Routers.lockEscalationPage);
|
||||
}),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel: "Amazon Alexa",
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {}),
|
||||
CommonItem(
|
||||
leftTitel: "Google Home",
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {}),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
Obx((){
|
||||
var title = "";
|
||||
if(state.getKeyInfosData.value.roomStatus == 1){
|
||||
title = TranslationLoader.lanKeys!.checkedIn!.tr;
|
||||
}else if(state.getKeyInfosData.value.roomStatus == 2){
|
||||
title = TranslationLoader.lanKeys!.leisure!.tr;
|
||||
}
|
||||
return CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.markedHouseState!.tr,
|
||||
rightTitle: title,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.markedHouseStatePage, arguments: state.getKeyInfosData.value);
|
||||
});
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, child: _switch())),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, child: _switch())),
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
),
|
||||
|
||||
@ -21,7 +21,7 @@ class _UnlockQRCodePageState extends State<UnlockQRCodePage> {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.burglarAlarm!.tr,
|
||||
barTitle: TranslationLoader.lanKeys!.unlockQRCode!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
|
||||
@ -56,7 +56,8 @@ class _LockDetailPageState extends State<LockDetailPage> {
|
||||
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
|
||||
|
||||
// signKey
|
||||
List<int> signKeyData = state.keyInfos.value.bluetooth!.signKey!.cast<int>();
|
||||
List<int> signKeyData =
|
||||
state.keyInfos.value.bluetooth!.signKey!.cast<int>();
|
||||
var saveSignKeyList = changeIntListToStringList(signKeyData);
|
||||
Storage.setStringList(saveBlueSignKey, saveSignKeyList);
|
||||
// print("publicKeyData:$publicKeyData saveStrList:$saveStrList privateKeyData:$privateKeyData savePrivateKeyList:$savePrivateKeyList");
|
||||
@ -129,7 +130,8 @@ class _LockDetailPageState extends State<LockDetailPage> {
|
||||
width: 268.w, height: 268.w),
|
||||
)),
|
||||
Visibility(
|
||||
visible: state.keyInfos.value.remoteEnable == 1 ? true: false,
|
||||
visible:
|
||||
state.keyInfos.value.remoteEnable == 1 ? true : false,
|
||||
child: Align(
|
||||
alignment: const Alignment(0.6, 1),
|
||||
child: Image.asset(
|
||||
@ -174,92 +176,99 @@ class _LockDetailPageState extends State<LockDetailPage> {
|
||||
// color: Colors.blue,
|
||||
child: SizedBox(
|
||||
child: GridView.count(
|
||||
crossAxisCount: 4,
|
||||
// childAspectRatio: 3,
|
||||
crossAxisSpacing: 20.w,
|
||||
mainAxisSpacing: 0.h,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
children: getShowWidget()
|
||||
),
|
||||
crossAxisCount: 4,
|
||||
// childAspectRatio: 3,
|
||||
crossAxisSpacing: 20.w,
|
||||
mainAxisSpacing: 0.h,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
children: getShowWidget()),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> getShowWidget(){
|
||||
List<Widget> getShowWidget() {
|
||||
var showWidgetArr = <Widget>[];
|
||||
|
||||
// 考勤
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png',
|
||||
TranslationLoader.lanKeys!.checkingIn!.tr, () {
|
||||
Get.toNamed( Routers.checkingInListPage);
|
||||
}));
|
||||
Get.toNamed(Routers.checkingInListPage);
|
||||
}));
|
||||
|
||||
var defaultWidgetArr = [
|
||||
// 电子钥匙
|
||||
bottomItem('images/main/icon_main_electronicKey.png', TranslationLoader.lanKeys!.electronicKey!.tr, () {
|
||||
bottomItem('images/main/icon_main_electronicKey.png',
|
||||
TranslationLoader.lanKeys!.electronicKey!.tr, () {
|
||||
Get.toNamed(Routers.electronicKeyListPage, arguments: {
|
||||
"lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": widget.keyInfo
|
||||
});
|
||||
}),
|
||||
"lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": widget.keyInfo
|
||||
});
|
||||
}),
|
||||
// 密码
|
||||
bottomItem('images/main/icon_main_password.png', TranslationLoader.lanKeys!.password!.tr, () {
|
||||
Get.toNamed(Routers.passwordKeyListPage,
|
||||
arguments: {
|
||||
"lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": widget.keyInfo
|
||||
});
|
||||
}),
|
||||
bottomItem('images/main/icon_main_password.png',
|
||||
TranslationLoader.lanKeys!.password!.tr, () {
|
||||
Get.toNamed(Routers.passwordKeyListPage, arguments: {
|
||||
"lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": widget.keyInfo
|
||||
});
|
||||
}),
|
||||
// ic卡
|
||||
bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, () {
|
||||
Get.toNamed(Routers.otherTypeKeyListPage,
|
||||
arguments: 0);
|
||||
}),
|
||||
bottomItem('images/main/icon_main_icCard.png',
|
||||
TranslationLoader.lanKeys!.card!.tr, () {
|
||||
Get.toNamed(Routers.otherTypeKeyListPage, arguments: 0);
|
||||
}),
|
||||
// 指纹
|
||||
bottomItem('images/main/icon_main_fingerprint.png', TranslationLoader.lanKeys!.fingerprint!.tr, () {
|
||||
Get.toNamed(Routers.otherTypeKeyListPage,
|
||||
arguments: 1);
|
||||
}),
|
||||
bottomItem('images/main/icon_main_fingerprint.png',
|
||||
TranslationLoader.lanKeys!.fingerprint!.tr, () {
|
||||
Get.toNamed(Routers.otherTypeKeyListPage, arguments: 1);
|
||||
}),
|
||||
// 遥控
|
||||
bottomItem('images/main/icon_main_remoteControl.png', TranslationLoader.lanKeys!.remoteControl!.tr, () {
|
||||
Get.toNamed(Routers.otherTypeKeyListPage,
|
||||
arguments: 2);
|
||||
}),
|
||||
bottomItem('images/main/icon_main_remoteControl.png',
|
||||
TranslationLoader.lanKeys!.remoteControl!.tr, () {
|
||||
Get.toNamed(Routers.otherTypeKeyListPage, arguments: 2);
|
||||
}),
|
||||
];
|
||||
showWidgetArr.addAll(defaultWidgetArr);
|
||||
|
||||
//可视对讲门锁新增->人脸
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', '人脸', () {
|
||||
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
||||
// arguments: 1);
|
||||
}),);
|
||||
showWidgetArr.add(
|
||||
bottomItem('images/main/icon_face.png', '人脸', () {
|
||||
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
||||
// arguments: 1);
|
||||
}),
|
||||
);
|
||||
|
||||
//可视对讲门锁新增->监控
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', '监控', () {
|
||||
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
||||
// arguments: 1);
|
||||
}),);
|
||||
showWidgetArr.add(
|
||||
bottomItem('images/main/icon_catEyes.png', '监控', () {
|
||||
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
||||
// arguments: 1);
|
||||
}),
|
||||
);
|
||||
|
||||
var endWiddget = [
|
||||
// 授权管理员
|
||||
bottomItem('images/main/icon_main_authorizedAdmin.png', TranslationLoader.lanKeys!.authorizedAdmin!.tr, () {
|
||||
Get.toNamed(Routers.authorizedAdminListPage, arguments: {
|
||||
"lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": widget.keyInfo
|
||||
});
|
||||
}),
|
||||
bottomItem('images/main/icon_main_authorizedAdmin.png',
|
||||
TranslationLoader.lanKeys!.authorizedAdmin!.tr, () {
|
||||
Get.toNamed(Routers.authorizedAdminListPage, arguments: {
|
||||
"lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": widget.keyInfo
|
||||
});
|
||||
}),
|
||||
// 操作记录
|
||||
bottomItem('images/main/icon_main_operatingRecord.png', TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
||||
Get.toNamed(Routers.lockOperatingRecordPage,
|
||||
arguments: {
|
||||
"lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": widget.keyInfo
|
||||
});
|
||||
}),
|
||||
bottomItem('images/main/icon_main_operatingRecord.png',
|
||||
TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
||||
Get.toNamed(Routers.lockOperatingRecordPage, arguments: {
|
||||
"lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": widget.keyInfo
|
||||
});
|
||||
}),
|
||||
// 设置
|
||||
bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, () {
|
||||
Get.toNamed(Routers.lockSetPage, arguments: widget.keyInfo);
|
||||
}),
|
||||
bottomItem(
|
||||
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr,
|
||||
() {
|
||||
Get.toNamed(Routers.lockSetPage, arguments: widget.keyInfo);
|
||||
}),
|
||||
];
|
||||
showWidgetArr.addAll(endWiddget);
|
||||
return showWidgetArr;
|
||||
|
||||
@ -86,8 +86,8 @@ class _PasswordKeyManageTabbarPageState
|
||||
Tab _tab(ItemView item) {
|
||||
return Tab(
|
||||
// text: item.title,
|
||||
child: Container(
|
||||
width: 1.sw / 8,
|
||||
child: SizedBox(
|
||||
width: item.title.length > 2 ? 1.sw / 8 : 1.sw / 12,
|
||||
// margin: EdgeInsets.all(10.w),
|
||||
// color: Colors.red,
|
||||
child: Text(
|
||||
|
||||
@ -41,7 +41,7 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
|
||||
TranslationLoader.lanKeys!.doorLock!.tr, () {
|
||||
Navigator.pushNamed(context, Routers.addLockPage);
|
||||
}),
|
||||
lockTypeItem('images/lockType/lockType_doorLock.png',
|
||||
lockTypeItem('images/lockType/lockType_NFCLock.png',
|
||||
TranslationLoader.lanKeys!.NFCPassiveLock!.tr, () {
|
||||
Navigator.pushNamed(context, Routers.addLockPage);
|
||||
}),
|
||||
@ -57,8 +57,7 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
|
||||
TranslationLoader.lanKeys!.parkingLock!.tr, () {
|
||||
Navigator.pushNamed(context, Routers.addLockPage);
|
||||
}),
|
||||
lockTypeItem(
|
||||
'images/lockType/lockType_intelligentLockCore.png',
|
||||
lockTypeItem('images/lockType/lockType_entranceGuardLock.png',
|
||||
TranslationLoader.lanKeys!.itelligentAccessControl!.tr,
|
||||
() {
|
||||
Navigator.pushNamed(context, Routers.addLockPage);
|
||||
@ -68,7 +67,7 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
|
||||
// TranslationLoader.lanKeys!.bicycleLock!.tr, () {
|
||||
// Navigator.pushNamed(context, Routers.addLockPage);
|
||||
// }),
|
||||
lockTypeItem('images/lockType/lockType_remoteControl.png',
|
||||
lockTypeItem('images/lockType/lockType_gatewayLock.png',
|
||||
TranslationLoader.lanKeys!.gateway!.tr, () {
|
||||
Navigator.pushNamed(context, Routers.gatewayListPage);
|
||||
}),
|
||||
@ -138,8 +137,8 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
|
||||
SizedBox(width: 30.w),
|
||||
Image.asset(
|
||||
lockTypeIcon,
|
||||
width: 32.w,
|
||||
height: 48.w,
|
||||
width: 48.w,
|
||||
height: 60.w,
|
||||
),
|
||||
SizedBox(width: 20.w),
|
||||
Expanded(
|
||||
|
||||
@ -17,32 +17,62 @@ class MineMultiLanguagePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MineMultiLanguagePageState extends State<MineMultiLanguagePage> {
|
||||
|
||||
final logic = Get.put(MineMultiLanguageLogic());
|
||||
final state = Get.find<MineMultiLanguageLogic>().state;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.multilingual!.tr, haveBack:true, backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: _children(),
|
||||
)
|
||||
);
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.multilingual!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: _children(),
|
||||
));
|
||||
}
|
||||
|
||||
List<Widget> _children(){
|
||||
List<Widget> _children() {
|
||||
List<Widget> l = [];
|
||||
for(int i = 0; i < state.languages.length; i++){
|
||||
l.add(
|
||||
CommonItem(
|
||||
leftTitel: '跟随系统',
|
||||
rightTitle: "",
|
||||
allHeight: 90.h,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: Container(),
|
||||
action: () {
|
||||
// logic.changeLanguage(e);
|
||||
}),
|
||||
);
|
||||
for (int i = 0; i < state.languages.length; i++) {
|
||||
var e = state.languages[i];
|
||||
var lanType = ExtensionLanguageType.fromLanguageCode(e.languageCode);
|
||||
l.add(CommonItem(leftTitel:lanType.lanTitle, rightTitle:"", allHeight: 90.h, isHaveLine: true, isHaveDirection:false, isHaveRightWidget: true, rightWidget: Obx(() => state.currentLanguageType.value == lanType ? Image(image: const AssetImage("images/icon_item_checked.png"),width:30.w,height:30.w, fit: BoxFit.contain,): Container()), action: (){
|
||||
logic.changeLanguage(e);
|
||||
}),);
|
||||
l.add(
|
||||
CommonItem(
|
||||
leftTitel: lanType.lanTitle,
|
||||
rightTitle: "",
|
||||
allHeight: 90.h,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: Obx(() => state.currentLanguageType.value == lanType
|
||||
? Image(
|
||||
image: const AssetImage("images/icon_item_checked.png"),
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
fit: BoxFit.contain,
|
||||
)
|
||||
: Container()),
|
||||
action: () {
|
||||
logic.changeLanguage(e);
|
||||
}),
|
||||
);
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
@ -153,6 +153,21 @@ class _MineSetPageState extends State<MineSetPage> {
|
||||
Navigator.pushNamed(context,
|
||||
Routers.aPPUnlockNeedMobileNetworkingLockPage);
|
||||
}),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel: "Amazon Alexa",
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {}),
|
||||
CommonItem(
|
||||
leftTitel: "Google Home",
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {}),
|
||||
// CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){
|
||||
//
|
||||
// }),
|
||||
|
||||
@ -46,7 +46,8 @@ abstract class Api {
|
||||
final String getWifiServiceIpURL = '/wifiLock/getWifiServiceIp'; // 获取Wifi锁服务器
|
||||
final String updateSpecialValueUrl = '/room/updateSpecialValue'; // 开启/关闭 远程开锁
|
||||
final String setAutoLockTimeUrl = '/room/setAutoLockTime'; // 自动闭锁
|
||||
final String getPassageModeConfigUrl = '/room/getPassageModeConfig'; // 获取锁的常开模式设置
|
||||
final String getPassageModeConfigUrl =
|
||||
'/room/getPassageModeConfig'; // 获取锁的常开模式设置
|
||||
final String configPassageModeUrl = '/room/configPassageMode'; // 配置锁的常开模式
|
||||
final String updateSettingUrl = '/room/updateSetting'; // 锁声音/防撬报警/重置键/考勤
|
||||
final String roomQueryDateUrl = '/room/queryDate'; // 获取网关时间
|
||||
@ -56,5 +57,4 @@ abstract class Api {
|
||||
final String lockUserListURL = '/keyUser/listKeyUser'; //锁用户列表
|
||||
final String canSendKeyURL = '/keyUser/canSendKey'; //群发钥匙检查
|
||||
final String batchSendKeyURL = '/key/batchSend'; //批处理群发钥匙
|
||||
|
||||
}
|
||||
|
||||
@ -297,10 +297,8 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取Wifi锁服务器
|
||||
Future<Response> getWifiLockServiceIpAndPort() => post(
|
||||
getWifiServiceIpURL.toUrl,
|
||||
jsonEncode({
|
||||
}));
|
||||
Future<Response> getWifiLockServiceIpAndPort() =>
|
||||
post(getWifiServiceIpURL.toUrl, jsonEncode({}));
|
||||
|
||||
Future<Response> passwordKeyList(
|
||||
String keyStatus,
|
||||
@ -428,10 +426,10 @@ class ApiProvider extends BaseProvider {
|
||||
lockListByGroupURL.toUrl,
|
||||
jsonEncode({'type': type, 'keyGroupId': keyGroupId}));
|
||||
|
||||
|
||||
/// 锁设置模块
|
||||
/// 锁设置模块
|
||||
// 远程开锁
|
||||
Future<Response> remoteUnlockingOpenOrCloseLoadData(String lockId, String featureValue) =>
|
||||
Future<Response> remoteUnlockingOpenOrCloseLoadData(
|
||||
String lockId, String featureValue) =>
|
||||
post(
|
||||
updateSpecialValueUrl.toUrl,
|
||||
jsonEncode({
|
||||
@ -440,7 +438,8 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 自动闭锁
|
||||
Future<Response> setAutoUnlockLoadData(String lockId, String autoLockTime, String type) =>
|
||||
Future<Response> setAutoUnlockLoadData(
|
||||
String lockId, String autoLockTime, String type) =>
|
||||
post(
|
||||
setAutoLockTimeUrl.toUrl,
|
||||
jsonEncode({
|
||||
@ -450,15 +449,22 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取锁的常开模式设置
|
||||
Future<Response> getPassageModeConfigLoadData(String lockId) =>
|
||||
post(
|
||||
getPassageModeConfigUrl.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}));
|
||||
Future<Response> getPassageModeConfigLoadData(String lockId) => post(
|
||||
getPassageModeConfigUrl.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}));
|
||||
|
||||
// 获取锁的常开模式设置
|
||||
Future<Response> configPassageMode(String lockId, String passageMode, String autoUnlock, String type, String startDate, String endDate, String isAllDay, List weekDays) =>
|
||||
Future<Response> configPassageMode(
|
||||
String lockId,
|
||||
String passageMode,
|
||||
String autoUnlock,
|
||||
String type,
|
||||
String startDate,
|
||||
String endDate,
|
||||
String isAllDay,
|
||||
List weekDays) =>
|
||||
post(
|
||||
configPassageModeUrl.toUrl,
|
||||
jsonEncode({
|
||||
@ -473,7 +479,8 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取锁的常开模式设置
|
||||
Future<Response> setLockSetGeneralSetting(String lockId, String changeType, String isOn, String type) =>
|
||||
Future<Response> setLockSetGeneralSetting(
|
||||
String lockId, String changeType, String isOn, String type) =>
|
||||
post(
|
||||
updateSettingUrl.toUrl,
|
||||
jsonEncode({
|
||||
@ -484,27 +491,25 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 通过网关获取锁的时间
|
||||
Future<Response> getLockTimeFromGatewayLoadData(String lockId) =>
|
||||
post(
|
||||
roomQueryDateUrl.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}));
|
||||
Future<Response> getLockTimeFromGatewayLoadData(String lockId) => post(
|
||||
roomQueryDateUrl.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}));
|
||||
|
||||
// 获取服务器当前时间
|
||||
Future<Response> getServerDatetimeLoadData(String lockId) =>
|
||||
post(
|
||||
getServerDatetimeUrl.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}));
|
||||
Future<Response> getServerDatetimeLoadData(String lockId) => post(
|
||||
getServerDatetimeUrl.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}));
|
||||
|
||||
// 获取锁版本信息
|
||||
Future<Response> getLockVersionInfoLoadData(String lockId) =>
|
||||
post(
|
||||
getLockVersionInfoUrl.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,}));
|
||||
Future<Response> getLockVersionInfoLoadData(String lockId) => post(
|
||||
getLockVersionInfoUrl.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}));
|
||||
|
||||
Future<Response> listLockByGroup(String type, String keyGroupId) => post(
|
||||
listLockByGroupURL.toUrl,
|
||||
@ -532,6 +537,25 @@ class ApiProvider extends BaseProvider {
|
||||
'keyGroupIdList': keyGroupIdList,
|
||||
'lockIdList': lockIdList
|
||||
}));
|
||||
|
||||
Future<Response> batchSendKey(
|
||||
String endDate,
|
||||
String keyGroupIdList,
|
||||
String lockIdList,
|
||||
String createUser,
|
||||
String isRemoteUnlock,
|
||||
String keyNameForAdmin,
|
||||
String receiverUsername,
|
||||
String startDate,
|
||||
String countryCode,
|
||||
String usernameType) =>
|
||||
post(
|
||||
batchSendKeyURL.toUrl,
|
||||
jsonEncode({
|
||||
'endDate': endDate,
|
||||
'keyGroupIdList': keyGroupIdList,
|
||||
'lockIdList': lockIdList
|
||||
}));
|
||||
}
|
||||
|
||||
extension ExtensionString on String {
|
||||
|
||||
@ -2,8 +2,8 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/login/seletCountryRegion/common/countryRegionEntity.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/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/basicInformation/KeyDetailEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/LockGroupListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
||||
@ -408,105 +408,93 @@ class ApiRepository {
|
||||
return PasswordKeyEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
|
||||
// 获取Wifi锁服务器
|
||||
Future<ConfiguringWifiEntity> getWifiLockServiceIpAndPort() async {
|
||||
final res = await apiProvider.getWifiLockServiceIpAndPort();
|
||||
return ConfiguringWifiEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
/// 锁设置模块
|
||||
/// 锁设置模块
|
||||
// 远程开锁开/关
|
||||
Future<LoginEntity> remoteUnlockingOpenOrClose(
|
||||
{
|
||||
Future<LoginEntity> remoteUnlockingOpenOrClose({
|
||||
required String lockId,
|
||||
required String featureValue,
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.remoteUnlockingOpenOrCloseLoadData(lockId, featureValue);
|
||||
final res = await apiProvider.remoteUnlockingOpenOrCloseLoadData(
|
||||
lockId, featureValue);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 自动闭锁
|
||||
Future<LoginEntity> setAutoUnlock(
|
||||
{
|
||||
required String lockId,
|
||||
required String autoLockTime,
|
||||
required String type,
|
||||
}) async {
|
||||
Future<LoginEntity> setAutoUnlock({
|
||||
required String lockId,
|
||||
required String autoLockTime,
|
||||
required String type,
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.setAutoUnlockLoadData(lockId, autoLockTime, type);
|
||||
await apiProvider.setAutoUnlockLoadData(lockId, autoLockTime, type);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取锁的常开模式设置 configPassageMode
|
||||
Future<GetPassageModeConfigEntity> getPassageModeConfig(
|
||||
{
|
||||
required String lockId,
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.getPassageModeConfigLoadData(lockId);
|
||||
Future<GetPassageModeConfigEntity> getPassageModeConfig({
|
||||
required String lockId,
|
||||
}) async {
|
||||
final res = await apiProvider.getPassageModeConfigLoadData(lockId);
|
||||
return GetPassageModeConfigEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 配置锁的常开模式
|
||||
Future<GetPassageModeConfigEntity> configPassageModeLoadData(
|
||||
{
|
||||
required String lockId,
|
||||
required String passageMode,
|
||||
required String autoUnlock,
|
||||
required String type,
|
||||
required String startDate,
|
||||
required String endDate,
|
||||
required String isAllDay,
|
||||
required List weekDays,
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.configPassageMode(lockId, passageMode, autoUnlock, type, startDate, endDate, isAllDay, weekDays);
|
||||
Future<GetPassageModeConfigEntity> configPassageModeLoadData({
|
||||
required String lockId,
|
||||
required String passageMode,
|
||||
required String autoUnlock,
|
||||
required String type,
|
||||
required String startDate,
|
||||
required String endDate,
|
||||
required String isAllDay,
|
||||
required List weekDays,
|
||||
}) async {
|
||||
final res = await apiProvider.configPassageMode(lockId, passageMode,
|
||||
autoUnlock, type, startDate, endDate, isAllDay, weekDays);
|
||||
return GetPassageModeConfigEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 配置锁的常规设置
|
||||
Future<LoginEntity> setLockSetGeneralSettingData(
|
||||
{
|
||||
required String lockId,
|
||||
required String changeType,
|
||||
required String isOn,
|
||||
required String type,
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.setLockSetGeneralSetting(lockId, changeType, isOn, type);
|
||||
Future<LoginEntity> setLockSetGeneralSettingData({
|
||||
required String lockId,
|
||||
required String changeType,
|
||||
required String isOn,
|
||||
required String type,
|
||||
}) async {
|
||||
final res = await apiProvider.setLockSetGeneralSetting(
|
||||
lockId, changeType, isOn, type);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取锁时间 通过网关
|
||||
Future<GetPassageModeConfigEntity> getLockTimeFromGateway(
|
||||
{
|
||||
required String lockId,
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.getLockTimeFromGatewayLoadData(lockId);
|
||||
Future<GetPassageModeConfigEntity> getLockTimeFromGateway({
|
||||
required String lockId,
|
||||
}) async {
|
||||
final res = await apiProvider.getLockTimeFromGatewayLoadData(lockId);
|
||||
return GetPassageModeConfigEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取服务器当前时间
|
||||
Future<GetServerDatetimeEntity> getServerDatetimeData(
|
||||
{
|
||||
required String lockId,
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.getServerDatetimeLoadData(lockId);
|
||||
Future<GetServerDatetimeEntity> getServerDatetimeData({
|
||||
required String lockId,
|
||||
}) async {
|
||||
final res = await apiProvider.getServerDatetimeLoadData(lockId);
|
||||
return GetServerDatetimeEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取锁版本信息
|
||||
Future<GetServerDatetimeEntity> getLockVersionInfoData(
|
||||
{
|
||||
required String lockId,
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.getLockVersionInfoLoadData(lockId);
|
||||
return GetServerDatetimeEntity.fromJson(res.body);}
|
||||
Future<GetServerDatetimeEntity> getLockVersionInfoData({
|
||||
required String lockId,
|
||||
}) async {
|
||||
final res = await apiProvider.getLockVersionInfoLoadData(lockId);
|
||||
return GetServerDatetimeEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
//分组下的锁列表
|
||||
Future<MassSendLockGroupListEntity> listLockByGroup(
|
||||
@ -535,4 +523,30 @@ class ApiRepository {
|
||||
await apiProvider.canSendKey(endDate, keyGroupIdList, lockIdList);
|
||||
return KeyDetailEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
//群发钥匙检查
|
||||
Future<KeyDetailEntity> batchSendKey(
|
||||
String endDate,
|
||||
String keyGroupIdList,
|
||||
String lockIdList,
|
||||
String createUser,
|
||||
String isRemoteUnlock,
|
||||
String keyNameForAdmin,
|
||||
String receiverUsername,
|
||||
String startDate,
|
||||
String countryCode,
|
||||
String usernameType) async {
|
||||
final res = await apiProvider.batchSendKey(
|
||||
endDate,
|
||||
keyGroupIdList,
|
||||
lockIdList,
|
||||
createUser,
|
||||
isRemoteUnlock,
|
||||
keyNameForAdmin,
|
||||
receiverUsername,
|
||||
startDate,
|
||||
countryCode,
|
||||
usernameType);
|
||||
return KeyDetailEntity.fromJson(res.body);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_connect/http/src/request/request.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginData.dart';
|
||||
|
||||
import '../login/login/entity/LoginEntity.dart';
|
||||
import '../tools/platform_info_services.dart';
|
||||
@ -18,7 +19,10 @@ FutureOr<Request> requestInterceptor(Request request) async {
|
||||
String? xToken = '';
|
||||
final data = await Storage.getString('userLoginData');
|
||||
if (data != null && data.isNotEmpty) {
|
||||
xToken = LoginEntity.fromJson(jsonDecode(data)).data!.accessToken;
|
||||
LoginData loginData = LoginData.fromJson(jsonDecode(data));
|
||||
xToken = loginData.accessToken;
|
||||
|
||||
// xToken = LoginEntity.fromJson(jsonDecode(data)).data!.accessToken;
|
||||
}
|
||||
request.headers['Authorization'] = "Bearer ${xToken ?? ''}";
|
||||
return request;
|
||||
|
||||
@ -45,11 +45,10 @@ class ShowTFView extends StatelessWidget {
|
||||
controller: controller,
|
||||
autofocus: false,
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding:
|
||||
EdgeInsets.only(top: 20.h, left: 15.0, bottom: 13.h),
|
||||
hintText: tipTitle,
|
||||
hintStyle: TextStyle(fontSize: 28.sp),
|
||||
const EdgeInsets.only(left: 5, top: -8, bottom: 6),
|
||||
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
hintStyle: TextStyle(fontSize: 22.sp, height: 1.0),
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
//左边图标设置
|
||||
|
||||