feat: 增加手动添加、邀请设置页面

This commit is contained in:
liyi 2025-09-20 16:03:20 +08:00
parent b176893a39
commit 7f84b06d85
20 changed files with 982 additions and 46 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -37,6 +37,18 @@ class _AppState extends State<App> {
selectionHandleColor: Colors.blue.shade300, selectionHandleColor: Colors.blue.shade300,
), ),
dialogBackgroundColor: Colors.white, dialogBackgroundColor: Colors.white,
checkboxTheme: CheckboxThemeData(
side: const BorderSide(
color: Colors.grey,
width: 1, //
),
visualDensity: VisualDensity.compact,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.r),
),
checkColor: MaterialStateProperty.all(Colors.white),
fillColor: MaterialStateProperty.all(Colors.blue),
),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
backgroundColor: Colors.white, backgroundColor: Colors.white,
elevation: 0, elevation: 0,

View File

@ -4,6 +4,7 @@ class AppImages{
static const String iconOneKeyDoorKey = 'assets/icon/icon_one_key_door_key.png'; static const String iconOneKeyDoorKey = 'assets/icon/icon_one_key_door_key.png';
static const String bgOneKeyDoor = 'assets/images/bg_one_key_door.png'; static const String bgOneKeyDoor = 'assets/images/bg_one_key_door.png';
static const String mockImage = 'assets/images/mockImage.jpg'; static const String mockImage = 'assets/images/mockImage.jpg';
static const String mockErCode = 'assets/images/mock_er_code.png';
// //
static const String iconVideoCenter = 'assets/icon/video_center.png'; static const String iconVideoCenter = 'assets/icon/video_center.png';

View File

@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -6,6 +7,7 @@ class CustomCellWidget extends StatelessWidget {
const CustomCellWidget({ const CustomCellWidget({
super.key, super.key,
required this.leftText, required this.leftText,
this.leftSubText,
this.leftIcon, this.leftIcon,
this.rightWidget, this.rightWidget,
this.onTap, this.onTap,
@ -13,6 +15,7 @@ class CustomCellWidget extends StatelessWidget {
}); });
final String leftText; final String leftText;
final String? leftSubText;
final Icon? leftIcon; final Icon? leftIcon;
final Widget? rightWidget; final Widget? rightWidget;
final GestureTapCallback? onTap; final GestureTapCallback? onTap;
@ -36,21 +39,48 @@ class CustomCellWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Row( Expanded(
mainAxisAlignment: MainAxisAlignment.start, flex: 1,
crossAxisAlignment: CrossAxisAlignment.center, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
if (leftIcon != null) leftIcon!, children: [
if (leftIcon != null) SizedBox(width: 4.w), Row(
Text( mainAxisAlignment: MainAxisAlignment.start,
leftText, crossAxisAlignment: CrossAxisAlignment.center,
style: TextStyle( children: [
fontSize: 14.sp, if (leftIcon != null) leftIcon!,
color: Colors.black87, if (leftIcon != null) SizedBox(width: 4.w),
fontWeight: FontWeight.w400, Expanded(
child: Text(
leftText,
style: TextStyle(
fontSize: 14.sp,
color: Colors.black87,
fontWeight: FontWeight.w400,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
],
), ),
), if (leftSubText != null)
], SizedBox(
height: 4.h,
),
if (leftSubText != null)
Text(
leftSubText!,
style: TextStyle(
fontSize: 11.sp,
color: Colors.grey,
fontWeight: FontWeight.w400,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
],
),
), ),
rightWidget ?? rightWidget ??
Text( Text(

View File

@ -7,6 +7,8 @@ class CustomAppBarWidget extends StatelessWidget implements PreferredSizeWidget
final Widget? leading; final Widget? leading;
final bool centerTitle; final bool centerTitle;
final Color? backgroundColor; final Color? backgroundColor;
final Color? titleColor;
final Color? backIconColor;
final double? elevation; final double? elevation;
final bool? showBackButton; final bool? showBackButton;
@ -17,6 +19,8 @@ class CustomAppBarWidget extends StatelessWidget implements PreferredSizeWidget
this.leading, this.leading,
this.centerTitle = true, this.centerTitle = true,
this.backgroundColor = Colors.white, this.backgroundColor = Colors.white,
this.titleColor = Colors.black,
this.backIconColor = Colors.black,
this.elevation, this.elevation,
this.showBackButton = true, this.showBackButton = true,
}); });
@ -31,6 +35,7 @@ class CustomAppBarWidget extends StatelessWidget implements PreferredSizeWidget
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: titleColor,
), ),
), ),
actions: actions, actions: actions,
@ -39,7 +44,10 @@ class CustomAppBarWidget extends StatelessWidget implements PreferredSizeWidget
leading: leading ?? leading: leading ??
(showBackButton && this.showBackButton == true (showBackButton && this.showBackButton == true
? IconButton( ? IconButton(
icon: const Icon(Icons.arrow_back_ios_new_rounded), icon: Icon(
Icons.arrow_back_ios_new_rounded,
color: backIconColor,
),
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
) )
: null), : null),

