From bf4b6bb209510d76435c25d19c4d76df79e3c188 Mon Sep 17 00:00:00 2001 From: Maya Date: Mon, 4 May 2026 11:59:14 +0300 Subject: [PATCH 1/4] empty commit From 9f9c37c4455e082e3c9751b606f0c596da22925a Mon Sep 17 00:00:00 2001 From: Maya Date: Tue, 12 May 2026 12:25:14 +0300 Subject: [PATCH 2/4] =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D1=8F=20=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=81=D1=82=D0=BA=D0=B0=20=D0=BF=D1=80=D0=BE=D1=84?= =?UTF-8?q?=D0=B8=D0=BB=D1=8F:=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B0=D0=BD=D1=8B=20=D0=B2=20=D0=BE=D1=82=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D1=82=D1=8B=20=D1=88=D0=B0=D0=BF=D0=BA=D0=B0?= =?UTF-8?q?=20=D1=81=20=D0=B0=D0=B2=D0=B0=D1=82=D0=B0=D1=80=D0=BA=D0=BE?= =?UTF-8?q?=D0=B9=20=D0=B8=20=D0=B8=D0=BC=D0=B5=D0=BD=D0=B5=D0=BC=20=D0=B8?= =?UTF-8?q?=20=D0=B1=D0=BB=D0=BE=D0=BA=D0=B8=20=D1=81=20=D0=B8=D0=BD=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D0=B5=D0=B9,=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BA=D0=B0=20=D0=B1=D0=B5=D0=B7=20=D0=B1=D0=BB=D0=BE?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B4=D0=BE=D1=81=D1=82=D0=B8=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/profile/ui/UserHeader.vue | 17 ++++ src/modules/profile/ui/UserInfo.vue | 21 ++++ src/router/profile.ts | 2 +- src/views/profile/ProfilePageV2.vue | 139 ++++++++++++++++++++++++++ 4 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 src/modules/profile/ui/UserHeader.vue create mode 100644 src/modules/profile/ui/UserInfo.vue create mode 100644 src/views/profile/ProfilePageV2.vue diff --git a/src/modules/profile/ui/UserHeader.vue b/src/modules/profile/ui/UserHeader.vue new file mode 100644 index 0000000..04755ea --- /dev/null +++ b/src/modules/profile/ui/UserHeader.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/modules/profile/ui/UserInfo.vue b/src/modules/profile/ui/UserInfo.vue new file mode 100644 index 0000000..1e91ff6 --- /dev/null +++ b/src/modules/profile/ui/UserInfo.vue @@ -0,0 +1,21 @@ + + + diff --git a/src/router/profile.ts b/src/router/profile.ts index bd936da..761f706 100644 --- a/src/router/profile.ts +++ b/src/router/profile.ts @@ -4,7 +4,7 @@ import { RouteRecordRaw } from 'vue-router'; export const profileRoutes: RouteRecordRaw[] = [ { path: '', - component: () => import('@/views/profile/ProfileView.vue'), + component: () => import('@/views/profile/ProfilePageV2.vue'), }, { path: 'sessions', diff --git a/src/views/profile/ProfilePageV2.vue b/src/views/profile/ProfilePageV2.vue new file mode 100644 index 0000000..b890429 --- /dev/null +++ b/src/views/profile/ProfilePageV2.vue @@ -0,0 +1,139 @@ + + + From 2cd9d25a9f691c32ed234c701868b6529476498d Mon Sep 17 00:00:00 2001 From: Maya Date: Thu, 14 May 2026 13:44:07 +0300 Subject: [PATCH 3/4] =?UTF-8?q?=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D0=BE=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D0=B0=D1=8F=20=D1=81?= =?UTF-8?q?=D1=81=D1=8B=D0=BB=D0=BA=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BE=D0=B3=D0=BE=20=D0=B4=D0=B8=D0=B7=D0=B0=D0=B9?= =?UTF-8?q?=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/profile.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/router/profile.ts b/src/router/profile.ts index 761f706..efd04ad 100644 --- a/src/router/profile.ts +++ b/src/router/profile.ts @@ -4,6 +4,10 @@ import { RouteRecordRaw } from 'vue-router'; export const profileRoutes: RouteRecordRaw[] = [ { path: '', + component: () => import('@/views/profile/ProfileView.vue'), + }, + { + path: '/redesign', component: () => import('@/views/profile/ProfilePageV2.vue'), }, { From de0154e31dd16e32c3fa7acc34d88baabdf830cc Mon Sep 17 00:00:00 2001 From: Maya Date: Mon, 18 May 2026 14:20:39 +0300 Subject: [PATCH 4/4] =?UTF-8?q?=D0=B4=D0=BE=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9=20=D0=B1=D0=BB=D0=BE=D0=BA=20=D0=B4=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D0=B8=D0=B6=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/profile/ui/AchievementElement.vue | 36 ++++++++ src/modules/profile/ui/UserAchievements.vue | 32 +++++++ src/views/profile/ProfilePageV2.vue | 89 +++++++++++++------ 3 files changed, 130 insertions(+), 27 deletions(-) create mode 100644 src/modules/profile/ui/AchievementElement.vue create mode 100644 src/modules/profile/ui/UserAchievements.vue diff --git a/src/modules/profile/ui/AchievementElement.vue b/src/modules/profile/ui/AchievementElement.vue new file mode 100644 index 0000000..8b77f6a --- /dev/null +++ b/src/modules/profile/ui/AchievementElement.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/src/modules/profile/ui/UserAchievements.vue b/src/modules/profile/ui/UserAchievements.vue new file mode 100644 index 0000000..dbf81e2 --- /dev/null +++ b/src/modules/profile/ui/UserAchievements.vue @@ -0,0 +1,32 @@ + + + diff --git a/src/views/profile/ProfilePageV2.vue b/src/views/profile/ProfilePageV2.vue index b890429..67f3003 100644 --- a/src/views/profile/ProfilePageV2.vue +++ b/src/views/profile/ProfilePageV2.vue @@ -3,16 +3,17 @@ import { VuConfig } from '@profcomff/ui-kit'; import UserInfo from '@/modules/profile/ui/UserInfo.vue'; import UserHeader from '@/modules/profile/ui/UserHeader.vue'; import Placeholder from '@/assets/profile_image_placeholder.webp'; -import { onMounted, ref } from 'vue'; import { apiClient, AuthApi, UserdataApi } from '@/api'; import { useRouter, useRoute } from 'vue-router'; -import { UserdataArray, UserdataCategoryName, UserdataParams } from '@/models'; -// import UserAchievements from '@/modules/profile/ui/UserAchievements.vue'; +import { UserdataArray, UserdataCategoryName, UserdataParams, AchievementGet } from '@/models'; +import UserAchievements from '@/modules/profile/ui/UserAchievements.vue'; import IrdomLayout from '@/components/IrdomLayout.vue'; import { useProfileStore } from '@/store/profile'; import { UserdataConverter } from '@/utils/UserdataConverter'; import { ToolbarActionItem } from '@/components/IrdomToolbar.vue'; import { useToolbar } from '@/store/toolbar'; +import { onMounted, ref, computed } from 'vue'; +import { getPictureUrl } from '@/utils/achievement'; const profileStore = useProfileStore(); const router = useRouter(); @@ -47,6 +48,10 @@ const userdataLoadingState = ref(UserdataLoadingState.Load const fullName = ref(''); const photoUrl = ref(''); +const userId = ref(-1); +const achievements = ref([]); +const achievementsIsLoading = ref(true); + const toolbarAction: ToolbarActionItem[] = [ { icon: 'edit', @@ -77,31 +82,60 @@ const loadUserdata = async () => { ])); if (me) { - const { data } = await UserdataApi.getUser(me.id); - if (data) { - fullName.value = - data.items.find( - item => - item.category === UserdataCategoryName.PersonalInfo && - item.param === UserdataParams.FullName - )?.value ?? 'Безымянный'; - photoUrl.value = - data.items.find( - item => - item.category === UserdataCategoryName.PersonalInfo && - item.param === UserdataParams.Photo - )?.value ?? Placeholder; - - userdata.value = UserdataConverter.flatToArray(data); - userdataLoadingState.value = UserdataLoadingState.Ready; - } else { - fullName.value = 'Безымянный'; - photoUrl.value = Placeholder; - userdataLoadingState.value = UserdataLoadingState.Error; + userId.value = me.id; + getUserInfo(); + loadAchievements(); + } +}; + +const getUserInfo = async () => { + const { data } = await UserdataApi.getUser(userId.value); + if (data) { + fullName.value = + data.items.find( + item => + item.category === UserdataCategoryName.PersonalInfo && + item.param === UserdataParams.FullName + )?.value ?? 'Безымянный'; + photoUrl.value = + data.items.find( + item => + item.category === UserdataCategoryName.PersonalInfo && item.param === UserdataParams.Photo + )?.value ?? Placeholder; + + userdata.value = UserdataConverter.flatToArray(data); + userdataLoadingState.value = UserdataLoadingState.Ready; + } else { + fullName.value = 'Безымянный'; + photoUrl.value = Placeholder; + userdataLoadingState.value = UserdataLoadingState.Error; + } +}; + +const loadAchievements = async () => { + try { + const resp = await apiClient.GET('/achievement/user/{user_id}', { + params: { path: { user_id: userId.value } }, + }); + if (resp.data) { + achievements.value = resp.data.achievement; } + } catch (error) { + console.error('Failed to load achievements:', error); + } finally { + achievementsIsLoading.value = false; } }; +const preparedAchievements = computed(() => { + return achievements.value.map(achievement => ({ + id: achievement.id, + name: achievement.name, + description: achievement.description, + picture: getPictureUrl(achievement.picture), + })); +}); + onMounted(async () => { loadUserdata(); }); @@ -119,9 +153,10 @@ onMounted(async () => {
- +

Основная информация