matchInfo-row.vue
2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<template>
<div class="border-info" style="margin: 20px" v-loading="loading">
<el-row v-if="language==0">
<el-col :lg="8"><div class="item"><label>赛事名称</label>{{matchInfo.name}}</div></el-col>
<el-col :lg="8"><div class="item"><label>赛事类型</label>{{matchInfo.level}}</div></el-col>
<el-col :lg="8"><div class="item"><label>赛事时间</label>{{matchInfo.beginTime?.slice(0,10)}} 至 {{ matchInfo.endTime?.slice(0,10) }}</div></el-col>
<el-col :lg="8"><div class="item"><label>报名时间</label>{{ matchInfo.signBeginTime?.slice(0,10) }} 至{{ matchInfo.signEndTime?.slice(0,10) }}</div></el-col>
<el-col :lg="16"><div class="item"><label>比赛地址</label>{{matchInfo.address}}</div></el-col>
</el-row>
<el-row v-else>
<el-col :lg="8"><div class="item"><label>Event Name</label>{{matchInfo.name}}</div></el-col>
<el-col :lg="8"><div class="item"><label>Event Type</label>{{matchInfo.level}}</div></el-col>
<el-col :lg="8"><div class="item"><label>Event Date</label>{{matchInfo.beginTime?.slice(0,10)}} ~ {{ matchInfo.endTime?.slice(0,10) }}</div></el-col>
<el-col :lg="8"><div class="item"><label>Registration Period</label>{{ matchInfo.signBeginTime?.slice(0,10) }} ~{{ matchInfo.signEndTime?.slice(0,10) }}</div></el-col>
<el-col :lg="16"><div class="item"><label>Event Address</label>{{matchInfo.address}}</div></el-col>
</el-row>
</div>
</template>
<script setup>
import {onMounted} from "@vue/runtime-core";
import * as match from "@/apiPc/match";
import cache from "@/plugins/cache";
const language = ref(cache.local.get('language') || 0)
const props = defineProps({
matchId: {
type: String,
required: true
}
})
const matchInfo = ref({})
const loading = ref(false)
onMounted(()=>{
loading.value = true
if(props.matchId)
getMatch()
})
const getMatch = () => {
match.getMatchById({ id: props.matchId }).then(res => {
matchInfo.value = res.data
loading.value = false
})
}
</script>
<style scoped lang="scss">
.border-info{
.item{margin: 5px 0;color: #4C5359; font-size: 14px;
label{font-size: 14px;margin-right: 14px}
}
}
</style>