View File

@ -21,7 +21,7 @@ class F {
// Release环境的API地址 // Release环境的API地址
switch (appFlavor) { switch (appFlavor) {
case Flavor.sky: case Flavor.sky:
return 'https://192.168.1.136:8112/api'; // API return 'https://192.168.1.139:8112/api'; // API
case Flavor.xhj: case Flavor.xhj:
return 'https://api.xhjcn.ltd/api'; // API return 'https://api.xhjcn.ltd/api'; // API
} }
@ -29,7 +29,7 @@ class F {
// Debug/Profile环境的API地址 // Debug/Profile环境的API地址
switch (appFlavor) { switch (appFlavor) {
case Flavor.sky: case Flavor.sky:
return 'http://192.168.1.136:8112/api'; return 'http://192.168.1.139:8112/api';
case Flavor.xhj: case Flavor.xhj:
return 'https://loacl.work.star-lock.cn/api'; return 'https://loacl.work.star-lock.cn/api';
} }
@ -67,7 +67,7 @@ class F {
// Debug/Profile环境的StarCloud地址 // Debug/Profile环境的StarCloud地址
switch (appFlavor) { switch (appFlavor) {
case Flavor.sky: case Flavor.sky:
return 'http://192.168.1.136:8111/sdk'; return 'http://192.168.1.139:8111/sdk';
case Flavor.xhj: case Flavor.xhj:
return 'http://local.cloud.star-lock.cn'; return 'http://local.cloud.star-lock.cn';
} }

View File

@ -34,6 +34,12 @@ import 'package:starwork_flutter/views/login/login_binding.dart';
import 'package:starwork_flutter/views/login/login_view.dart'; import 'package:starwork_flutter/views/login/login_view.dart';
import 'package:starwork_flutter/views/main/main_binding.dart'; import 'package:starwork_flutter/views/main/main_binding.dart';
import 'package:starwork_flutter/views/main/main_view.dart'; import 'package:starwork_flutter/views/main/main_view.dart';
import 'package:starwork_flutter/views/team/addPerson/add_person_binding.dart';
import 'package:starwork_flutter/views/team/addPerson/add_person_view.dart';
import 'package:starwork_flutter/views/team/inviteTeamMember/invitationSettings/invitation_settings_binding.dart';
import 'package:starwork_flutter/views/team/inviteTeamMember/invitationSettings/invitation_settings_view.dart';
import 'package:starwork_flutter/views/team/inviteTeamMember/invite_team_member_binding.dart';
import 'package:starwork_flutter/views/team/inviteTeamMember/invite_team_member_view.dart';
import 'package:starwork_flutter/views/team/joinTeam/join_team_binding.dart'; import 'package:starwork_flutter/views/team/joinTeam/join_team_binding.dart';
import 'package:starwork_flutter/views/team/joinTeam/join_team_view.dart'; import 'package:starwork_flutter/views/team/joinTeam/join_team_view.dart';
import 'package:starwork_flutter/views/team/teamManage/teamInfo/team_info_binding.dart'; import 'package:starwork_flutter/views/team/teamManage/teamInfo/team_info_binding.dart';
@ -186,5 +192,20 @@ class AppPages {
page: () => AccessControlManageView(), page: () => AccessControlManageView(),
binding: AccessControlManageBinding(), binding: AccessControlManageBinding(),
), ),
GetPage(
name: AppRoutes.teamInviteTeamMember,
page: () => InviteTeamMemberView(),
binding: InviteTeamMemberBinding(),
),
GetPage(
name: AppRoutes.teamInvitationSettings,
page: () => InvitationSettingsView(),
binding: InvitationSettingsBinding(),
),
GetPage(
name: AppRoutes.teamAddPerson,
page: () => AddPersonView(),
binding: AddPersonBinding(),
),
]; ];
} }

