no message

This commit is contained in:
xiaoronghao 2023-04-10 17:19:22 +08:00
parent 3000ff590b
commit e5df02f241
6 changed files with 102 additions and 38 deletions

View File

@ -19,7 +19,7 @@ baseURL = {
const service = axios.create({
baseURL: baseURL.forum,
timeout: 5000
timeout: 15000
})
// 2.请求拦截器

View File

@ -3,7 +3,7 @@
<header-nav :issearch="true" :needgetuser="true">
<template slot="header-title">帖子详情</template>
</header-nav>
<router-view></router-view>
<router-view :key="key"></router-view>
</div>
</template>
@ -19,6 +19,12 @@ export default {
};
},
computed: {
key() {
return this.$route.path + Math.random()
}
},
mounted() {
},

View File

@ -1,7 +1,7 @@
<template>
<div class="container">
<div class="detail-head flexacenter">
<div class="detail-section">版块<span class="section-name">香港澳门台湾留学申请</span></div>
<div class="detail-section" @click="toAllSection()">版块<span class="section-name">{{ info.forum }}</span></div>
<div class="detail-data flexacenter">
<div class="detail-data-item flexacenter">
<img class="detail-data-eye" src="@/assets/img/detail/eye.png">{{ info.views }}
@ -99,7 +99,7 @@
<template v-else-if="type == 3">
<div class="offer-content">
<div class="offer-content-box" v-if="tenementInfoState">
<div class="offer-content-box">
<template v-for="(item, index) in tenementKey">
<div class="offer-content-item flexacenter" :key="index" v-if="info[item.key]">
<div class="offer-content-key" v-if="info[item.key]">{{ item.name }}</div>
@ -112,8 +112,11 @@
</template>
</div>
<div v-html="info.message" class="vHtmlMessage" style="">
<div v-html="info.message" class="vHtmlMessage" style="margin: .52rem 0;">
</div>
<img class="tenement-img" v-for="(item, index) in info.images" :key="index" :src="item">
</div>
</template>
@ -145,7 +148,7 @@
<!-- <div class="card-head-fool">{{ index == 0 ? '楼主' : `${index}` }}</div> -->
</div>
<div class="card-content flex1" v-html="item.message"></div>
<div class="card-content flex1" @click.stop="handleReplyPop(item.token)" v-html="item.message"></div>
<template v-if="false">
@ -461,7 +464,11 @@ export default {
},
mounted() {
this.tid = this.$route.query['tid']
this.postList.page = this.$route.query['page']
this.getDetail()
window.scrollTo(0, 0);
},
methods: {
@ -538,7 +545,6 @@ export default {
this.info = { ...this.info, ...data.info }
console.log(this.info);
this.collegelist = collegelist
this.shareurl = data.shareurl
})
@ -546,9 +552,7 @@ export default {
// https://app.gter.net/tenement/forum/show
getTenementDetails() {
console.log("ggjlgjkgj");
this.$http.post("/tenement/forum/show", {
// tid: 2540476
token: this.token
}, "tenement").then(res => {
@ -623,19 +627,36 @@ export default {
},
//
handleReplyPop(token) {
console.log(token);
this.popState = "discussionSingle"
},
//
postComment(message) {
this.$http.post("/api/operation/reply", {
token: this.token,
message
}).then(res => {
console.log(res);
if (res.code != 200) return
let data = res.data
console.log(data);
this.popState = ""
})
},
//
currentChange() {
this.getPostList()
// this.getPostList()
let query = {
page: this.postList.page,
tid: this.tid
}
this.$router.push({ path: `/detailIndex`, query })
},
//
@ -672,7 +693,12 @@ export default {
//
postcollect() {
console.log("点击收藏");
}
},
//
toAllSection() {
this.$router.push({ path: `/allSections`, query: { twofid: this.info.fid } })
},
},
@ -827,6 +853,13 @@ export default {
padding: .5rem .32rem;
word-break: break-word;
/deep/ {
img {
width: 100% !important;
height: auto !important;
}
}
.quotation {
width: 100%;
color: #333;
@ -915,13 +948,21 @@ export default {
line-height: .6rem;
word-break: break-word;
/deep/ strong {
font-weight: bold;
/deep/ {
strong {
font-weight: bold;
}
img {
max-width: 100%;
}
}
/deep/ img {
max-width: 100%;
}
}
.tenement-img {
width: 100%;
}
.offer-content-box {

View File

@ -85,7 +85,7 @@ export default {
if (twofid) this.twofid = twofid
if (invitationPage) this.invitationPage = Number(invitationPage)
if (Number(onefid) > 0) this.handQuery()
if (Number(onefid) > 0 || Number(twofid) > 0) this.handQuery()
if (Number(twofid) > 0) this.getInvitationList()
@ -95,7 +95,6 @@ export default {
// query
handQuery() {
if (this.list.length >= 2) {
let list = this.list
list.forEach((el, index) => {
if (el.fid == this.onefid) this.allActive = index

View File

@ -2,7 +2,7 @@
<!-- 收藏版块 -->
<div class="collect">
<!-- 未收藏 -->
<div v-if="favoriteHeadList.length == 0" class="notCollect">
<div v-if="favoriteHeadList.length <= 1" class="notCollect">
<img class="notCollect-img" src="~assets/img/collect/notCollect.png" alt="未收藏" />
<div class="collect-text">收藏你感兴趣的版块迅速浏览相应的帖子</div>
<router-link to="/allSections" class="flexcenter collect-btn">
@ -10,12 +10,11 @@
<div class="collect-btn-text">马上收藏</div>
<svg-icon icon-class="collect-btn" class-name="icon-collect"></svg-icon>
</router-link>
<!-- </div> -->
</div>
<!-- 已收藏 -->
<div v-else>
<!-- 热门版块 -->
<div class="hot-box" v-if="favoriteHeadList.length != 0">
<div class="hot-box" v-if="favoriteHeadList.length > 1">
<div class="hot-label" :class="{ active: fid == item.fid }" v-for="(item, index) in favoriteHeadList" :key="index"
@click="hotLabelClick(item.fid)">
{{ item.name }}
@ -82,9 +81,12 @@ export default {
data() {
return {
allForumList: [], //
favoriteHeadList: [],
favoriteHeadList: [{
name: "全部",
fid: 0
}],
// favoriteHeadIdList: [],
favoriteHeadIdList: this.$parent.favorite,
favoriteHeadIdList: this.$store.state.favoriteList,
fid: 0, //
collect: [1],
settingShow: false, //
@ -106,20 +108,20 @@ export default {
},
watch: {
"$store.state.homeRequestState": {
handler(newV, oldV) {
console.log("newVnewV", newV);
// if (!newV) return
// this.$nextTick(() => {
// this.favoriteHeadIdList = this.$parent.favorite || []
// this.getAllForumList()
// "$store.state.homeRequestState": {
// handler(newV, oldV) {
// console.log("newVnewV", newV);
// if (!newV) return
// this.$nextTick(() => {
// this.favoriteHeadIdList = this.$parent.favorite || []
// this.getAllForumList()
// if (this.fid) this.handleFavoriteHeadList()
// })
// if (this.fid) this.handleFavoriteHeadList()
// })
},
immediate: true
},
// },
// immediate: true
// },
fid: {
handler(newV, oldV) {
@ -135,8 +137,11 @@ export default {
this.getCollectList()
// console.log(this.$store.state.favoriteList, "this.$store.state.favoriteList");
if (this.favoriteHeadIdList.length != 0) this.getAllForumList()
console.log("this.favoriteHeadIdList", this.favoriteHeadIdList, this.favoriteHeadList);
this.$store.subscribe((mutation, state) => {
if (mutation.type == "setHomeRequestState" && mutation.payload) {
if (!this.$store.state.homeRequestState) return
@ -153,6 +158,17 @@ export default {
methods: {
//
getCollectList() {
let { homeRequestState, favoriteList } = this.$store.state
console.log("homeRequestState", homeRequestState);
if (!homeRequestState) {
setTimeout(() => {
this.getCollectList()
}, 300);
return
}
if (favoriteList.length == 0) return
this.$startupUnderLoading(this)
this.$http.post("/api/home/threadList", {
limit: this.favorite.limit,

View File

@ -57,6 +57,8 @@ export default {
this.$store.commit('setHomeRequestState', true)
this.$store.commit('setFavoriteList', data.favorite)
this.$store.commit('setRecommendList', data.recommend)
// console.log(this.$store.state.favoriteList,"this.$store.state.favoriteListthis.$store.state.favoriteList ");
})
},
}