a1300399510@qq.com 提交于 2023/03/29 -14:38:27

This commit is contained in:
2023-03-29 14:38:43 +08:00
parent 947f9418ad
commit 6479762082
13 changed files with 578 additions and 587 deletions

View File

@@ -10,10 +10,9 @@
</div>
<div class="right flexacenter">
<div class="head-search flexcenter" v-if="issearch">
<img class="head-search-icon" src="@/assets/img/headerNav/search.png" />
<span>搜索</span>
</div>
<!-- <slot name="search"></slot> -->
<search-box slot="search" :issearch="true"></search-box>
<div class="head-more flexcenter" @click="headMorePopState = !headMorePopState">
<div class="red-dot" v-if="false"></div>
<img class="head-more-icon" src="@/assets/img/headerNav/threeAcross.svg" />
@@ -60,6 +59,7 @@
</div>
<div class="head-pop" v-if="headMorePopState" @click="headMorePopState = !headMorePopState"></div>
</div>
<header v-if="false">
<!-- 标题 -->
<div class="header-title">
@@ -69,7 +69,7 @@
<slot name="search"></slot>
<!-- 折叠按钮 -->
<div class="header-collapse" @click="collapseClick">
<div class="header-collapse">
<svg-icon icon-class="collapse" class-name="icon-collapse"></svg-icon>
<div class="collapse-red"></div>
<!-- 红点 -->
@@ -133,6 +133,8 @@
</template>
<script>
import SearchBox from "../components/SearchBox.vue";
export default {
name: "HeaderNav",
data() {
@@ -168,6 +170,10 @@ export default {
mounted() {
this.getMenu()
},
components: {
SearchBox,
},
methods: {
// 处理登录
handleRegister() {
@@ -196,13 +202,13 @@ export default {
});
},
// collapseClick() {
// if (this.collapseShow == true) this.collapseShow = false;
// else this.collapseShow = true;
// },
// collapseClose() {
// this.collapseShow = false;
// },
collapseClick() {
if (this.collapseShow == true) this.collapseShow = false;
else this.collapseShow = true;
},
collapseClose() {
this.collapseShow = false;
},
},
};
</script>
@@ -231,22 +237,6 @@ export default {
}
.right {
.head-search {
width: 2.4rem;
height: .8rem;
border-radius: 2.56rem;
background-color: rgba(235, 235, 235, 1);
color: #AAAAAA;
font-size: .3467rem;
.head-search-icon {
width: .4rem;
height: .4rem;
margin-right: .14rem;
}
margin-right: .4rem;
}
.head-more {
position: relative;
@@ -468,6 +458,175 @@ export default {
}
}
// 折叠弹窗
.collapse-box {
display: none;
position: absolute;
right: 0;
top: 1.19rem;
width: 750px;
margin: 0 auto;
min-height: 100%;
background-color: rgba(0, 0, 0, 0.7);
z-index: 8;
&.collapse-show {
display: block;
}
.collapse-container {
background-color: #fff;
width: 7.6rem;
height: 100%;
position: absolute;
right: 0;
top: 0;
display: flex;
flex-direction: column;
}
.collapse-my {
margin: 0.9rem 0;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 0 0.7rem 0 0.8rem;
.my-left {
width: 3.5rem;
display: flex;
align-items: center;
}
.my-right {
width: 2.5rem;
position: relative;
display: flex;
justify-content: end;
}
// 头像
.collapse-my-img {
width: 1.28rem;
height: 1.28rem;
border-radius: 0.67rem;
margin: 0 0.3rem 0 0;
}
.collapse-my-name {
font-size: 0.36rem;
color: #333;
}
.my-img {
width: 1.28rem;
height: 1.28rem;
}
.right-msg-img {
width: 0.44rem;
height: 0.44rem;
background-size: contain;
background-image: url("../assets/img/icon/email.png");
}
.right-msg-num {
display: flex;
justify-content: center;
width: 0.3rem;
height: 0.3rem;
line-height: 0.3rem;
border-radius: 0.2rem;
background-color: #fd3f5d;
color: #fff;
font-size: 0.254rem;
position: absolute;
top: -0.15rem;
right: -0.2rem;
z-index: 1;
}
// 未登录按钮
.loginBtn {
width: 2.24rem;
height: 0.8rem;
line-height: 0.8rem;
border-radius: 3.12rem;
background-color: rgba(98, 177, 255, 1);
color: #fff;
font-size: 0.34rem;
text-align: center;
}
}
// 折叠弹窗列表
.collapse-list {
margin-left: 0.8rem;
border-top: 0.013333rem solid #eee;
border-bottom: 0.013333rem solid #eee;
display: flex;
padding: 0.3rem 0;
flex-direction: column;
span {
height: 1.44rem;
line-height: 1.44rem;
border-radius: 0.22rem;
padding: 0 0.8rem;
font-size: 0.36rem;
margin: 0.1rem 0.8rem 0.1rem 0;
}
.listActive {
background-color: rgba(80, 227, 194, 1);
font-weight: bolder;
}
}
// 折叠弹窗发布帖子
.collapse-publish {
margin: 0.9rem 0;
display: flex;
justify-content: center;
align-items: center;
flex-direction: row;
span {
color: #000;
font-size: 0.4rem;
}
// 发布帖子图片
.collapse-publish-img {
width: 0.48rem;
height: 0.48rem;
border-radius: 0.24rem;
background-color: #fddf6d;
display: flex;
justify-content: center;
align-items: center;
margin-right: 0.2rem;
}
.icon-add {
width: 0.24rem;
height: 0.24rem;
}
}
.collapse-close {
display: flex;
justify-content: center;
padding: 0.5rem 0;
.icon-close {
width: 0.32rem;
height: 0.32rem;
}
}
}
header {
display: flex;
@@ -512,173 +671,6 @@ header {
right: -0.2rem;
}
// 折叠弹窗
.collapse-box {
display: none;
position: absolute;
right: 0;
top: 1.19rem;
width: 750px;
margin: 0 auto;
min-height: 100%;
background-color: rgba(0, 0, 0, 0.7);
z-index: 8;
&.collapse-show {
display: block;
}
.collapse-container {
background-color: #fff;
width: 7.6rem;
height: 100%;
position: absolute;
right: 0;
top: 0;
display: flex;
flex-direction: column;
}
.collapse-my {
margin: 0.9rem 0;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 0 0.7rem 0 0.8rem;
.my-left {
width: 3.5rem;
display: flex;
align-items: center;
}
.my-right {
width: 2.5rem;
position: relative;
display: flex;
justify-content: end;
}
// 头像
.collapse-my-img {
width: 1.28rem;
height: 1.28rem;
border-radius: 0.67rem;
margin: 0 0.3rem 0 0;
}
.collapse-my-name {
font-size: 0.36rem;
color: #333;
}
.my-img {
width: 1.28rem;
height: 1.28rem;
}
.right-msg-img {
width: 0.44rem;
height: 0.44rem;
background-size: contain;
background-image: url("../assets/img/icon/email.png");
}
.right-msg-num {
display: flex;
justify-content: center;
width: 0.3rem;
height: 0.3rem;
line-height: 0.3rem;
border-radius: 0.2rem;
background-color: #fd3f5d;
color: #fff;
font-size: 0.254rem;
position: absolute;
top: -0.15rem;
right: -0.2rem;
z-index: 1;
}
// 未登录按钮
.loginBtn {
width: 2.24rem;
height: 0.8rem;
line-height: 0.8rem;
border-radius: 3.12rem;
background-color: rgba(98, 177, 255, 1);
color: #fff;
font-size: 0.34rem;
text-align: center;
}
}
// 折叠弹窗列表
.collapse-list {
margin-left: 0.8rem;
border-top: 0.013333rem solid #eee;
border-bottom: 0.013333rem solid #eee;
display: flex;
padding: 0.3rem 0;
flex-direction: column;
span {
height: 1.44rem;
line-height: 1.44rem;
border-radius: 0.22rem;
padding: 0 0.8rem;
font-size: 0.36rem;
margin: 0.1rem 0.8rem 0.1rem 0;
}
.listActive {
background-color: rgba(80, 227, 194, 1);
font-weight: bolder;
}
}
// 折叠弹窗发布帖子
.collapse-publish {
margin: 0.9rem 0;
display: flex;
justify-content: center;
align-items: center;
flex-direction: row;
span {
color: #000;
font-size: 0.4rem;
}
// 发布帖子图片
.collapse-publish-img {
width: 0.48rem;
height: 0.48rem;
border-radius: 0.24rem;
background-color: #fddf6d;
display: flex;
justify-content: center;
align-items: center;
margin-right: 0.2rem;
}
.icon-add {
width: 0.24rem;
height: 0.24rem;
}
}
.collapse-close {
display: flex;
justify-content: center;
padding: 0.5rem 0;
.icon-close {
width: 0.32rem;
height: 0.32rem;
}
}
}
}
</style>

View File

@@ -0,0 +1,32 @@
<!-- 板块导航 头部 点击板块后的头部导航 -->
<template>
<div class="path-box">
<div>论坛</div>
<span class="path-slash">/</span>
<div class="oneEllipsis">{{ stairname }}</div>
<span class="path-slash">/</span>
<div class="oneEllipsis">{{ subsectionsname }}</div>
</div>
</template>
<script>
export default {
name: 'PlateNavigation',
data() {
return {
};
},
props: ["stairname", "subsectionsname"],
mounted() {
},
methods: {
},
};
</script>
<style lang="scss" scoped></style>

View File

@@ -1,23 +1,24 @@
<template>
<div>
<div class="header-search" @click="searchClick">
<div class="header-search-img"></div>
<div class="header-search-text">搜索</div>
<div class="head-search flexcenter" v-if="issearch" @click="searchClick()">
<img class="head-search-icon" src="@/assets/img/headerNav/search.png" />
<span>搜索</span>
</div>
<!-- 搜索弹窗 -->
<div class="search-window" :class="{'searchShow':searchWinShow == true}">
<div class="search-window" :class="{ 'searchShow': searchWinShow == true }">
<!-- 搜索框 -->
<div class="search-input">
<form action="javascript:return true;" @submit.prevent>
<div class="search-icon"></div>
<input ref="searchInput" v-model="searchText" type="search" placeholder="请输入搜索关键词"/>
<div v-if="showClear" class="clear-text" @click="clearText"></div>
</form>
<div class="search-close" @click="searchClose">取消</div>
<div class="search-input flexacenter">
<div class="form flexacenter">
<img class="search-icon" src="@/assets/img/headerNav/search.png">
<input class="flex1" ref="searchInput" v-model="searchText" type="text" placeholder="请输入搜索关键词" />
<img v-if="searchText" @click.stop="clearText()" class="clear-text" src="@/assets/img/icon/clear.png">
</div>
<div class="search-close" @click="searchClose()">取消</div>
</div>
<!-- 历史搜索 -->
<div class="search-content">
<div class="search-content flexcolumn">
<div class="search-text">历史搜索</div>
<div class="search-label">
<span>香港大学</span>
@@ -38,172 +39,157 @@
</template>
<script>
export default {
name: "SearchBox",
data() {
return {
searchWinShow: false,//显示搜索弹窗
searchText: '',
showClear: false, //显示清除按钮
}
},
methods: {
// 点击显示搜索弹窗
searchClick() {
this.searchWinShow = true
this.$refs.searchInput.blur();
},
// 点击隐藏搜索弹窗
searchClose(){
this.searchWinShow = false
},
// 搜索键盘、搜索
search(categoryId) {
this.$refs.searchInput.blur();
},
// 清空文本框
clearText() {
if(this.searchText.length > 0) {
this.searchText = ""
}
}
},
mounted() {
if(this.searchText.length > 0) {
this.showClear = true
}else{
this.showClear = false
}
export default {
name: "SearchBox",
data() {
return {
searchWinShow: false,//显示搜索弹窗
searchText: '',
showClear: false, //显示清除按钮
}
},
props: ["issearch"],
methods: {
collapseClick() {
if (this.collapseShow == true) this.collapseShow = false;
else this.collapseShow = true;
},
// 点击显示搜索弹窗
searchClick() {
this.searchWinShow = true
this.$nextTick(() => {
this.$refs.searchInput.focus();
})
},
// 点击隐藏搜索弹窗
searchClose() {
this.searchWinShow = false
},
// 搜索键盘、搜索
search(categoryId) {
this.$refs.searchInput.blur();
},
// 清空文本框
clearText() {
this.searchText = ""
}
},
mounted() {
if (this.searchText.length > 0) this.showClear = true
else this.showClear = false
}
}
</script>
<style lang="scss" scoped>
// 搜索弹窗
.search-window{
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
min-height: 100vh;
background-color: #f6f6f6;
z-index: 9;
&.searchShow{
display: block;
}
.search-input{
padding: 0.27rem 0.32rem 0.27rem;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
.search-icon{
position: absolute;
top: 0.43rem;
left: 0.3rem;
width: 0.32rem;
height: 0.32rem;
background-size: contain;
background-image: url('@/assets/img/icon/search.png');
}
form{
width: 90%;
position: relative;
}
input{
width: 100%;
box-sizing: border-box;
text-align: left;
font-size: 0.36rem;
height: 1.12rem;
line-height: 1.12rem;
border-radius: 0.56rem;
background-color: #ebebeb;
border: none;
color: #000;
display: block;
outline: 0;
padding-left: 0.8rem;
padding-right: 0.9rem;
text-decoration: none;
&[type="search"]{-webkit-appearance:none;}
&::-webkit-search-cancel-button {display: none;}
&:placeholder-shown{
color: #aaa;
}
}
.clear-text{
width: 0.4rem;
height: 0.4rem;
position: absolute;
top: 0.35rem;
right: 0.3rem;
background-size: contain;
background-image: url('/src/assets/img/icon/clear.png');
}
.search-close{
width: 10%;
font-size: 0.36rem;
text-align: right;
}
}
.search-content{
padding: 0.27rem 0.32rem 0.27rem;
display: flex;
flex-direction: column;
margin-top: 0.2rem;
.search-text{
color: #7F7F7F;
font-size: 0.32rem;
margin-bottom: 0.13rem;
}
.search-label{
display: flex;
flex-direction: row;
flex-wrap: wrap;
span{
padding: 0 0.2rem;
height: 0.96rem;
line-height: 0.96rem;
background-color: #fff;
border-radius: 0.16rem;
color: #333;
text-align: center;
font-size: 0.36rem;
margin: 0.2rem 0.16rem 0 0;
}
}
}
.head-search {
width: 2.4rem;
height: .8rem;
border-radius: 2.56rem;
background-color: rgba(235, 235, 235, 1);
color: #AAAAAA;
font-size: .3467rem;
.head-search-icon {
width: .4rem;
height: .4rem;
margin-right: .14rem;
}
.header-search {
width: 2.4rem;
height: 0.8rem;
line-height: 0.8rem;
border-radius: 2.56rem;
background-color: rgba(235, 235, 235, 1);
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-right: 0.35rem;
.header-search-img {
width: 0.4rem;
height: 0.4rem;
background-size: contain;
margin: 0 0.133333rem 0 0;
background-image: url("@/assets/img/icon/search.png");
}
.header-search-text {
text-align: left;
font-size: 0.32rem;
color: #aaaaaa;
display: block;
}
}
margin-right: .4rem;
}
// 搜索弹窗
.search-window {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
min-height: 100vh;
background-color: #f6f6f6;
z-index: 9;
&.searchShow {
display: block;
}
.search-input {
padding: 0.27rem 0.32rem 0.27rem;
justify-content: space-between;
.search-icon {
width: .4rem;
height: .4rem;
}
.form {
width: 90%;
background-color: #ebebeb;
height: 1.12rem;
line-height: 1.12rem;
border-radius: 0.56rem;
padding-left: .4rem;
}
input {
font-size: 0.36rem;
border: none;
outline: 0;
color: #000;
padding-left: .34rem;
height: 1.12rem;
background: transparent;
}
.clear-text {
width: 0.4rem;
height: 0.4rem;
padding: .48rem;
}
.search-close {
width: 10%;
font-size: 0.36rem;
text-align: right;
}
}
.search-content {
padding: 0.27rem 0.32rem 0.27rem;
margin-top: 0.2rem;
.search-text {
color: #7F7F7F;
font-size: 0.32rem;
margin-bottom: .32rem;
}
.search-label {
display: flex;
flex-direction: row;
flex-wrap: wrap;
span {
padding: 0 0.2rem;
height: 0.96rem;
line-height: 0.96rem;
background-color: #fff;
border-radius: 0.16rem;
color: #333;
text-align: center;
font-size: 0.36rem;
margin-right: .2rem;
margin-bottom: .24rem;
}
}
}
}
</style>

View File

@@ -1,41 +1,44 @@
<template>
<svg :class="svgClass" xmlns="http://www.w3.org/2000/svg">
<use :xlink:href="iconName" xmlns:xlink="http://www.w3.org/1999/xlink" />
<!-- <svg class="svg-icon" :class="svgClass" xmlns="http://www.w3.org/2000/svg"> -->
<!-- <use :xlink:href="iconName" xmlns:xlink="http://www.w3.org/1999/xlink" /> -->
<svg class="svg-icon" :class="className" xmlns="http://www.w3.org/2000/svg">
<use :xlink:href="`#icon-${iconClass}`" xmlns:xlink="http://www.w3.org/1999/xlink" />
</svg>
</template>
<script>
export default {
name: 'SvgIcon',
props: {
iconClass: {
type: String,
required: true
},
className: {
type: String,
default: ''
}
export default {
name: 'SvgIcon',
props: {
iconClass: {
type: String,
required: true
},
computed: {
iconName() {
return `#icon-${this.iconClass}`;
},
svgClass() {
if (this.className) {
return 'svg-icon ' + this.className;
} else {
return 'svg-icon';
}
className: {
type: String,
default: ''
}
},
computed: {
iconName() {
return `#icon-${this.iconClass}`;
},
svgClass() {
if (this.className) {
return 'svg-icon ' + this.className;
} else {
return 'svg-icon';
}
}
};
}
};
</script>
<style scoped>
.svg-icon {
/* width: 100%;
.svg-icon {
/* width: 100%;
height: 100%; */
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
</style>