View File

@ -15,6 +15,9 @@ class AppRoutes{
static const String teamJoinTeam = '/team/joinTeam'; static const String teamJoinTeam = '/team/joinTeam';
static const String teamManage = '/team/teamManage'; static const String teamManage = '/team/teamManage';
static const String teamInfo = '/team/teamInfo'; static const String teamInfo = '/team/teamInfo';
static const String teamInviteTeamMember = '/team/inviteTeamMember';
static const String teamInvitationSettings = '/team/invitationSettings';
static const String teamAddPerson = '/team/addPerson';
static const String deviceManage = '/device/deviceManage'; static const String deviceManage = '/device/deviceManage';
static const String searchDevice = '/device/searchDevice'; static const String searchDevice = '/device/searchDevice';
static const String confirmPairDevice = '/device/confirmPairDevice'; static const String confirmPairDevice = '/device/confirmPairDevice';

View File

@ -115,18 +115,13 @@ class DeviceSettingView extends GetView<DeviceSettingController> {
leftText: '远程开锁'.tr, leftText: '远程开锁'.tr,
onTap: () {}, onTap: () {},
visible: controller.lockFeatureMap['remoteUnlock'] == 1 && controller.lockFeatureMap['wifi'] == 1, visible: controller.lockFeatureMap['remoteUnlock'] == 1 && controller.lockFeatureMap['wifi'] == 1,
rightWidget: Row( rightWidget: CupertinoSwitch(
crossAxisAlignment: CrossAxisAlignment.center, value: controller.lockSettingMap['remoteUnlock'] == 1,
children: [ onChanged: (bool value) {
CupertinoSwitch( controller.enableRemoteUnlock(value);
value: controller.lockSettingMap['remoteUnlock'] == 1, },
onChanged: (bool value) { activeColor: Colors.blue, // iOS
controller.enableRemoteUnlock(value); trackColor: Colors.grey, //
},
activeColor: Colors.blue, // iOS
trackColor: Colors.grey, //
),
],
), ),
), ),
CustomCellWidget( CustomCellWidget(

View File

@ -280,7 +280,7 @@ class HomeView extends GetView<HomeController> {
'onTap': () => _handleMenuTap(0), 'onTap': () => _handleMenuTap(0),
}, },
{ {
'title': '加入团队', 'title': '邀请人员',
'icon': Icons.group_add, 'icon': Icons.group_add,
'onTap': () => _handleMenuTap(1), 'onTap': () => _handleMenuTap(1),
}, },
@ -370,7 +370,7 @@ class HomeView extends GetView<HomeController> {
Get.toNamed(AppRoutes.searchDevice); Get.toNamed(AppRoutes.searchDevice);
break; break;
case 1: case 1:
Get.toNamed(AppRoutes.teamJoinTeam); Get.toNamed(AppRoutes.teamInviteTeamMember);
break; break;
} }
} }

View File

