From b9fd9711de963158325fce1d4bfbd51c989ccef1 Mon Sep 17 00:00:00 2001
From: Tim <135014430+nagisa77@users.noreply.github.com>
Date: Sat, 16 Aug 2025 16:21:45 +0800
Subject: [PATCH] feat: add timeline filters on profile page
---
frontend_nuxt/pages/users/[id].vue | 50 ++++++++++++++++++++++++++++--
1 file changed, 48 insertions(+), 2 deletions(-)
diff --git a/frontend_nuxt/pages/users/[id].vue b/frontend_nuxt/pages/users/[id].vue
index dda0ab827..2e67ea756 100644
--- a/frontend_nuxt/pages/users/[id].vue
+++ b/frontend_nuxt/pages/users/[id].vue
@@ -204,12 +204,32 @@
+
+
+ 全部
+
+
+ 文章
+
+
+ 评论和回复
+
+
-
+
发布了文章
@@ -324,6 +344,15 @@ const hotPosts = ref([])
const hotReplies = ref([])
const hotTags = ref([])
const timelineItems = ref([])
+const timelineFilter = ref('all')
+const filteredTimelineItems = computed(() => {
+ if (timelineFilter.value === 'articles') {
+ return timelineItems.value.filter((item) => item.type === 'post')
+ } else if (timelineFilter.value === 'comments') {
+ return timelineItems.value.filter((item) => item.type === 'comment' || item.type === 'reply')
+ }
+ return timelineItems.value
+})
const followers = ref([])
const followings = ref([])
const medals = ref([])
@@ -777,6 +806,23 @@ watch(selectedTab, async (val) => {
width: 40%;
}
+.timeline-tabs {
+ display: flex;
+ flex-direction: row;
+ border-bottom: 1px solid var(--normal-border-color);
+ margin-bottom: 10px;
+}
+
+.timeline-tab-item {
+ padding: 10px 20px;
+ cursor: pointer;
+}
+
+.timeline-tab-item.selected {
+ color: var(--primary-color);
+ border-bottom: 2px solid var(--primary-color);
+}
+
.profile-timeline {
padding: 20px;
}