Files
sist_web/src/views/index/components/news_center.vue

350 lines
9.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script src="../../../utils/sist.js"></script>
<template>
<div class="news_center">
<el-row>
<el-col :span="5">
<div class="grid-content"></div>
</el-col>
<el-col :span="14">
<div class="headline">
<div class="title">
<!-- {{ $t("message.news_ceter") }}-->
新闻中心
<span class="vertica_line"></span>
<div class="news_center_english">
<span class="">NEWS</span>
<span class="">CENTER</span>
</div>
</div>
<div class="more">
<span class="more_text">更多</span>
<img src="../../../assets/index/news_center/gd_icon.png" alt="">
</div>
</div>
</el-col>
</el-row>
<!--轮播图下的新闻-->
<el-row>
<el-col :span="5">
<div class="grid-content"></div>
</el-col>
<el-col :span="14" class="news">
<el-row>
<el-col :span="6">
<div class="news_context">
<div class="news_context_img">
<img src="../../../assets/index/news_center/t4.png" alt="">
</div>
<div class="news_context_text">
<div class="vline">
<div class="news_context_text-title">信息引领勇于拼搏信息搏</div>
<div class="news_context_text-content">为促进学生学业发展学生学业学生学业学生学业给予2021年转专业同学有针对性的帮助信息科学与技术学院于10月26日开展
</div>
<div class="news_context_time">
<div class="icon"><img src="../../../assets/index/news_center/shijian.png" alt=""></div>
<span class="time">2022-10-2</span>
</div>
</div>
</div>
</div>
</el-col>
<el-col :span="6">
<div class="news_context">
<div class="news_context_img">
<img src="../../../assets/index/news_center/t4.png" alt="">
</div>
<div class="news_context_text">
<div class="vline">
<div class="news_context_text-title">信息引领勇于拼搏信息搏</div>
<div class="news_context_text-content">为促进学生学业发展学生学业学生学业学生学业给予2021年转专业同学有针对性的帮助信息科学与技术学院于10月26日开展
</div>
<div class="news_context_time">
<div class="icon"><img src="../../../assets/index/news_center/shijian.png" alt=""></div>
<span class="time">2022-10-2</span>
</div>
</div>
</div>
</div>
</el-col>
<el-col :span="6">
<div class="news_context">
<div class="news_context_img">
<img src="../../../assets/index/news_center/t4.png" alt="">
</div>
<div class="news_context_text">
<div class="vline">
<div class="news_context_text-title">信息引领勇于拼搏信息搏</div>
<div class="news_context_text-content">为促进学生学业发展学生学业学生学业学生学业给予2021年转专业同学有针对性的帮助信息科学与技术学院于10月26日开展
</div>
<div class="news_context_time">
<div class="icon"><img src="../../../assets/index/news_center/shijian.png" alt=""></div>
<span class="time">2022-10-2</span>
</div>
</div>
</div>
</div>
</el-col>
<el-col :span="6">
<div class="news_context">
<div class="news_context_img">
<img src="../../../assets/index/news_center/t4.png" alt="">
</div>
<div class="news_context_text">
<div class="vline">
<div class="news_context_text-title">信息引领勇于拼搏信息搏</div>
<div class="news_context_text-content">为促进学生学业发展学生学业学生学业学生学业给予2021年转专业同学有针对性的帮助信息科学与技术学院于10月26日开展
</div>
<div class="news_context_time">
<div class="icon"><img src="../../../assets/index/news_center/shijian.png" alt=""></div>
<span class="time">2022-10-2</span>
</div>
</div>
</div>
</div>
</el-col>
</el-row>
</el-col>
<el-col :span="5">
<div class="grid-content"></div>
</el-col>
</el-row>
</div>
</template>
<script>
import {banner, getArticleList} from "@/api";
import {toArticle, lookMoreComment} from "@/utils/sist";
import {lookMoreFixedComment} from "../../../utils/sist";
export default {
name: "news_center",
data() {
return {
newsDate: [],
bannerDate: [],
width: document.documentElement.clientWidth > 992
};
},
created() {
this.getList();
this.getBanner();
},
methods: {
clickTo(link) {
//console.log(link)
window.location.href = link;//当前标签页
},
getArticle(news) {
toArticle(news, this.width);
},
lookMore(news) {
lookMoreFixedComment("DpHktHeXJp3MX-FZoZdjz3w", this.width);
},
getList() {
getArticleList({
type: "NEd5n92EMIpyyBslaNqsRgE",
pageNum: 1,
pageSize: 4
}).then(res => {
this.newsDate = res.rows;
});
},
getBanner() {
banner("NEd5n92EMIpyyBslaNqsRgE").then(res => {
this.bannerDate = res.data;
});
}
}
};
</script>
<style>
.el-carousel__indicators {
display: none;
}
.grid-content {
height: 1px !important;
}
</style>
<style scoped lang="scss">
.news_center {
background-image: url("../../../assets/index/news_center/sy_bj3.png");
background-size : cover;
background-repeat:no-repeat;
//width: 100%;
height: 61rem;
.headline {
display: flex;
width: 100%;
justify-content: space-between;
.title {
display: flex;
width: 25.9rem;
height: 5.9rem;
line-height: 5.9rem;
border-radius: 2rem;
font-size: 3rem;
font-weight: 500;
letter-spacing: .1rem;
color: #FFFFFF;
text-align: left;
background: linear-gradient(240deg, rgba(0, 75, 177, 0) 0%, rgba(6, 79, 175, 0.64) 44%, #0A51AE 100%);
padding-left: 1.9rem;
margin-top: 6.3rem;
.vertica_line {
width: .1rem;
height: 2.5rem;
border: .1rem solid #FFFFFF;
margin: 1.7rem 1.4rem;
}
.news_center_english {
width: 5.3rem;
height: 2.8rem;
font-size: 1.3rem;
font-weight: 500;
color: #FFFFFF;
line-height: 1.4rem;
margin-top: 1.6rem;
span {
float: left;
}
}
}
}
.more {
display: flex;
height: 3.7rem;
margin-top: 9.8rem;
.more_text {
font-size: 1.6rem;
font-weight: 500;
color: #8B8B8B;
line-height: 2.3rem;
letter-spacing: .2rem;
}
img {
width: 2.9rem;
height: 1.4rem;
margin-left: 0.8rem;
margin-top: .5rem;
}
}
}
.news {
//width: 106.3rem;
height: 60.4%;
background-color: #fff;
margin-top: 4rem;
//.news_context:last-child {
// .news_context_text {
// .vline {
// //border-right: none;
// }
// }
//}
.news_context {
cursor: pointer;
//width: 28rem;
width: 100%;
height: 36.9rem;
&:hover {
box-shadow: 0 0 0.7rem 0 rgba(18, 69, 155, 0.59);
}
.news_context_img {
height: 42.8%;
width: 100%;
img {
width: 100%;
}
}
.news_context_text {
//padding: 4rem 2rem;
padding: 4rem 0 4rem 2rem;
.vline {
height: 14rem;
border-right: 1px solid #CCCCCC;
//padding-right: 1rem;
.news_context_text-title {
width: 23.8rem;
height: 2.1rem;
font-size: 1.5rem;
font-weight: 500;
color: #0040A4;
line-height: 2.1rem;
}
.news_context_text-content {
width: 23.8rem;
height: 5.3rem;
font-size: 1.3rem;
font-weight: 500;
color: #777777;
line-height: 1.8rem;
letter-spacing: .1rem;
margin-top: 1.6rem;
margin-bottom: 2.5rem;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box; //作为弹性伸缩盒子模型显示。
-webkit-box-orient: vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
-webkit-line-clamp: 3; //显示的行
}
.news_context_time {
display: flex;
.icon {
margin-right: .4rem;
img {
width: 1.1rem;
height: 1.1rem;
}
}
.time {
width: 6rem;
height: 1.4rem;
font-size: 1rem;
font-weight: 500;
color: #0040A4;
line-height: 1.4rem;
}
}
}
}
}
}
//@media screen and (min-width: 1100px) and (max-width: 1400px) {
// .news_context {
// width: 20rem !important;
// height: 20rem !important;
//
// .news_context_img {
// height: 12.5rem !important;
// }
// }
//}
</style>