feat(mobile-next): 工号登录与目录薄适配,并完成登录/会话/聊天/通讯录第一批界面

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
编码工程师
2026-08-20 02:30:10 +08:00
co-authored by Cursor multica-agent
parent d787c0a477
commit 60b6590409
17 changed files with 842 additions and 166 deletions
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:openim_common/openim_common.dart';
import '../../company/brand/app_tokens.dart';
import 'contacts_logic.dart';
class ContactsPage extends StatelessWidget {
@@ -13,79 +13,74 @@ class ContactsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: TitleBar.contacts(
onClickAddContacts: logic.addContacts,
backgroundColor: AppColors.pageBg,
appBar: AppBar(
title: const Text('通讯录'),
actions: [
IconButton(
onPressed: logic.addContacts,
icon: const Icon(Icons.person_add_alt, size: AppIconSize.md, color: AppColors.textPrimary),
),
],
),
backgroundColor: Styles.c_F8F9FA,
body: Obx(
() => SingleChildScrollView(
child: Column(
() => Column(
children: [
_entry(
icon: Icons.person_add_alt,
label: '新的同事',
count: logic.friendApplicationCount,
onTap: logic.newFriend,
),
_entry(
icon: Icons.group_outlined,
label: '我的群聊',
count: logic.groupApplicationCount,
onTap: logic.myGroup,
),
_entry(
icon: Icons.people_outline,
label: '同事',
onTap: logic.myFriend,
),
],
),
),
);
}
Widget _entry({
required IconData icon,
required String label,
int count = 0,
required VoidCallback onTap,
}) {
return InkWell(
onTap: onTap,
child: SizedBox(
height: 56,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: AppGap.x4),
child: Row(
children: [
_buildItemView(
assetsName: ImageRes.newFriend,
label: StrRes.newFriend,
count: logic.friendApplicationCount,
onTap: logic.newFriend,
),
_buildItemView(
assetsName: ImageRes.newGroup,
label: StrRes.newGroupRequest,
count: logic.groupApplicationCount,
onTap: logic.newGroup,
),
10.verticalSpace,
_buildItemView(
assetsName: ImageRes.myFriend,
label: StrRes.myFriend,
onTap: logic.myFriend,
),
_buildItemView(
assetsName: ImageRes.myGroup,
label: StrRes.myGroup,
onTap: logic.myGroup,
Container(
width: 40,
height: 40,
decoration: BoxDecoration(
color: AppColors.primaryActive,
borderRadius: BorderRadius.circular(AppRadius.control),
),
alignment: Alignment.center,
child: Icon(icon, size: AppIconSize.sm, color: AppColors.primary),
),
const SizedBox(width: AppGap.x3),
Text(label, style: const TextStyle(fontSize: AppFont.body, color: AppColors.textPrimary)),
const Spacer(),
if (count > 0) UnreadCountView(count: count),
],
),
),
),
);
}
Widget _buildItemView({
String? assetsName,
required String label,
Widget? icon,
int count = 0,
bool showRightArrow = true,
double? height,
Function()? onTap,
}) =>
Ink(
color: Styles.c_FFFFFF,
child: InkWell(
onTap: onTap,
child: Container(
height: height ?? 60.h,
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Row(
children: [
if (null != assetsName)
assetsName.toImage
..width = 42.w
..height = 42.h,
if (null != icon) icon,
12.horizontalSpace,
label.toText..style = Styles.ts_0C1C33_17sp,
const Spacer(),
if (count > 0) UnreadCountView(count: count),
4.horizontalSpace,
if (showRightArrow)
ImageRes.rightArrow.toImage
..width = 24.w
..height = 24.h,
],
),
),
),
);
}