@ -1,8 +1,11 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:starwork_flutter/common/constant/app_images.dart'; import 'package:starwork_flutter/common/constant/app_images.dart';
import 'package:starwork_flutter/common/constant/cache_keys.dart';
import 'package:starwork_flutter/common/utils/shared_preferences_utils.dart';
import 'mine_controller.dart'; import 'mine_controller.dart';
@ -40,15 +43,20 @@ class MineView extends GetView<MineController> {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( GestureDetector(
'我的', onTap: () {
style: TextStyle( SharedPreferencesUtils.delString(CacheKeys.token);
fontSize: 18.sp, },
fontWeight: FontWeight.w500, child: Text(
color: Colors.black87, '我的',
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w500,
color: Colors.black87,
),
overflow: TextOverflow.ellipsis,
maxLines: 1,
), ),
overflow: TextOverflow.ellipsis,
maxLines: 1,
), ),
Row( Row(
children: [ children: [
@ -170,10 +178,7 @@ class MineView extends GetView<MineController> {
SizedBox(width: 4.w), SizedBox(width: 4.w),
Text( Text(
'我的团队', '我的团队',
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Colors.black, fontWeight: FontWeight.w500),
fontSize: 12.sp,
color: Colors.black,
fontWeight: FontWeight.w500),
), ),
], ],
), ),
@ -182,7 +187,6 @@ class MineView extends GetView<MineController> {
); );
} }
// //
Widget _buildMenuItems() { Widget _buildMenuItems() {
return Container( return Container(
@ -267,7 +271,7 @@ class MineView extends GetView<MineController> {
return InkWell( return InkWell(
onTap: onTap, onTap: onTap,
child: Container( child: Container(
padding: EdgeInsets.symmetric( vertical: 10.h), padding: EdgeInsets.symmetric(vertical: 10.h),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [

View File

@ -0,0 +1,10 @@
import 'package:get/get.dart';
import 'add_person_controller.dart';
class AddPersonBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(() => AddPersonController());
}
}

View File

@ -0,0 +1,8 @@
import 'package:get/get.dart';
import 'package:get/get_rx/get_rx.dart';
import 'package:get/get_rx/src/rx_types/rx_types.dart';
import 'package:starwork_flutter/base/base_controller.dart';
class AddPersonController extends BaseController {
RxString selectedGender = 'male'.obs;
}

View File

@ -0,0 +1,465 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:starwork_flutter/common/constant/app_colors.dart';
import 'package:starwork_flutter/common/widgets/custom_cell_list_widget.dart';
import 'package:starwork_flutter/common/widgets/custom_cell_widget.dart';
import 'package:starwork_flutter/common/widgets/custome_app_bar_wdiget.dart';
import 'package:starwork_flutter/extension/function_extension.dart';
import 'add_person_controller.dart';
class AddPersonView extends GetView<AddPersonController> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.scaffoldBackgroundColor,
appBar: CustomAppBarWidget(
title: '添加人员'.tr,
backgroundColor: AppColors.scaffoldBackgroundColor,
),
body: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.only(
left: 10.w,
right: 10.w,
bottom: 10.h,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'基本信息'.tr,
style: TextStyle(
fontSize: 12.sp,
color: Colors.black54,
fontWeight: FontWeight.w400,
),
),
SizedBox(
height: 6.h,
),
CustomCellListWidget(
children: [
CustomCellWidget(
onTap: () {},
leftText: '组织'.tr,
leftIcon: Icon(
Icons.circle,
size: 4.w,
color: Colors.red,
),
rightWidget: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'请选择',
style: TextStyle(
fontSize: 14.sp,
color: Colors.black54,
fontWeight: FontWeight.w400,
),
),
SizedBox(
width: 4.w,
),
Icon(
Icons.arrow_forward_ios_rounded,
size: 16.sp,
color: Colors.grey[300],
)
],
),
),
CustomCellWidget(
onTap: () {},
leftText: '姓名'.tr,
leftIcon: Icon(
Icons.circle,
size: 4.w,
color: Colors.red,
),
rightWidget: Expanded(
flex: 3,
child: TextField(
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
),
decoration: InputDecoration(
isCollapsed: true,
hintText: '请输入姓名'.tr,
hintStyle: TextStyle(
fontSize: 14.sp,
color: Colors.black54,
fontWeight: FontWeight.w400,
),
//
border: InputBorder.none,
contentPadding: EdgeInsets.zero,
//
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
),
),
CustomCellWidget(
onTap: () {},
leftText: '开通账号'.tr,
leftSubText: '可登录并使用应用或管理功能',
leftIcon: Icon(
Icons.circle,
size: 4.w,
color: Colors.red,
),
rightWidget: CupertinoSwitch(
value: false,
onChanged: (bool value) {},
activeColor: Colors.blue, // iOS
trackColor: Colors.grey, //
),
),
CustomCellWidget(
onTap: () {},
leftText: '分配权限'.tr,
leftIcon: Icon(
Icons.circle,
size: 4.w,
color: Colors.red,
),
rightWidget: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'企业员工',
style: TextStyle(
fontSize: 14.sp,
color: Colors.black54,
fontWeight: FontWeight.w400,
),
),
SizedBox(
width: 4.w,
),
Icon(
Icons.arrow_forward_ios_rounded,
size: 16.sp,
color: Colors.grey[300],
)
],
),
)
],
),
SizedBox(
height: 10.h,
),
Text(
'扩展信息'.tr,
style: TextStyle(
fontSize: 12.sp,
color: Colors.black54,
fontWeight: FontWeight.w400,
),
),
SizedBox(
height: 10.h,
),
CustomCellListWidget(
children: [
CustomCellWidget(
onTap: () {},
leftText: '工号'.tr,
rightWidget: Expanded(
flex: 3,
child: TextField(
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
),
decoration: InputDecoration(
isCollapsed: true,
hintText: '选填'.tr,
hintStyle: TextStyle(
fontSize: 14.sp,
color: Colors.black54,
fontWeight: FontWeight.w400,
),
//
border: InputBorder.none,
contentPadding: EdgeInsets.zero,
//
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
),
),
CustomCellWidget(
onTap: () {},
leftText: '性别'.tr,
rightWidget: Obx(
() => Row(
children: [
Radio<String>(
value: 'male',
activeColor: Colors.blue,
groupValue: controller.selectedGender.value,
visualDensity: VisualDensity.compact,
onChanged: (value) {
controller.selectedGender.value = value!;
},
),
Text(''),
Radio<String>(
value: 'female',
activeColor: Colors.blue,
groupValue: controller.selectedGender.value,
visualDensity: VisualDensity.compact,
onChanged: (value) {
controller.selectedGender.value = value!;
},
),
Text(''),
],
),
),
),
CustomCellWidget(
onTap: () {},
leftText: '有效期'.tr,
rightWidget: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'请选择',
style: TextStyle(
fontSize: 14.sp,
color: Colors.black54,
fontWeight: FontWeight.w400,
),
),
SizedBox(
width: 4.w,
),
Icon(
Icons.arrow_forward_ios_rounded,
size: 16.sp,
color: Colors.grey[300],
)
],
),
),
CustomCellWidget(
onTap: () {},
leftText: '职务'.tr,
rightWidget: Expanded(
flex: 3,
child: TextField(
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
),
decoration: InputDecoration(
isCollapsed: true,
hintText: '选填'.tr,
hintStyle: TextStyle(
fontSize: 14.sp,
color: Colors.black54,
fontWeight: FontWeight.w400,
),
//
border: InputBorder.none,
contentPadding: EdgeInsets.zero,
//
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
),
),
CustomCellWidget(
onTap: () {},
leftText: '备注'.tr,
rightWidget: Expanded(
flex: 3,
child: TextField(
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
),
decoration: InputDecoration(
isCollapsed: true,
hintText: '选填'.tr,
hintStyle: TextStyle(
fontSize: 14.sp,
color: Colors.black54,
fontWeight: FontWeight.w400,
),
//
border: InputBorder.none,
contentPadding: EdgeInsets.zero,
//
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
),
),
CustomCellWidget(
onTap: () {},
leftText: '身份证号码'.tr,
rightWidget: Expanded(
flex: 3,
child: TextField(
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
),
decoration: InputDecoration(
isCollapsed: true,
hintText: '选填'.tr,
hintStyle: TextStyle(
fontSize: 14.sp,
color: Colors.black54,
fontWeight: FontWeight.w400,
),
//
border: InputBorder.none,
contentPadding: EdgeInsets.zero,
//
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
),
),
],
),
SizedBox(
height: 10.h,
),
SizedBox(
width: double.infinity,
child: Text(
textAlign: TextAlign.center,
'温馨提示:人脸/指纹/卡片信息需先保存后录入',
style: TextStyle(
fontSize: 12.sp,
color: Colors.grey,
fontWeight: FontWeight.w400,
),
),
),
SizedBox(
height: 10.h,
),
CustomCellListWidget(
children: [
CustomCellWidget(
onTap: () {
controller.showFunctionNotOpen();
},
leftText: '其他添加方式'.tr,
rightWidget: Icon(
Icons.arrow_forward_ios_rounded,
size: 16.sp,
color: Colors.grey,
),
),
],
),
],
),
Column(
children: [
Row(
children: [
Checkbox(
value: true,
// bool
onChanged: (bool? value) {},
),
Text(
'向用户发送短信邀请通知',
style: TextStyle(
fontSize: 12.sp,
color: Colors.grey,
fontWeight: FontWeight.w400,
),
)
],
),
SizedBox(
width: double.infinity,
child: Row(
children: [
Expanded(
child: ElevatedButton(
onPressed: () {}.debounce(),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.grey[100],
padding: EdgeInsets.symmetric(vertical: 12.h),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.r),
),
),
child: Text(
'保存'.tr,
style: TextStyle(
fontSize: 16.sp,
color: Colors.blue,
fontWeight: FontWeight.w500,
),
),
),
),
SizedBox(
width: 10.w,
),
Expanded(
child: ElevatedButton(
onPressed: () {}.debounce(),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blue,
padding: EdgeInsets.symmetric(vertical: 12.h),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.r)),
),
child: Text(
'保存并继续添加'.tr,
style: TextStyle(
fontSize: 16.sp,
color: Colors.white,
fontWeight: FontWeight.w500,
),
),
),
),
],
),
),
],
)
],
),
),
),
),
);
}
}

