feat: 增加团队管理页

This commit is contained in:
liyi 2025-09-11 15:31:57 +08:00
parent 90b95cb1d7
commit c1a6830614
8 changed files with 343 additions and 9 deletions

View File

@ -18,6 +18,8 @@ import 'package:starwork_flutter/views/main/main_binding.dart';
import 'package:starwork_flutter/views/main/main_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/team_manage_binding.dart';
import 'package:starwork_flutter/views/team/teamManage/team_manage_view.dart';
import 'package:starwork_flutter/views/team/teamNotice/teamNoticeDetails/team_notice_details_binding.dart';
import 'package:starwork_flutter/views/messages/messages_binding.dart';
import 'package:starwork_flutter/views/messages/messages_view.dart';
@ -109,5 +111,10 @@ class AppPages {
page: () => JoinTeamView(),
binding: JoinTeamBinding(),
),
GetPage(
name: AppRoutes.teamManage,
page: () => TeamManageView(),
binding: TeamManageBinding(),
),
];
}

View File

@ -15,4 +15,5 @@ class AppRoutes{
static const String teamUseCaseSetting = '/team/useCaseSetting';
static const String teamCreateTeam = '/team/createTeam';
static const String teamJoinTeam = '/team/joinTeam';
static const String teamManage = '/team/teamManage';
}

View File

@ -364,6 +364,7 @@ class HomeView extends GetView<HomeController> {
Get.toNamed(AppRoutes.searchDevice);
break;
case 1:
Get.toNamed(AppRoutes.teamJoinTeam);
break;
}
}

View File

@ -3,6 +3,7 @@ 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/routes/app_routes.dart';
class HomeNotDeviceArea extends StatefulWidget {
const HomeNotDeviceArea({super.key});
@ -63,7 +64,9 @@ class _HomeNotDeviceAreaState extends State<HomeNotDeviceArea> {
),
elevation: 0,
),
onPressed: () {},
onPressed: () {
Get.toNamed(AppRoutes.searchDevice);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [

View File

@ -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';
@ -159,14 +160,19 @@ class _MainLeftDrawerWidgetState extends State<MainLeftDrawerWidget> {
),
//
GestureDetector(
onTap: () {},
child: Container(
padding: EdgeInsets.all(8.w),
child: Icon(
Icons.settings,
size: 20.sp,
color: isSelected ? const Color(0xFF2196F3) : Colors.grey[600],
Visibility(
visible: team.isOwner ?? false,
child: GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.teamManage);
},
child: Container(
padding: EdgeInsets.all(8.w),
child: Icon(
Icons.settings,
size: 20.sp,
color: isSelected ? const Color(0xFF2196F3) : Colors.grey[600],
),
),
),
),

View File

@ -0,0 +1,9 @@
import 'package:get/get.dart';
import 'package:starwork_flutter/views/team/teamManage/team_manage_controller.dart';
class TeamManageBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(() => TeamManageController());
}
}

View File

@ -0,0 +1,5 @@
import 'package:starwork_flutter/base/base_controller.dart';
class TeamManageController extends BaseController{
}

View File

@ -0,0 +1,302 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.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_app_bar_widget.dart';
import 'package:starwork_flutter/extension/function_extension.dart';
import 'package:starwork_flutter/views/team/teamManage/team_manage_controller.dart';
class TeamManageView extends GetView<TeamManageController> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.scaffoldBackgroundColor,
appBar: CustomAppBarWidget(
title: '团队管理'.tr,
),
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
child: Column(
children: [
_buildHeadRow(),
SizedBox(
height: 10.h,
),
Expanded(
child: _buildOther(),
),
// 线
Divider(
height: 1.h,
color: Colors.grey.withOpacity(0.2),
),
SizedBox(
height: 10.h,
),
SizedBox(
width: double.infinity,
child: Row(
children: [
Expanded(
child: ElevatedButton(
onPressed: () {}.debounce(),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.grey[200],
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,
),
),
),
),
],
),
),
SizedBox(
height: 20.h,
),
],
),
),
);
}
_buildHeadRow() {
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.r),
color: Colors.blue,
boxShadow: [
BoxShadow(
color: Colors.blue.withOpacity(0.2),
spreadRadius: 2,
blurRadius: 3,
offset: const Offset(0, 3), // changes position of shadow
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'团队名称',
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.w500,
color: Colors.white,
),
),
SizedBox(
height: 8.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: 4.w, vertical: 2.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.r),
color: Colors.white.withOpacity(0.3),
),
child: Text(
'小区/公寓'.tr,
style: TextStyle(
fontSize: 10.sp,
fontWeight: FontWeight.w500,
color: Colors.white,
),
),
),
SizedBox(
width: 4.w,
),
Text(
'TD01022881',
style: TextStyle(
fontSize: 10.sp,
fontWeight: FontWeight.w500,
color: Colors.white,
),
)
],
)
],
),
const Icon(
Icons.arrow_forward_ios_rounded,
color: Colors.white,
)
],
),
);
}
_buildOther() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'其他',
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w500,
color: Colors.grey[400],
),
),
SizedBox(
height: 10.h,
),
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.r),
color: Colors.white,
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
children: [
Icon(
Icons.assignment_outlined,
color: Colors.blue.withOpacity(0.8),
),
SizedBox(
width: 8.w,
),
Text(
'运维服务',
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w500,
color: Colors.black87,
),
),
],
),
Icon(
Icons.arrow_forward_ios_rounded,
color: Colors.grey,
size: 14.sp,
)
],
),
SizedBox(height: 10.h),
// 线
Divider(
height: 1.h,
color: Colors.grey.withOpacity(0.2),
),
SizedBox(height: 10.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
children: [
Icon(
Icons.assignment_outlined,
color: Colors.blue.withOpacity(0.8),
),
SizedBox(
width: 8.w,
),
Text(
'操作日志',
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w500,
color: Colors.black87,
),
),
],
),
Icon(
Icons.arrow_forward_ios_rounded,
color: Colors.grey,
size: 14.sp,
)
],
),
SizedBox(height: 10.h),
Divider(
height: 1.h,
color: Colors.grey.withOpacity(0.2),
),
SizedBox(height: 10.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
children: [
Icon(
Icons.assignment_outlined,
color: Colors.blue.withOpacity(0.8),
),
SizedBox(
width: 8.w,
),
Text(
'团队二维码',
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w500,
color: Colors.black87,
),
),
],
),
Icon(
Icons.arrow_forward_ios_rounded,
color: Colors.grey,
size: 14.sp,
)
],
)
],
),
)
],
);
}
}