|
|
@@ -0,0 +1,197 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<Swiper :banner-array="carouselList" /> |
|
|
|
<div id="hot"> |
|
|
|
<div class="content"> |
|
|
|
<div class="list"> |
|
|
|
<div class="article" v-for="(item, index) in articleList" :key="index" @click="detail(item)"> |
|
|
|
<img :src="item.image"> |
|
|
|
<div class="acontent"> |
|
|
|
<div class="txt"> |
|
|
|
<a class="title">{{ item.title }}</a> |
|
|
|
<a class="tcontent">{{ item.detailText }}</a> |
|
|
|
</div> |
|
|
|
<a class="date">发布日期: {{ $moment(item.sendDate).format('YYYY-MM-DD HH:mm:ss') }}</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-pagination |
|
|
|
@current-change="handleCurrentChange" |
|
|
|
background |
|
|
|
layout="prev, pager, next" |
|
|
|
:page-size="pageSize" |
|
|
|
:current-page.sync="pageNum" |
|
|
|
:total="total"> |
|
|
|
</el-pagination> |
|
|
|
</div> |
|
|
|
<RightList /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-dialog title="" v-if="videoDialogVisible" :visible.sync="videoDialogVisible" :lock-scroll="false" :append-to-body="true" width="50%"> |
|
|
|
<VideoDialog :url="videoUrl" :lock-scroll="false" :append-to-body="true"></VideoDialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import Swiper from '@/components/swiper' |
|
|
|
import RightList from './right.vue' |
|
|
|
import { lunboList } from '@/api/home.js' |
|
|
|
import { newsListApi } from '@/api/article.js' |
|
|
|
/* eslint-disable */ |
|
|
|
export default { |
|
|
|
name: 'home', |
|
|
|
data () { |
|
|
|
return { |
|
|
|
total: 0, |
|
|
|
pageSize: 9, |
|
|
|
pageNum: 1, |
|
|
|
carouselList: [], |
|
|
|
articleList: [], |
|
|
|
news: [], |
|
|
|
videos: [], |
|
|
|
videoDialogVisible: false, |
|
|
|
videoUrl: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
Swiper, |
|
|
|
RightList |
|
|
|
}, |
|
|
|
created () { |
|
|
|
this.getlunboList() |
|
|
|
this.getnewsList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleCurrentChange(val) { |
|
|
|
this.pageNum = val |
|
|
|
this.getnewsList() |
|
|
|
}, |
|
|
|
async getlunboList () { |
|
|
|
const { data: { code, data } } = await lunboList() |
|
|
|
if (code === 200) { |
|
|
|
this.carouselList = data.list |
|
|
|
} |
|
|
|
}, |
|
|
|
async getnewsList () { |
|
|
|
let d = { |
|
|
|
pageNum: this.pageNum, |
|
|
|
pageSize: this.pageSize, |
|
|
|
type: this.$route.query.type, |
|
|
|
subType: this.$route.query.subType |
|
|
|
} |
|
|
|
const { data: { code, data } } = await newsListApi(d) |
|
|
|
if (code === 200) { |
|
|
|
this.articleList = data.list |
|
|
|
this.total = Number(data.total) |
|
|
|
} |
|
|
|
}, |
|
|
|
detail(item) { |
|
|
|
this.$router.push({ path: '/articleDetails', query: {id : item.id } }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.el-carousel__item{ |
|
|
|
background-size: 100%; |
|
|
|
background-repeat: no-repeat; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: flex-end; |
|
|
|
#txt { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
margin-bottom: 50px; |
|
|
|
color: #FFFFFF; |
|
|
|
.title { |
|
|
|
font-size: 36px; |
|
|
|
font-weight: bold; |
|
|
|
text-align: center; |
|
|
|
margin-bottom: 15px; |
|
|
|
|
|
|
|
} |
|
|
|
.subtitle { |
|
|
|
font-size: 16px; |
|
|
|
font-weight: 400; |
|
|
|
opacity: 0.5; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#hot { |
|
|
|
width: 100%; |
|
|
|
// height: 1200px; |
|
|
|
background: #F2F4F8; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
.content { |
|
|
|
width: 1200px; |
|
|
|
margin: 50px 0 50px 0; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
.list { |
|
|
|
padding: 30px; |
|
|
|
width: 820px; |
|
|
|
background-color: #FFFFFF; |
|
|
|
.article { |
|
|
|
display: flex; |
|
|
|
margin-bottom: 24px; |
|
|
|
img { |
|
|
|
width: 200px; |
|
|
|
min-width: 200px; |
|
|
|
height: 150px; |
|
|
|
} |
|
|
|
.acontent { |
|
|
|
height: 150px; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
justify-content: space-between; |
|
|
|
padding: 0 10px; |
|
|
|
.txt { |
|
|
|
a { |
|
|
|
display: block; |
|
|
|
text-align: left; |
|
|
|
} |
|
|
|
.tcontent{ |
|
|
|
word-wrap: break-word; |
|
|
|
display: -webkit-box; |
|
|
|
-webkit-line-clamp: 3; |
|
|
|
-webkit-box-orient: vertical; |
|
|
|
overflow: hidden; |
|
|
|
font-size: 14px; |
|
|
|
font-weight: 400; |
|
|
|
color: #000000; |
|
|
|
line-height: 24px; |
|
|
|
margin-top: 4px; |
|
|
|
} |
|
|
|
} |
|
|
|
.title { |
|
|
|
font-size: 18px; |
|
|
|
font-weight: bold; |
|
|
|
color: #000000; |
|
|
|
line-height: 35px; |
|
|
|
} |
|
|
|
.content { |
|
|
|
font-size: 14px; |
|
|
|
font-weight: 400; |
|
|
|
color: #000000; |
|
|
|
line-height: 24px; |
|
|
|
} |
|
|
|
.date { |
|
|
|
font-size: 14px; |
|
|
|
font-weight: 400; |
|
|
|
color: #7D8392; |
|
|
|
text-align: left; |
|
|
|
} |
|
|
|
} |
|
|
|
.acontent:not(:last-child) { |
|
|
|
margin-bottom: 0px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.el-pagination.is-background .el-pager li:not(.disabled).active { |
|
|
|
background-color: #07CAAF; |
|
|
|
} |
|
|
|
</style> |