Compare commits

..

No commits in common. "d82c425491c33102de7024cfdbccb4b39bc9330f" and "9e678d108c5694858f10dc970845ce9d2df31435" have entirely different histories.

27 changed files with 202 additions and 736 deletions

View File

@ -14,7 +14,6 @@
"svg-sprite-loader": "^6.0.11", "svg-sprite-loader": "^6.0.11",
"vue": "^2.6.14", "vue": "^2.6.14",
"vue-router": "^3.5.1", "vue-router": "^3.5.1",
"vue-sanitize": "^0.2.3",
"vuex": "^3.6.2" "vuex": "^3.6.2"
}, },
"devDependencies": { "devDependencies": {

BIN
public/img/bg1.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
public/img/bg2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
public/img/bg3.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
public/img/bg4.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
public/img/bg5.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
public/img/bg6.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
public/img/bg7.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
public/img/bg8.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@ -15,14 +15,9 @@ export default {
loading: null, loading: null,
} }
}, },
watch:{
},
mounted() { mounted() {
this.$store.dispatch('fetchHistoricalSearch') // this.$store.dispatch('fetchHistoricalSearch')
this.$store.dispatch('getAllForum', this) // this.$store.dispatch('getAllForum', this)
// this.$store.dispatch('getUserInfo', this) ///
}, },
} }
@ -40,7 +35,7 @@ export default {
flex-direction: column; flex-direction: column;
margin: 0 auto; margin: 0 auto;
position: relative; position: relative;
// overflow: hidden; overflow: hidden;
} }
a { a {

View File

@ -231,29 +231,6 @@ section {
} }
.paging {
margin-top: .48rem;
::v-deep {
.el-pagination.is-background .el-pager li:not(.disabled).active {
background: rgba(98, 177, 255, 1);
border-radius: 50%;
}
.el-pagination .btn-next .el-icon,
.el-pagination .btn-prev .el-icon {
font-size: .4rem;
}
.el-pagination.is-background.el-pagination--small .btn-next,
.el-pagination.is-background.el-pagination--small .btn-prev,
.el-pagination.is-background.el-pagination--small .el-pager li {
border-radius: 50%;
}
}
}
.result-empty-box { .result-empty-box {
height: 100%; height: 100%;
width: 100%; width: 100%;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -12,12 +12,11 @@
<div class="discussion-single-box flexflex flex1"> <div class="discussion-single-box flexflex flex1">
<div class="discussion-single-content flexacenter flex1"> <div class="discussion-single-content flexacenter flex1">
<input class="discussion-single-input flex1" cursor-spacing="5" type="text" <input class="discussion-single-input flex1" cursor-spacing="5" type="text"
:placeholder="twoCommentData ? '写回复…' : '想问啥,大胆问…'" :value="commentContent" :placeholder="twoCommentData ? '写回复…' : '想问啥,大胆问…'" v-model="commentContent" />
@input="inputCommentContent($event)" />
<img class="discussion-single-input-icom" @click.stop="setValue()" <img class="discussion-single-input-icom" @click.stop="setValue()"
src="@/assets/img/detail/unfold.png" /> src="@/assets/img/detail/unfold.png" />
</div> </div>
<div class="discussion-single-btn flexcenter" @click.stop="postComment()"> <div class="discussion-single-btn flexcenter" @click.stop="postComment(commentContent)">
发布 发布
</div> </div>
</div> </div>
@ -33,14 +32,14 @@
<div class="discussion-text one-line">{{ twoCommentData.content }}</div> <div class="discussion-text one-line">{{ twoCommentData.content }}</div>
</div> </div>
<div class="discussion-multi-content flexflex flex1"> <div class="discussion-multi-content flexflex flex1">
<textarea class="discussion-multi-textarea flex1" type="text" maxlength="500" :value="commentContent" <textarea class="discussion-multi-textarea flex1" type="text" maxlength="500" v-model="commentContent"
:placeholder="twoCommentData ? '写回复…' : '想问啥,大胆问…'" @input="inputCommentContent($event)"></textarea> :placeholder="twoCommentData ? '写回复…' : '想问啥,大胆问…'"></textarea>
<img class="discussion-multi-icom" @click.stop="openDiscussionSingle()" <img class="discussion-multi-icom" @click.stop="openDiscussionSingle()"
src="@/assets/img/detail/pack.png" /> src="@/assets/img/detail/pack.png" />
<div class="discussion-multi-sum">{{ 500 - commentContent.length }}</div> <div class="discussion-multi-sum">{{ 500 - commentContent.length }}</div>
</div> </div>
<div class="discussion-multi-bottom flexflex flexacenter"> <div class="discussion-multi-bottom flexflex flexacenter">
<div class="discussion-multi-btn flexcenter" @click.stop="postComment()"> <div class="discussion-multi-btn flexcenter" @click.stop="postComment(commentContent)">
发布 发布
</div> </div>
</div> </div>
@ -54,26 +53,30 @@ export default {
name: 'DetailReply', name: 'DetailReply',
data() { data() {
return { return {
commentContent: "",
openDiscussionSingleState: true, // openDiscussionSingleState: true, //
}; };
}, },
props: ["twoCommentData", "popState", "commentContent"], props: ["twoCommentData", "popState"],
mounted() { mounted() {
// console.log("");
console.log("子组件");
}, },
methods: { methods: {
// //
postComment() { postComment(commentContent) {
this.$parent.postComment() this.$parent.postComment(commentContent)
}, },
// //
handlePopCancel() { handlePopCancel() {
console.log(this.$parent.popState, "this.$parent.popState");
this.$parent.twoCommentData = null this.$parent.twoCommentData = null
this.$parent.popState = "" this.$parent.popState = ""
}, },
// //
@ -95,11 +98,6 @@ export default {
}, 500); }, 500);
}, },
inputCommentContent(event) {
let value = event.currentTarget.value
this.$parent.commentContent = value
}
}, },
}; };

View File

