This commit is contained in:
2023-03-28 18:04:49 +08:00
commit 947f9418ad
52 changed files with 18283 additions and 0 deletions

View File

@@ -0,0 +1,214 @@
<template>
<div class="allSections">
<!-- 左选项 -->
<div class="allSections-left">
<span v-for="(item,index) in list" :class="{'active':index == allActive}" :key="index" @click="allClick(index)">{{item.title}}</span>
</div>
<!-- 右选项 -->
<div class="allSections-right" :class="{'active':index == allActive}" v-for="(item,index) in list" :key="index">
<div class="allSections-right-item" v-for="(i,k) in starList" :key="k">
<div class="item-content">
<div class="item-title">{{i.title}}</div>
<div class="item-text">{{i.text}}</div>
</div>
<div class="item-star" @click="starClick(k)">
<img v-if="!showStar[k].checked" src="~assets/img/allSections/nullStar.png" alt="空星">
<img v-else src="~assets/img/allSections/star.png" alt="实星">
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "AllSections",
data() {
return {
allActive: 0,
showStar: [],
star: -1,
list:[
{
title: "2023招生官"
},
{
title: "香港澳门台湾留学版"
},
{
title: "美国留学版"
},
{
title: "加拿大留学版"
},
{
title: "英国留学版"
},
{
title: "欧洲留学版"
},
{
title: "欧洲留学版"
},
{
title: "欧洲留学版"
},
{
title: "欧洲留学版"
}
],
starList:[
{
title: "2023招生季[你好 招生官]",
text: "[权威、官方]的第一手信息。"
},
{
title: "2023招生季[你好 招生官]",
text: "[权威、官方]的第一手信息。"
},
{
title: "2023招生季[你好 招生官]",
text: "[权威、官方]的第一手信息。"
}
]
}
},
methods: {
allClick(index) {
this.allActive = index
},
starClick(k) {
this.star = k
if(this.showStar[k].checked){
this.showStar[k].checked = false
}else{
this.showStar[k].checked = true
}
console.log(this.showStar);
this.$forceUpdate()
}
},
created() {
for(var i = 0; i < this.starList.length; i++) {
this.showStar.push(this.starList[i])
}
for(let i in this.showStar){
this.showStar[i].checked = false
}
}
}
</script>
<style lang="scss" scoped>
.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));
}
.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;
border-radius: 0.32rem;
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;
/* box-shadow: 0px 0px 8px rgb(0 0 0 / 20%); */
display: flex;
flex-direction: column;
z-index: 1;
display: none;
padding-bottom: 0.4rem;
&.active{
display: block;
}
.allSections-right-item{
padding: 0.4rem 0;
margin: 0 0.32rem 0 0.7rem;
border-bottom: 0.013333rem solid #ddd;
display: flex;
justify-content: space-between;
position: relative;
.item-content{
width: 80%;
}
.item-title{
color: #000;
font-size: 0.32rem;
}
.item-text{
margin: 0.266667rem 0;
color: #aaa;
font-size: 0.28rem;
}
.item-star{
display: flex;
align-items: center;
img{
width: 20px;
}
}
&::before{
content: "";
width: 0.12rem;
height: 0.32rem;
border-radius: 0.16rem;
position: absolute;
top: 0.48rem;
left: -0.35rem;
background-color: #62b1ff;
}
}
}
</style>

387
src/views/collect/Collect.vue Executable file
View File

