|
@@ -6,6 +6,7 @@
|
|
|
<h3 class="name">{{ info.name || '暂无' }}</h3>
|
|
|
<p class="brief">{{ info.industry || '暂无' }}</p>
|
|
|
<p class="money" v-if="info.money">{{ info.money || '暂无' }}</p>
|
|
|
+ <p class="type" v-if="info.match_type">{{ getDict(info.match_type, 'type') || '暂无' }}</p>
|
|
|
<div class="time">
|
|
|
<el-image class="image" :src="time" fit="fill"></el-image>
|
|
|
<span>{{ info.start_time || '暂无' }} ~ {{ info.end_time || '暂无' }}</span>
|
|
@@ -114,7 +115,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import moment from 'moment'
|
|
|
-import { cloneDeep } from 'lodash-es'
|
|
|
+import { get, cloneDeep } from 'lodash-es'
|
|
|
const $checkRes = inject('$checkRes')
|
|
|
// 组件
|
|
|
import dataForm from './parts/index.vue'
|
|
@@ -136,6 +137,7 @@ const route = useRoute()
|
|
|
const info = ref({})
|
|
|
// 弹框
|
|
|
const cardTypeList = ref([])
|
|
|
+const typeList = ref([])
|
|
|
const ruleFormRef = ref()
|
|
|
const form = ref({})
|
|
|
const validatePhoneNumber = (rule, value, callback) => {
|
|
@@ -178,6 +180,9 @@ const searchOther = async () => {
|
|
|
// 证件类型
|
|
|
result = await dictDataStore.query({ code: 'cardType', is_use: '0' })
|
|
|
if ($checkRes(result)) cardTypeList.value = result.data
|
|
|
+ // 赛事类型
|
|
|
+ result = await dictDataStore.query({ code: 'activeType', is_use: '0' })
|
|
|
+ if ($checkRes(result)) typeList.value = result.data
|
|
|
}
|
|
|
const search = async () => {
|
|
|
let id = route.query.id
|
|
@@ -186,9 +191,19 @@ const search = async () => {
|
|
|
if (res.errcode == '0') info.value = res.data
|
|
|
}
|
|
|
}
|
|
|
+// 字典数据转换
|
|
|
+const getDict = (data, model) => {
|
|
|
+ if (data) {
|
|
|
+ let res
|
|
|
+ if (model == 'type') res = typeList.value.find((f) => f.value == data)
|
|
|
+ return get(res, 'label')
|
|
|
+ }
|
|
|
+}
|
|
|
// 报名参赛
|
|
|
const toSign = () => {
|
|
|
- dialog.value = true
|
|
|
+ if (info.value.match_type == '1') {
|
|
|
+ window.open(info.value.href, '_blank') // 在新标签页中打开URL
|
|
|
+ } else dialog.value = true
|
|
|
}
|
|
|
const toClose = () => {
|
|
|
dialog.value = false
|
|
@@ -246,6 +261,20 @@ provide('submitForm', submitForm)
|
|
|
margin-top: 25px;
|
|
|
color: #000;
|
|
|
}
|
|
|
+ .type {
|
|
|
+ font-size: $global-font-size-12;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ width: 70px;
|
|
|
+ height: 25px;
|
|
|
+ border-radius: 4px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 25px;
|
|
|
+ font-weight: 700;
|
|
|
+ color: #2a78ff;
|
|
|
+ background: #eaf1ff;
|
|
|
+ }
|
|
|
.time {
|
|
|
display: flex;
|
|
|
margin-top: 60px !important;
|