2026-04-18 14:10:27 +08:00
|
|
|
<script setup lang="ts">
|
2026-05-01 20:39:09 +08:00
|
|
|
import { useQuery } from '@tanstack/vue-query'
|
|
|
|
|
import { useI18n } from 'vue-i18n'
|
2026-04-18 14:10:27 +08:00
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
import KolPersonaCard from '@/components/kol/KolPersonaCard.vue'
|
|
|
|
|
import { kolManageApi } from '@/lib/api'
|
|
|
|
|
import { formatError } from '@/lib/errors'
|
2026-04-18 14:10:27 +08:00
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
const { t } = useI18n()
|
2026-04-18 14:10:27 +08:00
|
|
|
|
|
|
|
|
const profileQuery = useQuery({
|
2026-05-01 20:39:09 +08:00
|
|
|
queryKey: ['kol', 'profile'],
|
2026-04-18 14:10:27 +08:00
|
|
|
queryFn: () => kolManageApi.profile(),
|
2026-05-01 20:39:09 +08:00
|
|
|
})
|
2026-04-18 14:10:27 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="kol-profile-view">
|
2026-04-25 21:38:45 +08:00
|
|
|
<section class="page-title-card">
|
|
|
|
|
<div class="page-title-card__header">
|
|
|
|
|
<div class="page-title-card__copy">
|
2026-05-01 20:39:09 +08:00
|
|
|
<h2>{{ t('kol.profile.title') }}</h2>
|
|
|
|
|
<p>{{ t('kol.profile.subtitle') }}</p>
|
2026-04-25 21:38:45 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
2026-04-18 14:10:27 +08:00
|
|
|
|
|
|
|
|
<a-skeleton v-if="profileQuery.isPending.value" active avatar :paragraph="{ rows: 3 }" />
|
|
|
|
|
<a-alert
|
|
|
|
|
v-else-if="profileQuery.isError.value"
|
|
|
|
|
type="error"
|
|
|
|
|
show-icon
|
|
|
|
|
:message="formatError(profileQuery.error.value) || t('common.noData')"
|
|
|
|
|
/>
|
2026-05-01 20:39:09 +08:00
|
|
|
<KolPersonaCard v-else-if="profileQuery.data.value" :profile="profileQuery.data.value" />
|
2026-04-18 14:10:27 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.kol-profile-view {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 24px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|