@@ -0,0 +1,387 @@
<template>
<!-- 收藏版块 -->
<div class="collect">
<!-- 未收藏 -->
<div v-if="collect.length == 0" class="notCollect">
<img
class="notCollect-img"
src="~assets/img/collect/notCollect.png"
alt="未收藏"
/>
<div class="collect-text">收藏你感兴趣的版块迅速浏览相应的帖子</div>
<div class="collect-btn">
<div class="collect-btn-text">马上收藏</div>
<svg-icon icon-class="collect-btn" class-name="icon-collect"></svg-icon>
</div>
</div>
<!-- 已收藏 -->
<div v-else>
<!-- 热门版块 -->
<div class="hot-box">
<div
class="hot-label"
:class="{ active: hotActive == index }"
v-for="(item, index) in list"
:key="index"
@click="hotLabelClick(index)"
>
{{ item.label }}
</div>
<!-- 设置按钮 -->
<div class="setting flexcenter" @click="settingClick">
<img src="~assets/img/icon/setting.png" alt="设置" />
设置
</div>
<!-- 设置 收藏版块弹窗 -->
<div
class="setting-window"
:class="{ 'setting-show': settingShow == true }"
@click="settingClose"
>
<div class="setting-container" @click.stop>
<div class="setting-title">设置收藏版块</div>
<div class="setting-total">
<div class="setting-num">共收藏<b> 5 </b>个版块</div>
<div class="setting-add">
<router-link to="/allSections">
<svg-icon
icon-class="settingAdd"
class-name="setting-add-img"
></svg-icon
>添加
</router-link>
</div>
</div>
<!-- 弹窗收藏版块内容 -->
<div class="setting-sections">
<div class="setting-item">
<div class="setting-item-title">香港澳门台湾留学申请</div>
<div class="setting-star"></div>
</div>
</div>
<!-- 关闭弹窗 -->
<div class="setting-close" @click="settingClose">关闭</div>
</div>
</div>
</div>
<!-- 路径 -->
<div class="path-box">
<div>论坛</div>
<div class="oneEllipsis">论坛</div>
<div class="oneEllipsis">论坛</div>
</div>
<!-- 内容区域 -->
<section>
<!-- 帖子 -->
<div class="card-box">
<!-- 标题 -->
<div class="top moreEllipsis">
<div class="top-label">经验</div>
<div class="top-title">23fall 美国llm 求定位</div>
</div>
<!-- 帖子内容 -->
<div class="center">
<div class="center-text moreEllipsis">
背景生于80年代中期英语基础不好备考托福3个月刚好100分2018年8月开始读LLM.
读书期间Point Bar6666666666666666666666
</div>
</div>
<!-- 头像浏览量消息 -->
<div class="bottom">
<div class="bottom-box">
<svg-icon
icon-class="test-head"
class-name="icon-head"
></svg-icon>
<div class="bottom-name">匿名用户</div>
</div>
<div class="bottom-box">
<div class="bottom-right">
<svg-icon icon-class="look" class-name="icon-look"></svg-icon>
<div>1552</div>
</div>
<div class="bottom-right">
<svg-icon icon-class="msg" class-name="icon-look"></svg-icon>
<div>12</div>
</div>
</div>
</div>
<!-- 精华 -->
<div class="rightTop">
<div>
<span>精华</span>
</div>
</div>
</div>
<div class="card-box">
<!-- 帖子标题 -->
<div class="top moreEllipsis">
<div class="top-label">经验</div>
<div class="top-title">23fall 美国llm 求定位</div>
</div>
<!-- 帖子内容 -->
<div class="center">
<div class="center-text-visible">回复可见</div>
</div>
<!-- 头像浏览量消息 -->
<div class="bottom">
<div class="bottom-box">
<svg-icon
icon-class="test-head"
class-name="icon-head"
></svg-icon>
<div class="bottom-name">匿名用户</div>
</div>
<div class="bottom-box">
<div class="bottom-right">
<svg-icon icon-class="look" class-name="icon-look"></svg-icon>
<div>1552</div>
</div>
<div class="bottom-right">
<svg-icon icon-class="msg" class-name="icon-look"></svg-icon>
<div>12</div>
</div>
</div>
</div>
<!-- 精华 -->
<div class="rightTop">
<div>
<span>精华</span>
</div>
</div>
</div>
<!-- 广告 -->
<div class="banner-box">
<svg-icon icon-class="test-banner" class-name="banner"></svg-icon>
</div>
<!-- 分页 -->
<div class="paging-box">
<el-pagination layout="prev, pager, next" :total="100">
</el-pagination>
</div>
</section>
</div>
</div>
</template>
<script>
export default {
name: "Collect",
data() {
return {
hotActive: 0, //热门版块活跃点击
collect: [1],
settingShow: false, //弹窗显示
settingStar: false,
list: [
//版块
{
label: "全部",
},
{
label: "香港留学",
},
{
label: "香港留学",
},
{
label: "香港留学",
},
],
};
},
methods: {
hotLabelClick(index) {
this.hotActive = index;
},
// 点击显示弹窗
settingClick() {
this.settingShow = true;
},
// 点击弹窗以外区域隐藏按钮、关闭弹窗
settingClose() {
this.settingShow = false;
},
},
};
</script>
<style lang="scss" scoped>
.setting {
width: 1.44rem;
height: 0.72rem;
border-radius: 2.56rem;
border: 0.013333rem solid rgba(127, 127, 127, 1);
font-size: 0.3rem;
color: #333;
img {
width: 0.32rem;
height: 0.32rem;
}
}
//设置弹窗
.setting-window {
display: none;
width: 100%;
height: 100vh;
overflow: hidden;
background-color: rgba(0, 0, 0, 0.5);
position: fixed;
top: 0;
left: 0;
z-index: 7;
// 显示设置弹窗
&.setting-show {
display: block;
}
.setting-container {
position: absolute;
bottom: 0;
left: 0;
background-color: #fff;
width: 100%;
max-height: 90%;
min-height: 28%;
border-radius: 0.8rem 0.8rem 0 0;
overflow: hidden;
display: inline-grid;
align-content: flex-start;
}
//弹窗标题
.setting-title {
text-align: center;
padding: 0.56rem 0;
font-size: 0.48rem;
font-weight: bolder;
color: #000;
}
// 设置收藏弹窗版块量
.setting-total {
display: flex;
justify-content: space-between;
margin: 0.25rem 0.4rem 0 0.5rem;
b {
font-weight: bolder;
}
}
.setting-num,
.setting-add {
font-size: 0.32rem;
color: #000;
font-weight: 400;
}
.setting-add-img {
width: 0.4rem;
height: 0.4rem;
margin-right: 0.07rem;
}
// 设置收藏内容区域
.setting-sections {
width: 100%;
overflow-y: scroll;
display: inherit;
margin: 0.45rem 0 0;
max-height: 58vh;
margin-bottom: 2.8rem;
.setting-item {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-left: 0.87rem;
border-bottom: 0.013333rem solid #eee;
position: relative;
padding: 0.5rem 0;
&::before {
content: "";
width: 0.12rem;
height: 0.32rem;
border-radius: 0.16rem;
position: absolute;
top: 0.6rem;
left: -0.4rem;
background-color: #62b1ff;
}
.setting-item-title {
font-size: 0.36rem;
}
&:last-child {
border: none;
}
.setting-star {
width: 0.48rem;
height: 0.48rem;
background-size: contain;
background-image: url("assets/img/allSections/star.png");
margin-right: 0.4rem;
}
}
}
.setting-close {
width: 50%;
margin: 0.666667rem auto;
border: 0.013333rem solid #ccc;
height: 1.28rem;
line-height: 1.28rem;
border-radius: 0.67rem;
text-align: center;
position: fixed;
bottom: 0;
left: 25%;
}
}
// 未收藏样式
.notCollect {
height: 80vh;
border-radius: 0.32rem;
box-shadow: 0 0 0.16rem rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
align-items: center;
margin-top: 0.67rem;
background-color: #fff;
.notCollect-img {
width: 2.04rem;
margin: 4rem 0 0.5rem 0;
}
.collect-text {
font-size: 0.3rem;
color: #7f7f7f;
}
.collect-btn {
display: flex;
align-items: center;
.collect-btn-text {
color: #000;
font-weight: bold;
font-size: 0.4rem;
margin: 1rem 0.25rem;
}
//图标
.icon-collect {
width: 0.48rem;
height: 0.48rem;
}
}
}
</style>

