You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

411 lines
11 KiB

<!-- 年度赛事页面 -->
<template>
8 months ago
<div class="fill"></div>
<div class="banner">
6 months ago
<img src="../../assets/images/banner.jpg" alt="" />
8 months ago
</div>
<div class="competition" v-loading="loading">
<!-- 简介 -->
<div class="synopsis">
<div class="name">{{ yearRaceInfo.name }}</div>
<div class="content">
{{ yearRaceInfo.introduction }}
</div>
<!-- <div class="date">报名时间2023.08.23-2023.09.23</div> -->
</div>
8 months ago
<!-- 选择项目 -->
<div class="select">
<div class="left">
<div class="text-box">
<div class="title">选择项目</div>
6 months ago
<div class="small">选择下面的项目报名参与比赛</div>
<div class="back"><el-button type="primary" style="margin-top: 10px;" @click="$router.back()">返回</el-button></div>
</div>
8 months ago
<div class="card-list">
6 months ago
<div v-if="dataList.length == 0" style="font-size: 20px; color:#828282 ;">没有项目请创建年度比赛项目</div>
8 months ago
<template v-for="(o, i) in dataList" :key="o.id">
<div v-if="(i + 5) % 4 == 1" class="card" type="yellow">
<div class="top" :title="o.objName">{{ o.objName }}</div>
<div class="bottom">
<el-button class="btn" @click="goProjectName(o.id)">
立即报名
</el-button>
<el-link :underline="false" class="link">详情</el-link>
</div>
</div>
<div v-else-if="(i + 5) % 4 == 2" class="card" type="purple">
<div class="top" :title="o.objName">{{ o.objName }}</div>
<div class="bottom">
<el-button class="btn" @click="goProjectName(o.id)">
立即报名
</el-button>
<el-link :underline="false" class="link">详情</el-link>
</div>
</div>
<div v-else-if="(i + 5) % 4 == 3" class="card" type="cyan00">
<div class="top" :title="o.objName">{{ o.objName }}</div>
<div class="bottom">
<el-button class="btn" @click="goProjectName(o.id)">
立即报名
</el-button>
<el-link :underline="false" class="link">详情</el-link>
</div>
</div>
8 months ago
<div v-else-if="(i + 5) % 4 == 0" class="card" type="orange">
<div class="top" :title="o.objName">{{ o.objName }}</div>
<div class="bottom">
<el-button class="btn" @click="goProjectName(o.id)">
立即报名
</el-button>
<el-link :underline="false" class="link">详情</el-link>
</div>
</div>
</template>
</div>
</div>
<div class="right">
<div class="text-box">
<div class="title">历史比赛</div>
<div class="small">往年历史赛事</div>
</div>
<div class="game-list">
6 months ago
<div class="card-game" v-for="i in historyRaceList" :key="i.id">
<!-- <div class="pos">前往查看</div> -->
<div class="top">2024年度</div>
8 months ago
<div class="center">
6 months ago
<div class="text">{{ i.name }}</div>
8 months ago
<img src="../../assets/images/编组.png" alt="" />
</div>
6 months ago
<div class="bottom">报名时间{{ i.starttime }} - {{ i.endtime }}</div>
8 months ago
</div>
</div>
8 months ago
</div>
</div>
8 months ago
</div>
</template>
<script lang="ts" setup>
8 months ago
import { getCompetitionApi } from '@/api/person'
import { ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { ElMessage, ElLoading } from 'element-plus'
6 months ago
import { getYearRaceInfo,getHistoryRaceList } from '@/api/race'
8 months ago
const route = useRoute()
const router = useRouter()
// loading
8 months ago
const loading = ref(false)
let loadingInstance: any
watch(loading, (newVal) => {
if (newVal) loadingInstance = ElLoading.service({ fullscreen: true })
else if (loadingInstance) loadingInstance.close()
})
// 数据列表
8 months ago
const dataList = ref<any[]>([])
async function getList() {
8 months ago
try {
loading.value = true
const res: any = await getCompetitionApi(route.query.id as string)
if (!res.result) return
dataList.value = res.result
} catch (error) {
ElMessage.error('请求失败')
} finally {
loading.value = false
}
}
8 months ago
getList()
// 跳转项目名称
function goProjectName(id: any) {
8 months ago
router.push(`/projectName?id=${id}&bcId=${route.query.id}`)
}
8 months ago
const yearRaceInfo = ref<any>({})
const getYearRaceInfoEvent = async () => {
8 months ago
const res: any = await getYearRaceInfo({ id: route.query.id })
8 months ago
yearRaceInfo.value = res.result
console.log(res, 'yearRaceInfo.value ')
}
getYearRaceInfoEvent()
6 months ago
// 获取年度历史比赛
const historyRaceList = ref<any>([])
const getHistoryRaceListEvent = async () => {
const res: any = await getHistoryRaceList({ id: route.query.raceId })
console.log(res)
historyRaceList.value = res.result
}
getHistoryRaceListEvent()
</script>
<style lang="scss" scoped>
.fill {
8 months ago
padding-top: 80px;
}
.banner {
8 months ago
width: 100%;
height: 367px;
border-radius: 0px 0px 0px 0px;
8 months ago
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
.competition {
8 months ago
margin: 0 auto;
width: $base-container-width;
.synopsis {
.name {
height: 59px;
line-height: 59px;
font-family:
Open Sans,
Open Sans;
font-weight: bold;
font-size: 42px;
color: #333333;
}
8 months ago
.content {
margin-top: 40px;
font-family:
Open Sans,
Open Sans;
font-weight: 400;
font-size: 20px;
color: #555555;
6 months ago
line-height: 35px;
text-indent: 2em;
8 months ago
}
8 months ago
.date {
margin-top: 30px;
height: 23px;
line-height: 23px;
font-family:
Open Sans,
Open Sans;
font-weight: 400;
font-size: 20px;
color: #858585;
}
8 months ago
}
8 months ago
.select {
margin-top: 125px;
margin-bottom: 500px;
display: flex;
justify-content: space-between;
.left {
width: 1100px;
.card-list {
display: flex;
8 months ago
flex-wrap: wrap;
column-gap: 20px;
row-gap: 40px;
.card {
width: 260px;
height: 160px;
padding: 40px 0 0 30px;
6 months ago
box-shadow: 3px 2px 18px -7px rgba(0, 0, 0, 0.45);
transition: all 0.3s;
8 months ago
&[type='yellow'] {
background: url(../../assets/images/yellow.png) no-repeat;
background-size: cover;
--color: #ffc300;
--bg-color1: #ffcb9a;
--bg-color2: #ffc300;
}
&[type='purple'] {
background: url(../../assets/images/purple.png) no-repeat;
background-size: cover;
--color: #3f8bff;
--bg-color1: #90bbfc;
--bg-color2: #c4cdff;
}
&[type='cyan00'] {
background: url(../../assets/images/item.png) no-repeat;
background-size: cover;
--color: #76dae5;
--bg-color1: #74d9e4;
--bg-color2: #74e4bc;
}
&[type='orange'] {
background: url(../../assets/images/orange.png) no-repeat;
background-size: cover;
--color: #ff907b;
--bg-color1: #fca190;
--bg-color2: #fcd190;
}
.top {
margin-bottom: 30px;
font-family:
Microsoft YaHei UI,
Microsoft YaHei UI;
font-weight: bold;
font-size: 24px;
text-wrap: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.bottom {
display: flex;
gap: 50px;
.top,
.link {
color: var(--color);
}
8 months ago
.btn {
font-family:
Microsoft YaHei UI,
Microsoft YaHei UI;
font-weight: bold;
font-size: 14px;
width: 120px;
height: 30px;
border-radius: 15px;
color: #fff;
border: none;
background: linear-gradient(
to right,
var(--bg-color1),
var(--bg-color2)
);
}
8 months ago
}
}
6 months ago
.card:hover {
transform: translateY(-5px);
}
8 months ago
}
}
8 months ago
.right {
width: 260px;
.game-list {
.card-game {
width: 260px;
height: 140px;
background: linear-gradient(90deg, #21aca5 0%, #42d9ac 100%);
border-radius: 4px 4px 4px 4px;
margin-bottom: 18px;
background: url(../../assets/images/Rectangle284.png) no-repeat;
background-position: top right;
padding: 20px 22px;
position: relative;
.pos {
position: absolute;
top: 0;
right: 0;
width: 115px;
height: 28px;
font-family:
Microsoft YaHei UI,
Microsoft YaHei UI;
font-weight: 400;
font-size: 12px;
color: #f6f5fb;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.top {
font-family:
Microsoft YaHei UI,
Microsoft YaHei UI;
font-weight: 400;
font-size: 12px;
color: rgba(51, 51, 51, 0.8);
line-height: 14px;
}
.center {
margin: 10px 0;
display: flex;
justify-content: space-between;
align-items: center;
.text {
width: 140px;
height: 40px;
font-family:
Microsoft YaHei UI,
Microsoft YaHei UI;
font-weight: bold;
font-size: 16px;
color: #333333;
line-height: 20px;
}
8 months ago
}
.bottom {
font-family:
Microsoft YaHei UI,
Microsoft YaHei UI;
font-weight: 400;
font-size: 12px;
color: rgba(51, 51, 51, 0.8);
}
&:last-child {
margin-bottom: 0;
}
}
}
}
.left,
.right {
.text-box {
margin-bottom: 46px;
.title {
height: 42px;
line-height: 42px;
font-family: Inter, Inter;
font-weight: bold;
font-size: 40px;
color: #1e2033;
}
.small {
margin-top: 5px;
height: 24px;
line-height: 24px;
font-family: Inter, Inter;
font-weight: 400;
font-size: 16px;
color: #828282;
}
8 months ago
}
}
8 months ago
}
}
8 months ago
</style>