matchInfo-row.vue 2.13 KB
<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>