2026-02-05 18:00:11 +08:00
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { onMounted, ref } from 'vue'
|
2026-02-10 08:45:26 +08:00
|
|
|
import { useRoute } from 'vue-router'
|
2026-02-05 18:00:11 +08:00
|
|
|
import CompetitionLayout from '@/components/custom/user/CompetitionLayout.vue'
|
2026-02-06 17:45:44 +08:00
|
|
|
import { useRouterPush } from '@/hooks/common/router'
|
2026-02-10 08:45:26 +08:00
|
|
|
import { fetchGetTeamListByGroupId } from '@/service/api/competition'
|
2026-02-05 18:00:11 +08:00
|
|
|
|
2026-02-10 08:45:26 +08:00
|
|
|
const { routerPushByKey, routerBack } = useRouterPush()
|
|
|
|
|
const route = useRoute()
|
2026-02-05 18:00:11 +08:00
|
|
|
|
|
|
|
|
interface TeamItem {
|
|
|
|
|
id: number
|
|
|
|
|
name: string
|
|
|
|
|
icon: string
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-10 08:45:26 +08:00
|
|
|
const teams = ref<TeamItem[]>([])
|
|
|
|
|
const loading = ref(false)
|
2026-02-11 17:27:08 +08:00
|
|
|
const activityId = (route.query?.activityId) as string || ''
|
|
|
|
|
const groupsId = (route.query?.groupsId) as string || ''
|
|
|
|
|
const teamIds = ref<number[]>([])
|
2026-02-10 08:45:26 +08:00
|
|
|
|
|
|
|
|
async function getTeams() {
|
|
|
|
|
if (!groupsId)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
loading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const { data, error } = await fetchGetTeamListByGroupId(Number(groupsId))
|
|
|
|
|
if (error) {
|
|
|
|
|
window?.$message?.error(error.message)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const list = data?.data || []
|
|
|
|
|
if (list && Array.isArray(list)) {
|
|
|
|
|
teams.value = list.map((item: any) => ({
|
|
|
|
|
id: item.Id,
|
|
|
|
|
name: item.Name,
|
|
|
|
|
icon: 'star', // Default icon
|
|
|
|
|
}))
|
2026-02-11 17:27:08 +08:00
|
|
|
teamIds.value = list.map((item: any) => item.Id)
|
2026-02-10 08:45:26 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-02-05 18:00:11 +08:00
|
|
|
|
|
|
|
|
const showContent = ref(false)
|
|
|
|
|
|
|
|
|
|
function handleBack() {
|
2026-02-10 08:45:26 +08:00
|
|
|
routerBack()
|
2026-02-05 18:00:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleNext() {
|
2026-02-06 17:45:44 +08:00
|
|
|
// 进入规则页面
|
|
|
|
|
routerPushByKey('user_rules')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function selectTeam(_id: number) {
|
|
|
|
|
// 选择队伍逻辑
|
2026-02-11 17:27:08 +08:00
|
|
|
routerPushByKey('user_cover', { query: { activityId, groupsId, teamId: _id, teamIds: teamIds.value.join(',') } })
|
2026-02-05 18:00:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
showContent.value = true
|
2026-02-10 08:45:26 +08:00
|
|
|
getTeams()
|
2026-02-05 18:00:11 +08:00
|
|
|
}, 100)
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2026-02-06 17:45:44 +08:00
|
|
|
<CompetitionLayout :show-back="true" :show-next="false" :show-title="false" @back="handleBack" @next="handleNext">
|
2026-02-05 18:00:11 +08:00
|
|
|
<!-- Scroll Content -->
|
|
|
|
|
<div class="scroll-container">
|
|
|
|
|
<div class="scroll-body">
|
2026-02-06 17:45:44 +08:00
|
|
|
<!-- Title Section inside Scroll -->
|
|
|
|
|
<Transition name="fade-slide-down" appear>
|
|
|
|
|
<div v-if="showContent" class="title-section">
|
|
|
|
|
<div class="scroll-bg">
|
|
|
|
|
<span class="main-title text-4xl text-#22685a">
|
|
|
|
|
队伍名单
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Transition>
|
|
|
|
|
|
2026-02-05 18:00:11 +08:00
|
|
|
<div class="scroll-content">
|
|
|
|
|
<TransitionGroup name="list-anim" tag="div" class="teams-grid">
|
|
|
|
|
<div
|
|
|
|
|
v-for="(item, index) in teams" v-show="showContent" :key="item.id" class="team-item"
|
2026-02-10 08:45:26 +08:00
|
|
|
:style="{ '--delay': `${index * 0.1}s` }" @click="selectTeam(item.id)"
|
2026-02-05 18:00:11 +08:00
|
|
|
>
|
|
|
|
|
<div class="icon-wrapper">
|
2026-02-06 17:45:44 +08:00
|
|
|
<img src="@/assets/imgs/user/star-icon.svg" alt="team-icon" class="h-full w-full object-cover">
|
2026-02-05 18:00:11 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="team-name">
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</TransitionGroup>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="scroll-right-decor" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</CompetitionLayout>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.title-section {
|
|
|
|
|
position: absolute;
|
2026-02-06 17:45:44 +08:00
|
|
|
top: 18%; // 使用百分比定位,适应不同比例
|
|
|
|
|
left: 7%; // 微调位置,根据 1920x1080 下的视觉效果调整
|
2026-02-05 18:00:11 +08:00
|
|
|
z-index: 10;
|
|
|
|
|
|
|
|
|
|
.scroll-bg {
|
|
|
|
|
.main-title {
|
|
|
|
|
margin: 0;
|
|
|
|
|
writing-mode: vertical-rl; // 竖排文字
|
2026-02-06 17:45:44 +08:00
|
|
|
letter-spacing: 20px;
|
2026-02-05 18:00:11 +08:00
|
|
|
text-align: center;
|
2026-02-06 17:45:44 +08:00
|
|
|
font-weight: 900;
|
|
|
|
|
font-family: 'KaiTi', 'STKaiti', serif; // 尝试使用楷体增加古风感
|
2026-02-05 18:00:11 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 覆盖默认样式,因为这个页面设计比较特殊(卷轴)
|
|
|
|
|
.competition-layout :deep(.main-content) {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.scroll-container {
|
|
|
|
|
width: 80%;
|
|
|
|
|
height: 70%;
|
|
|
|
|
position: relative;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
2026-02-06 17:45:44 +08:00
|
|
|
// border: 1px solid red;
|
2026-02-05 18:00:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.scroll-body {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 781px;
|
|
|
|
|
position: relative;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2026-02-06 17:45:44 +08:00
|
|
|
background: url('@/assets/imgs/user/team-bg.svg') no-repeat center center;
|
2026-02-05 18:00:11 +08:00
|
|
|
background-size: 100% 100%;
|
|
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
|
left: -15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
|
right: -15px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.scroll-content {
|
|
|
|
|
width: 80%;
|
|
|
|
|
height: 80%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.teams-grid {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 60px;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.team-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.icon-wrapper {
|
|
|
|
|
width: 140px;
|
|
|
|
|
height: 140px;
|
|
|
|
|
position: relative;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
// background: url('@/assets/imgs/team-icon-bg.svg') no-repeat center center;
|
|
|
|
|
background-size: contain;
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.team-name {
|
|
|
|
|
font-size: 1.2rem;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Transitions
|
|
|
|
|
.fade-slide-down-enter-active,
|
|
|
|
|
.fade-slide-down-leave-active {
|
|
|
|
|
transition: all 0.8s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.fade-slide-down-enter-from,
|
|
|
|
|
.fade-slide-down-leave-to {
|
|
|
|
|
opacity: 0;
|
2026-02-06 17:45:44 +08:00
|
|
|
transform: translateX(-70px); // 竖排标题从左侧进入
|
2026-02-05 18:00:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.list-anim-enter-active,
|
|
|
|
|
.list-anim-leave-active {
|
|
|
|
|
transition: all 0.5s cubic-bezier(0.5, 0, 0.25, 1);
|
|
|
|
|
transition-delay: var(--delay);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.list-anim-enter-from,
|
|
|
|
|
.list-anim-leave-to {
|
|
|
|
|
opacity: 0;
|
|
|
|
|
transform: translateY(30px);
|
|
|
|
|
}
|
|
|
|
|
</style>
|