feat: 调整图标、调整获取团队详情
This commit is contained in:
parent
9e10952bef
commit
bb1d3eb819
BIN
assets/icon/icon_face.jpg
Normal file
BIN
assets/icon/icon_face.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
assets/icon/icon_new_person.jpg
Normal file
BIN
assets/icon/icon_new_person.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
BIN
assets/icon/icon_role.jpg
Normal file
BIN
assets/icon/icon_role.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@ -9,6 +9,7 @@ class ApiPath {
|
||||
static const String changeTeam = "/v1/team/changeTeam";
|
||||
static const String bindTeamStarCloudAccount = "/v1/team/bindStarCloudAccount";
|
||||
static const String updateTeamInfo = "/v1/team/updateTeam";
|
||||
static const String teamDetail = "/v1/team/detail";
|
||||
static const String getInviteInfo = "/v1/team/getInviteInfo";
|
||||
static const String getTeamInviteConfig = "/v1/team/teamApplyConfig";
|
||||
static const String updateTeamInviteConfig = "/v1/team/teamPersonConfigUpdate";
|
||||
|
||||
86
lib/api/model/team/response/team_details_response.dart
Normal file
86
lib/api/model/team/response/team_details_response.dart
Normal file
@ -0,0 +1,86 @@
|
||||
class TeamDetailsResponse {
|
||||
String? teamNo;
|
||||
String? teamName;
|
||||
int? scene;
|
||||
String? sceneCustomName;
|
||||
String? teamCode;
|
||||
bool? isOwner;
|
||||
String? owner;
|
||||
bool? isVip;
|
||||
String? personName;
|
||||
String? personNo;
|
||||
String? personPhone;
|
||||
int? personCount;
|
||||
int? isPersonal;
|
||||
int? isUpgrade;
|
||||
int? isBindEzviz;
|
||||
int? state;
|
||||
int? authStatus;
|
||||
|
||||
TeamDetailsResponse({
|
||||
this.teamNo,
|
||||
this.teamName,
|
||||
this.scene,
|
||||
this.sceneCustomName,
|
||||
this.teamCode,
|
||||
this.isOwner,
|
||||
this.owner,
|
||||
this.isVip,
|
||||
this.personName,
|
||||
this.personNo,
|
||||
this.personPhone,
|
||||
this.personCount,
|
||||
this.isPersonal,
|
||||
this.isUpgrade,
|
||||
this.isBindEzviz,
|
||||
this.state,
|
||||
this.authStatus,
|
||||
});
|
||||
|
||||
TeamDetailsResponse.fromJson(Map<String, dynamic> json) {
|
||||
teamNo = json['teamNo'] as String?;
|
||||
teamName = json['teamName'] as String?;
|
||||
scene = json['scene'] as int?;
|
||||
sceneCustomName = json['sceneCustomName'] as String?;
|
||||
teamCode = json['teamCode'] as String?;
|
||||
isOwner = json['isOwner'] as bool?;
|
||||
owner = json['owner'] as String?;
|
||||
isVip = json['isVip'] as bool?;
|
||||
personName = json['personName'] as String?;
|
||||
personNo = json['personNo'] as String?;
|
||||
personPhone = json['personPhone'] as String?;
|
||||
personCount = json['personCount'] as int?;
|
||||
isPersonal = json['isPersonal'] as int?;
|
||||
isUpgrade = json['isUpgrade'] as int?;
|
||||
isBindEzviz = json['isBindEzviz'] as int?;
|
||||
state = json['state'] as int?;
|
||||
authStatus = json['authStatus'] as int?;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['teamNo'] = teamNo;
|
||||
data['teamName'] = teamName;
|
||||
data['scene'] = scene;
|
||||
data['sceneCustomName'] = sceneCustomName;
|
||||
data['teamCode'] = teamCode;
|
||||
data['isOwner'] = isOwner;
|
||||
data['owner'] = owner;
|
||||
data['isVip'] = isVip;
|
||||
data['personName'] = personName;
|
||||
data['personNo'] = personNo;
|
||||
data['personPhone'] = personPhone;
|
||||
data['personCount'] = personCount;
|
||||
data['isPersonal'] = isPersonal;
|
||||
data['isUpgrade'] = isUpgrade;
|
||||
data['isBindEzviz'] = isBindEzviz;
|
||||
data['state'] = state;
|
||||
data['authStatus'] = authStatus;
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TeamDetailsResponse{teamNo: $teamNo, teamName: $teamName, scene: $scene, sceneCustomName: $sceneCustomName, teamCode: $teamCode, isOwner: $isOwner, owner: $owner, isVip: $isVip, personName: $personName, personNo: $personNo, personPhone: $personPhone, personCount: $personCount, isPersonal: $isPersonal, isUpgrade: $isUpgrade, isBindEzviz: $isBindEzviz, state: $state, authStatus: $authStatus}';
|
||||
}
|
||||
}
|
||||
@ -19,6 +19,7 @@ import 'package:starwork_flutter/api/model/team/response/depart_list_reponse.dar
|
||||
import 'package:starwork_flutter/api/model/team/response/invite_info_response.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/role_list_response.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/scene_info_response.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/team_details_response.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/team_invite_parameter_config_response.dart';
|
||||
import 'package:starwork_flutter/api/model/user/request/validation_code_login.dart';
|
||||
import 'package:starwork_flutter/api/model/user/response/token_response.dart';
|
||||
@ -95,6 +96,16 @@ class TeamApiService {
|
||||
);
|
||||
}
|
||||
|
||||
// 查询团队详情
|
||||
Future<ApiResponse<TeamDetailsResponse>> requestTeamDetails() {
|
||||
return _api.makeRequest(
|
||||
path: ApiPath.teamDetail,
|
||||
method: HttpConstant.post,
|
||||
fromJson: (data) => TeamDetailsResponse.fromJson(data),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/// 获取邀请信息
|
||||
Future<ApiResponse<InviteInfoResponse>> requestInviteInfo({
|
||||
required InviteInfoRequest request,
|
||||
|
||||
@ -57,6 +57,9 @@ class AppImages{
|
||||
static const String defaultAvatar = 'assets/images/default_avatar.png';
|
||||
static const String iconLockGroupItem = 'assets/icon/icon_lockGroup_item.png';
|
||||
static const String iconLockTypeDoorLock = 'assets/icon/lockType_doorLock.png';
|
||||
static const String iconFace = 'assets/icon/icon_face.jpg';
|
||||
static const String iconRole = 'assets/icon/icon_role.jpg';
|
||||
static const String iconNewPerson = 'assets/icon/icon_new_person.jpg';
|
||||
// 底部导航栏图标
|
||||
static const String iconHome = 'assets/icon/bar/home.png';
|
||||
static const String iconHomeSelected = 'assets/icon/bar/home_selected.png';
|
||||
|
||||
@ -9,5 +9,4 @@ class CacheKeys {
|
||||
static const String starCloudUid = 'starCloudUid';
|
||||
static const String starCloudUserLoginInfo = 'starCloudUserLoginInfo';
|
||||
static const String userAccountInfo = 'userAccountInfo';
|
||||
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ class HomeView extends GetView<HomeController> {
|
||||
),
|
||||
HomeTeamNoticeRowWidget(),
|
||||
HomeStatisticsRowWidget(
|
||||
personCount: 0,
|
||||
personCount: controller.mainController.selectedTeamDetails.value.personCount ?? 0,
|
||||
deviceCount: controller.mainController.deviceCountSize.value,
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
|
||||
@ -11,6 +11,7 @@ import 'package:starcloud/sdk/sdk_device_operate_extension.dart';
|
||||
import 'package:starcloud/sdk/starcloud.dart';
|
||||
import 'package:starwork_flutter/api/model/team/request/bind_team_star_cloud_account_request.dart';
|
||||
import 'package:starwork_flutter/api/model/team/request/change_current_team_request.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/team_details_response.dart';
|
||||
import 'package:starwork_flutter/api/model/team/response/team_info_response.dart';
|
||||
import 'package:starwork_flutter/api/model/user/response/user_info_response.dart';
|
||||
import 'package:starwork_flutter/api/service/team_api_service.dart';
|
||||
@ -50,6 +51,9 @@ class MainController extends BaseController {
|
||||
// 选中的团队
|
||||
var selectedTeam = TeamInfoResponse().obs;
|
||||
|
||||
// 选中团队的详情
|
||||
var selectedTeamDetails = TeamDetailsResponse().obs;
|
||||
|
||||
// 设备数量
|
||||
final deviceCountSize = 0.obs;
|
||||
|
||||
@ -106,12 +110,14 @@ class MainController extends BaseController {
|
||||
|
||||
// 构建自定义图标组件
|
||||
Widget _buildTabIcon(String unselectedIcon, String selectedIcon, int index) {
|
||||
return Obx(() => Image.asset(
|
||||
currentIndex.value == index ? selectedIcon : unselectedIcon,
|
||||
width: 24.w,
|
||||
height: 24.w,
|
||||
fit: BoxFit.contain,
|
||||
));
|
||||
return Obx(
|
||||
() => Image.asset(
|
||||
currentIndex.value == index ? selectedIcon : unselectedIcon,
|
||||
width: 24.w,
|
||||
height: 24.w,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 打开抽屉的方法
|
||||
@ -155,6 +161,7 @@ class MainController extends BaseController {
|
||||
return;
|
||||
}
|
||||
selectedTeam.value = myTeamList.first;
|
||||
await requestTeamDetail();
|
||||
|
||||
// 设置星云账户
|
||||
if (selectedTeam.value.teamCloudInfo != null) {
|
||||
@ -221,6 +228,9 @@ class MainController extends BaseController {
|
||||
onError: (err) {},
|
||||
);
|
||||
}
|
||||
|
||||
// 请求切换团队后的详情数据
|
||||
await requestTeamDetail();
|
||||
}
|
||||
}
|
||||
|
||||
@ -245,8 +255,6 @@ class MainController extends BaseController {
|
||||
void requestUserAccountInfo() async {
|
||||
var userInfo = await userApi.requestUserInfo();
|
||||
if (userInfo.isSuccess) {
|
||||
// 保存到缓存
|
||||
// 方式1: 直接存储 JSON 字符串(推荐)
|
||||
await SharedPreferencesUtils.setString(CacheKeys.userAccountInfo, jsonEncode(userInfo.data!.toJson()));
|
||||
// 从缓存中读取
|
||||
// String? cachedJson = await SharedPreferencesUtils.getString(CacheKeys.userAccountInfo);
|
||||
@ -260,4 +268,11 @@ class MainController extends BaseController {
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
requestTeamDetail() async {
|
||||
var response = await teamApi.requestTeamDetails();
|
||||
if (response.isSuccess) {
|
||||
selectedTeamDetails.value = response.data!;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,6 @@ class MainView extends GetView<MainController> {
|
||||
selectedTeam: controller.selectedTeam.value,
|
||||
onTeamSelected: (team) {
|
||||
controller.requestChangeCurrentTeam(team);
|
||||
|
||||
},
|
||||
onRefreshList: () {
|
||||
controller.requestAllTeamInfoList();
|
||||
|
||||
@ -50,8 +50,10 @@ class PersonnelManageView extends GetView<PersonnelManageController> {
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.person,
|
||||
Image.asset(
|
||||
AppImages.iconFace,
|
||||
width: 24.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.h,
|
||||
@ -59,7 +61,7 @@ class PersonnelManageView extends GetView<PersonnelManageController> {
|
||||
Text(
|
||||
'人脸信息'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp,
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
@ -71,8 +73,10 @@ class PersonnelManageView extends GetView<PersonnelManageController> {
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.person,
|
||||
Image.asset(
|
||||
AppImages.iconRole,
|
||||
width: 24.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.h,
|
||||
@ -80,7 +84,7 @@ class PersonnelManageView extends GetView<PersonnelManageController> {
|
||||
Text(
|
||||
'角色管理'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp,
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
@ -89,8 +93,10 @@ class PersonnelManageView extends GetView<PersonnelManageController> {
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.person,
|
||||
Image.asset(
|
||||
AppImages.iconNewPerson,
|
||||
width: 24.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.h,
|
||||
@ -208,7 +214,7 @@ class PersonnelManageView extends GetView<PersonnelManageController> {
|
||||
width: 34.w,
|
||||
height: 34.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[300],
|
||||
color: const Color(0xFFEBF3FE),
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
),
|
||||
child: ClipRRect(
|
||||
@ -216,7 +222,7 @@ class PersonnelManageView extends GetView<PersonnelManageController> {
|
||||
child: Icon(
|
||||
Icons.folder,
|
||||
size: 22.w,
|
||||
color: Colors.blue,
|
||||
color: const Color(0xFF5B9CF8),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user