2023-03-28 18:04:49 +08:00
|
|
|
|
<template>
|
|
|
|
|
<div class="allSections">
|
|
|
|
|
<!-- 左选项 -->
|
|
|
|
|
<div class="allSections-left">
|
2023-03-29 15:40:10 +08:00
|
|
|
|
<span v-for="(item, index) in list" :class="{ 'active': index == allActive }" :key="index"
|
2023-04-03 11:20:10 +08:00
|
|
|
|
@click="allClick(index)">{{ item.name }}</span>
|
2023-03-28 18:04:49 +08:00
|
|
|
|
</div>
|
|
|
|
|
<!-- 右选项 -->
|
2023-03-29 16:00:11 +08:00
|
|
|
|
<div class="allSections-right">
|
2023-04-03 11:20:10 +08:00
|
|
|
|
<div class="allSections-right-item" v-for="(i, k) in list[allActive].data" :key="k">
|
2023-03-28 18:04:49 +08:00
|
|
|
|
<div class="item-content">
|
2023-04-03 11:20:10 +08:00
|
|
|
|
<div class="item-title">{{ i.name }}</div>
|
|
|
|
|
<div class="item-text" v-html="i.description"></div>
|
2023-03-28 18:04:49 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="item-star" @click="starClick(k)">
|
2023-04-03 11:20:10 +08:00
|
|
|
|
<img v-if="!i.iscollection" src="~assets/img/allSections/nullStar.png" alt="空星">
|
2023-03-28 18:04:49 +08:00
|
|
|
|
<img v-else src="~assets/img/allSections/star.png" alt="实星">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2023-03-29 15:40:10 +08:00
|
|
|
|
export default {
|
|
|
|
|
name: "AllSections",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
allActive: 0,
|
2023-04-03 11:20:10 +08:00
|
|
|
|
list: [],
|
2023-03-29 15:40:10 +08:00
|
|
|
|
starList: [
|
|
|
|
|
{
|
|
|
|
|
title: "2023招生季[你好 招生官]",
|
|
|
|
|
text: "[权威、官方]的第一手信息。"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "2023招生季[你好 招生官]",
|
|
|
|
|
text: "全球博士项目信息发布,查找23fall博士交流群 点击加入微信群 QQ群号461086769"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "2023招生季[你好 招生官]",
|
|
|
|
|
text: "[权威、官方]的第一手信息。"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
allClick(index) {
|
|
|
|
|
this.allActive = index
|
2023-04-03 11:20:10 +08:00
|
|
|
|
console.log(index);
|
2023-03-28 18:04:49 +08:00
|
|
|
|
},
|
2023-03-29 15:40:10 +08:00
|
|
|
|
starClick(k) {
|
2023-04-03 11:20:10 +08:00
|
|
|
|
if (this.starList[k].checked) this.starList[k].checked = false
|
|
|
|
|
else this.starList[k].checked = true
|
2023-03-29 15:40:10 +08:00
|
|
|
|
|
|
|
|
|
this.$forceUpdate()
|
2023-04-03 11:20:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 获取全部板块
|
|
|
|
|
getAllForum() {
|
|
|
|
|
this.$http.post("/api/home/allForum").then((res) => {
|
|
|
|
|
console.log(res, "res");
|
|
|
|
|
if (res.code != 200) return;
|
|
|
|
|
this.list = res.data
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
this.$message.error(err.message)
|
|
|
|
|
});
|
2023-03-29 15:40:10 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2023-04-03 11:20:10 +08:00
|
|
|
|
|
2023-03-29 15:40:10 +08:00
|
|
|
|
created() {
|
2023-04-03 11:20:10 +08:00
|
|
|
|
console.log("dfgkljdflkdfgj");
|
|
|
|
|
|
|
|
|
|
this.starList.forEach(el => {
|
|
|
|
|
el.checked = false
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.getAllForum()
|
|
|
|
|
|
2023-04-03 11:00:11 +08:00
|
|
|
|
|
|
|
|
|
// https://forum.gter.net
|
2023-03-28 18:04:49 +08:00
|
|
|
|
}
|
2023-03-29 15:40:10 +08:00
|
|
|
|
}
|
2023-03-28 18:04:49 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2023-03-29 15:40:10 +08:00
|
|
|
|
.allSections {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
border-radius: 0.32rem;
|
|
|
|
|
margin-top: 0.666667rem;
|
|
|
|
|
filter: drop-shadow(0.05rem 0 0.09rem rgba(0, 0, 0, 0.1));
|
|
|
|
|
margin: .64rem 0.35rem 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.allSections-left {
|
|
|
|
|
width: 35%;
|
|
|
|
|
border-left: 0.013333rem solid #ddd;
|
|
|
|
|
background-color: rgba(235, 235, 235, 0.556862745098039);
|
|
|
|
|
border-radius: 0.32rem 0 0 0.32rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
|
|
span {
|
|
|
|
|
height: 1.28rem;
|
|
|
|
|
line-height: 1.28rem;
|
2023-03-28 18:04:49 +08:00
|
|
|
|
border-radius: 0.32rem;
|
2023-03-29 15:40:10 +08:00
|
|
|
|
font-size: 0.32rem;
|
|
|
|
|
// padding: 0 0 0 0.2rem;
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
font-weight: bolder;
|
|
|
|
|
border-radius: 0.32rem 0 0 0.32rem;
|
|
|
|
|
color: #000;
|
|
|
|
|
width: 105%;
|
|
|
|
|
margin-left: -0.133333rem;
|
|
|
|
|
filter: drop-shadow(0 0 0.08rem rgba(0, 0, 0, 0.1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.active::before {
|
|
|
|
|
content: "";
|
|
|
|
|
width: 0.36rem;
|
|
|
|
|
height: 101%;
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 0;
|
|
|
|
|
top: -100%;
|
|
|
|
|
box-shadow: 0.14rem 0.14rem #fff;
|
|
|
|
|
border-radius: 0 0 0.32rem 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.active::after {
|
|
|
|
|
content: "";
|
|
|
|
|
width: 0.36rem;
|
|
|
|
|
height: 101%;
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 0;
|
|
|
|
|
bottom: -100%;
|
|
|
|
|
box-shadow: 0.14rem -0.14rem #fff;
|
|
|
|
|
border-radius: 0 0.32rem 0 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&:first-child.active::before {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&:last-child.active::after {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.allSections-right {
|
|
|
|
|
width: 65%;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
border-radius: 0 0.32rem 0.32rem 0;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
padding-bottom: 0.4rem;
|
|
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
|
display: block;
|
2023-03-28 18:04:49 +08:00
|
|
|
|
}
|
2023-03-29 15:40:10 +08:00
|
|
|
|
|
|
|
|
|
.allSections-right-item {
|
|
|
|
|
padding: 0.4rem 0;
|
|
|
|
|
margin: 0 0.32rem 0 0.7rem;
|
|
|
|
|
border-bottom: 0.013333rem solid #ddd;
|
2023-03-28 18:04:49 +08:00
|
|
|
|
display: flex;
|
2023-03-29 15:40:10 +08:00
|
|
|
|
justify-content: space-between;
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
|
|
.item-content {
|
|
|
|
|
width: 80%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-title {
|
|
|
|
|
color: #000;
|
2023-03-28 18:04:49 +08:00
|
|
|
|
font-size: 0.32rem;
|
|
|
|
|
}
|
2023-03-29 15:40:10 +08:00
|
|
|
|
|
|
|
|
|
.item-text {
|
|
|
|
|
margin: 0.266667rem 0;
|
|
|
|
|
color: #aaa;
|
|
|
|
|
font-size: 0.28rem;
|
2023-03-28 18:04:49 +08:00
|
|
|
|
}
|
2023-03-29 15:40:10 +08:00
|
|
|
|
|
|
|
|
|
.item-star {
|
2023-03-28 18:04:49 +08:00
|
|
|
|
display: flex;
|
2023-03-29 15:40:10 +08:00
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
img {
|
|
|
|
|
width: 20px;
|
2023-03-28 18:04:49 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-29 15:40:10 +08:00
|
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
|
content: "";
|
|
|
|
|
width: 0.12rem;
|
|
|
|
|
height: 0.32rem;
|
|
|
|
|
border-radius: 0.16rem;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0.48rem;
|
|
|
|
|
left: -0.35rem;
|
|
|
|
|
background-color: #62b1ff;
|
|
|
|
|
}
|
2023-03-28 18:04:49 +08:00
|
|
|
|
}
|
2023-04-03 11:00:11 +08:00
|
|
|
|
}
|
|
|
|
|
</style>
|