提交
This commit is contained in:
parent
d82c425491
commit
15b7c46e35
src
components
views
@ -1,12 +1,13 @@
|
|||||||
<!-- 板块导航 头部 点击板块后的头部导航 -->
|
<!-- 板块导航 头部 点击板块后的头部导航 -->
|
||||||
<template>
|
<template>
|
||||||
<router-link class="path-box" to="/allSections">
|
<div class="path-box">
|
||||||
<div>论坛</div>
|
<div>论坛</div>
|
||||||
<span class="path-slash">/</span>
|
<span class="path-slash">/</span>
|
||||||
<div class="oneEllipsis">{{ stairname }}</div>
|
<div class="oneEllipsis">{{ stairname }}</div>
|
||||||
<span class="path-slash">/</span>
|
<span class="path-slash">/</span>
|
||||||
<div class="oneEllipsis">{{ subsectionsname }}</div>
|
<div class="oneEllipsis">{{ subsectionsname }}</div>
|
||||||
</router-link>
|
<router-link v-if="isskip" class="path-box-a" :to="path"></router-link>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -15,10 +16,10 @@ export default {
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
path: "/allSections",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ["stairname", "subsectionsname"],
|
props: ["stairname", "subsectionsname", "isskip"],
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -46,6 +47,15 @@ export default {
|
|||||||
box-shadow: 0 0 0.16rem rgba(0, 0, 0, 0.1);
|
box-shadow: 0 0 0.16rem rgba(0, 0, 0, 0.1);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
.path-box-a {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: #7F7F7F;
|
||||||
|
}
|
||||||
|
|
||||||
.path-slash {
|
.path-slash {
|
||||||
color: #D7D7D7;
|
color: #D7D7D7;
|
||||||
font-size: .32rem;
|
font-size: .32rem;
|
||||||
|
@ -289,7 +289,8 @@
|
|||||||
|
|
||||||
<div class="bottom-item flex1 flexacenter">
|
<div class="bottom-item flex1 flexacenter">
|
||||||
<div class="bottom-operation-box 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 class="loginBtn" v-if="!islogin" @click.stop="setValue('isloginBtnState', true, 'boolean')">
|
||||||
</div>
|
</div>
|
||||||
<img v-if="info.islike == 0" class="bottom-operation-icom"
|
<img v-if="info.islike == 0" class="bottom-operation-icom"
|
||||||
@ -659,7 +660,6 @@ export default {
|
|||||||
|
|
||||||
// 处理回复点击弹出弹窗
|
// 处理回复点击弹出弹窗
|
||||||
handleReplyPop(item) {
|
handleReplyPop(item) {
|
||||||
// console.log(item);
|
|
||||||
this.popState = "discussionSingle"
|
this.popState = "discussionSingle"
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -675,9 +675,8 @@ export default {
|
|||||||
this.popState = ""
|
this.popState = ""
|
||||||
let { count, limit } = this.postList
|
let { count, limit } = this.postList
|
||||||
|
|
||||||
|
|
||||||
let page = Math.ceil((count + 1) / limit)
|
let page = Math.ceil((count + 1) / limit)
|
||||||
console.log(page, this.postList.page);
|
|
||||||
if (page == this.postList.page) {
|
if (page == this.postList.page) {
|
||||||
this.$router.go(0)
|
this.$router.go(0)
|
||||||
return
|
return
|
||||||
@ -695,9 +694,6 @@ export default {
|
|||||||
|
|
||||||
// 点击改变页数
|
// 点击改变页数
|
||||||
currentChange() {
|
currentChange() {
|
||||||
|
|
||||||
// this.getPostList()
|
|
||||||
|
|
||||||
let query = {
|
let query = {
|
||||||
page: this.postList.page,
|
page: this.postList.page,
|
||||||
tid: this.tid
|
tid: this.tid
|
||||||
@ -741,21 +737,16 @@ export default {
|
|||||||
this[key] = value
|
this[key] = value
|
||||||
},
|
},
|
||||||
|
|
||||||
// 收藏
|
|
||||||
postcollect() {
|
|
||||||
console.log("点击收藏");
|
|
||||||
},
|
|
||||||
|
|
||||||
// 跳转全部板块的列表
|
// 跳转全部板块的列表
|
||||||
toAllSection() {
|
toAllSection() {
|
||||||
this.$router.push({ path: `/allSections`, query: { twofid: this.info.fid } })
|
this.$router.push({ path: `/allSections`, query: { fid: this.info.fid } })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 处理点击编辑自己的回复
|
// 处理点击编辑自己的回复
|
||||||
handleIsmyself(item) {
|
handleIsmyself(item) {
|
||||||
console.log(item, "item");
|
|
||||||
this.twoCommentData = item.message
|
|
||||||
this.popState = "discussionMulti"
|
this.popState = "discussionMulti"
|
||||||
|
this.commentContent = item.message
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="allSections" v-if="!twofid">
|
<div class="allSections" v-if="isPlateListState">
|
||||||
<div class="allSections-left">
|
<div class="allSections-left">
|
||||||
<span v-for="(item, index) in list" :class="{ 'active': index == allActive }" :key="index"
|
<span v-for="(item, index) in list" :class="{ 'active': index == allActive }" :key="index"
|
||||||
@click="allClick(index, item.fid)">{{ item.name }}</span>
|
@click="allClick(index, item.fid)">{{ item.name }}</span>
|
||||||
@ -20,13 +20,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else style="margin:.64rem 0;">
|
<div v-else style="margin:.64rem 0;">
|
||||||
<div @click.stop="backAll()">
|
<div class="" @click.stop="flybackAll()">
|
||||||
<plate-navigation :stairname="plate.stairname" :subsectionsname="plate.subsectionsname"></plate-navigation>
|
<plate-navigation :stairname="plate.stairname" :subsectionsname="plate.subsectionsname"
|
||||||
|
:fid="fid"></plate-navigation>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div style="margin:.4rem 0.35rem">
|
<div style="margin:.4rem 0.35rem">
|
||||||
<template v-if="invitationList.length != 0">
|
<template v-if="invitationList.length != 0">
|
||||||
<index-list :list="invitationList"></index-list>
|
<index-list :list="invitationList"></index-list>
|
||||||
@ -34,11 +35,8 @@
|
|||||||
<div class="result-empty-box flexcenter shadow" v-else>
|
<div class="result-empty-box flexcenter shadow" v-else>
|
||||||
<img class="result-empty-icon" src="@/assets/img/icon/empty.png">
|
<img class="result-empty-icon" src="@/assets/img/icon/empty.png">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- .paging-box { -->
|
|
||||||
|
|
||||||
<div v-if="invitationList.length != 0" class="paging-bo paging flexcenter">
|
<div v-if="invitationList.length != 0" class="paging-bo paging flexcenter">
|
||||||
<el-pagination small background layout="prev, pager, next" @current-change="currentChange"
|
<el-pagination small background layout="prev, pager, next" @current-change="currentChange"
|
||||||
:current-page.sync="invitationPage" :page-size="invitationLimit" :total="invitationCount">
|
:current-page.sync="invitationPage" :page-size="invitationLimit" :total="invitationCount">
|
||||||
@ -56,12 +54,10 @@ export default {
|
|||||||
name: "AllSections",
|
name: "AllSections",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
allActive: 0,
|
allActive: null,
|
||||||
// list: [{}],
|
// list: [{}],
|
||||||
list: this.$store.state.allForumList,
|
list: this.$store.state.allForumList,
|
||||||
postCollectionState: false, // 收藏的请求的状态
|
postCollectionState: false, // 收藏的请求的状态
|
||||||
onefid: 0, // 一级列表的板块id
|
|
||||||
twofid: 0, // 是否有选中的板块id
|
|
||||||
invitationList: [], // 选中板块帖子的列表
|
invitationList: [], // 选中板块帖子的列表
|
||||||
invitationLimit: 10,
|
invitationLimit: 10,
|
||||||
invitationPage: 1, //
|
invitationPage: 1, //
|
||||||
@ -72,6 +68,8 @@ export default {
|
|||||||
},
|
},
|
||||||
loading: null, // 加载状态
|
loading: null, // 加载状态
|
||||||
|
|
||||||
|
isPlateListState: true, // 是否是板块列表状态
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -82,7 +80,6 @@ export default {
|
|||||||
this.list = newV
|
this.list = newV
|
||||||
},
|
},
|
||||||
immediate: true
|
immediate: true
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -91,39 +88,41 @@ export default {
|
|||||||
if (mutation.type == "setAllForumList") this.list = this.$store.state.allForumList
|
if (mutation.type == "setAllForumList") this.list = this.$store.state.allForumList
|
||||||
});
|
});
|
||||||
|
|
||||||
let { onefid, twofid, invitationPage } = this.$route.query
|
let { invitationPage, fid } = this.$route.query
|
||||||
if (onefid) this.onefid = onefid
|
if (fid) this.fid = fid
|
||||||
if (twofid) this.twofid = twofid
|
|
||||||
if (invitationPage) this.invitationPage = Number(invitationPage)
|
if (invitationPage) this.invitationPage = Number(invitationPage)
|
||||||
|
|
||||||
if (Number(onefid) > 0 || Number(twofid) > 0) this.handQuery()
|
if (Number(fid) > 0) this.handQuery()
|
||||||
|
else this.allActive = 0
|
||||||
if (Number(twofid) > 0) this.getInvitationList()
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
// 处理 query 的参数
|
// 处理 query 的参数
|
||||||
handQuery() {
|
handQuery() {
|
||||||
|
console.log(this.list);
|
||||||
if (this.list.length >= 2) {
|
if (this.list.length >= 2) {
|
||||||
let list = this.list
|
let list = this.list
|
||||||
console.log("list", list);
|
|
||||||
list.forEach((el, index) => {
|
list.forEach((el, index) => {
|
||||||
if (el.fid == this.onefid) this.allActive = index
|
if (el.fid == this.fid) this.allActive = index
|
||||||
if (this.twofid) {
|
el.data && el.data.forEach((element, i) => {
|
||||||
el.data.forEach((element, i) => {
|
if (element.fid == this.fid) {
|
||||||
if (element.fid == this.twofid) {
|
this.allActive = index
|
||||||
this.plate = {
|
this.plate = {
|
||||||
stairname: el.name,
|
stairname: el.name,
|
||||||
subsectionsname: element.name,
|
subsectionsname: element.name,
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
this.getInvitationList()
|
||||||
|
this.isPlateListState = false
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log(this.allActive, "allActive");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.handQuery()
|
this.handQuery()
|
||||||
@ -131,14 +130,10 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 点击返回选择一级列表页面
|
|
||||||
backAll() {
|
|
||||||
this.twofid = 0
|
|
||||||
},
|
|
||||||
|
|
||||||
allClick(index, fid) {
|
allClick(index, fid) {
|
||||||
this.allActive = index
|
this.allActive = index
|
||||||
this.$updateURLSearchParams({ onefid: fid })
|
this.$updateURLSearchParams({ fid })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 点击收藏
|
// 点击收藏
|
||||||
@ -169,12 +164,11 @@ export default {
|
|||||||
|
|
||||||
// 点击选中板块 并获取列表
|
// 点击选中板块 并获取列表
|
||||||
pitchPlate(fid, subsectionsname) {
|
pitchPlate(fid, subsectionsname) {
|
||||||
this.twofid = fid
|
|
||||||
this.plate = {
|
this.plate = {
|
||||||
stairname: this.list[this.allActive].name,
|
stairname: this.list[this.allActive].name,
|
||||||
subsectionsname,
|
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", {
|
this.$http.get("/api/home/threadList", {
|
||||||
page: this.invitationPage,
|
page: this.invitationPage,
|
||||||
limit: this.invitationLimit,
|
limit: this.invitationLimit,
|
||||||
fid: this.twofid
|
fid: this.fid
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let data = res.data
|
let data = res.data
|
||||||
this.invitationList = data.data
|
this.invitationList = data.data
|
||||||
@ -199,7 +193,12 @@ export default {
|
|||||||
|
|
||||||
// 点击页数
|
// 点击页数
|
||||||
currentChange() {
|
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
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
<!-- 已收藏 -->
|
<!-- 已收藏 -->
|
||||||
<div v-else>
|
<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"
|
<div class="hot-label" :class="{ active: fid == item.fid }" v-for="(item, index) in favoriteHeadList" :key="index"
|
||||||
@click="hotLabelClick(item.fid)">
|
@click="hotLabelClick(item.fid)">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
@ -30,7 +31,7 @@
|
|||||||
<div class="setting-container" @click.stop>
|
<div class="setting-container" @click.stop>
|
||||||
<div class="setting-title">设置收藏版块</div>
|
<div class="setting-title">设置收藏版块</div>
|
||||||
<div class="setting-total">
|
<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">
|
<router-link to="/allSections" class="flexcenter setting-add">
|
||||||
<svg-icon icon-class="settingAdd" class-name="setting-add-img"></svg-icon>添加
|
<svg-icon icon-class="settingAdd" class-name="setting-add-img"></svg-icon>添加
|
||||||
</router-link>
|
</router-link>
|
||||||
@ -38,7 +39,7 @@
|
|||||||
<!-- 弹窗收藏版块内容 -->
|
<!-- 弹窗收藏版块内容 -->
|
||||||
<div class="setting-sections">
|
<div class="setting-sections">
|
||||||
<div v-for="(item, index) in favoriteHeadList" :key="index">
|
<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-item-title">{{ item.name }}</div>
|
||||||
<div class="setting-star"></div>
|
<div class="setting-star"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -52,7 +53,7 @@
|
|||||||
|
|
||||||
<!-- 路径 -->
|
<!-- 路径 -->
|
||||||
<template v-if="fid != 0">
|
<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>
|
</template>
|
||||||
|
|
||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
@ -178,10 +179,13 @@ export default {
|
|||||||
handleFavoriteHeadList() {
|
handleFavoriteHeadList() {
|
||||||
let allForumList = this.allForumList
|
let allForumList = this.allForumList
|
||||||
let favoriteHeadIdList = this.favoriteHeadIdList
|
let favoriteHeadIdList = this.favoriteHeadIdList
|
||||||
let favoriteHeadList = [{
|
// let favoriteHeadList = [{
|
||||||
name: "全部",
|
// name: "全部",
|
||||||
fid: 0
|
// fid: 0
|
||||||
}]
|
// }]
|
||||||
|
|
||||||
|
let favoriteHeadList = []
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
allForumList.forEach((el, index) => {
|
allForumList.forEach((el, index) => {
|
||||||
@ -246,7 +250,8 @@ export default {
|
|||||||
this.$Message.success(res.message)
|
this.$Message.success(res.message)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.$store.commit('setHomeRequestState', false)
|
this.$store.commit('setHomeRequestState', false)
|
||||||
this.$parent.init()
|
this.$store.dispatch('getUserInfo', this)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
@click="hotLabelClick(item.fid)">{{ item.name }}</div>
|
@click="hotLabelClick(item.fid)">{{ item.name }}</div>
|
||||||
</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>
|
:subsectionsname="plate.subsectionsname"></plate-navigation>
|
||||||
<section>
|
<section>
|
||||||
<template v-if="list.length != 0 || loading">
|
<template v-if="list.length != 0 || loading">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user