This commit is contained in:
xiaoronghao 2023-04-11 19:34:15 +08:00
parent d82c425491
commit 15b7c46e35
5 changed files with 71 additions and 66 deletions

View File

@ -1,12 +1,13 @@
<!-- 板块导航 头部 点击板块后的头部导航 -->
<template>
<router-link class="path-box" to="/allSections">
<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>
</router-link>
<router-link v-if="isskip" class="path-box-a" :to="path"></router-link>
</div>
</template>
<script>
@ -15,10 +16,10 @@ export default {
data() {
return {
path: "/allSections",
};
},
props: ["stairname", "subsectionsname"],
props: ["stairname", "subsectionsname", "isskip"],
mounted() {
},
@ -46,6 +47,15 @@ export default {
box-shadow: 0 0 0.16rem rgba(0, 0, 0, 0.1);
position: relative;
.path-box-a {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #7F7F7F;
}
.path-slash {
color: #D7D7D7;
font-size: .32rem;

View File

@ -289,7 +289,8 @@
<div class="bottom-item flex1 flexacenter">
<div class="bottom-operation-box flex1 flexacenter">
<div class="bottom-operation-item flex1 flexcolumn flexcenter" @click="info.islike == 0 ? tapOperate('like') : ''">
<div class="bottom-operation-item flex1 flexcolumn flexcenter"
@click="info.islike == 0 ? tapOperate('like') : ''">
<div class="loginBtn" v-if="!islogin" @click.stop="setValue('isloginBtnState', true, 'boolean')">
</div>
<img v-if="info.islike == 0" class="bottom-operation-icom"
@ -659,7 +660,6 @@ export default {
//
handleReplyPop(item) {
// console.log(item);
this.popState = "discussionSingle"
},
@ -675,9 +675,8 @@ export default {
this.popState = ""
let { count, limit } = this.postList
let page = Math.ceil((count + 1) / limit)
console.log(page, this.postList.page);
if (page == this.postList.page) {
this.$router.go(0)
return
@ -695,9 +694,6 @@ export default {
//
currentChange() {
// this.getPostList()
let query = {
page: this.postList.page,
tid: this.tid
@ -741,21 +737,16 @@ export default {
this[key] = value
},
//
postcollect() {
console.log("点击收藏");
},
//
toAllSection() {
this.$router.push({ path: `/allSections`, query: { twofid: this.info.fid } })
this.$router.push({ path: `/allSections`, query: { fid: this.info.fid } })
},
//
handleIsmyself(item) {
console.log(item, "item");
this.twoCommentData = item.message
this.popState = "discussionMulti"
this.commentContent = item.message
},
},

View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="allSections" v-if="!twofid">
<div class="allSections" v-if="isPlateListState">
<div class="allSections-left">
<span v-for="(item, index) in list" :class="{ 'active': index == allActive }" :key="index"
@click="allClick(index, item.fid)">{{ item.name }}</span>
@ -20,13 +20,14 @@
</div>
</div>
</div>
</div>
<div v-else style="margin:.64rem 0;">
<div @click.stop="backAll()">
<plate-navigation :stairname="plate.stairname" :subsectionsname="plate.subsectionsname"></plate-navigation>
<div class="" @click.stop="flybackAll()">
<plate-navigation :stairname="plate.stairname" :subsectionsname="plate.subsectionsname"
:fid="fid"></plate-navigation>
</div>
<div style="margin:.4rem 0.35rem">
<template v-if="invitationList.length != 0">
<index-list :list="invitationList"></index-list>
@ -34,11 +35,8 @@
<div class="result-empty-box flexcenter shadow" v-else>
<img class="result-empty-icon" src="@/assets/img/icon/empty.png">
</div>
</div>
<!-- .paging-box { -->
<div v-if="invitationList.length != 0" class="paging-bo paging flexcenter">
<el-pagination small background layout="prev, pager, next" @current-change="currentChange"
:current-page.sync="invitationPage" :page-size="invitationLimit" :total="invitationCount">
@ -56,12 +54,10 @@ export default {
name: "AllSections",
data() {
return {
allActive: 0,
allActive: null,
// list: [{}],
list: this.$store.state.allForumList,
postCollectionState: false, //
onefid: 0, // id
twofid: 0, // id
invitationList: [], //
invitationLimit: 10,
invitationPage: 1, //
@ -72,6 +68,8 @@ export default {
},
loading: null, //
isPlateListState: true, //
}
},
@ -82,7 +80,6 @@ export default {
this.list = newV
},
immediate: true
}
},
@ -91,39 +88,41 @@ export default {
if (mutation.type == "setAllForumList") this.list = this.$store.state.allForumList
});
let { onefid, twofid, invitationPage } = this.$route.query
if (onefid) this.onefid = onefid
if (twofid) this.twofid = twofid
let { invitationPage, fid } = this.$route.query
if (fid) this.fid = fid
if (invitationPage) this.invitationPage = Number(invitationPage)
if (Number(onefid) > 0 || Number(twofid) > 0) this.handQuery()
if (Number(twofid) > 0) this.getInvitationList()
if (Number(fid) > 0) this.handQuery()
else this.allActive = 0
},
methods: {
// query
handQuery() {
console.log(this.list);
if (this.list.length >= 2) {
let list = this.list
console.log("list", list);
list.forEach((el, index) => {
if (el.fid == this.onefid) this.allActive = index
if (this.twofid) {
el.data.forEach((element, i) => {
if (element.fid == this.twofid) {
this.plate = {
stairname: el.name,
subsectionsname: element.name,
}
if (el.fid == this.fid) this.allActive = index
el.data && el.data.forEach((element, i) => {
if (element.fid == this.fid) {
this.allActive = index
this.plate = {
stairname: el.name,
subsectionsname: element.name,
}
})
}
this.getInvitationList()
this.isPlateListState = false
}
})
})
console.log(this.allActive, "allActive");
} else {
setTimeout(() => {
this.handQuery()
@ -131,14 +130,10 @@ export default {
}
},
//
backAll() {
this.twofid = 0
},
allClick(index, fid) {
this.allActive = index
this.$updateURLSearchParams({ onefid: fid })
this.$updateURLSearchParams({ fid })
},
//
@ -169,12 +164,11 @@ export default {
//
pitchPlate(fid, subsectionsname) {
this.twofid = fid
this.plate = {
stairname: this.list[this.allActive].name,
subsectionsname,
}
this.$router.push({ path: `/allSections`, query: { onefid: this.list[this.allActive].fid, twofid: this.twofid } })
this.$router.push({ path: `/allSections`, query: { fid } })
},
//
@ -183,7 +177,7 @@ export default {
this.$http.get("/api/home/threadList", {
page: this.invitationPage,
limit: this.invitationLimit,
fid: this.twofid
fid: this.fid
}).then(res => {
let data = res.data
this.invitationList = data.data
@ -199,7 +193,12 @@ export default {
//
currentChange() {
this.$router.push({ path: `/allSections`, query: { onefid: this.list[this.allActive].fid, twofid: this.twofid, invitationPage: this.invitationPage } })
this.$router.push({ path: `/allSections`, query: { fid: this.fid, invitationPage: this.invitationPage } })
},
flybackAll() {
console.log("jkldfgjklfggfdjklgfjkl");
this.isPlateListState = true
},
},

View File

@ -14,7 +14,8 @@
<!-- 已收藏 -->
<div v-else>
<!-- 热门版块 -->
<div class="hot-box" v-if="favoriteHeadList.length > 1">
<div class="hot-box" v-if="favoriteHeadList.length > 0">
<div class="hot-label" :class="{ active: fid == 0 }" @click="hotLabelClick(0)">全部</div>
<div class="hot-label" :class="{ active: fid == item.fid }" v-for="(item, index) in favoriteHeadList" :key="index"
@click="hotLabelClick(item.fid)">
{{ item.name }}
@ -30,7 +31,7 @@
<div class="setting-container" @click.stop>
<div class="setting-title">设置收藏版块</div>
<div class="setting-total">
<div class="setting-num">共收藏<b> {{ favoriteHeadList.length - 1 }} </b>个版块</div>
<div class="setting-num">共收藏<b> {{ favoriteHeadList.length }} </b>个版块</div>
<router-link to="/allSections" class="flexcenter setting-add">
<svg-icon icon-class="settingAdd" class-name="setting-add-img"></svg-icon>添加
</router-link>
@ -38,7 +39,7 @@
<!-- 弹窗收藏版块内容 -->
<div class="setting-sections">
<div v-for="(item, index) in favoriteHeadList" :key="index">
<div v-if="index != 0" class="setting-item" @click.stop="cancelFavoritesSection(item.fid, index)">
<div class="setting-item" @click.stop="cancelFavoritesSection(item.fid, index)">
<div class="setting-item-title">{{ item.name }}</div>
<div class="setting-star"></div>
</div>
@ -52,7 +53,7 @@
<!-- 路径 -->
<template v-if="fid != 0">
<plate-navigation :stairname="plate.stairname" :subsectionsname="plate.subsectionsname"></plate-navigation>
<plate-navigation :isskip="true" :stairname="plate.stairname" :subsectionsname="plate.subsectionsname"></plate-navigation>
</template>
<!-- 内容区域 -->
@ -178,10 +179,13 @@ export default {
handleFavoriteHeadList() {
let allForumList = this.allForumList
let favoriteHeadIdList = this.favoriteHeadIdList
let favoriteHeadList = [{
name: "全部",
fid: 0
}]
// let favoriteHeadList = [{
// name: "",
// fid: 0
// }]
let favoriteHeadList = []
allForumList.forEach((el, index) => {
@ -246,7 +250,8 @@ export default {
this.$Message.success(res.message)
}).finally(() => {
this.$store.commit('setHomeRequestState', false)
this.$parent.init()
this.$store.dispatch('getUserInfo', this)
})

View File

@ -6,7 +6,7 @@
@click="hotLabelClick(item.fid)">{{ item.name }}</div>
</div>
<!-- 路径 -->
<plate-navigation v-if="fid != 0" :stairname="plate.stairname"
<plate-navigation :isskip="isskip" v-if="fid != 0" :stairname="plate.stairname"
:subsectionsname="plate.subsectionsname"></plate-navigation>
<section>
<template v-if="list.length != 0 || loading">