index.vue
3.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
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
<template>
<div>
<div class="box" style="padding: 0 10%">
<el-row class="contest-title">
<el-col :lg="12">
<h3>赛事视频</h3>
</el-col>
<el-col :lg="12">
<div style="display: flex;align-items: center;height: 100%">
<el-input class="search-input" clearable placeholder="请输入搜索内容" v-model="searchParam.text">
<template #append>
<el-button class="search-btn" >
<el-icon>
<Search/>
</el-icon>
</el-button>
</template>
</el-input>
</div>
</el-col>
</el-row>
<el-row>
<el-col class="photo-space" :lg="6" v-for="item in itemList">
<div class="photo-img-group">
<img class="photo-img" @click="goDetail(item)" :src="fillImgUrl(item.picUrl)">
<div class="photo-img-info">
<span style="display: block;font-size: 16px;padding:5px 0">{{item.name}}</span>
<span style="display: block;font-size: 14px;color: #C2A165">{{item.publishTime}}</span>
</div>
</div>
</el-col>
</el-row>
</div>
</div>
</template>
<script setup>
import { ArrowRight, Search } from '@element-plus/icons-vue'
import { onMounted, ref } from 'vue'
import { getNewsListById } from '@/apiPc/webSite'
import { useRouter } from 'vue-router'
import {useStorage} from "@vueuse/core/index";
import * as match from "@/apiPc/match";
const language = useStorage('language', 1)
const router = useRouter()
const searchParam = ref({
status: 1,
sortId: 2000,
})
const itemList = ref([])
onMounted(() => {
getList()
})
const searchByType = (type) => {
searchParam.value.type = type
}
const getList = () => {
match.getNoteList(searchParam.value).then(res => {
if (res.code === 200) {
itemList.value = res.rows
itemList.value.forEach(x => {
x.attacth = JSON.parse(x.attacthJson)
})
}
})
}
const goDetail = (n) => {
router.push({
path: `/news/detail/${n.noteId}`
})
}
</script>
<style lang="scss" scoped>
.contest-title {
h3 {
color: #fff;
font-size: 32px;
}
.contest-title-btn {
background: transparent;
color: #fff;
border: none;
border-radius: 15px;
}
.btn-active {
background: rgba(255,255,255,0.3);
}
.search-input {
height: 50px;
border: none;
background: #0E142C;
border-radius: 25px;
.search-btn {
width: 40px;
height: 40px;
border-radius: 20px;
background: #232B49;
color: #fff;
padding: 0;
}
:deep(.el-input__wrapper) {
background: transparent;
box-shadow: none;
}
:deep(.el-input-group__append) {
width: 50px;
background: transparent;
box-shadow: none;
}
}
}
.photo-space {
padding: 10px;
}
.photo-img-group {
padding: 20px;
width: 100%;
position: relative;
.photo-img-info {
background: #1F2644;
width: 100%;
height: 50px;
padding-left: 20px;
color: #fff;
}
}
.photo-img {
width: 100%;
aspect-ratio: 2/1;
cursor: pointer;
}
</style>