diff --git a/frontend/src/components/common/NotificationPanel.vue b/frontend/src/components/common/NotificationPanel.vue new file mode 100644 index 0000000..8112601 --- /dev/null +++ b/frontend/src/components/common/NotificationPanel.vue @@ -0,0 +1,56 @@ + + + + + + + 暂无新通知 + + + + + + + + + diff --git a/frontend/src/components/team/GameSelectDialog.vue b/frontend/src/components/team/GameSelectDialog.vue new file mode 100644 index 0000000..9bf8b02 --- /dev/null +++ b/frontend/src/components/team/GameSelectDialog.vue @@ -0,0 +1,180 @@ + + + + + + + + 搜索中... + + + + + + {{ game.name }} + {{ game.platform }} + + + + + + 未找到匹配的游戏,手动输入: + + + + + + 确认 + + + + + + + diff --git a/frontend/src/components/team/InviteButton.vue b/frontend/src/components/team/InviteButton.vue new file mode 100644 index 0000000..599a537 --- /dev/null +++ b/frontend/src/components/team/InviteButton.vue @@ -0,0 +1,78 @@ + + + + + 邀请 + + + + diff --git a/frontend/src/stores/notification.ts b/frontend/src/stores/notification.ts new file mode 100644 index 0000000..4674ea3 --- /dev/null +++ b/frontend/src/stores/notification.ts @@ -0,0 +1,41 @@ +import { defineStore } from 'pinia' +import { ref, computed } from 'vue' +import type { Invitation } from '@/types' +import { getPendingInvitations } from '@/api/invitations' + +export const useNotificationStore = defineStore('notification', () => { + const pendingInvitations = ref([]) + const loading = ref(false) + const showPanel = ref(false) + + const unreadCount = computed(() => pendingInvitations.value.length) + + async function loadPendingInvitations() { + try { + loading.value = true + pendingInvitations.value = await getPendingInvitations() + } catch (error) { + console.error('加载待处理邀请失败:', error) + } finally { + loading.value = false + } + } + + function removeInvitation(invitationId: string) { + pendingInvitations.value = pendingInvitations.value.filter(i => i.id !== invitationId) + } + + function togglePanel() { + showPanel.value = !showPanel.value + } + + return { + pendingInvitations, + loading, + showPanel, + unreadCount, + loadPendingInvitations, + removeInvitation, + togglePanel + } +})