matchDetail.vue
6.35 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<template>
<div class="app-container">
<div class="box">
<el-breadcrumb class="mt20" :separator-icon="ArrowRight">
<el-breadcrumb-item :to="{ path: '/' }">
<el-icon>
<HomeFilled />
</el-icon>
首页
</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/competition' }">竞赛</el-breadcrumb-item>
<el-breadcrumb-item :to="{ name: 'calendar' }">竞赛日程</el-breadcrumb-item>
<el-breadcrumb-item>竞赛详情</el-breadcrumb-item>
</el-breadcrumb>
<el-card class="mt20">
<el-row :gutter="30">
<el-col :span="8" :xs="24" :lg="8">
<div class="imgbox">
<el-image fit="cover" style="aspect-ratio: 16/9" :src="fillImgUrl_webSite(activity.cover)" />
</div>
</el-col>
<el-col class="info" :span="16" :xs="24" :lg="16">
<h3> {{ activity.name }}</h3>
<div>
<div>
<el-tag v-for="(t,i) in activity.level?.split(',')" :key="i" type="danger" class="mr10">{{ t }}</el-tag>
</div>
<div class="date">竞赛时间:{{ activity.rangeStr }}</div>
<div class="date">竞赛地点:{{ activity.address }}</div>
</div>
</el-col>
</el-row>
</el-card>
<el-card class="mt20 mb20">
<el-tabs v-model="activeName">
<el-tab-pane label="详情" name="first">
<div v-html="activity.introduce" />
</el-tab-pane>
<el-tab-pane label="精彩照片" name="second">
<el-row :gutter="30" class="jcbox">
<el-col
v-for="(img,i) in activity.images" :key="i" :sm="8" :xl="7" :xs="12"
:lg="8"
>
<div class="imgbox">
<el-image
fit="cover"
:src="img"
:preview-src-list="activity.images"
/>
<!-- <img :src="img">-->
<!-- <h3 class="esp">name</h3>-->
</div>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="参赛运动员" name="third">
<el-table v-loading="loading" :data="playerList" border stripe>
<el-table-column type="index" width="55" align="center" label="序号" />
<el-table-column label="姓名" align="center" prop="name" show-overflow-tooltip />
<el-table-column label="性别" align="center" prop="sex" />
<el-table-column label="级别" align="center" prop="level" show-overflow-tooltip />
<el-table-column label="所属地区" align="center" prop="areas" show-overflow-tooltip />
</el-table>
<div v-if="total>0" class="pc-page-box">
<PaginationPc v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getPlayer" />
</div>
<el-empty v-if="total == 0" description="暂无数据" />
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</div>
</template>
<script setup>
import { getCurrentInstance, ref, watch } from 'vue'
import { onMounted } from '@vue/runtime-core'
import { useRoute } from 'vue-router'
import { getMatchInfo, getMatchPlayerList } from '@/apiPc/webSite'
import { ArrowRight } from '@element-plus/icons-vue'
import _ from 'lodash'
const route = useRoute()
const { proxy } = getCurrentInstance()
const activeName = ref('first')
const activity = ref({})
const playerList = ref([])
const total = ref(0)
const loading = ref(true)
const queryParams = ref({
pageNum: 1,
pageSize: 10
})
onMounted(() => {
initData()
})
async function initData() {
if (!route.params.id) {
return
}
queryParams.value.noteId = route.params.id
const res = await getMatchInfo(route.params.id)
activity.value = res.data
activity.value.images = _.map(res.data.photos.split(','), (img) => proxy.fillImgUrl_webSite(img))
}
watch(activeName, (val) => {
if (val === 'third' && playerList.value.length == 0) {
getPlayer()
}
})
function getPlayer() {
loading.value = true
getMatchPlayerList(queryParams.value).then((res) => {
loading.value = false
playerList.value = res.rows
total.value = res.total
})
}
</script>
<style lang="scss" scoped>
:deep(.el-table .el-table__header-wrapper th, .el-table .el-table__fixed-header-wrapper th){
background: #f4f4f4!important;
}
.jcbox{
.imgbox {
aspect-ratio: 16/9;
position: relative;
margin-bottom: 24px;
cursor: pointer;
overflow: hidden;
img {
transform: scale(1);
transition: all 0.2s;
height: 100%;
object-fit: cover;
}
&:hover img {
transform: scale(1.1);
transform-origin: center;
}
h3 {
color: #fff;
position: absolute;
margin: 0;
padding: 15px;
bottom: 0;
width: 100%;
text-overflow: ellipsis;
overflow: hidden;
font-family: SC-song, serif;
z-index: 1;
}
&::before {
content: '';
width: 100%;
height: 25%;
background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6));
position: absolute;
z-index: 1;
left: 0;
bottom: 0;
}
}
}
.info {
h3 {
font-size: 24px;
color: #AD181F;
}
.date{ line-height: 1.6;font-size: 16px;
color: #666;margin: 15px 0 0}
}
.btns {
display: flex;
justify-content: space-between;
margin-top: 20px;
a {
width: 48%;
display: block;
text-align: center;
color: #fff;
height: 45px;
line-height: 45px;
background: linear-gradient(270deg, #FCD258 0%, #D3AA5A 0%, #E4C889 99%);
border-radius: 2px;
font-size: 18px;
}
i {
padding: 0 15px;
}
i.icon1 {
background: url("@/assets/v1/about/icon01.png") no-repeat left;
background-size: contain;
}
i.icon2 {
background: url("@/assets/v1/about/icon02.png") no-repeat left;
background-size: contain;
}
a:hover {
background: linear-gradient(90deg, #FCD258 0%, #D3AA5A 0%, #E4C889 99%);
}
}
.tab1 {
background: url("@/assets/v1/about/tab1.png") no-repeat right bottom #FEFDFB;
background-size: contain;
}
.forWei {
display: none;
}
@media (max-width: 500px) {
.forWei {
display: block;
}
.box {
display: none;
}
}
</style>