86
src/views/index.vue Executable file
View File

@@ -0,0 +1,86 @@
<template>
<div>
<header-nav :issearch="true" :needgetuser="true">
<template slot="header-title">寄托天下论坛</template>
<search-box slot="search"></search-box>
</header-nav>
<nav>
<router-link to="/recommend">推荐阅读</router-link>
<router-link to="/collect">收藏的版块</router-link>
<router-link to="/allSections">全部版块</router-link>
</nav>
<!-- 发帖子 -->
<div class="publish flexcolumn flexcenter">
<svg-icon icon-class="add" class-name="icon-publish"></svg-icon>
发帖
</div>
<router-view />
</div>
</template>
<script>
import HeaderNav from "../components/HeaderNav";
import SearchBox from "../components/SearchBox.vue";
export default {
name: "Index",
data() {
return {};
},
components: {
HeaderNav,
SearchBox,
},
};
</script>
<style lang="scss">
// 导航
nav {
display: flex;
justify-content: center;
align-self: center;
border-radius: 2.56rem;
height: 1.28rem;
line-height: 1.28rem;
flex-direction: row;
background-color: rgba(235, 235, 235, 1);
margin: 1.5rem 0.35rem 0.2rem;
a {
flex: 1;
font-size: 0.4rem;
border-radius: 2.56rem;
text-align: center;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
-webkit-user-select: none;
-moz-user-focus: none;
-moz-user-select: none;
&.router-link-exact-active {
color: #000;
font-weight: bolder;
background-color: rgba(80, 227, 194, 1);
}
}
}
// 发帖按钮
.publish {
background-color: rgba(253, 223, 109, 1);
width: 1.6rem;
height: 1.6rem;
border-radius: 2.56rem;
position: fixed;
right: 0.4rem;
bottom: 20%;
font-size: 0.32rem;
z-index: 6;
color: #000;
.icon-publish {
width: 0.4rem;
height: 0.4rem;
margin-bottom: 0.1rem;
}
}
</style>

