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.
256 lines
6.6 KiB
256 lines
6.6 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 history gray"> |
|
<div class="inner"> |
|
<h2 style="margin-left: 57px">{{ modules[1].form.title }}</h2> |
|
<div class="texts"> |
|
<div class="left"> |
|
<h2>{{ modules[1].form.subTitle }}</h2> |
|
<div class="line"></div> |
|
<div class="des">{{ modules[1].form.des }}</div> |
|
<img :class="{'arrow': modules[1].form.link.linkName !== '无'}" src="@/assets/images/arrow.png" alt="" @click="openLink(modules[1].form)"> |
|
</div> |
|
<img class="bg" width="562" height="506" :src="modules[1].form.pic" alt=""> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<div class="block"> |
|
<div class="inner" style="width: 1558px"> |
|
<h2 class="b-title">{{ modules[2].form.title }}</h2> |
|
<p class="intro">{{ modules[2].form.des }}</p> |
|
<ul class="app"> |
|
<li v-for="(item, i) in modules[3].list" :key="i" :class="{'cursor-pointer': item.link.linkName !== '无'}" @click="openLink(item)"> |
|
<img class="bg" :src="require('@/assets/images/application/app' + (i + 1) + '.png')" alt=""> |
|
<img class="icon" :src="require('@/assets/images/application/app' + (i + 1) + '-1.png')" alt=""> |
|
<p class="text">{{ item.title }}</p> |
|
</li> |
|
</ul> |
|
</div> |
|
</div> |
|
|
|
<div class="block gray"> |
|
<div class="inner"> |
|
<h2 class="b-title">{{ modules[4].form.title }}</h2> |
|
<p class="intro">{{ modules[4].form.des }}</p> |
|
<ul class="group"> |
|
<li v-for="(item, i) in modules[5].list" :key="i" :class="{'cursor-pointer': item.link.linkName !== '无'}" @click="openLink(item)"> |
|
<img :src="item.pic" alt=""> |
|
<p class="text">{{ item.title }}</p> |
|
</li> |
|
</ul> |
|
</div> |
|
</div> |
|
|
|
<div class="block news-block"> |
|
<div class="inner"> |
|
<h2 class="b-title">{{ modules[6].form.title }}</h2> |
|
<p class="intro">{{ modules[6].form.des }}</p> |
|
<ul class="news"> |
|
<li v-for="(item, i) in articles" :key="i" @click="toArtice(item)"> |
|
<img src="@/assets/images/channel1.png" alt=""> |
|
<div class="texts"> |
|
<h6>{{ item.columnName }}</h6> |
|
<div class="des" v-html="item.mainBody"></div> |
|
<span class="meta">{{ item.createTime }}</span> |
|
</div> |
|
</li> |
|
</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 { |
|
articles: [] |
|
} |
|
}, |
|
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) |
|
|
|
// 获取文章列表 |
|
const { column, site, articleNum } = json[7].form |
|
if (column.length) { |
|
this.$post(this.api.queryArticle, { |
|
siteId: site, |
|
columnIds: [column[column.length - 1]], |
|
pageNum: 1, |
|
pageSize: articleNum || 6 |
|
}).then(({ data }) => { |
|
this.articles = data.records |
|
}).catch(err => {}) |
|
} |
|
} |
|
}).catch(err => {}) |
|
}, |
|
} |
|
}; |
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
@import "../../styles/page/page.scss"; |
|
.history { |
|
h2 { |
|
font-size: 30px; |
|
color: #333; |
|
} |
|
.texts { |
|
display: flex; |
|
justify-content: space-between; |
|
padding: 82px 57px 30px; |
|
margin-top: 20px; |
|
background-color: #fff; |
|
border-radius: 100px 0px 0px 0px; |
|
} |
|
.left { |
|
width: 695px; |
|
} |
|
.des { |
|
margin: 20px 0; |
|
font-size: 22px; |
|
color: #181818; |
|
line-height: 31px; |
|
} |
|
.bg { |
|
margin: -122px 0 0 0; |
|
} |
|
} |
|
.app { |
|
display: flex; |
|
flex-wrap: wrap; |
|
li { |
|
position: relative; |
|
display: flex; |
|
flex-direction: column; |
|
justify-content: center; |
|
align-items: center; |
|
width: 368px; |
|
height: 252px; |
|
margin: 0 14px 14px 0; |
|
&:first-child { |
|
width: 750px; |
|
} |
|
&:nth-child(3), &:nth-child(7), &:nth-child(10) { |
|
margin-right: 0; |
|
} |
|
&:nth-child(9) { |
|
width: 563px; |
|
} |
|
&:nth-child(10) { |
|
width: 555px; |
|
} |
|
} |
|
.bg { |
|
position: absolute; |
|
top: 0; |
|
left: 0; |
|
width: 100%; |
|
height: 100%; |
|
} |
|
.icon { |
|
position: relative; |
|
} |
|
.text { |
|
position: relative; |
|
margin-top: 20px; |
|
font-size: 32px; |
|
color: #fff; |
|
} |
|
} |
|
.group { |
|
display: flex; |
|
flex-wrap: wrap; |
|
li { |
|
position: relative; |
|
width: 448px; |
|
margin: 0 28px 39px 0; |
|
&:nth-child(3n) { |
|
margin-right: 0; |
|
} |
|
} |
|
img { |
|
width: 100%; |
|
height: 353px; |
|
} |
|
.text { |
|
font-size: 30px; |
|
font-family: SFProDisplay-Bold, SFProDisplay; |
|
font-weight: bold; |
|
line-height: 143px; |
|
color: #272727; |
|
text-align: center; |
|
background-color: #fff; |
|
} |
|
} |
|
.news-block { |
|
background: url(../../assets/images/info-bg.png) 0 0/100% 100% no-repeat; |
|
} |
|
.news { |
|
position: relative; |
|
display: flex; |
|
flex-wrap: wrap; |
|
li { |
|
display: inline-flex; |
|
width: 686px; |
|
padding: 34px; |
|
margin-bottom: 28px; |
|
background-color: #fff; |
|
cursor: pointer; |
|
&:nth-child(odd) { |
|
margin-right: 28px; |
|
} |
|
} |
|
img { |
|
width: 237px; |
|
height: 167px; |
|
} |
|
.texts { |
|
margin-left: 34px; |
|
} |
|
h6 { |
|
font-size: 18px; |
|
color: #0648A8; |
|
} |
|
.des { |
|
margin: 14px 0; |
|
font-size: 16px; |
|
color: #333; |
|
line-height: 22px; |
|
} |
|
.meta { |
|
font-size: 16px; |
|
color: #999; |
|
} |
|
} |
|
</style> |