粒子研究院前台前端
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.

277 lines
7.2 KiB

2 years ago
<template>
<div class="wrap">
<el-carousel height="480px" :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">
2 years ago
<div :class="['banner-item', {'cursor-pointer': 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
2 years ago
<div class="block">
2 years ago
<div class="inner">
<ul class="card">
<li>
<img class="pic" :src="modules[1].form.pic" alt="">
<div class="texts">
<h6>{{ modules[1].form.title }}</h6>
<p class="text">{{ modules[1].form.des }}</p>
</div>
2 years ago
<div class="arrow">
2 years ago
<img src="@/assets/images/arrow-white.png" alt="" :class="{'cursor-pointer': modules[1].form.link.linkName !== '无'}" @click="openLink(modules[1].form)">
2 years ago
</div>
</li>
<li>
<img class="pic" :src="modules[2].form.pic" alt="">
<div class="texts">
<h6>{{ modules[2].form.title }}</h6>
<p class="text">{{ modules[2].form.des }}</p>
</div>
2 years ago
<div class="arrow">
2 years ago
<img src="@/assets/images/arrow-white.png" alt="" :class="{'cursor-pointer': modules[2].form.link.linkName !== '无'}" @click="openLink(modules[2].form)">
2 years ago
</div>
</li>
<li>
<img class="pic" :src="modules[3].form.pic" alt="">
<div class="texts">
<h6>{{ modules[3].form.title }}</h6>
<p class="text">{{ modules[3].form.des }}</p>
</div>
2 years ago
<div class="arrow">
2 years ago
<img src="@/assets/images/arrow-white.png" alt="" :class="{'cursor-pointer': modules[3].form.link.linkName !== '无'}" @click="openLink(modules[3].form)">
2 years ago
</div>
</li>
<li>
<img class="pic" :src="modules[4].form.pic" alt="">
<div class="texts">
<h6>{{ modules[4].form.title }}</h6>
<p class="text">{{ modules[4].form.des }}</p>
</div>
2 years ago
<div class="arrow">
2 years ago
<img src="@/assets/images/arrow-white.png" alt="" :class="{'cursor-pointer': modules[4].form.link.linkName !== '无'}" @click="openLink(modules[4].form)">
2 years ago
</div>
2 years ago
</li>
</ul>
</div>
</div>
2 years ago
<div class="block gray">
2 years ago
<div class="inner">
<h2 class="b-title">{{ modules[5].form.title }}</h2>
<p class="intro">{{ modules[5].form.des }}</p>
2 years ago
<ul class="people">
2 years ago
<template v-for="(item, i) in modules[6].list">
2 years ago
<li v-if="item.isEnable" :key="i" :class="{'cursor-pointer': item.link.linkName !== '无'}" @click="openLink(item)">
2 years ago
<img class="comma" src="@/assets/images/comma.png" alt="">
<div class="left">
<h6>{{ item.title }}</h6>
<div class="des">{{ item.des }}</div>
</div>
<img class="pic" :src="item.pic" alt="">
</li>
</template>
2 years ago
</ul>
</div>
</div>
2 years ago
<ul class="shows">
2 years ago
<template v-for="(item, i) in modules[7].list">
<li v-if="item.isEnable" :key="i">
<div class="left">
<h6>{{ item.title }}</h6>
<div class="sub">{{ item.subTitle }}</div>
<div class="des">{{ item.des }}</div>
2 years ago
<img src="@/assets/images/arrow-white.png" alt="" :class="{'arrow': item.link.linkName !== '无'}" @click="openLink(item)">
2 years ago
</div>
<img class="pic" :src="item.pic" alt="">
</li>
</template>
2 years ago
</ul>
2 years ago
</div>
</template>
<script>
import mixins from '@/mixins/page'
2 years ago
import Setting from '@/setting'
import Util from '@/libs/util'
export default {
mixins: [mixins],
2 years ago
data() {
return {
2 years ago
}
},
mounted() {
},
methods: {
// 获取文章详情
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)
}
2 years ago
}).catch(err => {})
},
}
};
</script>
<style lang="scss" scoped>
@import "../../styles/page/page.scss";
2 years ago
.card {
display: flex;
justify-content: center;
li {
position: relative;
display: inline-flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 368px;
height: 526px;
margin-right: 14px;
color: #fff;
&:hover {
.arrow {
opacity: 1;
}
}
.pic {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
2 years ago
}
.texts {
position: relative;
2 years ago
}
h6 {
margin-bottom: 10px;
font-size: 35px;
}
.text {
font-size: 24px;
}
.arrow {
position: absolute;
bottom: 0;
width: 100%;
height: 177px;
padding-top: 62px;
text-align: center;
background: #36404A;
opacity: 0;
transition: .3s;
2 years ago
cursor: default;
2 years ago
}
}
2 years ago
}
.people {
position: relative;
2 years ago
li {
position: relative;
min-height: 450px;
padding: 100px 70px 30px 57px;
margin-bottom: 100px;
background-color: #fff;
&:nth-child(even) {
display: flex;
justify-content: flex-end;
.comma {
left: 660px;
}
.pic {
left: 0;
right: auto;
}
}
}
.comma {
position: absolute;
top: -22px;
left: 57px;
}
.left {
2 years ago
width: 51%;
2 years ago
}
h6 {
font-size: 24px;
color: #333;
}
.des {
margin-top: 20px;
font-size: 20px;
color: #666;
line-height: 32px;
}
.pic {
position: absolute;
top: -60px;
right: 43px;
2 years ago
width: 45%;
2 years ago
height: 450px;
}
}
2 years ago
.shows {
position: relative;
2 years ago
li {
position: relative;
display: flex;
align-items: center;
width: 100%;
height: 654px;
2 years ago
margin-bottom: 40px;
color: #fff;
&:nth-child(even) {
flex-direction: row-reverse;
2 years ago
}
&:nth-child(2) {
.left {
background-color: rgba(47, 79, 23, .65);
}
}
&:nth-child(3) {
.left {
background-color: rgba(91, 58, 35, .65);
}
}
}
.left {
2 years ago
position: relative;
z-index: 1;
2 years ago
width: 43.3%;
height: 100%;
2 years ago
padding: 138px 30px 30px 103px;
background-color: rgba(54, 54, 54, .65);
}
.pic {
2 years ago
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
}
2 years ago
h6 {
font-size: 46px;
}
.sub {
margin: 20px;
font-size: 36px;
}
.des {
margin-bottom: 40px;
font-size: 24px;
}
}
2 years ago
</style>