121
src/views/recommend/Recommend.vue Executable file
View File

@@ -0,0 +1,121 @@
<template>
<div class="recommend">
<!-- 热门版块 -->
<div class="hot-box">
<div class="hot-label" :class="{'active': hotActive == index}" v-for="(item, index) in list" :key="index" @click="hotLabelClick(index)">{{item.label}}</div>
</div>
<!-- 路径 -->
<div class="path-box">
<div>论坛</div>
<div class="oneEllipsis">论坛论坛论坛论坛论坛</div>
<div class="oneEllipsis">论坛</div>
</div>
<!-- 内容区域 -->
<section>
<!-- 帖子 -->
<div class="card-box">
<div class="top moreEllipsis">
<div class="top-label">经验</div>
<div class="top-title">23fall 美国llm 求定位</div>
</div>
<div class="center">
<div class="center-text moreEllipsis">背景生于80年代中期英语基础不好备考托福3个月刚好100分2018年8月开始读LLM. 读书期间Point Bar6666666666666666666666</div>
</div>
<div class="bottom">
<div class="bottom-box">
<svg-icon icon-class="test-head" class-name="icon-head"></svg-icon>
<div class="bottom-name">匿名用户</div>
</div>
<div class="bottom-box">
<div class="bottom-right">
<svg-icon icon-class="look" class-name="icon-look"></svg-icon>
<div>1552</div>
</div>
<div class="bottom-right">
<svg-icon icon-class="msg" class-name="icon-look"></svg-icon>
<div>12</div>
</div>
</div>
</div>
<!-- 精华 -->
<div class="rightTop">
<div>
<span>精华</span>
</div>
</div>
</div>
<div class="card-box">
<div class="top moreEllipsis">
<div class="top-label">经验</div>
<div class="top-title">23fall 美国llm 求定位</div>
</div>
<div class="center">
<div class="center-text-visible">
回复可见
</div>
</div>
<div class="bottom">
<div class="bottom-box">
<svg-icon icon-class="test-head" class-name="icon-head"></svg-icon>
<div class="bottom-name">匿名用户</div>
</div>
<div class="bottom-box">
<div class="bottom-right">
<svg-icon icon-class="look" class-name="icon-look"></svg-icon>
<div>1552</div>
</div>
<div class="bottom-right">
<svg-icon icon-class="msg" class-name="icon-msg"></svg-icon>
<div>12</div>
</div>
</div>
</div>
</div>
<!-- 广告 -->
<div class="banner-box">
<svg-icon icon-class="test-banner" class-name="banner"></svg-icon>
</div>
<!-- 分页 -->
<div class="paging-box">
<el-pagination
layout="prev, pager, next"
:total="100">
</el-pagination>
</div>
</section>
</div>
</template>
<script>
export default {
name: "Recommend",//推荐阅读
data() {
return {
hotActive: -1,//热门版块活跃点击
list: [
{
label: "香港留学"
},
{
label: "香港留学"
},
{
label: "香港留学"
},
{
label: "香港留学"
}
]
}
},
methods: {
hotLabelClick(index) {
this.hotActive = index
}
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,19 @@
<template>
<div>
</div>
</template>
<script>
export default{
name: "SearchResult",
data() {
return {
}
}
}
</script>
<style>
</style>