View File

@ -0,0 +1,10 @@
import 'package:get/get.dart';
import 'invitation_settings_controller.dart';
class InvitationSettingsBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(() => InvitationSettingsController());
}
}

View File

@ -0,0 +1,6 @@
import 'package:get/get.dart';
import 'package:starwork_flutter/base/base_controller.dart';
class InvitationSettingsController extends BaseController {
// TODO:
}

View File

@ -0,0 +1,97 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:starwork_flutter/common/constant/app_colors.dart';
import 'package:starwork_flutter/common/widgets/custom_cell_list_widget.dart';
import 'package:starwork_flutter/common/widgets/custom_cell_widget.dart';
import 'package:starwork_flutter/common/widgets/custome_app_bar_wdiget.dart';
import 'invitation_settings_controller.dart';
class InvitationSettingsView extends GetView<InvitationSettingsController> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.scaffoldBackgroundColor,
appBar: CustomAppBarWidget(
title: '邀请设置'.tr,
backgroundColor: AppColors.scaffoldBackgroundColor,
),
body: SafeArea(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 10.w,
vertical: 10.h,
),
child: Column(
children: [
CustomCellListWidget(
children: [
CustomCellWidget(
onTap: () {},
leftText: '人员配置'.tr,
leftSubText: '关闭审核后,新申请的用户无需审核即可加入成功',
rightWidget: CupertinoSwitch(
value: false,
onChanged: (bool value) {},
activeColor: Colors.blue, // iOS
trackColor: Colors.grey, //
),
),
CustomCellWidget(
onTap: () {},
leftText: '申请加入时可录入人脸'.tr,
rightWidget: CupertinoSwitch(
value: false,
onChanged: (bool value) {},
activeColor: Colors.blue, // iOS
trackColor: Colors.grey, //
),
),
CustomCellWidget(
onTap: () {},
leftText: '邀请信息30天后自动失效'.tr,
rightWidget: CupertinoSwitch(
value: false,
onChanged: (bool value) {},
activeColor: Colors.blue, // iOS
trackColor: Colors.grey, //
),
),
],
),
SizedBox(height: 10.h),
CustomCellListWidget(
children: [
CustomCellWidget(
onTap: () {},
leftText: '给用户设置的默认角色'.tr,
leftSubText: '对手动添加与邀请加入的成员均会生效',
rightWidget: Row(
children: [
Text(
'企业员工'.tr,
style: TextStyle(
fontSize: 14.sp,
color: Colors.grey,
fontWeight: FontWeight.w400,
),
),
SizedBox(width: 4.w),
Icon(
Icons.arrow_forward_ios,
size: 16.sp,
color: Colors.grey,
),
],
),
),
],
)
],
),
),
),
);
}
}

