获取年度比赛项目id

GST002_old
JayChou 4 months ago
parent 1af1a6e862
commit 8d53a67e99
  1. 8
      src/api/race.ts
  2. 5
      src/styles/index.scss
  3. 32
      src/views/raceInfo/index.vue

@ -128,3 +128,11 @@ export const cancelRace = (params: any) => {
params, params,
}) })
} }
// 获取项目id
export const getProjectId = (params: any) => {
return request({
url: '/comp/comp/findanncomppid',
method: 'GET',
params,
})
}

@ -47,3 +47,8 @@
img{ img{
width: 100%; width: 100%;
} }
.race-description{
p{
line-height: 30px;
}
}

@ -1,13 +1,11 @@
<template> <template>
<div class="container-1420 container"> <div class="container-1420 container">
<!-- 年度比赛详细信息 --> <!-- 年度比赛详细信息 -->
<div class="year-race-info"> <div class="year-race-info">
<div class="left-info"> <div class="left-info">
<el-card> <el-card>
<template #header> <template #header>
<div style="display: flex;justify-content: space-between;"> <div style="display: flex; justify-content: space-between">
<el-breadcrumb> <el-breadcrumb>
<el-breadcrumb-item <el-breadcrumb-item
v-for="item in Route.matched" v-for="item in Route.matched"
@ -17,7 +15,9 @@
{{ item.meta.title }} {{ item.meta.title }}
</el-breadcrumb-item> </el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
<div><el-button @click="scrollToPosition">查看详情</el-button></div> <div>
<el-button @click="scrollToPosition">查看详情</el-button>
</div>
</div> </div>
</template> </template>
<div> <div>
@ -121,7 +121,7 @@
<div style="margin-top: 30px; font-size: 24px; font-weight: 600"> <div style="margin-top: 30px; font-size: 24px; font-weight: 600">
年度比赛列表: 年度比赛列表:
</div> </div>
<el-card v-if="reacProjectList.length === 0" style="margin-top: 20px;"> <el-card v-if="reacProjectList.length === 0" style="margin-top: 20px">
<div <div
style=" style="
display: flex; display: flex;
@ -135,7 +135,7 @@
<p>没有年度比赛~</p> <p>没有年度比赛~</p>
</div> </div>
</el-card> </el-card>
<el-card style="margin-top: 20px;" v-else> <el-card style="margin-top: 20px" v-else>
<div class="race-list"> <div class="race-list">
<div <div
class="item" class="item"
@ -184,7 +184,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, reactive, ref, toRefs, watch } from 'vue' import { onMounted, reactive, ref, toRefs, watch } from 'vue'
import { getYearRaceList, getRaceInfo, getHistoryRaceList } from '@/api/race' import {
getYearRaceList,
getRaceInfo,
getHistoryRaceList,
getProjectId,
} from '@/api/race'
import { useRouter, useRoute } from 'vue-router' import { useRouter, useRoute } from 'vue-router'
const Route = useRoute() const Route = useRoute()
const Router = useRouter() const Router = useRouter()
@ -220,7 +225,11 @@ const getraceInfoEvent = async () => {
getraceInfoEvent() getraceInfoEvent()
// //
const goToCompetition = (id: any) => { const goToCompetition = async (id: any) => {
const projectId = await getProjectId({ anncmopid: id })
console.log(projectId)
return
Router.push({ path: '/competition', query: { id, raceId: Route.query.id } }) Router.push({ path: '/competition', query: { id, raceId: Route.query.id } })
} }
@ -248,11 +257,12 @@ const createfileLink = (url: any) => {
fileList.value = list fileList.value = list
} }
const scrollToPosition = () => { const scrollToPosition = () => {
const targetPosition = (document.getElementById('introduction')as HTMLElement).offsetTop - 100; const targetPosition =
(document.getElementById('introduction') as HTMLElement).offsetTop - 100
window.scrollTo({ window.scrollTo({
top: targetPosition, top: targetPosition,
behavior: 'smooth', // behavior: 'smooth', //
}); })
} }
</script> </script>
@ -471,7 +481,7 @@ const scrollToPosition = () => {
font-size: 14px; font-size: 14px;
line-height: 22px; line-height: 22px;
border: 1px solid #ccc; border: 1px solid #ccc;
padding: 10px; padding: 20px;
margin-top: 20px; margin-top: 20px;
p { p {
img { img {

Loading…
Cancel
Save