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

134 lines
3.7 KiB

<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">
<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>
<div class="block gray">
<div class="inner">
<h2 class="b-title">{{ modules[1].form.title }}</h2>
<p class="intro">{{ modules[1].form.des }}</p>
<img :class="{'cursor-pointer': modules[1].form.link.linkName !== '无'}" width="100%" height="536" :src="modules[1].form.pic" alt="" @click="openLink(modules[1].form)">
</div>
</div>
<div class="block">
<div class="inner">
<h2 class="b-title">{{ modules[2].form.title }}</h2>
<p class="intro">{{ modules[2].form.des }}</p>
<img :class="{'cursor-pointer': modules[2].form.link.linkName !== '无'}" width="100%" height="536" :src="modules[2].form.pic" alt="" @click="openLink(modules[2].form)">
</div>
</div>
<div class="block gray">
<div class="inner">
<h2 class="b-title">{{ modules[3].form.title }}</h2>
<p class="intro">{{ modules[3].form.des }}</p>
<ul class="list">
<template v-for="(item, i) in modules[4].list">
<li v-if="item.isEnable" :key="i">
<img class="pic" :src="item.pic" alt="" :class="{'cursor-pointer': item.link.linkName !== '无'}" @click="openLink(item)">
<div class="texts">
<h6>{{ item.title }}</h6>
<p class="sub">{{ item.subTitle }}</p>
<div class="des">{{ item.des }}</div>
</div>
</li>
</template>
</ul>
</div>
</div>
</div>
</template>
<script>
import mixins from '@/mixins/page'
import Setting from '@/setting'
import Util from '@/libs/util'
export default {
mixins: [mixins],
data() {
return {
}
},
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)
}
}).catch(err => {})
},
}
};
</script>
<style lang="scss" scoped>
@import "../../styles/page/page.scss";
.list {
li {
position: relative;
&:nth-child(even) {
text-align: right;
.texts {
left: 0;
}
}
}
.pic {
width: 47%;
height: 730px;
}
.texts {
position: absolute;
top: 120px;
left: 610px;
width: 60%;
height: 440px;
padding: 60px 30px 30px 100px;
background-color: #fff;
}
h6 {
font-size: 40px;
color: #3C3C3C;
}
.sub {
font-size: 24px;
color: #1C1C1C;
line-height: 33px;
}
.des {
font-size: 20px;
color: #3C3C3C;
line-height: 32px;
}
}
@media (max-width: 1520px) {
.list {
.pic {
width: 45%;
}
.texts {
width: 50%;
}
}
}
</style>