2026-04-17 14:30:47 +08:00
|
|
|
<script setup lang="ts">
|
2026-05-01 20:39:09 +08:00
|
|
|
import { TagOutlined, TeamOutlined, ThunderboltOutlined, UserOutlined } from '@ant-design/icons-vue'
|
|
|
|
|
import type { KolPackageSummary } from '@geo/shared-types'
|
|
|
|
|
import { computed } from 'vue'
|
|
|
|
|
import { useI18n } from 'vue-i18n'
|
2026-04-17 14:30:47 +08:00
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
import { resolveApiURL } from '@/lib/api'
|
2026-04-18 15:01:40 +08:00
|
|
|
|
2026-04-17 14:30:47 +08:00
|
|
|
const props = defineProps<{
|
2026-05-01 20:39:09 +08:00
|
|
|
package: KolPackageSummary
|
|
|
|
|
}>()
|
2026-04-17 14:30:47 +08:00
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
2026-05-01 20:39:09 +08:00
|
|
|
(e: 'click', id: number): void
|
|
|
|
|
}>()
|
2026-04-17 14:30:47 +08:00
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
const { t } = useI18n()
|
|
|
|
|
const coverUrl = computed(() => resolveApiURL(props.package.cover_url))
|
2026-04-17 14:30:47 +08:00
|
|
|
|
|
|
|
|
function handleClick() {
|
2026-05-01 20:39:09 +08:00
|
|
|
emit('click', props.package.id)
|
2026-04-17 14:30:47 +08:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<a-card hoverable class="kol-package-card" @click="handleClick">
|
|
|
|
|
<template #cover>
|
2026-05-01 20:39:09 +08:00
|
|
|
<div
|
|
|
|
|
v-if="coverUrl"
|
|
|
|
|
class="card-cover-image"
|
|
|
|
|
:style="{ backgroundImage: `url(${coverUrl})` }"
|
|
|
|
|
>
|
2026-04-18 15:01:40 +08:00
|
|
|
<img alt="cover" :src="coverUrl" />
|
2026-04-17 14:30:47 +08:00
|
|
|
</div>
|
|
|
|
|
<div v-else class="card-cover-fallback">
|
|
|
|
|
<ThunderboltOutlined class="fallback-icon" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<a-card-meta>
|
|
|
|
|
<template #title>
|
|
|
|
|
<div class="card-title">
|
|
|
|
|
{{ props.package.name }}
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #description>
|
|
|
|
|
<div class="card-description">
|
|
|
|
|
<div class="kol-info">
|
|
|
|
|
<a-avatar :src="props.package.kol_avatar_url" size="small">
|
|
|
|
|
<template #icon><UserOutlined /></template>
|
|
|
|
|
</a-avatar>
|
|
|
|
|
<span class="kol-name">{{ props.package.kol_display_name }}</span>
|
|
|
|
|
</div>
|
2026-05-01 20:39:09 +08:00
|
|
|
<div v-if="props.package.industry" class="industry-badge">
|
2026-04-17 14:30:47 +08:00
|
|
|
<a-tag color="blue">
|
|
|
|
|
<template #icon><TagOutlined /></template>
|
|
|
|
|
{{ props.package.industry }}
|
|
|
|
|
</a-tag>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="stats">
|
|
|
|
|
<span class="stat-item">
|
|
|
|
|
<ThunderboltOutlined />
|
|
|
|
|
{{ t('kol.marketplace.prompts', { count: props.package.prompt_count }) }}
|
|
|
|
|
</span>
|
|
|
|
|
<span class="stat-item">
|
|
|
|
|
<TeamOutlined />
|
|
|
|
|
{{ t('kol.marketplace.subscribers', { count: props.package.subscriber_count }) }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</a-card-meta>
|
|
|
|
|
</a-card>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.kol-package-card {
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
transition: all 0.3s;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kol-package-card:hover {
|
|
|
|
|
transform: translateY(-4px);
|
|
|
|
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-cover-image {
|
2026-04-25 23:17:04 +08:00
|
|
|
aspect-ratio: 16 / 9;
|
|
|
|
|
background-color: #eef2f6;
|
|
|
|
|
background-position: center;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2026-04-17 14:30:47 +08:00
|
|
|
overflow: hidden;
|
2026-04-25 23:17:04 +08:00
|
|
|
position: relative;
|
|
|
|
|
isolation: isolate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-cover-image::before {
|
2026-05-01 20:39:09 +08:00
|
|
|
content: '';
|
2026-04-25 23:17:04 +08:00
|
|
|
position: absolute;
|
|
|
|
|
inset: -16px;
|
|
|
|
|
z-index: 0;
|
|
|
|
|
background: inherit;
|
|
|
|
|
filter: blur(18px);
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
transform: scale(1.08);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-cover-image::after {
|
2026-05-01 20:39:09 +08:00
|
|
|
content: '';
|
2026-04-25 23:17:04 +08:00
|
|
|
position: absolute;
|
|
|
|
|
inset: 0;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
background: rgba(248, 250, 252, 0.34);
|
2026-04-17 14:30:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-cover-image img {
|
2026-04-25 23:17:04 +08:00
|
|
|
position: relative;
|
|
|
|
|
z-index: 2;
|
2026-04-17 14:30:47 +08:00
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
2026-04-25 23:17:04 +08:00
|
|
|
object-fit: contain;
|
2026-04-17 14:30:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-cover-fallback {
|
2026-04-25 23:17:04 +08:00
|
|
|
aspect-ratio: 16 / 9;
|
2026-04-17 14:30:47 +08:00
|
|
|
background: linear-gradient(135deg, #f0f7ff 0%, #e6f0ff 100%);
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.fallback-icon {
|
|
|
|
|
font-size: 48px;
|
|
|
|
|
color: #bae0ff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-title {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #1a1a1a;
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-description {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kol-info {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kol-name {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #595959;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.industry-badge {
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stats {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 16px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #8c8c8c;
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stat-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:deep(.ant-card-body) {
|
|
|
|
|
padding: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:deep(.ant-card-meta-title) {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
</style>
|