粒子研究院前台前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

386 lines
7.3 KiB

2 years ago
<template>
<div class="wrap">
2 years ago
<el-carousel :interval="6000" :arrow="(modules[0] && modules[0].list.filter(e => e.isEnable).length > 1) ? 'hover' : 'never'" :indicator-position="modules[0].list.filter(e => e.isEnable).length > 1 ? '' : 'none'">
<template v-for="(item, i) in modules[0].list">
<el-carousel-item v-if="item.pic && item.isEnable" :key="i">
<div :class="['banner-item', {'cursor-pointer': isLink(item.link.linkName)}]" @click="openLink(item)">
<img :src="item.pic" alt="">
<p class="banner-name">{{ item.title }}</p>
</div>
</el-carousel-item>
</template>
</el-carousel>
2 years ago
<div class="block share">
<div class="inner">
2 years ago
<h6>{{ modules[1].form.title }}</h6>
<p class="en" v-html="modules[1].form.des"></p>
<div class="sum">{{ modules[2].form.title }}</div>
<div class="flex beamBox">
2 years ago
<div class="left">
2 years ago
<div class="des" v-html="modules[2].form.des"></div>
2 years ago
</div>
2 years ago
<img class="pic" :src="modules[2].form.pic" alt="">
2 years ago
</div>
</div>
</div>
<div class="intro">
2 years ago
<img class="pic" src="http://10.10.11.7/images/device/2.png" alt="">
<div class="des" v-html="modules[3].form.des"></div>
2 years ago
</div>
<div class="unit">
2 years ago
<h6>{{ modules[4].form.title }}</h6>
<img class="pic" :src="modules[4].form.pic" alt="">
2 years ago
</div>
</div>
</template>
<script>
import mixins from '@/mixins/page'
import WOW from 'wow.js'
export default {
mixins: [mixins],
data() {
return {
2 years ago
}
},
mounted() {
new WOW().init()
},
methods: {
2 years ago
// 获取文章详情
getInfo() {
// 预览/详情
this.$post(`${this.api[this.preview ? 'getRedisCache' : 'findPage']}?columnId=${this.id}`)
.then(({ data }) => {
if (data.length) {
// state:已发布(1)则取theEditedJson,草稿(0)则取jsonBeforeEditing
const json = JSON.parse(
this.preview ? data : data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing']
);
this.modules = json;
console.log('🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json', json);
}
})
.catch((err) => { });
}
2 years ago
}
};
</script>
<style lang="scss" scoped>
@import url(../../plugins/wow/animate.css);
@import "../../styles/page/page.scss";
2 years ago
.wrap{
background: url(http://10.10.11.7/images/device/4.png) bottom right/auto no-repeat;
/deep/ .el-carousel {
height: 12.6rem;
.el-carousel__container{
height: 12.6rem;
}
img{
height: 12.6rem;
}
}
}
2 years ago
.banner-item {
.banner-name {
font-size: 2.16rem;
left: 17%;
bottom: 20%;
}
2 years ago
}
.block {
padding: 3.85rem 0;
.inner {
h6 {
font-size: 1.76rem;
}
.en {
font-size: 1.76rem;
margin: 0px 0 2rem;
}
.sum {
margin-top: 3rem;
font-size: .96rem;
}
}
2 years ago
}
2 years ago
.beamBox {
position: relative;
.left{
flex-grow: 1;
}
.imgText {
position: absolute;
2 years ago
right: 2rem;
bottom: 2.25rem;
2 years ago
display: flex;
2 years ago
font-size: .9rem;
2 years ago
font-weight: 400;
.readio {
width: 7px;
height: 7px;
background-color: #2A2A2A;
border-radius: 50%;
margin-right: 10px;
margin-top: 8px;
}
}
}
2 years ago
.share {
position: relative;
.inner {
2 years ago
width: 1200px;
2 years ago
}
.left {
2 years ago
// width: 34.1875rem;
flex-grow: 1;
margin-right: 4.125rem;
2 years ago
}
h6 {
position: relative;
2 years ago
font-size: 1.92rem;
2 years ago
font-family: PingFangSC-Medium, PingFang SC;
2 years ago
font-weight: bold;
2 years ago
color: #333333;
}
.en {
margin-top: -25px;
font-size: 2.4rem;
2 years ago
font-family: PingFangSC-Light, PingFang SC;
font-weight: 300;
color: #E3E3E3;
}
.sum {
margin-top: 60px;
font-size: 1.2rem;
2 years ago
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 44px;
}
.des {
2 years ago
margin-top: 1.25rem;
font-size: .88rem;
2 years ago
color: #333;
2 years ago
line-height: 1.85rem;
-webkit-line-clamp: inherit;
2 years ago
overflow: visible;
}
.pic {
2 years ago
width: 30.5rem;
height: auto;
2 years ago
margin-top: 10px;
2 years ago
border-top-left-radius: 20px;
}
}
.intro {
display: flex;
align-items: center;
2 years ago
width: 80%;
2 years ago
height: 19.65rem;
2 years ago
margin-bottom: 67px;
.pic {
width: 60%;
height: 100%;
}
.des {
2 years ago
height: 19.65rem;
padding: 2.85rem 3rem 1rem 3rem;
font-size: .96rem;
2 years ago
color: #fff;
2 years ago
line-height: 2rem;
2 years ago
background: #2E4984;
2 years ago
-webkit-line-clamp: 7; //设定一共3行,超出的部分隐藏,并用省略号来表示
2 years ago
}
}
.unit {
width: 986px;
padding-bottom: 60px;
margin: 0 auto;
h6 {
2 years ago
padding-left: .93rem;
margin-bottom: .93rem;
font-size: .88rem;
2 years ago
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #2A2A2A;
border-left: 4px solid #1583FF;
}
}
@media (max-width: 1200px) {
.inner{
padding: 0 20px;
width: 90% !important;
.sum{
line-height: 25px;
margin-top: 40px;
}
}
.beamBox{
display: flex;
flex-direction: column;
2 years ago
position: relative;
.left {
width: 100%;
}
.des{
-webkit-line-clamp: 100
}
.pic{
margin-top: 10px;
width: 100%;
height: auto;
}
}
.intro{
height: auto;
flex-direction: column;
.pic {
width: 100%;
}
.des {
-webkit-line-clamp: 100
}
}
.unit {
width: 100%;
img{
width: 100%;
}
}
}
2 years ago
@media (max-width: 320px) {
.banner{
2 years ago
height: 12rem;
padding: 6rem 0 0 2rem;
}
.beamBox {
.imgText {
bottom: 1rem;
right: 1rem;
}
}
.intro {
width: 100%;
.des {
height: auto;
}
2 years ago
}
}
2 years ago
@media (min-width: 320px) and (max-width: 375px) {
2 years ago
.banner{
2 years ago
height: 12rem;
padding: 6rem 0 0 2rem;
}
.beamBox {
.imgText {
bottom: 1rem;
right: 1rem;
}
2 years ago
}
2 years ago
.intro {
width: 100%;
.des {
height: auto;
}
}
}
@media (min-width: 375px) and (max-width: 480px) {
.banner{
2 years ago
height: 12rem;
padding: 6rem 0 0 2rem;
}
.beamBox {
.imgText {
bottom: 2rem;
right: 2rem;
}
}
.intro {
width: 100%;
.des {
height: auto;
}
2 years ago
}
}
2 years ago
@media (min-width: 480px) and (max-width: 640px) {
2 years ago
.banner{
2 years ago
height: 12rem;
padding: 6rem 0 0 2rem;
}
.beamBox {
.imgText {
bottom: 3rem;
right: 3rem;
}
}
.intro {
width: 100%;
.des {
height: auto;
}
2 years ago
}
}
2 years ago
@media (min-width: 640px) and (max-width: 768px) {
2 years ago
.banner{
2 years ago
height: 12rem;
padding: 6rem 0 0 2rem;
}
.beamBox {
.imgText {
bottom: 3rem;
right: 3rem;
}
}
.intro {
width: 100%;
.des {
height: auto;
}
2 years ago
}
}
2 years ago
@media (min-width: 768px) and (max-width: 980px) {
2 years ago
.banner{
2 years ago
height: 12rem;
padding: 6rem 0 0 2rem;
}
.beamBox {
.imgText {
bottom: 3rem;
right: 3rem;
}
}
.intro {
width: 100%;
.des {
height: auto;
}
2 years ago
}
}
2 years ago
@media (min-width: 980px) and (max-width: 1200px) {
2 years ago
.banner{
2 years ago
height: 12rem;
padding: 6rem 0 0 2rem;
}
.beamBox {
.imgText {
bottom: 4rem;
right: 4rem;
}
}
.intro {
width: 100%;
.des {
height: auto;
}
}
}
2 years ago
</style>