From 7f84b06d8592e90b4ccd38626c809da2398e3105 Mon Sep 17 00:00:00 2001 From: liyi Date: Sat, 20 Sep 2025 16:03:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=81=E9=82=80=E8=AF=B7=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/images/mock_er_code.png | Bin 0 -> 5422 bytes lib/app.dart | 12 + lib/common/constant/app_images.dart | 1 + lib/common/widgets/custom_cell_widget.dart | 58 ++- .../widgets/custome_app_bar_wdiget.dart | 10 +- lib/flavors.dart | 6 +- lib/routes/app_pages.dart | 21 + lib/routes/app_routes.dart | 3 + .../deviceSetting/device_setting_view.dart | 19 +- lib/views/home/home_view.dart | 4 +- lib/views/mine/mine_view.dart | 32 +- .../team/addPerson/add_person_binding.dart | 10 + .../team/addPerson/add_person_controller.dart | 8 + lib/views/team/addPerson/add_person_view.dart | 465 ++++++++++++++++++ .../invitation_settings_binding.dart | 10 + .../invitation_settings_controller.dart | 6 + .../invitation_settings_view.dart | 97 ++++ .../invite_team_member_binding.dart | 10 + .../invite_team_member_controller.dart | 6 + .../invite_team_member_view.dart | 250 ++++++++++ 20 files changed, 982 insertions(+), 46 deletions(-) create mode 100644 assets/images/mock_er_code.png create mode 100644 lib/views/team/addPerson/add_person_binding.dart create mode 100644 lib/views/team/addPerson/add_person_controller.dart create mode 100644 lib/views/team/addPerson/add_person_view.dart create mode 100644 lib/views/team/inviteTeamMember/invitationSettings/invitation_settings_binding.dart create mode 100644 lib/views/team/inviteTeamMember/invitationSettings/invitation_settings_controller.dart create mode 100644 lib/views/team/inviteTeamMember/invitationSettings/invitation_settings_view.dart create mode 100644 lib/views/team/inviteTeamMember/invite_team_member_binding.dart create mode 100644 lib/views/team/inviteTeamMember/invite_team_member_controller.dart create mode 100644 lib/views/team/inviteTeamMember/invite_team_member_view.dart diff --git a/assets/images/mock_er_code.png b/assets/images/mock_er_code.png new file mode 100644 index 0000000000000000000000000000000000000000..a825a6a63ef4a45c33a9686e3f569084c5d2636d GIT binary patch literal 5422 zcmZ`-dpwls+n;%i43ZgER5nji3Zb?_il-3iz!pt%+#hc$olzh^u_4me%^1RrksM?Y;+tk%m z$7JSNpW#AX-UJR(lT>;4*UeJn3uvZ!6~jiG`3?U#5$C501hlTj6F!eG$bhKVwo!-noRaoVOi?Y& zvRlRsTj5SoAwO1@bN0)HW9@eGgd&W?JxckKVB^q(3zWFB*O*UHO-wI zyQ1uRk`N}G%l#u-{K6FCX_j;KgebA1p0YHt{)y#`3%4pJzIDU5PkI{?;9IapmVgd^ z*#14_$ErNH9@UMh5WOktvU`9(WzIjleIu7Ut9OqUQY`M_JybC<-XbhB-ZMVL=y6;_ zgS2<@j$zl9svL({=PIj9{R15%d9q3s6Z?t=*>due?MPu!$&+z#`4GH!%5e=R1<8=F zW!O7&cc_v)G$58;o_Cx{%5!i&Y_h0Bxa|-}{1$(FG@nc3P!-O|ii*u4UgKG2nlqN^ ztK)D!9JRgOw_!ZY_)VpWHsc8Epf1?$0sFERGw21MjA^Ef{qzHl^O|&R9hj!fcIAJp zx1^c#R-STFN1gRXw2_gKO`u%s+Qd8QZHrqRBo_zk>>mE5ko%2@3Ih8F6RkR$zwK0M z3DUkbnLy75?j?CzDrHB=TPK!HA^LvE^3~ZUME;Wpy#e%T?o8uxr1e$JM^bPu^qi&D z6kM7Id>r?cmxSgJobBLpci7$j7A~CyR36=MT_pgva<}<&Z+3q;wgNvr%5omOv0Do1 zATIi)(kM8>AJFz@*oemDGGNTpf@Z$gPn)mI)y>F6?S!}n*%Iex7bFgxMoFlnwy}Mz z^A<(jV57vfWypA=WLLkWuRNL!;idpK71sa{>Ek4OtL8DhvFM^Bj+}c$AHe0_6jj+F zqZXE)2K1522?Q#iLCr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O zzaK6~kO7zKhp0`^T%fdm@nf<=|E*1V_=dc4yFgXDPWdTWF&1}~yWJsInTZ1;Ro!x8 z-k!mkUvcJ})fdSu`iPCbv~Q08tvbo7Pdi2mdu4c|%-nR{=0*I>emf3_S4+MH^wz1F z*?aU43JWA2HCB5A*br6a6Xg;L_~h<{B-r#3J5nZlzfuMt^d)+wDtoy*F8-%}%HRj# z&_4U8Gm-g2D2Y?nLNegqm|8DoKc1{5>d$-)SSPgp{U$D|lTIKwv*U74^n{ZEU5Vm- zkcJViS%7Ykl)fd}*XV|5)$xQ-m_`i92LpB~U&P&yxvx32E=@GU^;`l>|n~g$1d< zC&XO1$qHNJpKnd*&1s4)RA88EzQOymOQUGZ{{hTDF#01jeIBvyi5zD{u0I5~V$hAL z{%=o_JvXuoX)dt{P(GtYK;!9zekEeFvCve$yc?|AaEv1!hc-RxJ4Y8Kv_xg~X>-D# zX5z2fH4?sxY$OQL1@|3J44aK~BqJSF&my}e#B4$nW(*5i{N*YMTZ>)`%hhJ^Sq(7$U3>lJ^6?Ed`ZDX?`S66-L38J69tfw}K% z^sMc~dGM(2mv>}YUjp&+kvU^=yb6zx_yeVQzjG-Ms8>zgs$}=c7zS?l+Lh0idS|S? zKBwj)O6&6|#OBF^q!79&M99~^FCu2ZPBwxRP0J)fs>95IrE_!$D#E0CbXaG7K0>iw zhL`u^w~HaJS(-MVx#lQYI2`YLuemwava-=KSP?Z>vo9+CQR1MT_~@{#&aZdqErxSE zUi*ZOC((@AGbvex)>HO_LfXFC5KeH!^~>4a8aTiNC1Ml2+bY15VBgf-3xMoa*;KL# zPC|_Yi*3m0+(V`F?(g|P)SufVrcr}*E { selectionHandleColor: Colors.blue.shade300, ), 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( backgroundColor: Colors.white, elevation: 0, diff --git a/lib/common/constant/app_images.dart b/lib/common/constant/app_images.dart index c0ef443..930a7d5 100644 --- a/lib/common/constant/app_images.dart +++ b/lib/common/constant/app_images.dart @@ -4,6 +4,7 @@ class AppImages{ 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 mockImage = 'assets/images/mockImage.jpg'; + static const String mockErCode = 'assets/images/mock_er_code.png'; // 视频类图标 static const String iconVideoCenter = 'assets/icon/video_center.png'; diff --git a/lib/common/widgets/custom_cell_widget.dart b/lib/common/widgets/custom_cell_widget.dart index d829896..1ea1e7f 100644 --- a/lib/common/widgets/custom_cell_widget.dart +++ b/lib/common/widgets/custom_cell_widget.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -6,6 +7,7 @@ class CustomCellWidget extends StatelessWidget { const CustomCellWidget({ super.key, required this.leftText, + this.leftSubText, this.leftIcon, this.rightWidget, this.onTap, @@ -13,6 +15,7 @@ class CustomCellWidget extends StatelessWidget { }); final String leftText; + final String? leftSubText; final Icon? leftIcon; final Widget? rightWidget; final GestureTapCallback? onTap; @@ -36,21 +39,48 @@ class CustomCellWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - if (leftIcon != null) leftIcon!, - if (leftIcon != null) SizedBox(width: 4.w), - Text( - leftText, - style: TextStyle( - fontSize: 14.sp, - color: Colors.black87, - fontWeight: FontWeight.w400, + Expanded( + flex: 1, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + if (leftIcon != null) leftIcon!, + if (leftIcon != null) SizedBox(width: 4.w), + 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 ?? Text( diff --git a/lib/common/widgets/custome_app_bar_wdiget.dart b/lib/common/widgets/custome_app_bar_wdiget.dart index 4c01d1c..849aaa5 100644 --- a/lib/common/widgets/custome_app_bar_wdiget.dart +++ b/lib/common/widgets/custome_app_bar_wdiget.dart @@ -7,6 +7,8 @@ class CustomAppBarWidget extends StatelessWidget implements PreferredSizeWidget final Widget? leading; final bool centerTitle; final Color? backgroundColor; + final Color? titleColor; + final Color? backIconColor; final double? elevation; final bool? showBackButton; @@ -17,6 +19,8 @@ class CustomAppBarWidget extends StatelessWidget implements PreferredSizeWidget this.leading, this.centerTitle = true, this.backgroundColor = Colors.white, + this.titleColor = Colors.black, + this.backIconColor = Colors.black, this.elevation, this.showBackButton = true, }); @@ -31,6 +35,7 @@ class CustomAppBarWidget extends StatelessWidget implements PreferredSizeWidget style: TextStyle( fontSize: 18.sp, fontWeight: FontWeight.w500, + color: titleColor, ), ), actions: actions, @@ -39,7 +44,10 @@ class CustomAppBarWidget extends StatelessWidget implements PreferredSizeWidget leading: leading ?? (showBackButton && this.showBackButton == true ? 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(), ) : null), diff --git a/lib/flavors.dart b/lib/flavors.dart index 6b6fb1f..668f240 100644 --- a/lib/flavors.dart +++ b/lib/flavors.dart @@ -21,7 +21,7 @@ class F { // Release环境的API地址 switch (appFlavor) { case Flavor.sky: - return 'https://192.168.1.136:8112/api'; // 生产环境API + return 'https://192.168.1.139:8112/api'; // 生产环境API case Flavor.xhj: return 'https://api.xhjcn.ltd/api'; // 生产环境API } @@ -29,7 +29,7 @@ class F { // Debug/Profile环境的API地址(开发环境) switch (appFlavor) { case Flavor.sky: - return 'http://192.168.1.136:8112/api'; + return 'http://192.168.1.139:8112/api'; case Flavor.xhj: return 'https://loacl.work.star-lock.cn/api'; } @@ -67,7 +67,7 @@ class F { // Debug/Profile环境的StarCloud地址(开发环境) switch (appFlavor) { case Flavor.sky: - return 'http://192.168.1.136:8111/sdk'; + return 'http://192.168.1.139:8111/sdk'; case Flavor.xhj: return 'http://local.cloud.star-lock.cn'; } diff --git a/lib/routes/app_pages.dart b/lib/routes/app_pages.dart index 0999d62..368e8eb 100644 --- a/lib/routes/app_pages.dart +++ b/lib/routes/app_pages.dart @@ -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/main/main_binding.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_view.dart'; import 'package:starwork_flutter/views/team/teamManage/teamInfo/team_info_binding.dart'; @@ -186,5 +192,20 @@ class AppPages { page: () => AccessControlManageView(), 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(), + ), ]; } diff --git a/lib/routes/app_routes.dart b/lib/routes/app_routes.dart index 33e2160..19a0d77 100644 --- a/lib/routes/app_routes.dart +++ b/lib/routes/app_routes.dart @@ -15,6 +15,9 @@ class AppRoutes{ static const String teamJoinTeam = '/team/joinTeam'; static const String teamManage = '/team/teamManage'; 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 searchDevice = '/device/searchDevice'; static const String confirmPairDevice = '/device/confirmPairDevice'; diff --git a/lib/views/device/deviceSetting/device_setting_view.dart b/lib/views/device/deviceSetting/device_setting_view.dart index 09cab41..299f99e 100644 --- a/lib/views/device/deviceSetting/device_setting_view.dart +++ b/lib/views/device/deviceSetting/device_setting_view.dart @@ -115,18 +115,13 @@ class DeviceSettingView extends GetView { leftText: '远程开锁'.tr, onTap: () {}, visible: controller.lockFeatureMap['remoteUnlock'] == 1 && controller.lockFeatureMap['wifi'] == 1, - rightWidget: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - CupertinoSwitch( - value: controller.lockSettingMap['remoteUnlock'] == 1, - onChanged: (bool value) { - controller.enableRemoteUnlock(value); - }, - activeColor: Colors.blue, // 可选:打开时的颜色(iOS 默认为系统蓝色,可自定义) - trackColor: Colors.grey, // 可选:关闭时的背景轨道颜色 - ), - ], + rightWidget: CupertinoSwitch( + value: controller.lockSettingMap['remoteUnlock'] == 1, + onChanged: (bool value) { + controller.enableRemoteUnlock(value); + }, + activeColor: Colors.blue, // 可选:打开时的颜色(iOS 默认为系统蓝色,可自定义) + trackColor: Colors.grey, // 可选:关闭时的背景轨道颜色 ), ), CustomCellWidget( diff --git a/lib/views/home/home_view.dart b/lib/views/home/home_view.dart index e1127df..6900cce 100644 --- a/lib/views/home/home_view.dart +++ b/lib/views/home/home_view.dart @@ -280,7 +280,7 @@ class HomeView extends GetView { 'onTap': () => _handleMenuTap(0), }, { - 'title': '加入团队', + 'title': '邀请人员', 'icon': Icons.group_add, 'onTap': () => _handleMenuTap(1), }, @@ -370,7 +370,7 @@ class HomeView extends GetView { Get.toNamed(AppRoutes.searchDevice); break; case 1: - Get.toNamed(AppRoutes.teamJoinTeam); + Get.toNamed(AppRoutes.teamInviteTeamMember); break; } } diff --git a/lib/views/mine/mine_view.dart b/lib/views/mine/mine_view.dart index 5e87f32..a996527 100644 --- a/lib/views/mine/mine_view.dart +++ b/lib/views/mine/mine_view.dart @@ -1,8 +1,11 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.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_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'; @@ -40,15 +43,20 @@ class MineView extends GetView { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( - '我的', - style: TextStyle( - fontSize: 18.sp, - fontWeight: FontWeight.w500, - color: Colors.black87, + GestureDetector( + onTap: () { + SharedPreferencesUtils.delString(CacheKeys.token); + }, + child: Text( + '我的', + style: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w500, + color: Colors.black87, + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, ), - overflow: TextOverflow.ellipsis, - maxLines: 1, ), Row( children: [ @@ -170,10 +178,7 @@ class MineView extends GetView { SizedBox(width: 4.w), Text( '我的团队', - style: TextStyle( - fontSize: 12.sp, - color: Colors.black, - fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 12.sp, color: Colors.black, fontWeight: FontWeight.w500), ), ], ), @@ -182,7 +187,6 @@ class MineView extends GetView { ); } - // 菜单项区域 Widget _buildMenuItems() { return Container( @@ -267,7 +271,7 @@ class MineView extends GetView { return InkWell( onTap: onTap, child: Container( - padding: EdgeInsets.symmetric( vertical: 10.h), + padding: EdgeInsets.symmetric(vertical: 10.h), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/views/team/addPerson/add_person_binding.dart b/lib/views/team/addPerson/add_person_binding.dart new file mode 100644 index 0000000..9139b98 --- /dev/null +++ b/lib/views/team/addPerson/add_person_binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'add_person_controller.dart'; + +class AddPersonBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => AddPersonController()); + } +} \ No newline at end of file diff --git a/lib/views/team/addPerson/add_person_controller.dart b/lib/views/team/addPerson/add_person_controller.dart new file mode 100644 index 0000000..372e8d4 --- /dev/null +++ b/lib/views/team/addPerson/add_person_controller.dart @@ -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; +} diff --git a/lib/views/team/addPerson/add_person_view.dart b/lib/views/team/addPerson/add_person_view.dart new file mode 100644 index 0000000..d3d2c44 --- /dev/null +++ b/lib/views/team/addPerson/add_person_view.dart @@ -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 { + @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( + value: 'male', + activeColor: Colors.blue, + groupValue: controller.selectedGender.value, + visualDensity: VisualDensity.compact, + onChanged: (value) { + controller.selectedGender.value = value!; + }, + ), + Text('男'), + Radio( + 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, + ), + ), + ), + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/views/team/inviteTeamMember/invitationSettings/invitation_settings_binding.dart b/lib/views/team/inviteTeamMember/invitationSettings/invitation_settings_binding.dart new file mode 100644 index 0000000..f6c7969 --- /dev/null +++ b/lib/views/team/inviteTeamMember/invitationSettings/invitation_settings_binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'invitation_settings_controller.dart'; + +class InvitationSettingsBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => InvitationSettingsController()); + } +} \ No newline at end of file diff --git a/lib/views/team/inviteTeamMember/invitationSettings/invitation_settings_controller.dart b/lib/views/team/inviteTeamMember/invitationSettings/invitation_settings_controller.dart new file mode 100644 index 0000000..c42c2ca --- /dev/null +++ b/lib/views/team/inviteTeamMember/invitationSettings/invitation_settings_controller.dart @@ -0,0 +1,6 @@ +import 'package:get/get.dart'; +import 'package:starwork_flutter/base/base_controller.dart'; + +class InvitationSettingsController extends BaseController { + // TODO: 在这里添加业务逻辑 +} \ No newline at end of file diff --git a/lib/views/team/inviteTeamMember/invitationSettings/invitation_settings_view.dart b/lib/views/team/inviteTeamMember/invitationSettings/invitation_settings_view.dart new file mode 100644 index 0000000..2adda64 --- /dev/null +++ b/lib/views/team/inviteTeamMember/invitationSettings/invitation_settings_view.dart @@ -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 { + @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, + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/views/team/inviteTeamMember/invite_team_member_binding.dart b/lib/views/team/inviteTeamMember/invite_team_member_binding.dart new file mode 100644 index 0000000..37a19c2 --- /dev/null +++ b/lib/views/team/inviteTeamMember/invite_team_member_binding.dart @@ -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()); + } +} \ No newline at end of file diff --git a/lib/views/team/inviteTeamMember/invite_team_member_controller.dart b/lib/views/team/inviteTeamMember/invite_team_member_controller.dart new file mode 100644 index 0000000..3795aaf --- /dev/null +++ b/lib/views/team/inviteTeamMember/invite_team_member_controller.dart @@ -0,0 +1,6 @@ +import 'package:get/get.dart'; +import 'package:starwork_flutter/base/base_controller.dart'; + +class InviteTeamMemberController extends BaseController { + // TODO: 在这里添加业务逻辑 +} \ No newline at end of file diff --git a/lib/views/team/inviteTeamMember/invite_team_member_view.dart b/lib/views/team/inviteTeamMember/invite_team_member_view.dart new file mode 100644 index 0000000..9ca1327 --- /dev/null +++ b/lib/views/team/inviteTeamMember/invite_team_member_view.dart @@ -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 { + @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, + ), + ], + ), + ), + ), + ), + ); + } +}