feat(navigation): add schedule tab and stack navigator

Add new ScheduleTab to main navigation with ScheduleStackNavigator for managing course schedule screens. Includes CourseDetailScreen with modal presentation. Also exports scheduleService and related types for the new schedule feature.

fix(message): add group_id parameter to invite and request handlers

Pass group_id from extra_data when calling respondInvite and reviewJoinRequest APIs, as the backend now requires this parameter.

refactor(message): extract mergeMessagesById helper method

Centralize message merging logic into a reusable private method to avoid duplication and ensure consistent message deduplication behavior.
This commit is contained in:
2026-03-12 08:37:08 +08:00
parent f10c9cc1d7
commit 798dd7c9a0
12 changed files with 1606 additions and 16 deletions

View File

@@ -65,13 +65,18 @@ const GroupInviteDetailScreen: React.FC = () => {
const handleDecision = async (approve: boolean) => {
const flag = extra_data?.flag;
const groupId = extra_data?.group_id;
if (!flag) {
Alert.alert('提示', '缺少邀请标识,无法处理');
return;
}
if (!groupId) {
Alert.alert('提示', '缺少群组标识,无法处理');
return;
}
setSubmitting(true);
try {
await groupService.respondInvite({ flag, approve });
await groupService.respondInvite(groupId, { flag, approve });
Alert.alert('成功', approve ? '已同意加入群聊' : '已拒绝邀请', [
{ text: '确定', onPress: () => navigation.goBack() },
]);

View File

@@ -77,20 +77,25 @@ const GroupRequestDetailScreen: React.FC = () => {
const handleDecision = async (approve: boolean) => {
const flag = extra_data?.flag;
const groupId = extra_data?.group_id;
if (!flag) {
Alert.alert('提示', '缺少请求标识,无法处理');
return;
}
if (!groupId) {
Alert.alert('提示', '缺少群组标识,无法处理');
return;
}
setSubmitting(true);
try {
if (message.system_type === 'group_invite') {
await groupService.respondInvite({
await groupService.respondInvite(groupId, {
flag,
approve,
});
} else {
await groupService.reviewJoinRequest({
await groupService.reviewJoinRequest(groupId, {
flag,
approve,
});