2026-02-05 18:00:11 +08:00
|
|
|
|
<script lang="ts" setup>
|
2026-03-09 17:34:40 +08:00
|
|
|
|
import { computed, 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
|
|
|
|
|
2026-03-09 17:34:40 +08:00
|
|
|
|
const RoundType = computed(() => Number(route.query?.RoundType || 0))
|
|
|
|
|
|
|
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
|
|
|
|
|
2026-03-02 09:53:34 +08:00
|
|
|
|
const showBackground = ref(false)
|
|
|
|
|
|
const showTitle = ref(false)
|
|
|
|
|
|
const showList = ref(false)
|
2026-02-05 18:00:11 +08:00
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
// 进入规则页面
|
2026-03-11 17:58:57 +08:00
|
|
|
|
// routerPushByKey('user_rules')
|
|
|
|
|
|
routerPushByKey('user_cover', { query: { activityId, groupsId, teamIds: teamIds.value.join(','), RoundType: RoundType.value } })
|
2026-02-06 17:45:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function selectTeam(_id: number) {
|
|
|
|
|
|
// 选择队伍逻辑
|
2026-03-09 17:34:40 +08:00
|
|
|
|
routerPushByKey('user_cover', { query: { activityId, groupsId, teamId: _id, teamIds: teamIds.value.join(','), RoundType: RoundType.value } })
|
2026-02-05 18:00:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
2026-03-02 09:53:34 +08:00
|
|
|
|
getTeams()
|
|
|
|
|
|
// 1. 背景卷轴展开 - 稍微慢一点开始,给人一种准备的感觉
|
2026-02-05 18:00:11 +08:00
|
|
|
|
setTimeout(() => {
|
2026-03-02 09:53:34 +08:00
|
|
|
|
showBackground.value = true
|
|
|
|
|
|
}, 300)
|
|
|
|
|
|
|
2026-03-11 17:58:57 +08:00
|
|
|
|
// 2. 标题浮现 - 等卷轴展开一大半再出来 (卷轴动画约 3s,这里设为 2000ms)
|
2026-03-02 09:53:34 +08:00
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
showTitle.value = true
|
2026-03-11 17:58:57 +08:00
|
|
|
|
}, 2000)
|
2026-03-02 09:53:34 +08:00
|
|
|
|
|
2026-03-11 17:58:57 +08:00
|
|
|
|
// 3. 列表出现 - 等卷轴完全展开并定住后再出 (卷轴动画结束需 3s,这里给 3200ms)
|
2026-03-02 09:53:34 +08:00
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
showList.value = true
|
2026-03-11 17:58:57 +08:00
|
|
|
|
}, 2500)
|
2026-02-05 18:00:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
2026-03-11 17:58:57 +08:00
|
|
|
|
<CompetitionLayout :show-back="true" :show-next="true" next-btn-text="下一步" :show-title="false" @next="handleNext" @back="handleBack">
|
2026-02-05 18:00:11 +08:00
|
|
|
|
<!-- Scroll Content -->
|
|
|
|
|
|
<div class="scroll-container">
|
2026-03-02 09:53:34 +08:00
|
|
|
|
<!-- 卷轴背景动画容器 -->
|
|
|
|
|
|
<Transition name="scroll-expand">
|
|
|
|
|
|
<div v-if="showBackground" class="scroll-body">
|
|
|
|
|
|
<!-- Title Section inside Scroll -->
|
|
|
|
|
|
<Transition name="fade-slide-down">
|
|
|
|
|
|
<div v-if="showTitle" class="title-section">
|
|
|
|
|
|
<div class="scroll-bg">
|
|
|
|
|
|
<span class="main-title text-4xl text-#22685a">
|
|
|
|
|
|
队伍名单
|
|
|
|
|
|
</span>
|
2026-02-05 18:00:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-03-02 09:53:34 +08:00
|
|
|
|
</Transition>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="scroll-content">
|
|
|
|
|
|
<TransitionGroup name="list-anim" tag="div" class="teams-grid">
|
|
|
|
|
|
<div
|
2026-03-11 17:58:57 +08:00
|
|
|
|
v-for="(item, index) in showList ? teams : []" :key="item.id" class="team-item"
|
2026-03-12 14:33:30 +08:00
|
|
|
|
:style="{ '--delay': `${index * 0.4}s` }" @click="selectTeam(item.id)"
|
2026-03-02 09:53:34 +08:00
|
|
|
|
>
|
|
|
|
|
|
<div class="icon-wrapper">
|
2026-03-10 17:55:45 +08:00
|
|
|
|
<img src="@/assets/imgs/user/team-title-icon.svg" alt="team-icon" class="h-full w-full object-cover">
|
2026-03-02 09:53:34 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="team-name">
|
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</TransitionGroup>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="scroll-right-decor" />
|
2026-02-05 18:00:11 +08:00
|
|
|
|
</div>
|
2026-03-02 09:53:34 +08:00
|
|
|
|
</Transition>
|
2026-02-05 18:00:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</CompetitionLayout>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2026-03-02 09:53:34 +08:00
|
|
|
|
// 卷轴展开动画 - 变得更慢更优雅
|
|
|
|
|
|
.scroll-expand-enter-active {
|
2026-03-11 17:58:57 +08:00
|
|
|
|
transition: clip-path 3s cubic-bezier(0.25, 1, 0.5, 1);
|
2026-03-02 09:53:34 +08:00
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.scroll-expand-leave-active {
|
2026-03-11 17:58:57 +08:00
|
|
|
|
transition: clip-path 1.5s ease;
|
2026-03-02 09:53:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.scroll-expand-enter-from,
|
|
|
|
|
|
.scroll-expand-leave-to {
|
2026-03-11 17:58:57 +08:00
|
|
|
|
clip-path: inset(0 50% 0 50%);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.scroll-expand-enter-to,
|
|
|
|
|
|
.scroll-expand-leave-from {
|
|
|
|
|
|
clip-path: inset(0 0 0 0);
|
2026-03-02 09:53:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 标题进场动画 - 更加缓慢浮现
|
|
|
|
|
|
.fade-slide-down-enter-active {
|
|
|
|
|
|
transition: all 1.2s ease-out;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.fade-slide-down-enter-from {
|
|
|
|
|
|
opacity: 0;
|
|
|
|
|
|
transform: translateY(-40px);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 列表进场动画 (使用 keyframes 实现更丝滑的渐入)
|
|
|
|
|
|
.list-anim-enter-active {
|
2026-03-11 17:58:57 +08:00
|
|
|
|
animation: list-enter 1s cubic-bezier(0.23, 1, 0.32, 1) both; // both 模式确保动画前后状态保留
|
2026-03-02 09:53:34 +08:00
|
|
|
|
animation-delay: var(--delay);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@keyframes list-enter {
|
|
|
|
|
|
0% {
|
|
|
|
|
|
opacity: 0;
|
|
|
|
|
|
transform: translateY(80px) scale(0.9);
|
|
|
|
|
|
}
|
2026-03-11 17:58:57 +08:00
|
|
|
|
|
2026-03-02 09:53:34 +08:00
|
|
|
|
100% {
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
transform: translateY(0) scale(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-05 18:00:11 +08:00
|
|
|
|
.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-03-11 17:58:57 +08:00
|
|
|
|
background: url('@/assets/imgs/user/team-bg-animation.svg') no-repeat center center;
|
2026-02-05 18:00:11 +08:00
|
|
|
|
background-size: 100% 100%;
|
2026-03-02 09:53:34 +08:00
|
|
|
|
transform-origin: center; // 确保从中心展开
|
2026-03-11 17:58:57 +08:00
|
|
|
|
will-change: clip-path; // 优化性能
|
2026-02-05 18:00:11 +08:00
|
|
|
|
|
|
|
|
|
|
&::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;
|
2026-03-02 09:53:34 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
transition: transform 0.3s;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
transform: translateY(-5px);
|
|
|
|
|
|
}
|
2026-02-05 18:00:11 +08:00
|
|
|
|
|
|
|
|
|
|
.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;
|
2026-03-10 17:55:45 +08:00
|
|
|
|
margin-bottom: 10px;
|
2026-03-02 09:53:34 +08:00
|
|
|
|
filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
|
2026-02-05 18:00:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.team-name {
|
2026-03-02 09:53:34 +08:00
|
|
|
|
font-size: 1.5rem;
|
2026-02-05 18:00:11 +08:00
|
|
|
|
color: #333;
|
|
|
|
|
|
font-weight: bold;
|
2026-03-02 09:53:34 +08:00
|
|
|
|
text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
|
2026-03-10 17:55:45 +08:00
|
|
|
|
background: url('@/assets/imgs/user/team-title-bg.svg') no-repeat center center;
|
|
|
|
|
|
background-size: contain;
|
|
|
|
|
|
padding: 15px 30px;
|
|
|
|
|
|
border-radius: 10px;
|
2026-02-05 18:00:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|