Merge branch 'release' of gitee.com:starlock-cn/app-starlock into release
# Conflicts: # lib/network/api.dart 冲突合并
This commit is contained in:
commit
15dd47d2f0
@ -10,8 +10,8 @@ import 'package:star_lock/tools/dateTool.dart';
|
|||||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_reply.dart';
|
|
||||||
import '../../../../blue/io_protocol/io_transferPermissions.dart';
|
import '../../../../blue/io_protocol/io_transferPermissions.dart';
|
||||||
|
import '../../../../blue/io_reply.dart';
|
||||||
import '../../../../blue/io_tool/io_tool.dart';
|
import '../../../../blue/io_tool/io_tool.dart';
|
||||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
import '../../../../blue/sender_manage.dart';
|
import '../../../../blue/sender_manage.dart';
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.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/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_state.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
|
|
||||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||||
@ -31,8 +32,8 @@ class AuthorizedAdminPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
||||||
with SingleTickerProviderStateMixin {
|
with SingleTickerProviderStateMixin {
|
||||||
final logic = Get.put(AuthorizedAdminLogic());
|
final AuthorizedAdminLogic logic = Get.put(AuthorizedAdminLogic());
|
||||||
final state = Get.find<AuthorizedAdminLogic>().state;
|
final AuthorizedAdminState state = Get.find<AuthorizedAdminLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -60,7 +61,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
_tabBar(),
|
_tabBar(),
|
||||||
_pageWidget(),
|
_pageWidget(),
|
||||||
],
|
],
|
||||||
@ -78,7 +79,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
// 限时
|
// 限时
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
keyInfoWidget(),
|
keyInfoWidget(),
|
||||||
keyTimeWidget(),
|
keyTimeWidget(),
|
||||||
keyOnlyManageWidget(),
|
keyOnlyManageWidget(),
|
||||||
@ -92,7 +93,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
// 永久
|
// 永久
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
keyInfoWidget(),
|
keyInfoWidget(),
|
||||||
keyOnlyManageWidget(),
|
keyOnlyManageWidget(),
|
||||||
keyBottomWidget(
|
keyBottomWidget(
|
||||||
@ -107,17 +108,17 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
// 顶部钥匙信息widget
|
// 顶部钥匙信息widget
|
||||||
Widget keyInfoWidget() {
|
Widget keyInfoWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
|
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: getTFWidget(true,
|
rightWidget: getTFWidget(true,
|
||||||
TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, 1)),
|
TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, 1)),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
@ -128,7 +129,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||||
),
|
),
|
||||||
action: () async {
|
action: () async {
|
||||||
var result = await Navigator.pushNamed(
|
final Object? result = await Navigator.pushNamed(
|
||||||
context, Routers.selectCountryRegionPage);
|
context, Routers.selectCountryRegionPage);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
result as Map<String, dynamic>;
|
result as Map<String, dynamic>;
|
||||||
@ -140,7 +141,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
),
|
),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: getTFWidget(
|
rightWidget: getTFWidget(
|
||||||
false, TranslationLoader.lanKeys!.enterYourName!.tr, 2)),
|
false, TranslationLoader.lanKeys!.enterYourName!.tr, 2)),
|
||||||
@ -152,17 +153,18 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
// 生效失效时间
|
// 生效失效时间
|
||||||
Widget keyTimeWidget() {
|
Widget keyTimeWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||||
rightTitle: state.beginDate.value,
|
rightTitle: state.beginDate.value,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
PDuration selectDate =
|
final PDuration selectDate =
|
||||||
PDuration.parse(DateTime.tryParse(state.beginDate.value));
|
PDuration.parse(DateTime.tryParse(state.beginDate.value));
|
||||||
Pickers.showDatePicker(context,
|
Pickers.showDatePicker(context,
|
||||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
selectDate: selectDate,
|
||||||
|
mode: DateMode.YMDHM, onConfirm: (PDuration p) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.beginDate.value = DateTool().getYMDHNDateString(p, 1);
|
state.beginDate.value = DateTool().getYMDHNDateString(p, 1);
|
||||||
});
|
});
|
||||||
@ -173,10 +175,11 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
rightTitle: state.endDate.value,
|
rightTitle: state.endDate.value,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
PDuration selectDate =
|
final PDuration selectDate =
|
||||||
PDuration.parse(DateTime.tryParse(state.endDate.value));
|
PDuration.parse(DateTime.tryParse(state.endDate.value));
|
||||||
Pickers.showDatePicker(context,
|
Pickers.showDatePicker(context,
|
||||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
selectDate: selectDate,
|
||||||
|
mode: DateMode.YMDHM, onConfirm: (PDuration p) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.endDate.value = DateTool().getYMDHNDateString(p, 1);
|
state.endDate.value = DateTool().getYMDHNDateString(p, 1);
|
||||||
});
|
});
|
||||||
@ -190,14 +193,14 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
// 实名认证
|
// 实名认证
|
||||||
Widget keyOnlyManageWidget() {
|
Widget keyOnlyManageWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: "仅管理自己创建的用户",
|
leftTitel: '仅管理自己创建的用户',
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
isTipsImg: true,
|
isTipsImg: true,
|
||||||
tipsImgAction: () {
|
tipsImgAction: () {
|
||||||
ShowTipView().showSureAlertDialog("授权管理员只能查看和管理自己下发的钥匙、密码等权限");
|
ShowTipView().showSureAlertDialog('授权管理员只能查看和管理自己下发的钥匙、密码等权限');
|
||||||
},
|
},
|
||||||
rightWidget: SizedBox(
|
rightWidget: SizedBox(
|
||||||
width: 60.w,
|
width: 60.w,
|
||||||
@ -212,11 +215,11 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
|
|
||||||
Widget keyBottomWidget(String tipStr) {
|
Widget keyBottomWidget(String tipStr) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.all(20.w),
|
padding: EdgeInsets.all(20.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
tipStr,
|
tipStr,
|
||||||
@ -233,26 +236,27 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.send!.tr,
|
btnName: TranslationLoader.lanKeys!.send!.tr,
|
||||||
onClick: () async {
|
onClick: () async {
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
//发送钥匙请求
|
//发送钥匙请求
|
||||||
logic.sendElectronicKeyRequest();
|
logic.sendElectronicKeyRequest();
|
||||||
} else {
|
} else {
|
||||||
logic.showToast("演示模式");
|
logic.showToast('演示模式');
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(right: 30.w),
|
padding: EdgeInsets.only(right: 30.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode =
|
||||||
|
await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
Get.toNamed(Routers.volumeAuthorizationLockManagePage);
|
Get.toNamed(Routers.volumeAuthorizationLockManagePage);
|
||||||
} else {
|
} else {
|
||||||
logic.showToast("演示模式");
|
logic.showToast('演示模式');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -270,16 +274,15 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
// 实名认证
|
// 实名认证
|
||||||
Widget keyRealNameWidget() {
|
Widget keyRealNameWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isTipsImg: true,
|
isTipsImg: true,
|
||||||
isHaveLine:
|
isHaveLine: logic.state.isRequireAuth.value == true,
|
||||||
logic.state.isRequireAuth.value == true ? true : false,
|
|
||||||
tipsImgAction: () {
|
tipsImgAction: () {
|
||||||
ShowTipView().showSureAlertDialog(
|
ShowTipView().showSureAlertDialog(
|
||||||
"人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。".tr);
|
'人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。'.tr);
|
||||||
},
|
},
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: SizedBox(
|
rightWidget: SizedBox(
|
||||||
@ -289,7 +292,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
visible: logic.state.isRequireAuth.value,
|
visible: logic.state.isRequireAuth.value,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: '真实姓名'.tr,
|
leftTitel: '真实姓名'.tr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
rightWidget: getTFWidget(false, '请输入真实姓名'.tr, 3)))),
|
rightWidget: getTFWidget(false, '请输入真实姓名'.tr, 3)))),
|
||||||
@ -297,7 +300,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
visible: logic.state.isRequireAuth.value,
|
visible: logic.state.isRequireAuth.value,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: '身份证号'.tr,
|
leftTitel: '身份证号'.tr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: getTFWidget(false, '请输入身份证号'.tr, 4)))),
|
rightWidget: getTFWidget(false, '请输入身份证号'.tr, 4)))),
|
||||||
],
|
],
|
||||||
@ -307,13 +310,13 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
// 发送电子钥匙成功
|
// 发送电子钥匙成功
|
||||||
Widget sendElectronicKeySucceed() {
|
Widget sendElectronicKeySucceed() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
height: 250.h,
|
height: 250.h,
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 30.h,
|
height: 30.h,
|
||||||
),
|
),
|
||||||
@ -327,9 +330,9 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
"发送成功",
|
'发送成功',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 26.sp,
|
fontSize: 26.sp,
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
@ -354,9 +357,9 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
),
|
),
|
||||||
OutLineBtn(
|
OutLineBtn(
|
||||||
btnName:
|
btnName:
|
||||||
state.emailOrPhoneController.text.contains("@") ? '邮件通知' : "短信通知",
|
state.emailOrPhoneController.text.contains('@') ? '邮件通知' : '短信通知',
|
||||||
onClick: () {
|
onClick: () {
|
||||||
if (state.emailOrPhoneController.text.contains("@")) {
|
if (state.emailOrPhoneController.text.contains('@')) {
|
||||||
Get.toNamed(Routers.sendEmailNotificationPage);
|
Get.toNamed(Routers.sendEmailNotificationPage);
|
||||||
} else {
|
} else {
|
||||||
NativeInteractionTool()
|
NativeInteractionTool()
|
||||||
@ -387,7 +390,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
height: 65.h,
|
height: 65.h,
|
||||||
width: 300.w,
|
width: 300.w,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
//输入框一行
|
//输入框一行
|
||||||
@ -425,38 +428,37 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: 10.w,
|
width: 10.w,
|
||||||
),
|
),
|
||||||
isHaveBtn
|
if (isHaveBtn)
|
||||||
? Container(
|
Container(
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
height: 30.w,
|
height: 30.w,
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage('images/icon_addressBook.png'),
|
image: AssetImage('images/icon_addressBook.png'),
|
||||||
fit: BoxFit.fill),
|
fit: BoxFit.fill),
|
||||||
),
|
),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
Contact? currentContact =
|
final Contact? currentContact =
|
||||||
await state.contactPicker.selectContact();
|
await state.contactPicker.selectContact();
|
||||||
setState(() {
|
setState(() {
|
||||||
state.contact = currentContact!;
|
state.contact = currentContact!;
|
||||||
if (currentContact.phoneNumbers!.isNotEmpty) {
|
if (currentContact.phoneNumbers!.isNotEmpty) {
|
||||||
state.emailOrPhoneController.text = currentContact
|
state.emailOrPhoneController.text = currentContact
|
||||||
.phoneNumbers![0]
|
.phoneNumbers![0]
|
||||||
.replaceAll(RegExp(r"\s+\b|\b\s"), "");
|
.replaceAll(RegExp(r'\s+\b|\b\s'), '');
|
||||||
}
|
}
|
||||||
|
if (currentContact.fullName!.isNotEmpty) {
|
||||||
if (currentContact.fullName!.isNotEmpty) {
|
state.keyNameController.text = currentContact.fullName!;
|
||||||
state.keyNameController.text =
|
}
|
||||||
currentContact.fullName!;
|
});
|
||||||
}
|
},
|
||||||
});
|
),
|
||||||
},
|
)
|
||||||
),
|
else
|
||||||
)
|
Container()
|
||||||
: Container()
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -469,7 +471,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: state.isAuthentication.value,
|
value: state.isAuthentication.value,
|
||||||
onChanged: (value) {
|
onChanged: (bool value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
if (logic.state.isAuthentication.value == false) {
|
if (logic.state.isAuthentication.value == false) {
|
||||||
logic.keyCheckFace();
|
logic.keyCheckFace();
|
||||||
@ -489,7 +491,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: state.onlyManageYouCreatesUser.value,
|
value: state.onlyManageYouCreatesUser.value,
|
||||||
onChanged: (value) {
|
onChanged: (bool value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.onlyManageYouCreatesUser.value =
|
state.onlyManageYouCreatesUser.value =
|
||||||
!state.onlyManageYouCreatesUser.value;
|
!state.onlyManageYouCreatesUser.value;
|
||||||
@ -498,7 +500,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future _openModalBottomSheet() async {
|
void _openModalBottomSheet() {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
@ -506,7 +508,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
constraints: BoxConstraints(maxHeight: 270.h),
|
constraints: BoxConstraints(maxHeight: 270.h),
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: ScreenUtil().screenWidth,
|
width: ScreenUtil().screenWidth,
|
||||||
height: 180.h,
|
height: 180.h,
|
||||||
@ -537,7 +539,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> initBottomSheetList() {
|
List<Widget> initBottomSheetList() {
|
||||||
List<Widget> widgetList = [];
|
final List<Widget> widgetList = <Widget>[];
|
||||||
|
|
||||||
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友', 0));
|
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友', 0));
|
||||||
widgetList.add(buildCenter3('images/icon_message.png', '短信', 1));
|
widgetList.add(buildCenter3('images/icon_message.png', '短信', 1));
|
||||||
@ -557,7 +559,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
EdgeInsets.only(top: 20.w, bottom: 20.w, left: 10.w, right: 10.w),
|
EdgeInsets.only(top: 20.w, bottom: 20.w, left: 10.w, right: 10.w),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: <Widget>[
|
||||||
Image.asset(
|
Image.asset(
|
||||||
imageName,
|
imageName,
|
||||||
width: 50.w,
|
width: 50.w,
|
||||||
@ -579,7 +581,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
//\n生效时间:${itemData.startDate}\n类型:永久\n锁名:${itemData.keyboardPwdName}
|
//\n生效时间:${itemData.startDate}\n类型:永久\n锁名:${itemData.keyboardPwdName}
|
||||||
_jumpSmartDeviceRoute(int itemIndex) {
|
dynamic _jumpSmartDeviceRoute(int itemIndex) {
|
||||||
Get.back();
|
Get.back();
|
||||||
switch (itemIndex) {
|
switch (itemIndex) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -613,8 +615,8 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
TabBar _tabBar() {
|
TabBar _tabBar() {
|
||||||
return TabBar(
|
return TabBar(
|
||||||
controller: state.tabController,
|
controller: state.tabController,
|
||||||
tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(),
|
tabs: _itemTabs.map(_tab).toList(),
|
||||||
onTap: (index) {
|
onTap: (int index) {
|
||||||
FocusScope.of(context).requestFocus(FocusNode());
|
FocusScope.of(context).requestFocus(FocusNode());
|
||||||
},
|
},
|
||||||
isScrollable: true,
|
isScrollable: true,
|
||||||
@ -655,14 +657,14 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
child: TabBarView(
|
child: TabBarView(
|
||||||
controller: state.tabController,
|
controller: state.tabController,
|
||||||
children: _itemTabs
|
children: _itemTabs
|
||||||
.map((ItemView item) => Obx(() => indexChangeWidget()))
|
.map((ItemView item) => Obx(indexChangeWidget))
|
||||||
.toList()),
|
.toList()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<ItemView> _itemTabs = <ItemView>[
|
final List<ItemView> _itemTabs = <ItemView>[
|
||||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, type: "0"),
|
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, type: '0'),
|
||||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, type: "1"),
|
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, type: '1'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:flutter_slidable/flutter_slidable.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.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/authorizedAdmin/authorizedAdminList/authorizedAdminList_logic.dart';
|
||||||
|
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/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 'package:star_lock/tools/storage.dart';
|
||||||
@ -25,8 +26,8 @@ class AuthorizedAdminListPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
||||||
final logic = Get.put(AuthorizedAdminListLogic());
|
final AuthorizedAdminListLogic logic = Get.put(AuthorizedAdminListLogic());
|
||||||
final state = Get.find<AuthorizedAdminListLogic>().state;
|
final AuthorizedAdminListState state = Get.find<AuthorizedAdminListLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -37,7 +38,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
|
|
||||||
Future<void> mockRequest() async {
|
Future<void> mockRequest() async {
|
||||||
// 获取是否是演示模式 演示模式不获取接口
|
// 获取是否是演示模式 演示模式不获取接口
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
logic.mockNetworkDataRequest().then((ElectronicKeyListEntity value) {
|
logic.mockNetworkDataRequest().then((ElectronicKeyListEntity value) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
@ -63,7 +64,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
mockRequest();
|
mockRequest();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Expanded(child: _buildMainUI()),
|
Expanded(child: _buildMainUI()),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
@ -72,7 +73,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
btnName: TranslationLoader.lanKeys!.addAuthorizedAdmin!.tr,
|
btnName: TranslationLoader.lanKeys!.addAuthorizedAdmin!.tr,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
Navigator.pushNamed(context, Routers.authorizedAdminPage)
|
Navigator.pushNamed(context, Routers.authorizedAdminPage)
|
||||||
.then((val) {
|
.then((Object? val) {
|
||||||
if (val != null) {
|
if (val != null) {
|
||||||
logic.pageNo = 1;
|
logic.pageNo = 1;
|
||||||
mockRequest();
|
mockRequest();
|
||||||
@ -89,14 +90,14 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMainUI() {
|
Widget _buildMainUI() {
|
||||||
return Obx(() => state.itemDataList.value.isEmpty
|
return Obx(() => state.itemDataList.isEmpty
|
||||||
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - 90)
|
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - 90)
|
||||||
: SlidableAutoCloseBehavior(
|
: SlidableAutoCloseBehavior(
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
itemCount: state.itemDataList.value.length,
|
itemCount: state.itemDataList.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (BuildContext c, int index) {
|
||||||
ElectronicKeyListItem indexEntity =
|
final ElectronicKeyListItem indexEntity =
|
||||||
state.itemDataList.value[index];
|
state.itemDataList[index];
|
||||||
String useDateStr = ''; //使用期限
|
String useDateStr = ''; //使用期限
|
||||||
String keyStatus = ''; //钥匙状态
|
String keyStatus = ''; //钥匙状态
|
||||||
|
|
||||||
@ -116,16 +117,16 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Slidable(
|
return Slidable(
|
||||||
key: ValueKey(indexEntity.keyId),
|
key: ValueKey<int?>(indexEntity.keyId),
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
extentRatio: 0.2,
|
extentRatio: 0.2,
|
||||||
motion: const ScrollMotion(),
|
motion: const ScrollMotion(),
|
||||||
children: [
|
children: <Widget>[
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
onPressed: (BuildContext context) {
|
onPressed: (BuildContext context) {
|
||||||
ShowTipView()
|
ShowTipView()
|
||||||
.showDeleteAdministratorIsHaveAllDataDialog(
|
.showDeleteAdministratorIsHaveAllDataDialog(
|
||||||
'同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
'同时删除其发送的所有钥匙,钥匙删除后不能恢复', (bool isAllData) {
|
||||||
logic.deleteKeyRequest(indexEntity.keyId.toString(),
|
logic.deleteKeyRequest(indexEntity.keyId.toString(),
|
||||||
isAllData ? 1 : 0);
|
isAllData ? 1 : 0);
|
||||||
});
|
});
|
||||||
@ -145,9 +146,9 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
isAdminKey, () {
|
isAdminKey, () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context, Routers.electronicKeyDetailPage,
|
context, Routers.electronicKeyDetailPage,
|
||||||
arguments: {
|
arguments: <String, ElectronicKeyListItem>{
|
||||||
"itemData": indexEntity,
|
'itemData': indexEntity,
|
||||||
}).then((val) {
|
}).then((Object? val) {
|
||||||
if (val != null) {
|
if (val != null) {
|
||||||
logic.mockNetworkDataRequest();
|
logic.mockNetworkDataRequest();
|
||||||
setState(() {});
|
setState(() {});
|
||||||
@ -172,14 +173,14 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
|
|
||||||
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||||
//限期
|
//限期
|
||||||
DateTime startDateStr =
|
final DateTime startDateStr =
|
||||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
||||||
DateTime endDateStr =
|
final DateTime endDateStr =
|
||||||
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 == XSConstantMacro.keyTypeLong) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||||
useDateStr = "永久";
|
useDateStr = '永久';
|
||||||
}
|
}
|
||||||
return useDateStr;
|
return useDateStr;
|
||||||
}
|
}
|
||||||
@ -192,7 +193,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
height: 100.h,
|
height: 100.h,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(width: 30.w),
|
SizedBox(width: 30.w),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
avatarURL,
|
avatarURL,
|
||||||
@ -203,13 +204,13 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: <Widget>[
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 1.sw - 110.w - 100.w,
|
width: 1.sw - 110.w - 100.w,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(receiveUser,
|
child: Text(receiveUser,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
@ -231,7 +232,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
useDate,
|
useDate,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@ -0,0 +1,71 @@
|
|||||||
|
class NoticeTemplateEntity {
|
||||||
|
NoticeTemplateEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
NoticeTemplateEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
if (json['data'] is Map) {
|
||||||
|
data = Data.fromJson(json['data']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['errorCode'] = errorCode;
|
||||||
|
data['description'] = description;
|
||||||
|
data['errorMsg'] = errorMsg;
|
||||||
|
data['data'] = this.data;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Data {
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['list'] is List) {
|
||||||
|
json['list'].forEach((dynamic element) {
|
||||||
|
list?.add(Item.fromJson(element));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Item>? list = [];
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['list'] = list;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Item {
|
||||||
|
Item.fromJson(Map<String, dynamic> json) {
|
||||||
|
type = json['type'];
|
||||||
|
name = json['name'];
|
||||||
|
template = json['template'];
|
||||||
|
isUse = json['isUse'];
|
||||||
|
fee = json['fee'];
|
||||||
|
}
|
||||||
|
|
||||||
|
String? type;
|
||||||
|
String? name;
|
||||||
|
String? template;
|
||||||
|
int? isUse;
|
||||||
|
int? fee;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['type'] = type;
|
||||||
|
data['name'] = name;
|
||||||
|
data['template'] = template;
|
||||||
|
data['isUse'] = isUse;
|
||||||
|
data['fee'] = fee;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,19 +2,22 @@ import 'dart:ffi';
|
|||||||
|
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/notice_template_entity.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lockSet/basicInformation/basicInformation/KeyDetailEntity.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/commonDataManage.dart';
|
||||||
|
|
||||||
import 'volumeAuthorizationLock_state.dart';
|
import 'volumeAuthorizationLock_state.dart';
|
||||||
|
|
||||||
class VolumeAuthorizationLockLogic extends BaseGetXController {
|
class VolumeAuthorizationLockLogic extends BaseGetXController {
|
||||||
final state = VolumeAuthorizationLockState();
|
final VolumeAuthorizationLockState state = VolumeAuthorizationLockState();
|
||||||
|
|
||||||
//发送批量授权管理员
|
//发送批量授权管理员
|
||||||
Future<void> addAuthorizedAdminRequest() async {
|
Future<void> addAuthorizedAdminRequest() async {
|
||||||
String getFailureDateTime = '0';
|
String getFailureDateTime = '0';
|
||||||
String getEffectiveDateTime = '0';
|
String getEffectiveDateTime = '0';
|
||||||
if (state.selectWidgetType == '1') {
|
if (state.selectWidgetType.value == '1') {
|
||||||
getFailureDateTime =
|
getFailureDateTime =
|
||||||
state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
||||||
getEffectiveDateTime =
|
getEffectiveDateTime =
|
||||||
@ -25,11 +28,11 @@ class VolumeAuthorizationLockLogic extends BaseGetXController {
|
|||||||
showToast('请选择锁'.tr);
|
showToast('请选择锁'.tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var entity = await ApiRepository.to.addAuthorizedAdmin(
|
final KeyDetailEntity entity = await ApiRepository.to.addAuthorizedAdmin(
|
||||||
createUser: state.isCreateUser.value ? '1' : '0',
|
createUser: state.isCreateUser.value ? '1' : '0',
|
||||||
endDate: getFailureDateTime,
|
endDate: getFailureDateTime,
|
||||||
isRemoteUnlock: '0',
|
isRemoteUnlock: '0',
|
||||||
keyGroupIdList: [],
|
keyGroupIdList: <dynamic>[],
|
||||||
lockIdList: state.lockIdList.value,
|
lockIdList: state.lockIdList.value,
|
||||||
name: state.keyNameController.text,
|
name: state.keyNameController.text,
|
||||||
startDate: getEffectiveDateTime,
|
startDate: getEffectiveDateTime,
|
||||||
@ -49,4 +52,5 @@ class VolumeAuthorizationLockLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -181,7 +181,7 @@ class _VolumeAuthorizationLockPageState
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.lock!.tr,
|
leftTitel: TranslationLoader.lanKeys!.lock!.tr,
|
||||||
rightTitle: state.lockIdList.value.isEmpty
|
rightTitle: state.lockIdList.isEmpty
|
||||||
? TranslationLoader.lanKeys!.pleaseSelect!.tr
|
? TranslationLoader.lanKeys!.pleaseSelect!.tr
|
||||||
: state.lockIdList.length.toString(),
|
: state.lockIdList.length.toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
@ -190,11 +190,13 @@ class _VolumeAuthorizationLockPageState
|
|||||||
arguments: <String, String>{'keyLimits': '1'})
|
arguments: <String, String>{'keyLimits': '1'})
|
||||||
.then((Object? value) {
|
.then((Object? value) {
|
||||||
//得到选中的锁ID列表
|
//得到选中的锁ID列表
|
||||||
if (value != null) {
|
if (value is Map<String, dynamic> &&
|
||||||
value as Map<String, dynamic>;
|
value['selectLockIdList'] is List) {
|
||||||
state.lockIdList.value = value['selectLockIdList'];
|
state.lockIdList.clear();
|
||||||
|
value['selectLockIdList'].forEach((element) {
|
||||||
// setState(() {});
|
state.lockIdList.add(element);
|
||||||
|
});
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
@ -211,13 +213,6 @@ class _VolumeAuthorizationLockPageState
|
|||||||
width: 60.w,
|
width: 60.w,
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
child: _onlyManageYouCreatesUserSwitch())),
|
child: _onlyManageYouCreatesUserSwitch())),
|
||||||
|
|
||||||
// CommonItem(
|
|
||||||
// leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
|
||||||
// rightTitle: '',
|
|
||||||
// isHaveRightWidget: true,
|
|
||||||
// rightWidget: SizedBox(width: 60.w, height: 50.h, child: _switch()),
|
|
||||||
// action: () {}),
|
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -359,47 +354,10 @@ class _VolumeAuthorizationLockPageState
|
|||||||
state.isSendSuccess.value = false;
|
state.isSendSuccess.value = false;
|
||||||
Navigator.pop(context, true);
|
Navigator.pop(context, true);
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
|
||||||
height: 10.h,
|
|
||||||
),
|
|
||||||
OutLineBtn(
|
|
||||||
btnName: '邮件通知',
|
|
||||||
onClick: () {
|
|
||||||
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10.h,
|
|
||||||
),
|
|
||||||
OutLineBtn(
|
|
||||||
btnName: '微信通知',
|
|
||||||
onClick: () {},
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10.h,
|
|
||||||
),
|
|
||||||
OutLineBtn(
|
|
||||||
btnName: '标记为已入住',
|
|
||||||
onClick: () {},
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// CupertinoSwitch _switch() {
|
|
||||||
// return CupertinoSwitch(
|
|
||||||
// activeColor: CupertinoColors.activeBlue,
|
|
||||||
// trackColor: CupertinoColors.systemGrey5,
|
|
||||||
// thumbColor: CupertinoColors.white,
|
|
||||||
// value: state.isRemoteUnlock.value,
|
|
||||||
// onChanged: (bool value) {
|
|
||||||
// setState(() {
|
|
||||||
// _isRemoteUnlock = !_isRemoteUnlock;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
//仅管理自己创建的用户
|
//仅管理自己创建的用户
|
||||||
CupertinoSwitch _onlyManageYouCreatesUserSwitch() {
|
CupertinoSwitch _onlyManageYouCreatesUserSwitch() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
@ -407,7 +365,7 @@ class _VolumeAuthorizationLockPageState
|
|||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: state.onlyManageYouCreatesUser.value,
|
value: state.onlyManageYouCreatesUser.value,
|
||||||
onChanged: (value) {
|
onChanged: (bool value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.onlyManageYouCreatesUser.value =
|
state.onlyManageYouCreatesUser.value =
|
||||||
!state.onlyManageYouCreatesUser.value;
|
!state.onlyManageYouCreatesUser.value;
|
||||||
|
|||||||
@ -236,4 +236,6 @@ abstract class Api {
|
|||||||
final String deleteLockCloudStorageURL = '/lockCloudStorage/delete'; //删除云存
|
final String deleteLockCloudStorageURL = '/lockCloudStorage/delete'; //删除云存
|
||||||
|
|
||||||
final String getUserNoList = '/key/getUserNoList'; //获取指定锁下所有userNo
|
final String getUserNoList = '/key/getUserNoList'; //获取指定锁下所有userNo
|
||||||
|
|
||||||
|
final String getNoticeTemplateURL = '/key/getNoticeTemplate'; //获取短信或者邮箱模板
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2085,6 +2085,17 @@ class ApiProvider extends BaseProvider {
|
|||||||
// 获取指定锁下所有userNo
|
// 获取指定锁下所有userNo
|
||||||
Future<Response> getLockUserNoList(int lockId) =>
|
Future<Response> getLockUserNoList(int lockId) =>
|
||||||
post(getUserNoList.toUrl, jsonEncode({'lockId': lockId}));
|
post(getUserNoList.toUrl, jsonEncode({'lockId': lockId}));
|
||||||
|
|
||||||
|
// 获取短信或者邮箱模板
|
||||||
|
Future<Response<dynamic>> getNoticeTemplate(
|
||||||
|
int lockId, int keyId, int channelType) =>
|
||||||
|
post(
|
||||||
|
getNoticeTemplateURL.toUrl,
|
||||||
|
jsonEncode(<String, int>{
|
||||||
|
'lockId': lockId,
|
||||||
|
'keyId': keyId,
|
||||||
|
'channelType': channelType,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ExtensionString on String {
|
extension ExtensionString on String {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/blue/entity/lock_user_no_list_entity.dart';
|
import 'package:star_lock/blue/entity/lock_user_no_list_entity.dart';
|
||||||
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.dart';
|
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/notice_template_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.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/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||||
@ -2119,4 +2120,15 @@ class ApiRepository {
|
|||||||
final res = await apiProvider.getLockUserNoList(lockId);
|
final res = await apiProvider.getLockUserNoList(lockId);
|
||||||
return LockUserNoListEntity.fromJson(res.body);
|
return LockUserNoListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 电子钥匙获取短信模板
|
||||||
|
Future<NoticeTemplateEntity> getNoticeTemplate({
|
||||||
|
required int lockId,
|
||||||
|
required int keyId,
|
||||||
|
required int channelType,
|
||||||
|
}) async {
|
||||||
|
final Response<dynamic> res =
|
||||||
|
await apiProvider.getNoticeTemplate(lockId, keyId, channelType);
|
||||||
|
return NoticeTemplateEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import 'package:get/get_connect/http/src/request/request.dart';
|
|||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
|
|
||||||
FutureOr<dynamic> responseLogInterceptor(Request request, Response response) {
|
FutureOr<dynamic> responseLogInterceptor(Request request, Response response) {
|
||||||
// AppLog.log('HTTP request:${request.url}\n RESPONSE => stataCode:${response.statusCode} ${response.bodyString}'); // \n ${response.headers}
|
AppLog.log('HTTP request:${request.url}\n RESPONSE => stataCode:${response.statusCode} ${response.bodyString}'); // \n ${response.headers}
|
||||||
EasyLoading.dismiss(animation: true);
|
EasyLoading.dismiss(animation: true);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,8 +55,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# 1.0.45+2024052003:打包给公司测试
|
# 1.0.45+2024052003:打包给公司测试
|
||||||
# 1.0.46+2024052004:打包给公司测试
|
# 1.0.46+2024052004:打包给公司测试
|
||||||
# 1.0.47+2024052101:打包给欧阳回归测试
|
# 1.0.47+2024052101:打包给欧阳回归测试
|
||||||
|
# 1.0.48+2024052201:打包给欧阳回归测试
|
||||||
|
|
||||||
version: 1.0.47+2024052101
|
version: 1.0.48+2024052201
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.12.0 <3.0.0'
|
sdk: '>=2.12.0 <3.0.0'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user