@ -76,48 +76,36 @@ export default {
tab: "Offer榜", tab: "Offer榜",
headMorePopState: false, // headMorePopState: false, //
islogin: false, islogin: false,
userInfo: {}, // userInfo I ,, user user userInfo: {},
menu: [], menu: [],
hotSearchkeywords: [], // hotSearchkeywords: [], //
}; };
}, },
props: ["issearch", "needgetuser", "userinfo"], props: ["issearch", "needgetuser", "userinfo"],
watch: { watch: {
// needgetuser: { needgetuser: {
// handler(newValue, oldValue) { handler(newValue, oldValue) {
// // if (newValue) this.getUserInfoData(); if (newValue) this.getUserInfoData();
// }, },
// immediate: true, immediate: true,
// }, },
// userinfo(newValue, oldValue) {
// this.userInfo = newValue;
// this.islogin = newValue.uid > 0 ? true : false;
// },
userinfo(newValue, oldValue) {
this.userInfo = newValue;
this.islogin = newValue.uid > 0 ? true : false;
},
headMorePopState(newValue, oldValue) { headMorePopState(newValue, oldValue) {
if (newValue) this.$pageStop(); if (newValue) this.$pageStop();
else this.$pageMove(); else this.$pageMove();
}, },
}, },
mounted() { mounted() {
let user = this.$store.state.user this.getMenu()
if (JSON.stringify(user) === "{}") this.$store.dispatch('getUserInfo', this)
else {
this.userInfo = user
this.islogin = user.uid > 0 ? true : false;
this.hotSearchkeywords = this.$store.state.hotSearchkeywords
}
// this.getMenu()
}, },
components: { components: {
SearchBox, SearchBox,
}, },
methods: { methods: {
// //
handleRegister() { handleRegister() {
@ -127,10 +115,10 @@ export default {
// //
getUserInfoData() { getUserInfoData() {
return
// this.$http.post("/widget/getUser").then((res) => { // this.$http.post("/widget/getUser").then((res) => {
this.$http.post("/api/index",).then((res) => { this.$http.post("/api/index",).then((res) => {
if (res.code != 200) return; if (res.code != 200) return;
// this.prototype.userInfo = res.data.user
this.userInfo = res.data.user; this.userInfo = res.data.user;
this.islogin = res.data.user.uid > 0 ? true : false; this.islogin = res.data.user.uid > 0 ? true : false;
this.hotSearchkeywords = res.data.hotSearchkeywords this.hotSearchkeywords = res.data.hotSearchkeywords

View File

@ -53,6 +53,7 @@ export default {
mounted() { mounted() {
if (this.searchText.length > 0) this.showClear = true if (this.searchText.length > 0) this.showClear = true
else this.showClear = false else this.showClear = false
}, },
methods: { methods: {

View File

@ -6,8 +6,6 @@ import ElementUI, { Message, Pagination, loading } from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate, updateURLSearchParams } from "@/utils/common.js" import { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate, updateURLSearchParams } from "@/utils/common.js"
import http from "@/utils/request" import http from "@/utils/request"
import VueSanitize from 'vue-sanitize'
import hintBox from '@/components/Hintbox' import hintBox from '@/components/Hintbox'
Vue.config.productionTip = false Vue.config.productionTip = false
@ -47,7 +45,6 @@ if (!Array.isArray) {
Vue.use(ElementUI); Vue.use(ElementUI);
Vue.use(Pagination); Vue.use(Pagination);
Vue.use(VueSanitize);
new Vue({ new Vue({

View File

@ -6,14 +6,8 @@ Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
historicalSearch: [], historicalSearch: [],
allForumList: [], // 全部板块数据 allForumList: [{}], // 全部板块数据
homeRequestState: false, // 首页推荐和收藏接口的数据请求状态 这个是是否需要发送请求,因为用户点击收藏后需要重新获取
getUserInfoState: false, // 这个是是否在请求状态
favoriteList: [],
recommendList: [],
user: {}, // 用户信息
hotSearchkeywords: [], // 热门搜索
loading: null,
}, },
getters: { getters: {
}, },
@ -32,30 +26,6 @@ export default new Vuex.Store({
state.allForumList = payload state.allForumList = payload
}, },
setHomeRequestState(state, payload) {
state.homeRequestState = payload
},
setFavoriteList(state, payload) {
state.favoriteList = payload
},
setRecommendList(state, payload) {
state.recommendList = payload
},
setUser(state, payload) {
state.user = payload
},
setHotSearchkeywords(state, payload) {
state.hotSearchkeywords = payload
},
setgetUserInfoState(state, payload) {
state.getUserInfoState = payload
},
}, },
actions: { actions: {
@ -67,7 +37,6 @@ export default new Vuex.Store({
// 获取全部板块的数据 // 获取全部板块的数据
getAllForum({ commit }, that) { getAllForum({ commit }, that) {
// getAllForum(commit, that) {
that.$startupUnderLoading(that) that.$startupUnderLoading(that)
that.$http.get("/api/home/allForum").then(res => { that.$http.get("/api/home/allForum").then(res => {
if (res.code != 200) return; if (res.code != 200) return;
@ -79,39 +48,10 @@ export default new Vuex.Store({
}).finally(() => { }).finally(() => {
that.$closeUnderLoading(that) that.$closeUnderLoading(that)
}) })
// allForumList
},
// 获取用户信息 获取收藏信息那些数据
getUserInfo({ state, commit }, that) {
if (state.getUserInfoState) return
commit('setgetUserInfoState', true)
// that.$startupUnderLoading(that)
that.$http.post("/api/home").then(res => {
if (res.code != 200) return;
let data = res.data
let { config, favorite, hotSearchkeywords, recommend, user } = data
commit('setHomeRequestState', true)
commit('setUser', user)
commit('setFavoriteList', favorite)
commit('setRecommendList', recommend)
commit('setHotSearchkeywords', hotSearchkeywords)
if (that.userInfo) { // 这个是顶部用户数据的 这样不用监听是否请求成功
that.userInfo = user
that.islogin = user.uid > 0 ? true : false;
that.hotSearchkeywords = hotSearchkeywords
} }
}).catch(err => {
that.$message.error(err.message)
}).finally(() => {
// that.$closeUnderLoading(that)
commit('setgetUserInfoState', false)
})
},
}, },
modules: { modules: {

View File

@ -48,8 +48,6 @@ function copy(value, message) {
// 启动加载中 // 启动加载中
function startupUnderLoading(that) { function startupUnderLoading(that) {
// this.
that.loading = that.$loading({ that.loading = that.$loading({
lock: true, lock: true,
text: '加载中...', text: '加载中...',
@ -59,7 +57,7 @@ function startupUnderLoading(that) {
// 关闭加载中 // 关闭加载中
function closeUnderLoading(that) { function closeUnderLoading(that) {
that.loading && that.loading.close(); that.loading.close();
that.loading = null that.loading = null
} }

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="container"> <div class="container">
<div class="detail-head flexacenter"> <div class="detail-head flexacenter">
<div class="detail-section" @click="toAllSection()">版块<span class="section-name">{{ info.forum }}</span></div> <div class="detail-section">版块<span class="section-name">香港澳门台湾留学申请</span></div>
<div class="detail-data flexacenter"> <div class="detail-data flexacenter">
<div class="detail-data-item flexacenter"> <div class="detail-data-item flexacenter">
<img class="detail-data-eye" src="@/assets/img/detail/eye.png">{{ info.views }} <img class="detail-data-eye" src="@/assets/img/detail/eye.png">{{ info.views }}
@ -18,7 +18,6 @@
{{ info.subject }} {{ info.subject }}
</div> </div>
<!-- --> <!-- -->
<div class="card flexcenter"> <div class="card flexcenter">
<div class="card-item shadow" v-if="postList.page == 1"> <div class="card-item shadow" v-if="postList.page == 1">
@ -100,7 +99,7 @@
<template v-else-if="type == 3"> <template v-else-if="type == 3">
<div class="offer-content"> <div class="offer-content">
<div class="offer-content-box"> <div class="offer-content-box" v-if="tenementInfoState">
<template v-for="(item, index) in tenementKey"> <template v-for="(item, index) in tenementKey">
<div class="offer-content-item flexacenter" :key="index" v-if="info[item.key]"> <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> <div class="offer-content-key" v-if="info[item.key]">{{ item.name }}</div>
@ -113,20 +112,15 @@
</template> </template>
</div> </div>
<div v-html="info.message" class="vHtmlMessage" style="margin: .52rem 0;"> <div v-html="info.message" class="vHtmlMessage" style="">
</div> </div>
<img class="tenement-img" v-for="(item, index) in info.images" :key="index" :src="item">
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div class="offer-content"> <div class="offer-content">
<!-- <div v-html="info.message" style="line-height: normal;" class="vHtmlMessage"></div> --> <div v-html="info.message" style="line-height: normal;" class="vHtmlMessage">
<!-- <div style="line-height: normal;" ref="vHtmlMessage" class="vHtmlMessage">{{ info.message }}</div> --> </div>
<div style="line-height: normal;" ref="vHtmlMessage" class="vHtmlMessage"></div>
</div> </div>
</template> </template>
</div> </div>
@ -137,7 +131,9 @@
<img class="card-head-icon" :src="item.avatar" /> <img class="card-head-icon" :src="item.avatar" />
<div class="card-head-content flex1 flexflex"> <div class="card-head-content flex1 flexflex">
<div class="card-head-name flexflex">{{ item.author }} <div class="card-head-name flexflex">{{ item.author }}
<div class="landlord flexcenter" v-if="item.isauthor == 1">楼主</div> <!-- <div class="landlord flexcenter" v-if="index == 0">
楼主
</div> -->
</div> </div>
<div class="card-head-time">{{ $formattedDate(item.dateline) }}</div> <div class="card-head-time">{{ $formattedDate(item.dateline) }}</div>
</div> </div>
@ -146,13 +142,10 @@
index + 2}` }}</div> index + 2}` }}</div>
<div class="card-head-fool" v-else>{{ `${(postList.page - 1) * postList.limit + index + 1}` }} <div class="card-head-fool" v-else>{{ `${(postList.page - 1) * postList.limit + index + 1}` }}
</div> </div>
<div class="edit-box flexcenter" v-if="item.ismyself == 1" @click.stop="handleIsmyself(item)">
<img class="edit-icom" src="@/assets/img/detail/edit.png" />
</div>
<!-- <div class="card-head-fool">{{ index == 0 ? '楼主' : `${index}` }}</div> --> <!-- <div class="card-head-fool">{{ index == 0 ? '楼主' : `${index}` }}</div> -->
</div> </div>
<div class="card-content flex1" @click.stop="handleReplyPop(item)" v-html="item.message"></div> <div class="card-content flex1" v-html="item.message"></div>
<template v-if="false"> <template v-if="false">
@ -289,7 +282,12 @@
<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="tapOperate('like')">
<!-- <div class="praise_bubble" id="praise_bubble" @click.stop=""
:style="{ height: prepareLiskeState ? '' : '.5333rem' }">
<div class="bubble" v-for="(item, index) in listlist" :key="index"></div>
</div> -->
<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"
@ -298,7 +296,7 @@
<img v-else class="bottom-operation-icom" <img v-else class="bottom-operation-icom"
:class="{ 'prepareLiskeAnimateState': prepareLiskeAnimateState }" :class="{ 'prepareLiskeAnimateState': prepareLiskeAnimateState }"
src="@/assets/img/icon/like-o.png" /> src="@/assets/img/icon/like-o.png" />
<div class="bottom-operation-text">{{ info.recommend_add == 0 ? '' : info.recommend_add }}</div> <div class="bottom-operation-text">{{ stat.like == 0 ? '' : stat.like }}</div>
</div> </div>
<div class="bottom-operation-item flex1 flexcolumn flexcenter" <div class="bottom-operation-item flex1 flexcolumn flexcenter"
@click="tapOperate(info.isfav == 0 ? 'collect' : 'uncollect')"> @click="tapOperate(info.isfav == 0 ? 'collect' : 'uncollect')">
@ -317,8 +315,7 @@
</div> </div>
</div> </div>
<detail-reply :two-comment-data="twoCommentData" :comment-content="commentContent" <detail-reply :two-comment-data="twoCommentData" :pop-state="popState"></detail-reply>
:pop-state="popState"></detail-reply>
<coins :coin-config="coinConfig" :pop-state="popState"></coins> <coins :coin-config="coinConfig" :pop-state="popState"></coins>
</div> </div>
@ -327,7 +324,6 @@
<script> <script>
import DetailReply from '@/components/DetailReply' import DetailReply from '@/components/DetailReply'
import Coins from '@/components/unlock/Coins' import Coins from '@/components/unlock/Coins'
export default { export default {
name: 'detailIndex', name: 'detailIndex',
data() { data() {
@ -336,7 +332,7 @@ export default {
// avatar: "https://oss.gter.net/avatar/97KwEWANd_4DHWiY6VbnSUFSCKroYWFjYQ~~/middle", // avatar: "https://oss.gter.net/avatar/97KwEWANd_4DHWiY6VbnSUFSCKroYWFjYQ~~/middle",
// content: "", // content: "",
// }, // },
popState: "", // discussionSingle discussionMulti popState: "",
coinConfig: { coinConfig: {
strategy: { strategy: {
button: "攒币指南", button: "攒币指南",
@ -460,18 +456,12 @@ export default {
loading: null, // loading: null, //
commentContent: "", //
operateState: false, //
}; };
}, },
mounted() { mounted() {
this.tid = this.$route.query['tid'] this.tid = this.$route.query['tid']
this.postList.page = this.$route.query['page'] || 1
this.getDetail() this.getDetail()
window.scrollTo(0, 0);
}, },
methods: { methods: {
@ -484,42 +474,14 @@ export default {
if (res.code != 200) return if (res.code != 200) return
let data = res.data let data = res.data
let info = data.info let info = data.info
const reg = new RegExp("\r\n", "g") const reg = new RegExp("\r\n", "g")
info['message'] = info['message'].replaceAll(reg, '<br/>') info['message'] = info['message'].replaceAll(reg, '<br/>')
info['message'] = info['message'].replace(/<img[^>]*>/g, (match) => { info['message'] = info['message'].replace(/<img[^>]*>/g, (match) => {
return match.replace(/width="[^"]*"/g, '').replace(/height="[^"]*"/g, ''); return match.replace(/width="[^"]*"/g, '').replace(/height="[^"]*"/g, '');
}) });
info["messageList"] = []
info['message'] = info['message'].replaceAll("[hide]作者设置了回复可见[/hide]", `<div class="flexcenter content-unlock content-unlock-no replyVisible" @click="aa()"><img class="unlock-icom" src="./img/unlock.png"/>作者设置了回复可见</div>`)
// if (info.message.indexOf("[hide][/hide]")) {
// `<div class="flexcenter content-unlock content-unlock-no"><img class="unlock-icom" src="@/assets/img/detail/unlock.png"></div>`
// }
// console.log(info['message']);
// info['message'] = this.$sanitize(info['message'])
// console.log(info['message']);
data.type == 0 ? this.$refs['vHtmlMessage'] ? this.$refs.vHtmlMessage.innerHTML = info['message'] : "" : ""
let replyVisibleList = document.getElementsByClassName("replyVisible")
if (!Array.isArray(replyVisibleList)) {
for (let i = 0; i < replyVisibleList.length; i++) {
replyVisibleList[i].addEventListener('click', () => {
this.$emit("replyVisibleClick")
})
}
this.$on('replyVisibleClick', () => {
this.popState = "discussionSingle"
})
}
// console.log(info, "offerinfo", data.type);
this.info = info this.info = info
this.type = data.type this.type = data.type
@ -529,8 +491,7 @@ export default {
else if (this.type == 5) this.getsummaryDetails() else if (this.type == 5) this.getsummaryDetails()
else if (this.type == 3) this.getTenementDetails() else if (this.type == 3) this.getTenementDetails()
else if (this.type == 2) this.getInterviewDetails() else if (this.type == 2) this.getInterviewDetails()
this.getPostList()
info['ispost'] != 0 ? this.getPostList() : ''
}).finally(() => { }).finally(() => {
this.$closeUnderLoading(this) this.$closeUnderLoading(this)
@ -545,6 +506,7 @@ export default {
let data = res.data let data = res.data
// let offerinfo = data.offerinfo // let offerinfo = data.offerinfo
let offerinfo = data.collegelist[0] let offerinfo = data.collegelist[0]
console.log("offerinfo", offerinfo);
let useperformanceStr = "" let useperformanceStr = ""
offerinfo.useperformance && offerinfo.useperformance.forEach((el, index) => { offerinfo.useperformance && offerinfo.useperformance.forEach((el, index) => {
useperformanceStr += el + (offerinfo.useperformance.length - 1 == index ? '' : '、') useperformanceStr += el + (offerinfo.useperformance.length - 1 == index ? '' : '、')
@ -554,6 +516,7 @@ export default {
// offerinfo['schoolname'] = offerinfo.school.name // offerinfo['schoolname'] = offerinfo.school.name
this.offerinfo = offerinfo this.offerinfo = offerinfo
// this.shareurl = data.shareurl
}) })
}, },
@ -575,15 +538,17 @@ export default {
this.info = { ...this.info, ...data.info } this.info = { ...this.info, ...data.info }
console.log(this.info);
this.collegelist = collegelist this.collegelist = collegelist
this.shareurl = data.shareurl this.shareurl = data.shareurl
}) })
}, },
// https://app.gter.net/tenement/forum/show
//
getTenementDetails() { getTenementDetails() {
console.log("ggjlgjkgj");
this.$http.post("/tenement/forum/show", { this.$http.post("/tenement/forum/show", {
// tid: 2540476
token: this.token token: this.token
}, "tenement").then(res => { }, "tenement").then(res => {
@ -611,6 +576,7 @@ export default {
const reg = new RegExp("\r\n", "g") const reg = new RegExp("\r\n", "g")
info['message'] = info['message'].replaceAll(reg, '<br/>') info['message'] = info['message'].replaceAll(reg, '<br/>')
info['message'] = info['message'].replace(/<img[^>]*>/g, (match) => { info['message'] = info['message'].replace(/<img[^>]*>/g, (match) => {
console.log("match", match);
return match.replace(/width="[^"]*"/g, '').replace(/height="[^"]*"/g, ''); return match.replace(/width="[^"]*"/g, '').replace(/height="[^"]*"/g, '');
}); });
@ -621,16 +587,16 @@ export default {
// //
getInterviewDetails() { getInterviewDetails() {
// https://app.gter.net/InterviewExperience/thread
this.$http.post("/InterviewExperience/thread", { this.$http.post("/InterviewExperience/thread", {
// token: this.token, // token: this.token,
// tid: this.tid // tid: this.tid
// tid: 2322145, tid: 2322145,
// uniqid: "--G1tS2SCTOQyoOMiedlLKxTnFvHWjBwQezsJjvVJFwgqOtOFeYr4_LAAG5RV37ETvMl2Zd4tSCc-_dqeKpERxXsx-tPfXrUs0kUysTGLzgxYzU~", uniqid: "--G1tS2SCTOQyoOMiedlLKxTnFvHWjBwQezsJjvVJFwgqOtOFeYr4_LAAG5RV37ETvMl2Zd4tSCc-_dqeKpERxXsx-tPfXrUs0kUysTGLzgxYzU~",
// token: "5e3c42209eebfbab66e6f0d6c70a53c7", token: "5e3c42209eebfbab66e6f0d6c70a53c7",
token: this.token
}, "tenement").then(res => { }, "tenement").then(res => {
// console.log(res); console.log(res);
if (res.code != 200) return if (res.code != 200) return
let data = res.data let data = res.data
this.info = { ...this.info, ...data } this.info = { ...this.info, ...data }
@ -657,60 +623,24 @@ export default {
}, },
//
handleReplyPop(item) {
// console.log(item);
this.popState = "discussionSingle"
},
// //
postComment(message) { postComment(message) {
this.$http.post("/api/operation/reply", { this.$http.post("/api/operation/reply", {
token: this.token, token: this.token,
message: this.commentContent message
}).then(res => { }).then(res => {
if (res.code != 200) return console.log(res);
// let data = res.data
// console.log(data);
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
}
let query = {
page,
tid: this.tid
}
this.$router.push({ path: `/detailIndex`, query })
}) })
}, },
// //
currentChange() { currentChange() {
this.getPostList()
// this.getPostList()
let query = {
page: this.postList.page,
tid: this.tid
}
this.$router.push({ path: `/detailIndex`, query })
}, },
// //
tapOperate(key) { tapOperate(key) {
// like collect uncollect // like collect uncollect
if (this.operateState) return
this.operateState = true
let url = "" let url = ""
if (key == "like") url = "/api/operation/threadLike" if (key == "like") url = "/api/operation/threadLike"
@ -720,13 +650,11 @@ export default {
this.$http.post(url, { tid: this.tid }).then(res => { this.$http.post(url, { tid: this.tid }).then(res => {
console.log(res); console.log(res);
if (res.code != 200) return if (res.code != 200) return
if (key == "like") this.info.islike = 1 if (key == "like") this.info.like = 1
if (key == "collect") this.info.isfav = 1 if (key == "collect") this.info.isfav = 1
if (key == "uncollect") this.info.isfav = 0 if (key == "uncollect") this.info.isfav = 0
this.$message.success(res.message) this.$message.success(res.message)
}).finally(() => {
this.operateState = false
}) })
}, },
@ -744,19 +672,7 @@ export default {
// //
postcollect() { postcollect() {
console.log("点击收藏"); console.log("点击收藏");
}, }
//
toAllSection() {
this.$router.push({ path: `/allSections`, query: { twofid: this.info.fid } })
},
//
handleIsmyself(item) {
console.log(item, "item");
this.twoCommentData = item.message
this.popState = "discussionMulti"
},
}, },
@ -902,21 +818,7 @@ export default {
color: rgb(127, 127, 127); color: rgb(127, 127, 127);
font-size: .32rem; font-size: .32rem;
} }
.edit-box {
width: .64rem;
height: .64rem;
border-radius: 50%;
background: #f6f6f6;
margin-left: .32rem;
.edit-icom {
width: .4rem;
// height: .4rem;
} }
}
}
.card-content { .card-content {
color: #333; color: #333;
@ -925,13 +827,6 @@ export default {
padding: .5rem .32rem; padding: .5rem .32rem;
word-break: break-word; word-break: break-word;
/deep/ {
img {
width: 100% !important;
height: auto !important;
}
}
.quotation { .quotation {
width: 100%; width: 100%;
color: #333; color: #333;
@ -967,7 +862,6 @@ export default {
} }
} }
/deep/ {
.content-unlock { .content-unlock {
&.content-unlock-no { &.content-unlock-no {
height: 3.2rem; height: 3.2rem;
@ -976,7 +870,6 @@ export default {
width: .64rem; width: .64rem;
height: .64rem; height: .64rem;
margin-right: 0.2rem; margin-right: 0.2rem;
vertical-align: middle;
} }
} }
@ -1009,7 +902,7 @@ export default {
} }
} }
}
} }
@ -1022,65 +915,13 @@ export default {
line-height: .6rem; line-height: .6rem;
word-break: break-word; word-break: break-word;
/deep/ { /deep/ strong {
strong {
font-weight: bold; font-weight: bold;
} }
img { /deep/ img {
max-width: 100%; max-width: 100%;
} }
.content-unlock {
&.content-unlock-no {
height: 3.2rem;
.unlock-icom {
width: .64rem;
height: .64rem;
margin-right: 0.2rem;
vertical-align: middle;
}
}
background: rgba(242, 242, 242, 0.7);
margin: .48rem 0;
color: #555555;
font-size: .32rem;
border-radius: .16rem;
&.content-already {
background: rgba(242, 242, 242, 0.7);
margin: .48rem 0;
padding: .32rem;
color: #555555;
font-size: .32rem;
border-radius: .16rem;
.content-already-header {
color: #7f7f7f;
font-size: .28rem;
justify-content: center;
}
.content-unlock-wenzi {
color: #333;
font-size: .36rem;
line-height: .6rem;
margin-top: .3rem;
}
}
}
}
}
.tenement-img {
width: 100%;
} }
.offer-content-box { .offer-content-box {

View File

@ -7,7 +7,7 @@
</div> </div>
<div class="allSections-right"> <div class="allSections-right">
<div class="allSections-right-item" @click="pitchPlate(i.fid, i.name)" <div class="allSections-right-item" @click="pitchPlate(i.fid, i.name)"
v-for="(i, k) in (list[allActive] && list[allActive]['data'])" :key="k"> v-for="(i, k) in list[allActive].data" :key="k">
<div class="item-content"> <div class="item-content">
<div class="item-title">{{ i.name }}</div> <div class="item-title">{{ i.name }}</div>
<div v-if="i.description" class="item-text" v-html="i.description.replace(/<[^>]+>/g, '')"></div> <div v-if="i.description" class="item-text" v-html="i.description.replace(/<[^>]+>/g, '')"></div>
@ -37,9 +37,8 @@
</div> </div>
<!-- .paging-box { -->
<div v-if="invitationList.length != 0" class="paging-bo paging flexcenter"> <div v-if="invitationList.length != 0" class="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">
</el-pagination> </el-pagination>
@ -75,17 +74,6 @@ export default {
} }
}, },
watch: {
"$store.state.allForumList": {
handler(newV, oldV) {
if (!Array.isArray(newV)) return
this.list = newV
},
immediate: true
}
},
mounted() { mounted() {
this.$store.subscribe((mutation, state) => { this.$store.subscribe((mutation, state) => {
if (mutation.type == "setAllForumList") this.list = this.$store.state.allForumList if (mutation.type == "setAllForumList") this.list = this.$store.state.allForumList
@ -96,22 +84,26 @@ export default {
if (twofid) this.twofid = twofid 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(onefid) > 0) this.a()
if (Number(twofid) > 0) this.getInvitationList() if (Number(twofid) > 0) this.getInvitationList()
}, },
methods: { methods: {
// query a() {
handQuery() {
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) => {
// console.log(this.twofid);
if (el.fid == this.onefid) this.allActive = index if (el.fid == this.onefid) this.allActive = index
if (this.twofid) { if (this.twofid) {
el.data.forEach((element, i) => { el.data.forEach((element, i) => {
console.log(element, i);
if (element.fid == this.twofid) { if (element.fid == this.twofid) {
this.plate = { this.plate = {
stairname: el.name, stairname: el.name,
@ -124,9 +116,11 @@ export default {
}) })
console.log(this.onefid, "onefidonefid");
} else { } else {
setTimeout(() => { setTimeout(() => {
this.handQuery() this.a()
}, 500) }, 500)
} }
@ -138,7 +132,10 @@ export default {
allClick(index, fid) { allClick(index, fid) {
this.allActive = index this.allActive = index
this.$updateURLSearchParams({ onefid: fid }) const params = new URLSearchParams(window.location.search);
params.set('onefid', fid);
const newUrl = window.location.pathname + '?' + params.toString();
window.history.pushState({}, '', newUrl);
}, },
// //
@ -162,8 +159,6 @@ export default {
this.$forceUpdate() this.$forceUpdate()
}).finally(() => { }).finally(() => {
this.postCollectionState = false this.postCollectionState = false
this.$store.commit('setHomeRequestState', false)
this.$store.dispatch('getUserInfo', this)
}) })
}, },
@ -180,7 +175,7 @@ export default {
// //
getInvitationList() { getInvitationList() {
this.$startupUnderLoading(this) this.$startupUnderLoading(this)
this.$http.get("/api/home/threadList", { this.$http.post("/api/home/threadList", {
page: this.invitationPage, page: this.invitationPage,
limit: this.invitationLimit, limit: this.invitationLimit,
fid: this.twofid fid: this.twofid
@ -241,15 +236,6 @@ export default {
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
-webkit-overflow-scrolling: touch;
&::-webkit-scrollbar {
display: none;
}
span { span {
height: 1.28rem; height: 1.28rem;
line-height: 1.28rem; line-height: 1.28rem;

View File

@ -2,44 +2,45 @@
<!-- 收藏版块 --> <!-- 收藏版块 -->
<div class="collect"> <div class="collect">
<!-- 未收藏 --> <!-- 未收藏 -->
<div v-if="favoriteHeadList.length == 0" class="notCollect"> <div v-if="collect.length == 0" class="notCollect">
<img class="notCollect-img" src="~assets/img/collect/notCollect.png" alt="未收藏" /> <img class="notCollect-img" src="~assets/img/collect/notCollect.png" alt="未收藏" />
<div class="collect-text">收藏你感兴趣的版块迅速浏览相应的帖子</div> <div class="collect-text">收藏你感兴趣的版块迅速浏览相应的帖子</div>
<!-- <div class="collect-btn"> -->
<router-link to="/allSections" class="flexcenter collect-btn"> <router-link to="/allSections" class="flexcenter collect-btn">
<div class="collect-btn-text">马上收藏</div> <div class="collect-btn-text">马上收藏</div>
<svg-icon icon-class="collect-btn" class-name="icon-collect"></svg-icon> <svg-icon icon-class="collect-btn" class-name="icon-collect"></svg-icon>
</router-link> </router-link>
<!-- </div> -->
</div> </div>
<!-- 已收藏 --> <!-- 已收藏 -->
<div v-else> <div v-else>
<!-- 热门版块 --> <!-- 热门版块 -->
<div class="hot-box" v-if="favoriteHeadList.length > 1"> <div class="hot-box">
<div class="hot-label" :class="{ active: fid == item.fid }" v-for="(item, index) in favoriteHeadList" :key="index" <div class="hot-label" :class="{ active: hotActive == index }" v-for="(item, index) in list" :key="index"
@click="hotLabelClick(item.fid)"> @click="hotLabelClick(index)">
{{ item.name }} {{ item.label }}
</div> </div>
<!-- 设置按钮 --> <!-- 设置按钮 -->
<div class="setting flexcenter" @click="settingClick"> <div class="setting flexcenter" @click="settingClick">
<img src="~assets/img/icon/setting.png" alt="设置" /> <img src="~assets/img/icon/setting.png" alt="设置" />
设置 设置
</div> </div>
<!-- 设置 收藏版块弹窗 --> <!-- 设置 收藏版块弹窗 -->
<div class="setting-window" :class="{ 'setting-show': settingShow == true }" @click="settingClose"> <div class="setting-window" :class="{ 'setting-show': settingShow == true }" @click="settingClose">
<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> {{ list.length - 1 }} </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>
</div> </div>
<!-- 弹窗收藏版块内容 --> <!-- 弹窗收藏版块内容 -->
<div class="setting-sections"> <div class="setting-sections">
<div v-for="(item, index) in favoriteHeadList" :key="index"> <div v-for="(item, index) in list" :key="index">
<div v-if="index != 0" class="setting-item" @click.stop="cancelFavoritesSection(item.fid, index)"> <div v-if="index != 0" class="setting-item" @click.stop="cancelFavoritesSection(index)">
<div class="setting-item-title">{{ item.name }}</div> <div class="setting-item-title">{{ item.label }}</div>
<div class="setting-star"></div> <div class="setting-star"></div>
</div> </div>
</div> </div>
@ -49,24 +50,12 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 路径 --> <!-- 路径 -->
<template v-if="fid != 0"> <plate-navigation stairname="寄托学术类备" subsectionsname="SAT、AP考试、海外本科申…"></plate-navigation>
<plate-navigation :stairname="plate.stairname" :subsectionsname="plate.subsectionsname"></plate-navigation>
</template>
<!-- 内容区域 --> <!-- 内容区域 -->
<section> <section>
<template v-if="favorite.list.length != 0 || loading"> <!-- <index-list :list=""></index-list> -->
<index-list :list="favorite.list"></index-list> <index-list></index-list>
<div class="paging flexcenter">
<el-pagination small background layout="prev, pager, next" @current-change="currentChange"
:current-page.sync="favorite.page" :page-size="favorite.limit" :total="favorite.count">
</el-pagination>
</div>
</template>
</section> </section>
</div> </div>
</div> </div>
@ -80,146 +69,37 @@ export default {
name: "Collect", name: "Collect",
data() { data() {
return { return {
allForumList: [], // hotActive: 0, //
favoriteHeadList: [],
// {
// name: "",
// fid: 0
// }],
favoriteHeadIdList: [],
// favoriteHeadIdList: this.$store.state.favoriteList,
fid: 0, //
collect: [1], collect: [1],
settingShow: false, // settingShow: false, //
settingStar: false, settingStar: false,
plate: { list: [
stairname: "",// //
subsectionsname: "",// {
label: "全部",
}, },
favorite: { // {
list: [], label: "香港留学",
limit: 20,
page: 1,
count: 0
}, },
loading: null, {
label: "香港留学",
},
{
label: "香港留学",
},
],
}; };
}, },
watch: {
"$store.state.allForumList": {
handler(newV, oldV) {
if (!Array.isArray(newV)) return
this.allForumList = newV
if (this.favoriteHeadList.length != 0) this.handleFavoriteHeadList()
},
immediate: true
},
favoriteHeadIdList: {
handler(newV, oldV) {
if (!Array.isArray(newV)) return
this.favoriteHeadList = newV
if (this.allForumList.length != 0) this.handleFavoriteHeadList()
},
immediate: true
},
},
mounted() { mounted() {
let { page, fid } = this.$route.query
if (page) this.favorite.page = Number(page)
if (fid) this.fid = fid
this.init()
}, },
components: {
plateNavigation,
indexList
},
methods: { methods: {
init() { hotLabelClick(index) {
let { homeRequestState, favoriteList } = this.$store.state this.hotActive = index;
if (!homeRequestState) {
setTimeout(() => {
this.init()
}, 300);
} else {
this.favoriteHeadIdList = favoriteList
this.getCollectList()
}
},
//
getCollectList() {
if (this.favoriteHeadIdList.length == 0) return
this.$startupUnderLoading(this)
this.$http.get("/api/home/threadList", {
limit: this.favorite.limit,
page: this.favorite.page,
fid: this.fid,
type: "fav"
}).then(res => {
if (res.code != 200) return
let data = res.data
this.favorite.list = data.data
this.favorite.page = data.page
this.favorite.limit = data.limit
this.favorite.count = data.count
}).finally(() => {
this.$closeUnderLoading(this)
})
},
//
handleFavoriteHeadList() {
let allForumList = this.allForumList
let favoriteHeadIdList = this.favoriteHeadIdList
let favoriteHeadList = [{
name: "全部",
fid: 0
}]
allForumList.forEach((el, index) => {
if (!Array.isArray(el.data)) return
el.data.forEach(elememt => {
if (elememt.fid == this.fid) {
this.plate.stairname = el.name
this.plate.subsectionsname = elememt.name
}
if (favoriteHeadIdList.includes(elememt.fid)) {
favoriteHeadList.push({
fid: elememt.fid,
name: elememt.name,
})
}
})
})
this.favoriteHeadList = favoriteHeadList
},
currentChange() {
let query = {
page: this.favorite.page,
}
if (this.fid) query['fid'] = this.fid
this.$router.push({ path: `/collect`, query })
},
hotLabelClick(fid) {
let query = {
page: 1,
fid
}
this.$router.push({ path: `/collect`, query })
}, },
// //
settingClick() { settingClick() {
@ -230,33 +110,11 @@ export default {
this.settingShow = false; this.settingShow = false;
}, },
// //
cancelFavoritesSection(fid, index) { cancelFavoritesSection(index) {
let url = "/api/operation/unforumFav" this.list.splice(index, 1)
this.$http.post(url, {
fid
}).then(res => {
if (res.code != 200) return
let list = this.$store.state.allForumList
this.$store.commit('setAllForumList', list)
this.favoriteHeadList.splice(index, 1)
this.$Message.success(res.message)
}).finally(() => {
this.$store.commit('setHomeRequestState', false)
this.$parent.init()
})
} }
}, },
components: {
plateNavigation,
indexList
},
}; };
</script> </script>
@ -456,7 +314,6 @@ export default {
.paging { .paging {
margin-top: .48rem; margin-top: .48rem;
padding-bottom: 1rem;
::v-deep { ::v-deep {
.el-pagination.is-background .el-pager li:not(.disabled).active { .el-pagination.is-background .el-pager li:not(.disabled).active {

View File

@ -34,25 +34,20 @@ export default {
return this.$route.path + Math.random() return this.$route.path + Math.random()
} }
}, },
watch: {
"$store.state.homeRequestState": {
handler(newV, oldV) {
let { favoriteList, recommendList } = this.$store.state
this.favorite = favoriteList
this.recommend = recommendList
},
immediate: true
}
},
mounted() { mounted() {
this.init()
}, },
components: { components: {
HeaderNav, HeaderNav,
}, },
methods: { methods: {
init() {
this.$http.post("/api/home").then(res => {
let data = res.data
this.favorite = data.favorite
this.recommend = data.recommend
})
},
} }
}; };
</script> </script>

View File

@ -2,21 +2,14 @@
<div class="recommend"> <div class="recommend">
<!-- 热门版块 --> <!-- 热门版块 -->
<div class="hot-box"> <div class="hot-box">
<div class="hot-label" :class="{ 'active': item.fid == fid }" v-for="(item, index) in hotList" :key="index" <div class="hot-label" :class="{ 'active': hotActive == index }" v-for="(item, index) in list" :key="index"
@click="hotLabelClick(item.fid)">{{ item.name }}</div> @click="hotLabelClick(index)">{{ item.label }}</div>
</div> </div>
<!-- 路径 --> <!-- 路径 -->
<plate-navigation v-if="fid != 0" :stairname="plate.stairname" <plate-navigation stairname="香港澳门台湾" subsectionsname="SAT、AP考试、海外本科申…"></plate-navigation>
:subsectionsname="plate.subsectionsname"></plate-navigation>
<section> <section>
<template v-if="list.length != 0 || loading"> <template v-if="list.length == 0">
<index-list :list="list"></index-list> <index-list></index-list>
<div class="paging flexcenter">
<el-pagination small background layout="prev, pager, next" @current-change="currentChange"
:current-page.sync="page" :page-size="limit" :total="count">
</el-pagination>
</div>
</template> </template>
<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">
@ -32,102 +25,30 @@ export default {
name: "Recommend",// name: "Recommend",//
data() { data() {
return { return {
hotList: [], hotActive: -1,//
list: [], list: [
count: 0, // {
limit: 20, // label: "香港留学"
page: 1, //
fid: 0, // id
plate: {
stairname: "",//
subsectionsname: "",//
}, },
{
loading: null, label: "香港留学"
allForumList: this.$store.state.allForumList || [], },
{
label: "香港留学"
},
{
label: "香港留学"
} }
}, ]
watch: {
"$parent.recommend": {
handler(newV, oldV) {
this.hotList = newV
},
immediate: true
},
"$store.state.allForumList": {
handler(newV, oldV) {
this.allForumList = newV
this.handleForumFid()
},
immediate: true
} }
}, },
mounted() { mounted() {
let { page, fid } = this.$route.query console.log(this.$parent);
if (page) this.page = Number(page)
if (fid) {
this.fid = fid
this.handleForumFid()
}
this.init()
}, },
methods: { methods: {
init() { hotLabelClick(index) {
this.$startupUnderLoading(this) this.hotActive = index
this.$http.get("/api/home/threadList", {
limit: this.limit,
type: "recommend",
page: this.page,
fid: this.fid,
}).then(res => {
if (res.code != 200) return
let data = res.data
this.list = data.data
this.limit = data.limit
this.page = data.page
this.count = data.count
}).finally(() => {
this.$closeUnderLoading(this)
})
},
//
handleForumFid() {
let allForumList = this.allForumList
if (!Array.isArray(allForumList) || allForumList.length <= 1) return
allForumList.forEach((el, index) => {
if (!Array.isArray(el['data'])) return
el.data.forEach(element => {
if (element['fid'] == this.fid) {
this.plate.subsectionsname = element.name
this.plate.stairname = el.name
}
})
})
},
currentChange() {
let query = {
page: this.page,
}
if (this.fid) query['fid'] = this.fid
this.$router.push({ path: `/recommend`, query })
},
hotLabelClick(fid) {
let query = {
page: 1,
fid
}
this.$router.push({ path: `/recommend`, query })
} }
}, },
components: { components: {
@ -138,13 +59,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.path-box {
margin-bottom: 0.2rem;
}
.paging { .paging {
margin-top: .48rem; margin-top: .48rem;
padding-bottom: 1rem;
::v-deep { ::v-deep {
.el-pagination.is-background .el-pager li:not(.disabled).active { .el-pagination.is-background .el-pager li:not(.disabled).active {
@ -156,25 +72,10 @@ export default {
.el-pagination .btn-prev .el-icon { .el-pagination .btn-prev .el-icon {
font-size: .4rem; font-size: .4rem;
} }
.is-background.el-pagination--small .el-pager li {
border-radius: 50% !important;
} }
.el-pagination.is-background.el-pagination--small .btn-next,
.el-pagination.is-background.el-pagination--small .btn-prev,
.el-pagination.is-background.el-pagination--small .el-pager li {
border-radius: 50%;
}
}
} }
section { section {
padding-top: 0;
height: 10.3333rem; height: 10.3333rem;
} }
</style> </style>

View File

@ -108,11 +108,9 @@ export default {
let kw = this.kw let kw = this.kw
if (!kw) return if (!kw) return
this.page = 1 this.page = 1
this.getSearchResult()
this.$router.push({ path: `/searchResult`, query: { kw: this.kw, page: this.page } }) this.$updateURLSearchParams({ kw: this.kw, page: this.page })
// this.getSearchResult()
// this.$updateURLSearchParams({ kw: this.kw, page: this.page })
}, },
// //