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

882 lines
25 KiB

<template>
<div class="wrap">
<div class="iasf-banner">
<img :src="modules[0].form.pic"
alt="">
<div class="texts">
<h6>{{ modules[0].form.title }}</h6>
<p class="text">{{ modules[0].form.des }}</p>
</div>
</div>
<div class="block">
<div class="inner">
<ul class="card">
<li class="wow fadeInDown"
data-wow-delay="0.2s">
<img class="pic"
:src="modules[1].form.pic"
alt="">
<div class="texts">
<h6>{{ modules[1].form.title }}</h6>
<p class="des">{{ modules[1].form.des }}</p>
<img src="@/assets/images/arrow.png"
alt=""
:class="{'arrow': isLink(modules[1].form.link.linkName)}"
@click="openLink(modules[1].form)">
</div>
</li>
<li class="wow fadeInDown"
data-wow-delay="0.6s">
<img class="pic"
:src="modules[2].form.pic"
alt="">
<div class="texts">
<h6>{{ modules[2].form.title }}</h6>
<p class="des">{{ modules[2].form.des }}</p>
<img src="@/assets/images/arrow.png"
alt=""
:class="{'arrow': isLink(modules[2].form.link.linkName)}"
@click="openLink(modules[2].form)">
</div>
</li>
</ul>
</div>
</div>
<div class="block news-wrap">
<div class="inner">
<h2 class="b-title wow fadeInUp news-title">{{ modules[3].form.title }}</h2>
<template v-if="articles.length">
<div class="news-banner wow fadeInDown"
data-wow-delay="0.5s"
@click="toArtice(articles[0], modules[4].form)">
<div class="pic-wrap">
<img class="pic"
width="100%"
height="100%"
:src="articles[0].titleImg"
alt="">
</div>
<div class="right">
<h6>{{ articles[0].title }}</h6>
<div class="des"
v-html="articles[0].mainBody"></div>
<p class="meta">{{ articles[0].releaseTime }} {{ articles[0].classificationName && ' | ' + articles[0].classificationName }}</p>
</div>
</div>
<ul class="news">
<template v-for="(item, i) in articles">
<li v-if="i"
:key="i"
class="wow fadeInDown"
:data-wow-delay="(0.1 * i).toFixed(1) + 's'"
@click="toArtice(item, modules[4].form)">
<img class="pic"
:src="item.titleImg"
alt="">
<div class="texts">
<p class="meta">{{ item.releaseTime }} {{ item.classificationName && ' | ' + item.classificationName }}</p>
<div class="des">{{ item.title }}</div>
</div>
</li>
</template>
</ul>
</template>
<ul class="news-carousel">
<li v-if="articles1.length">
<img class="pic"
src="http://10.10.11.7/images/iasf/8.png"
alt="">
<div class="texts">
<h6 @click="toAll(modules[5].form)">{{ getColumnTitle(modules[5].form) }}</h6>
<p class="meta">{{ curArticle1.source }}</p>
<div class="des"
@click="toArtice(curArticle1, modules[5].form)">{{ curArticle1.title }}</div>
<p class="date">{{ curArticle1.releaseTime }}</p>
</div>
<div class="action">
<i class="el-icon-arrow-left dir"
@click.stop="prevCarousel(1)"></i>
<ul class="inds">
<li v-for="i in articles1.length > 3 ? 4 : articles1.length"
:key="i"
:class="{active: curInd1 == i - 1}"
@click.stop="switchCarousel(1, i - 1)"></li>
</ul>
<i class="el-icon-arrow-right dir"
@click.stop="nextCarousel(1)"></i>
</div>
</li>
<li v-if="articles2.length">
<img class="pic"
src="http://10.10.11.7/images/iasf/9.png"
alt="">
<div class="texts">
<h6 @click="toAll(modules[6].form)">{{ getColumnTitle(modules[6].form) }}</h6>
<p class="meta">{{ curArticle2.classificationName }}</p>
<div class="des"
@click="toArtice(curArticle2, modules[6].form)">{{ curArticle2.title }}</div>
<p class="date">{{ curArticle2.releaseTime }}</p>
</div>
<div class="action">
<i class="el-icon-arrow-left dir"
@click.stop="prevCarousel(2)"></i>
<ul class="inds">
<li v-for="i in articles2.length > 3 ? 4 : articles2.length"
:key="i"
:class="{active: curInd2 == i - 1}"
@click.stop="switchCarousel(2, i - 1)"></li>
</ul>
<i class="el-icon-arrow-right dir"
@click.stop="nextCarousel(2)"></i>
</div>
</li>
<li v-if="articles3.length">
<img class="pic"
src="http://10.10.11.7/images/iasf/10.png"
alt="">
<div class="texts">
<h6 @click="toAll(modules[7].form)">{{ getColumnTitle(modules[7].form) }}</h6>
<div class="des m-t-8"
@click="toArtice(curArticle3, modules[7].form)">{{ curArticle3.title }}</div>
<p class="date">{{ curArticle3.releaseTime }}</p>
</div>
<div class="action">
<i class="el-icon-arrow-left dir"
@click.stop="prevCarousel(3)"></i>
<ul class="inds">
<li v-for="i in articles3.length > 3 ? 4 : articles3.length"
:key="i"
:class="{active: curInd3 == i - 1}"
@click.stop="switchCarousel(3, i - 1)"></li>
</ul>
<i class="el-icon-arrow-right dir"
@click.stop="nextCarousel(3)"></i>
</div>
</li>
</ul>
</div>
</div>
<div class="block">
<div class="inner">
<h2 class="b-title wow fadeInUp">{{ modules[8].form.title }}</h2>
<p class="intro wow fadeInUp"
data-wow-delay="0.5s">{{ modules[8 ].form.des }}</p>
<ul v-if="articles4.length"
class="people">
<li v-for="(item, i) in articles4"
:key="i"
@click="toArtice(item, modules[9].form)"
class="wow fadeInDown">
<img class="pic"
:src="item.titleImg"
alt="">
<div class="texts">
<h6>{{ item.title }}</h6>
<p class="job">岗位:{{ item.post }}</p>
<p class="hobby">爱好:{{ item.post }}</p>
<div class="text"
v-html="item.mainBody"></div>
</div>
</li>
</ul>
<div class="all-link"
@click="toAll(modules[9].form)">
<span>{{$t('column.all')}} <img class="icon"
src="@/assets/images/arrow.png"
alt=""></span>
</div>
</div>
</div>
<div class="block">
<div class="inner">
<h2 class="b-title wow fadeInUp">{{ modules[10].form.title }}</h2>
<p class="intro wow fadeInUp"
data-wow-delay="0.5s">{{ modules[10].form.des }}</p>
<div class="talent">
<div class="left wow fadeInLeft"
data-wow-delay="0.5s">
<h6>{{ modules[11].form.title }}</h6>
<p class="sub-title">{{ modules[11].form.subTitle }}</p>
<div class="text"
v-html="modules[11].form.des"></div>
<el-button v-if="isLink(modules[11].form.link.linkName)"
type="primary"
round
@click="openLink(modules[11].form)">这里跳转 ></el-button>
</div>
<img :src="modules[11].form.pic"
alt=""
class="pic">
</div>
</div>
</div>
<div class="about"
style="margin-top: 100px">
<div class="inner">
<div class="left">
<h6>{{ modules[12].form.title }}</h6>
<div class="text"
v-html="modules[12].form.des"></div>
<img src="@/assets/images/arrow-white.png"
alt=""
:class="{'arrow': isLink(modules[12].form.link.linkName)}"
@click="openLink(modules[12].form)">
</div>
<img class="pic"
:src="modules[12].form.pic"
alt="">
</div>
</div>
<div class="block"
style="margin-top: 100px">
<div class="inner">
<ul class="entry">
<li :class="{'cursor-pointer': isLink(modules[13].form.link.linkName)}"
@click="openLink(modules[13].form)">
<img class="icon"
:src="modules[13].form.pic"
alt="">
<p class="text">{{ modules[13].form.title }}</p>
</li>
<li :class="{'cursor-pointer': isLink(modules[14].form.link.linkName)}"
@click="openLink(modules[14].form)">
<img class="icon"
:src="modules[14].form.pic"
alt="">
<p class="text">{{ modules[14].form.title }}</p>
</li>
<li :class="{'cursor-pointer': isLink(modules[15].form.link.linkName)}"
@click="openLink(modules[15].form)">
<img class="icon"
:src="modules[15].form.pic"
alt="">
<p class="text">{{ modules[15].form.title }}</p>
</li>
<li :class="{'cursor-pointer': isLink(modules[16].form.link.linkName)}"
@click="openLink(modules[16].form)">
<img class="icon"
:src="modules[16].form.pic"
alt="">
<p class="text">{{ modules[16].form.title }}</p>
</li>
<li :class="{'cursor-pointer': isLink(modules[17].form.link.linkName)}"
@click="openLink(modules[17].form)">
<img class="icon"
:src="modules[17].form.pic"
alt="">
<p class="text">{{ modules[17].form.title }}</p>
</li>
</ul>
</div>
</div>
<ul class="tools">
<li v-for="(item, i) in modules[18].list"
:key="i"
@click="openLink(item)">
<img :src="'http://10.10.11.7/images/iasf/icon' + (i < 4 ? i + 1 : 1) + '.png'"
alt=""
class="icon">
{{ item.title }}
</li>
</ul>
</div>
</template>
<script>
import mixins from '@/mixins/page'
import Setting from '@/setting'
import Util from '@/libs/util'
import WOW from 'wow.js'
export default {
mixins: [mixins],
data () {
return {
articles: [],
articles1: [],
articles2: [],
articles3: [],
articles4: [],
curInd1: 0,
curArticle1: {},
curInd2: 0,
curArticle2: {},
curInd3: 0,
curArticle3: {},
timer: null,
}
},
mounted () {
new WOW().init()
},
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'])
console.log('JSON=>', json)
this.modules = json
console.log("🚀 ~ file: index.vue ~ line 138 ~ this.$post ~ this.modules", this.modules)
// 获取文章列表
if (json[4].form.column.length) {
const { column, articleNum } = json[4].form
this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`).then(({ data }) => {
this.articles = Util.removeTag(data.slice(0, articleNum || 4))
}).catch(err => { })
}
if (json[5].form.column.length) {
const { column, articleNum } = json[5].form
this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`).then(({ data }) => {
this.articles1 = Util.removeTag(data.slice(0, articleNum || 4))
if (this.articles1.length) this.curArticle1 = this.articles1[0]
}).catch(err => { })
}
if (json[6].form.column.length) {
const { column, articleNum } = json[6].form
this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`).then(({ data }) => {
this.articles2 = Util.removeTag(data.slice(0, articleNum || 4))
if (this.articles2.length) this.curArticle2 = this.articles2[0]
}).catch(err => { })
}
if (json[7].form.column.length) {
const { column, articleNum } = json[7].form
this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`).then(({ data }) => {
this.articles3 = Util.removeTag(data.slice(0, articleNum || 4))
if (this.articles3.length) this.curArticle3 = this.articles3[0]
}).catch(err => { })
}
if (json[9].form.column.length) {
const { column, articleNum } = json[9].form
this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`).then(({ data }) => {
this.articles4 = Util.removeTag(data.slice(0, articleNum || 3))
}).catch(err => { })
}
this.carouselInterval()
}
}).catch(err => { })
},
// 自动轮播
carouselInterval () {
clearInterval(this.timer)
this.timer = setInterval(() => {
this.curInd1++
if (this.curInd1 > 3) this.curInd1 = 0
if (this.articles1[this.curInd1]) this.curArticle1 = this.articles1[this.curInd1] || {}
this.curInd2++
if (this.curInd2 > 3) this.curInd2 = 0
if (this.articles2[this.curInd2]) this.curArticle2 = this.articles2[this.curInd2] || {}
this.curInd3++
if (this.curInd3 > 3) this.curInd3 = 0
if (this.articles3[this.curInd3]) this.curArticle3 = this.articles3[this.curInd3] || {}
}, 5000)
},
// 手动轮播切换
switchCarousel (k, i) {
if (this['curInd' + k] !== i) {
this['curInd' + k] = i
this['curArticle' + k] = this['articles' + k][this['curInd' + k]] || {}
}
},
// 上一页轮播
prevCarousel (k) {
--this['curInd' + k]
if (this['curInd' + k] < 0) this['curInd' + k] = this['articles' + k].length - 1
this['curArticle' + k] = this['articles' + k][this['curInd' + k]] || {}
},
// 上一页轮播
nextCarousel (k) {
++this['curInd' + k]
if (this['curInd' + k] > this['articles' + k].length - 1) this['curInd' + k] = 0
this['curArticle' + k] = this['articles' + k][this['curInd' + k]] || {}
},
}
};
</script>
<style lang="scss" scoped>
@import url(../../plugins/wow/animate.css);
@import '../../styles/page/page.scss';
.iasf-banner {
height: 727px;
img {
width: 100%;
height: 100%;
}
.texts {
position: absolute;
bottom: 40%;
left: 120px;
h6,
.text {
padding: 20px 15px;
color: #fff;
background-color: rgba(0, 0, 0, 0.29);
}
h6 {
margin-bottom: 30px;
font-size: 3rem;
font-family: AlimamaShuHeiTi-Bold, AlimamaShuHeiTi;
}
.text {
font-size: 1.1rem;
font-family: AppleSystemUIFont;
}
}
}
.block {
padding-top: 3.15rem;
.b-title {
font-size: 2.25rem;
}
.intro {
font-size: 1.35rem;
margin-bottom: 3.6rem;
}
}
.card {
display: flex;
justify-content: space-between;
li {
width: 47%;
transition: 0.3s;
&:hover {
margin-top: -0.9375rem;
}
}
.pic {
width: 100%;
height: auto;
}
.texts {
padding-left: 1.375rem;
margin-top: 3rem;
border-left: 2px solid #dfe4e9;
}
h6 {
margin-bottom: 1.56rem;
line-height: 2rem;
font-size: 1.368rem;
color: #333;
@include mul-ellipsis(2);
}
.des {
font-size: 1.024rem;
color: #222;
line-height: 30px;
}
}
.news-wrap {
background: url(http://10.10.11.7/images/iasf/1.png) 0 0/100% 100% no-repeat;
}
.news-title:after {
display: none;
}
.news-banner {
display: flex;
cursor: pointer;
.pic-wrap {
width: 50%;
height: 20.5rem;
overflow: hidden;
}
.pic {
transition: 0.5s;
&:hover {
transform: scale(1.3);
}
}
.right {
position: relative;
width: 50%;
padding: 50px 50px 30px;
background: #1583ff;
color: #fff;
h6 {
font-size: 1.34rem;
}
.des {
font-size: 1.02rem;
}
.meta {
font-size: 1.04rem;
}
&:hover {
background: #465f85;
h6,
.des,
.meta {
color: #fff;
transform: translateY(15px);
}
}
}
h6 {
font-size: 1.3rem;
transition: 0.3s;
}
.des {
margin: 30px 0;
font-size: 0.9rem;
line-height: 24px;
transition: 0.3s;
}
.meta {
font-size: 0.8rem;
transition: 0.3s;
}
}
.news {
display: flex;
flex-wrap: wrap;
margin: 10px 0;
li {
width: calc((100% - 18px) / 3);
margin-right: 9px;
background-color: #fff;
cursor: pointer;
&:nth-child(3n) {
margin-right: 0;
}
}
.pic {
width: 100%;
height: 220px;
}
.texts {
padding: 20px 24px 50px;
background-color: #fff;
}
.meta {
font-size: 0.9rem;
color: #666;
}
h6 {
margin-top: 5px;
font-size: 1.1rem;
font-family: PingFangSC-Semibold, PingFang SC;
color: #333;
@include mul-ellipsis(2);
}
}
.news-carousel {
display: flex;
li {
position: relative;
width: calc((100% - 18px) / 3);
height: 284px;
margin-right: 9px;
&:nth-child(3n) {
margin-right: 0;
}
}
.pic {
width: 100%;
height: 100%;
}
.texts {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 50px 30px;
color: #fff;
background-color: rgba(0, 0, 0, 0.3);
}
h6 {
font-size: 1.2rem;
font-family: PingFangSC-Medium, PingFang SC;
cursor: pointer;
}
.meta {
margin: 8px 0;
font-size: 0.9rem;
color: rgba(255, 255, 255, 0.86);
}
.des {
margin-bottom: 8px;
font-size: 1rem;
font-family: PingFangSC-Medium, PingFang SC;
cursor: pointer;
}
.date {
font-size: 0.8rem;
}
.action {
position: absolute;
bottom: 20px;
right: 20px;
display: flex;
align-items: center;
font-size: 14px;
color: rgba(255, 255, 255, 0.65);
}
.inds {
display: inline-flex;
margin: 0 5px;
li {
width: 10px;
height: 10px;
margin-right: 6px;
background: rgba(255, 255, 255, 0.65);
border-radius: 50%;
transition: 0.2s;
cursor: pointer;
&.active {
width: 20px;
background: rgba(255, 255, 255, 0.3);
border-radius: 5px;
}
&:last-child {
margin-right: 0;
}
}
}
.dir {
line-height: 1;
cursor: pointer;
}
}
.people {
display: flex;
li {
width: 33.33%;
padding: 30px;
text-align: center;
border-right: 1px solid #ddd;
cursor: pointer;
&:last-child {
border-right: 0;
}
}
.pic {
width: 260px;
height: 260px;
margin-bottom: 10px;
border-radius: 50%;
}
h6 {
font-size: 1.1rem;
font-family: PingFangSC-Medium, PingFang SC;
color: #333;
}
.job {
margin: 10px 0;
font-size: 1rem;
font-family: PingFangSC-Medium, PingFang SC;
color: #333;
}
.hobby {
margin-bottom: 15px;
font-size: 1rem;
color: #333;
}
.text {
font-size: 1rem;
line-height: 1.6;
color: #333;
}
}
.talent {
display: flex;
color: #fff;
background: #1a2844;
border-radius: 0px 100px 0px 100px;
.left {
width: 50%;
padding: 120px 0 0 5%;
}
h6 {
font-size: 1.6rem;
}
.sub-title {
margin: 8px 0 20px;
font-size: 0.9rem;
}
.text {
margin-bottom: 60px;
font-size: 1rem;
line-height: 2;
}
.pic {
width: 50%;
min-height: 465px;
}
}
.about {
background: #0a7fec;
.inner {
position: relative;
height: 350px;
padding: 50px;
}
.left {
width: 48%;
}
h6 {
font-size: 1.8rem;
font-family: PingFangSC-Semibold, PingFang SC;
color: #fff;
}
.text {
margin: 20px 0;
font-size: 1rem;
color: #fff;
}
.pic {
position: absolute;
top: -60px;
right: 0;
max-width: 48%;
height: 460px;
}
}
.entry {
display: flex;
flex-wrap: wrap;
li {
display: inline-flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 220px;
margin: 0 20px 20px 0;
text-align: center;
&:first-child {
width: calc((100% - 20px) / 2);
background-color: rgba(201, 102, 2, 0.83);
}
&:nth-child(2) {
width: calc((100% - 20px) / 2);
margin-right: 0;
background: #4fbc72;
}
&:nth-child(3) {
width: calc((100% - 40px) / 3);
background-color: rgba(237, 196, 95, 0.93);
}
&:nth-child(4) {
width: calc((100% - 40px) / 3);
background-color: rgba(8, 156, 218, 0.73);
}
&:nth-child(5) {
width: calc((100% - 40px) / 3);
margin-right: 0;
background: #2172e3;
}
}
.text {
margin-top: 15px;
font-size: 1rem;
font-family: PingFangSC-Medium, PingFang SC;
color: #fff;
}
}
.tools {
position: fixed;
top: 430px;
right: 0;
li {
display: flex;
justify-content: center;
align-items: center;
width: 160px;
margin-bottom: 1px;
font-size: 1rem;
color: #0084ff;
line-height: 56px;
background-color: rgba(57, 59, 59, 0.94);
cursor: pointer;
&.active {
width: 192px;
color: #fff;
background-color: rgba(1, 129, 247, 0.94);
}
}
.icon {
margin-right: 10px;
}
}
@media (max-width: 1200px) {
.block {
padding: 3.125rem 0;
.inner {
width: 95%;
margin: 0 auto;
.card {
flex-direction: column;
li {
margin-top: 1.25rem;
width: 100%;
}
}
}
}
.news {
flex-direction: column;
li {
width: 100%;
}
}
.news-banner {
flex-direction: column;
.pic-wrap,
.right {
width: 100%;
}
}
.news-carousel,
.people {
flex-direction: column;
li {
width: 100%;
margin-bottom: 10px;
}
}
.talent {
flex-direction: column;
.left,
.pic {
width: 100%;
}
}
.about {
.inner {
height: auto;
}
.left {
width: 100%;
}
.pic {
position: static;
max-width: 100%;
height: auto;
margin-top: 10px;
}
}
.entry {
flex-direction: column;
li {
width: 100% !important;
margin-right: 0;
}
}
}
</style>