index.vue
4.15 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
<template>
<div>
<div class="box">
<div class="indexTitle">
<h3 class="leftboderTT">赛事视频</h3>
<a class="more" @click="goList(query1.sortId,'赛事视频')">MORE</a>
</div>
<el-row :gutter="20">
<el-col :lg="12" :sm="24" :md="12">
<div class="liveImgbox" @click="goDetail(newsList[0])">
<i class="ii">直播中</i>
<img :src="fillImgUrl_webSite(newsList[0]?.picUrl)">
<h3 class="esp">{{ newsList[0]?.name }}
</h3>
</div>
</el-col>
<el-col :lg="12" :sm="24">
<el-row :gutter="20">
<el-col :md="12" :lg="12">
<div class="videoImgbox" @click="goDetail(newsList[1])">
<img :src="fillImgUrl_webSite(newsList[1]?.picUrl)">
</div>
</el-col>
<el-col :md="12" :lg="12">
<div class="videoImgbox" @click="goDetail(newsList[2])">
<img :src="fillImgUrl_webSite(newsList[2]?.picUrl)">
</div>
</el-col>
<el-col :md="12" :lg="12" class="mt20">
<div class="videoImgbox" @click="goDetail(newsList[3])">
<img :src="fillImgUrl_webSite(newsList[3]?.picUrl)">
</div>
</el-col>
<el-col :md="12" :lg="12" class="mt20">
<div class="videoImgbox" @click="goDetail(newsList[4])">
<img :src="fillImgUrl_webSite(newsList[4]?.picUrl)">
</div>
</el-col>
</el-row>
</el-col>
</el-row>
<div class="indexTitle">
<h3 class="leftboderTT">精彩图片</h3>
<a class="more" @click="goList(query2.sortId,'精彩图片')">MORE</a>
</div>
<el-row class="mb20" :gutter="20">
<el-col :lg="9">
<div class="picbox" @click="goDetail(newsList2[0])"><img :src="fillImgUrl_webSite(newsList2[0]?.picUrl)"/></div>
</el-col>
<el-col :lg="15">
<el-row :gutter="20">
<el-col :lg="16">
<div class="picbox" @click="goDetail(newsList2[1])"><img :src="fillImgUrl_webSite(newsList2[1]?.picUrl)"/></div>
</el-col>
<el-col :lg="8">
<div class="picbox" @click="goDetail(newsList2[2])" style="height: calc(50% - 10px)"><img :src="fillImgUrl_webSite(newsList2[2]?.picUrl)"/></div>
<div class="picbox" @click="goDetail(newsList2[3])" style="height: calc(50% - 10px);margin-top: 20px"><img :src="fillImgUrl_webSite(newsList2[3]?.picUrl)"/></div>
</el-col>
</el-row>
<el-row :gutter="20" class="mt20">
<el-col :lg="8" v-for="(n,index) in newsList2" :key="index" v-show="index>3">
<div class="picbox" @click="goDetail(n)" ><img :src="fillImgUrl_webSite(n.picUrl)"/></div>
</el-col>
</el-row>
</el-col>
</el-row>
<div class="mb60" />
</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'
const router = useRouter()
const activeName = ref(0)
const total = ref(0)
const list = ref([])
const newsList = ref([])
const newsList2 = ref([])
const query1 = ref({
pageSize: 5,
pageNum: 1,
sortId: '10000006'
})
const query2 = ref({
pageSize: 7,
pageNum: 1,
sortId: '10000007'
})
onMounted(() => {
getList(query1.value)
getList2(query2.value)
})
const getList = (obj) => {
getNewsListById(obj).then(res => {
newsList.value = res.rows
})
}
const getList2 = (obj) => {
getNewsListById(obj).then(res => {
newsList2.value = res.rows
})
}
const goList = (sortId, name) => {
router.push({
path: `/news/list/${sortId}`,
query: {
kindName: name
}
})
}
const goDetail = (n) => {
if (n.isOut == '1') {
window.open(n.jumpUrl)
} else {
window.open(router.resolve({
path: `/news/detail/${n.noteId}`
}).href)
}
}
</script>
<style lang="scss" scoped>
.leftboderTT{
font-size: 20px;}
@media (max-width: 800px) {
[class*=el-col-]{display: block;margin: 0 0 20px}
}
</style>