View File

@ -0,0 +1,10 @@
import 'package:get/get.dart';
import 'invite_team_member_controller.dart';
class InviteTeamMemberBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(() => InviteTeamMemberController());
}
}

View File

@ -0,0 +1,6 @@
import 'package:get/get.dart';
import 'package:starwork_flutter/base/base_controller.dart';
class InviteTeamMemberController extends BaseController {
// TODO:
}

View File

@ -0,0 +1,250 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:starwork_flutter/common/constant/app_colors.dart';
import 'package:starwork_flutter/common/constant/app_images.dart';
import 'package:starwork_flutter/common/widgets/custome_app_bar_wdiget.dart';
import 'package:starwork_flutter/extension/function_extension.dart';
import 'package:starwork_flutter/routes/app_routes.dart';
import 'invite_team_member_controller.dart';
class InviteTeamMemberView extends GetView<InviteTeamMemberController> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: CustomAppBarWidget(
title: '邀请人员'.tr,
titleColor: Colors.white,
backIconColor: Colors.white,
backgroundColor: Colors.blue[500],
),
backgroundColor: Colors.blue[500],
body: SafeArea(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 10.w,
vertical: 10.h,
),
child: SizedBox(
width: double.infinity,
child: Column(
children: [
Stack(
children: [
Container(
width: double.infinity,
height: 320.h,
margin: EdgeInsets.only(
top: 40.h,
),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.circular(8.r),
),
padding: EdgeInsets.symmetric(
horizontal: 10.w,
vertical: 10.h,
),
),
Container(
width: double.infinity,
height: 330.h,
decoration: BoxDecoration(
color: Colors.blue[50],
borderRadius: BorderRadius.circular(8.r),
),
margin: EdgeInsets.only(
top: 20.h,
left: 10.w,
right: 10.w,
),
padding: EdgeInsets.symmetric(
horizontal: 10.w,
vertical: 10.h,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
'19210651的互联',
style: TextStyle(
fontSize: 16.sp,
color: Colors.black,
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 10.h),
ClipRRect(
borderRadius: BorderRadius.circular(8.r),
child: Image(
width: 220.w,
image: const AssetImage(AppImages.mockErCode),
fit: BoxFit.cover, //
),
),
SizedBox(height: 10.h),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'团队码',
style: TextStyle(
fontWeight: FontWeight.w300,
color: Colors.grey,
fontSize: 16.sp,
),
),
SizedBox(
height: 5.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'19210651',
style: TextStyle(
fontWeight: FontWeight.w400,
color: Colors.black,
fontSize: 16.sp,
),
),
SizedBox(
width: 4.w,
),
Icon(
Icons.library_books_rounded,
size: 16.sp,
color: Colors.grey,
)
],
)
],
)
],
),
),
],
),
SizedBox(
height: 10.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'失效时间:永久有效',
style: TextStyle(
fontSize: 14.sp,
color: Colors.white,
),
),
SizedBox(
width: 10.w,
),
Icon(
Icons.refresh,
size: 16.sp,
color: Colors.white,
),
Text(
'重置',
style: TextStyle(
fontSize: 14.sp,
color: Colors.white,
),
),
],
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.teamInvitationSettings);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
'邀请设置',
style: TextStyle(
fontSize: 14.sp,
color: Colors.white,
),
),
Icon(
Icons.arrow_forward_ios_rounded,
size: 16.sp,
color: Colors.white,
)
],
),
),
SizedBox(
height: 10.h,
),
Row(
children: [
Expanded(
child: ElevatedButton(
onPressed: () {
controller.showFunctionNotOpen();
}.debounce(),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
padding: EdgeInsets.symmetric(vertical: 12.h),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.r)),
),
child: Text(
'微信邀请'.tr,
style: TextStyle(
fontSize: 16.sp,
color: Colors.blue,
fontWeight: FontWeight.w500,
),
),
),
),
SizedBox(
width: 10.w,
),
Expanded(
child: ElevatedButton(
onPressed: () {
Get.toNamed(AppRoutes.teamAddPerson);
}.debounce(),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
padding: EdgeInsets.symmetric(vertical: 12.h),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.r)),
),
child: Text(
'手动添加'.tr,
style: TextStyle(
fontSize: 16.sp,
color: Colors.blue,
fontWeight: FontWeight.w500,
),
),
),
),
],
),
],
),
),
SizedBox(
height: 20.h,
),
],
),
),
),
),
);
}
}