coach.vue
10.2 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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<template>
<div>
<div class="topBannerbox">
<el-carousel v-if="bannerlist?.length>0" class="topBanner">
<el-carousel-item v-for="(n,index) in bannerlist" :key="index">
<div class="imgbox" @click="goDetail(n)">
<img :src="fillImgUrl_webSite(n.bannerUrl)">
<h3>{{ n.name }}</h3>
</div>
</el-carousel-item>
</el-carousel>
</div>
<div v-if="newslist.length>0" class="box forPc">
<div class="nakedTitle">
<h3>{{ kind }}资讯</h3>
<a class="more" @click="goList(query1,`${kind}资讯`)">MORE⇀</a>
</div>
<el-card class="mb20">
<el-row class="topNews" :gutter="20">
<el-col :lg="12" :sm="24" :md="12">
<el-carousel indicator-position="none">
<el-carousel-item v-for="(n,index) in newslist?.slice(0,1)" :key="index">
<div class="imgbox carouselImg" @click="goDetail(n)">
<div class="date">
<div class="day">{{ n.belongTime?.substring(8, 10) }}</div>
<p>{{ n.belongTime?.substring(0, 7).replace(/-/g, '/') }}</p>
</div>
<img :src="fillImgUrl_webSite(n.picUrl)">
<h3 class="esp">{{ n.name }}</h3>
</div>
</el-carousel-item>
</el-carousel>
</el-col>
<el-col :lg="12" :sm="24" :md="12" class="news-l-r">
<div>
<table style="width: 100%" cellpadding="0" cellspacing="0">
<tr v-for="(n,index) in newslist?.slice(1,3)" :key="index">
<td>
<div class="item" style="width: 600px;padding: 0" @click="goDetail(n)">
<div v-if="n.picUrl" class="imgbox" style="width: 220px;height: 130px;">
<img :src="fillImgUrl_webSite(n.picUrl)">
</div>
<div class="info" style="width: calc(100% - 220px)">
<div class="date">{{ n.belongTime }}</div>
<h2 class="esp_2">{{ n.name }}</h2>
<p class="esp">
{{ n.subName }}
</p>
</div>
</div>
</td>
</tr>
</table>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="news-arrow">
<el-col
v-for="(n ,index) in newslist" v-show="index>2" :lg="12" :xs="12"
:sm="24" @click="goDetail(n)"
>
<div class="item">
<h3 class="esp">
<el-icon color="#7B7F83">
<CaretRight />
</el-icon>
{{ n.name }}
</h3>
<span class="date">04-10</span>
</div>
</el-col>
</el-row>
</el-card>
</div>
<div class="box forPc">
<div v-if="kind == '裁判员'" class="nakedTitle">
<h3>裁委会</h3>
<a class="more" @click="goPersonList(query2.label)">MORE⇀</a>
</div>
<el-card v-if="kind == '裁判员'">
<el-row :gutter="20">
<el-col v-for="(m,index) in personlist" v-show="index<3" :lg="8" :sm="24">
<div class="cpItemBox mt30 mb20">
<div class="cpItem">
<div class="info">
<h3>
<div>{{ m.realName }}</div>
<span>{{ m.labelStr }}</span>
</h3>
<p class="esp_3" v-html="m.remark" />
</div>
<img style="object-fit: cover;" :src="fillImgUrl_webSite(m.picUrl)">
</div>
</div>
</el-col>
</el-row>
</el-card>
<div class="nakedTitle">
<h3 v-if="kind == '裁判员'">优秀{{ kind }}</h3>
<h3 v-else>{{ kind }}</h3>
<a class="more" @click="goPersonList(query2.label)">MORE⇀</a>
</div>
<el-card class="mb20">
<el-row class="JsmemberList" :gutter="20">
<el-col v-for="m in personlist" :lg="4" :sm="12">
<div class="item" style="margin: 0" @click="goPersonDetail(m)">
<div class="imgbox"><img :src="fillImgUrl_webSite(m.picUrl)"></div>
<h3>{{ m.realName }}</h3>
</div>
</el-col>
</el-row>
</el-card>
</div>
<div class="forWei">
<div class="wbg">
<div class="nakedTitle">
<h3>{{ kind }}资讯</h3>
<a class="more" @click="goList(query1,`${kind}资讯`)">MORE⇀</a>
</div>
<div class="news-l-r">
<div style="border-top: 1px dashed #EEE;padding: 10px 0 0;">
<div v-for="(n,index) in newslist?.slice(0,3)" :key="index" class="item" style="padding: 0 0 10px" @click="goDetail(n)">
<div class="info" style="width: calc(100% - 120px)">
<h3 class="esp_2">{{ n.name }}</h3>
<div class="date">{{ n.belongTime }}</div>
</div>
<div v-if="n.picUrl" class="imgbox" style="width: 110px;height: 80px;margin-left: 10px">
<img :src="fillImgUrl_webSite(n.picUrl)">
</div>
</div>
</div>
</div>
</div>
<div class="wbg mt20">
<div class="nakedTitle">
<h3>{{ kind }}</h3>
<a class="more" @click="goPersonList(query2.label)">MORE⇀</a>
</div>
<div class="autoOverflowBox">
<div class="JsmemberList">
<div v-for="m in personlist" :key="m.id" class="item" @click="goPersonDetail(m)">
<div class="imgbox"><img :src="fillImgUrl_webSite(m.picUrl)"></div>
<h3 class="esp">{{ m.realName }}</h3>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { onMounted, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { getBannerListBySortId, getNewsListById, getPersonByLabel } from '@/apiPc/webSite'
const route = useRoute()
const router = useRouter()
const kind = ref('')
const query1 = ref({
pageSize: 9,
pageNum: 1
})
const query2 = ref({
pageSize: 6,
pageNum: 1
})
const newslist = ref([])
const personlist = ref([])
const bannerlist = ref([])
onMounted(() => {
var val = route.params.kind
judeKind(val)
})
watch(() => route.params.kind, (val) => {
judeKind(val)
})
const judeKind = (val) => {
if (val == '2') {
kind.value = '裁判员'
query2.value.label = 2
query1.value.sortId = '1026'
query1.value.code = '90000001'
getList()
getBannerList()
} else if (val == '1') {
kind.value = '教练员'
query2.value.label = 1
query1.value.sortId = '1027'
query1.value.code = '90000002'
getList()
getBannerList()
} else if (val == '6') {
kind.value = '解说员'
query2.value.label = 6
query1.value.sortId = '1028'
query1.value.code = '90000003'
getList()
getBannerList()
} else if (val == '9') {
kind.value = '运动员'
query2.value.label = 9
query1.value.sortId = '1704749631689469954'
query1.value.code = '90000004'
getList()
getBannerList()
} else if (val == '7') {
kind.value = '宣传员'
query2.value.label = 7
query1.value.sortId = '1031'
query1.value.code = '11000001'
getList()
getBannerList()
} else if (val == '3') {
kind.value = '考官'
query2.value.label = 3
// query1.value.sortId = '1031'
// query1.value.code = '11000001'
// getList()
}
}
const getList = () => {
getPersonByLabel(query2.value).then(res => {
personlist.value = res.rows
})
getNewsListById(query1.value).then(res => {
newslist.value = res.rows
})
}
const getBannerList = () => {
getBannerListBySortId(query1.value.sortId).then(res => {
bannerlist.value = res.data
})
}
const goDetail = (n) => {
if (n.isOut == '1') {
window.open(n.jumpUrl)
} else {
router.push({
path: `/news/detail/${n.noteId}`
})
}
}
const goList = (query, name) => {
query.sortName = name
router.push({
name: 'noticeList',
query: query
})
}
const goPersonList = (label) => {
router.push({
name: 'personList',
query: {
label: label
}
})
}
const goPersonDetail = (m) => {
router.push({
path: `/about/leader/${m.id}`,
query: {
name: encodeURIComponent(m.labelStr),
from: route.params.kind
}
})
}
</script>
<style lang="scss" scoped>
.cpItemBox{position: relative;
&::before{content: '';background:#d4ad62;width: 80%;height: 50%;
position: absolute;left: -6px;top: -6px;
}
}
.cpItem{position: relative;box-shadow: 0 0 6px #ddd;padding: 10px 15px;
background: #fff;
.info{width: calc(100% - 160px);
h3{border-bottom: 1px solid #d4ad62;display: flex;align-items: center;margin: 0;
div{border-bottom: 1px solid #d4ad62;padding: 10px 0;}
span{font-size: 14px;color: #fff;background: #d4ad62;
padding: 2px 6px;margin-left: 6px;position: relative;display: inline-block;height: 20px;
&::after{content: '';width: 0;
height: 0;right: -12px;position: absolute;top: 0;
border-top: 21px solid #d4ad62;
border-right: 12px solid transparent;}
}
}
p{font-size: 12px;}
}
img{position: absolute;width: 150px;height: 200px;right: 0;bottom: 0;}
}
.news-l-r{
.item:first-child{margin-bottom: 20px;}
tr:nth-child(3) td{border-bottom: 1px dashed #e1e1e1;}
}
.news-arrow .item:last-child{border-bottom: 1px dashed #e1e1e1;}
.topBanner{height: 500px;
:deep(.el-carousel__container){height: 100%;}
}
@media (max-width: 500px) {
.forWei {
height: 100vh;
overflow: auto;
background: #F6F6FA;
padding: 1px;
.wbg{padding:0 10px;}
.nakedTitle h3{margin: 10px 0;}
}
.topBannerbox {
background: #fff;
padding: 1px;
.el-carousel {
--el-carousel-indicator-height: 4px;
--el-carousel-indicator-width: 4px;
}
}
.topBanner{height: 220px;border-radius: 10px;margin: 15px;
h3{text-align: left;font-size: 15px;padding: 30px 15px 20px;
}
:deep(.el-carousel__indicators--horizontal){left: auto;right: 0;
bottom: 12px;
}
:deep(.el-carousel__button){border-radius: 5px;}
:deep(.el-carousel__indicator.is-active button){width: 12px;}
}
}
</style>