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",
"vue": "^2.6.14",
"vue-router": "^3.5.1",
"vue-sanitize": "^0.2.3",
"vuex": "^3.6.2"
},
"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,
}
},
watch:{
},
mounted() {
this.$store.dispatch('fetchHistoricalSearch') //
this.$store.dispatch('getAllForum', this) //
// this.$store.dispatch('getUserInfo', this) ///
this.$store.dispatch('fetchHistoricalSearch')
this.$store.dispatch('getAllForum', this)
},
}
@ -40,7 +35,7 @@ export default {
flex-direction: column;
margin: 0 auto;
position: relative;
// overflow: hidden;
overflow: hidden;
}
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 {
height: 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-content flexacenter flex1">
<input class="discussion-single-input flex1" cursor-spacing="5" type="text"
:placeholder="twoCommentData ? '写回复…' : '想问啥,大胆问…'" :value="commentContent"
@input="inputCommentContent($event)" />
:placeholder="twoCommentData ? '写回复…' : '想问啥,大胆问…'" v-model="commentContent" />
<img class="discussion-single-input-icom" @click.stop="setValue()"
src="@/assets/img/detail/unfold.png" />
</div>
<div class="discussion-single-btn flexcenter" @click.stop="postComment()">
<div class="discussion-single-btn flexcenter" @click.stop="postComment(commentContent)">
发布
</div>
</div>
@ -33,14 +32,14 @@
<div class="discussion-text one-line">{{ twoCommentData.content }}</div>
</div>
<div class="discussion-multi-content flexflex flex1">
<textarea class="discussion-multi-textarea flex1" type="text" maxlength="500" :value="commentContent"
:placeholder="twoCommentData ? '写回复…' : '想问啥,大胆问…'" @input="inputCommentContent($event)"></textarea>
<textarea class="discussion-multi-textarea flex1" type="text" maxlength="500" v-model="commentContent"
:placeholder="twoCommentData ? '写回复…' : '想问啥,大胆问…'"></textarea>
<img class="discussion-multi-icom" @click.stop="openDiscussionSingle()"
src="@/assets/img/detail/pack.png" />
<div class="discussion-multi-sum">{{ 500 - commentContent.length }}</div>
</div>
<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>
@ -54,26 +53,30 @@ export default {
name: 'DetailReply',
data() {
return {
commentContent: "",
openDiscussionSingleState: true, //
};
},
props: ["twoCommentData", "popState", "commentContent"],
props: ["twoCommentData", "popState"],
mounted() {
// console.log("");
console.log("子组件");
},
methods: {
//
postComment() {
this.$parent.postComment()
postComment(commentContent) {
this.$parent.postComment(commentContent)
},
//
handlePopCancel() {
console.log(this.$parent.popState, "this.$parent.popState");
this.$parent.twoCommentData = null
this.$parent.popState = ""
},
//
@ -95,11 +98,6 @@ export default {
}, 500);
},
inputCommentContent(event) {
let value = event.currentTarget.value
this.$parent.commentContent = value
}
},
};

View File

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

View File

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

View File

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

View File

@ -6,14 +6,8 @@ Vue.use(Vuex)
export default new Vuex.Store({
state: {
historicalSearch: [],
allForumList: [], // 全部板块数据
homeRequestState: false, // 首页推荐和收藏接口的数据请求状态 这个是是否需要发送请求,因为用户点击收藏后需要重新获取
getUserInfoState: false, // 这个是是否在请求状态
favoriteList: [],
recommendList: [],
user: {}, // 用户信息
hotSearchkeywords: [], // 热门搜索
loading: null,
allForumList: [{}], // 全部板块数据
},
getters: {
},
@ -32,30 +26,6 @@ export default new Vuex.Store({
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: {
@ -67,7 +37,6 @@ export default new Vuex.Store({
// 获取全部板块的数据
getAllForum({ commit }, that) {
// getAllForum(commit, that) {
that.$startupUnderLoading(that)
that.$http.get("/api/home/allForum").then(res => {
if (res.code != 200) return;
@ -79,39 +48,10 @@ export default new Vuex.Store({
}).finally(() => {
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: {

View File

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

View File

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

View File

@ -3,7 +3,7 @@
<header-nav :issearch="true" :needgetuser="true">
<template slot="header-title">帖子详情</template>
</header-nav>
<router-view :key="key" />
<router-view></router-view>
</div>
</template>
@ -18,11 +18,6 @@ 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" @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-item flexacenter">
<img class="detail-data-eye" src="@/assets/img/detail/eye.png">{{ info.views }}
@ -18,7 +18,6 @@
{{ info.subject }}
</div>
<!-- -->
<div class="card flexcenter">
<div class="card-item shadow" v-if="postList.page == 1">
@ -100,7 +99,7 @@
<template v-else-if="type == 3">
<div class="offer-content">
<div class="offer-content-box">
<div class="offer-content-box" v-if="tenementInfoState">
<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>
@ -113,20 +112,15 @@
</template>
</div>
<div v-html="info.message" class="vHtmlMessage" style="margin: .52rem 0;">
<div v-html="info.message" class="vHtmlMessage" style="">
</div>
<img class="tenement-img" v-for="(item, index) in info.images" :key="index" :src="item">
</div>
</template>
<template v-else>
<div class="offer-content">
<!-- <div v-html="info.message" style="line-height: normal;" class="vHtmlMessage"></div> -->
<!-- <div style="line-height: normal;" ref="vHtmlMessage" class="vHtmlMessage">{{ info.message }}</div> -->
<div style="line-height: normal;" ref="vHtmlMessage" class="vHtmlMessage"></div>
<div v-html="info.message" style="line-height: normal;" class="vHtmlMessage">
</div>
</div>
</template>
</div>
@ -137,7 +131,9 @@
<img class="card-head-icon" :src="item.avatar" />
<div class="card-head-content flex1 flexflex">
<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 class="card-head-time">{{ $formattedDate(item.dateline) }}</div>
</div>
@ -146,13 +142,10 @@
index + 2}` }}</div>
<div class="card-head-fool" v-else>{{ `${(postList.page - 1) * postList.limit + index + 1}` }}
</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>
<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">
@ -289,7 +282,12 @@
<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="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>
<img v-if="info.islike == 0" class="bottom-operation-icom"
@ -298,7 +296,7 @@
<img v-else class="bottom-operation-icom"
:class="{ 'prepareLiskeAnimateState': prepareLiskeAnimateState }"
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 class="bottom-operation-item flex1 flexcolumn flexcenter"
@click="tapOperate(info.isfav == 0 ? 'collect' : 'uncollect')">
@ -317,8 +315,7 @@
</div>
</div>
<detail-reply :two-comment-data="twoCommentData" :comment-content="commentContent"
:pop-state="popState"></detail-reply>
<detail-reply :two-comment-data="twoCommentData" :pop-state="popState"></detail-reply>
<coins :coin-config="coinConfig" :pop-state="popState"></coins>
</div>
@ -327,7 +324,6 @@
<script>
import DetailReply from '@/components/DetailReply'
import Coins from '@/components/unlock/Coins'
export default {
name: 'detailIndex',
data() {
@ -336,7 +332,7 @@ export default {
// avatar: "https://oss.gter.net/avatar/97KwEWANd_4DHWiY6VbnSUFSCKroYWFjYQ~~/middle",
// content: "",
// },
popState: "", // discussionSingle discussionMulti
popState: "",
coinConfig: {
strategy: {
button: "攒币指南",
@ -460,18 +456,12 @@ export default {
loading: null, //
commentContent: "", //
operateState: false, //
};
},
mounted() {
this.tid = this.$route.query['tid']
this.postList.page = this.$route.query['page'] || 1
this.getDetail()
window.scrollTo(0, 0);
},
methods: {
@ -484,42 +474,14 @@ export default {
if (res.code != 200) return
let data = res.data
let info = data.info
const reg = new RegExp("\r\n", "g")
info['message'] = info['message'].replaceAll(reg, '<br/>')
info['message'] = info['message'].replace(/<img[^>]*>/g, (match) => {
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.type = data.type
@ -529,8 +491,7 @@ export default {
else if (this.type == 5) this.getsummaryDetails()
else if (this.type == 3) this.getTenementDetails()
else if (this.type == 2) this.getInterviewDetails()
info['ispost'] != 0 ? this.getPostList() : ''
this.getPostList()
}).finally(() => {
this.$closeUnderLoading(this)
@ -545,6 +506,7 @@ export default {
let data = res.data
// let offerinfo = data.offerinfo
let offerinfo = data.collegelist[0]
console.log("offerinfo", offerinfo);
let useperformanceStr = ""
offerinfo.useperformance && offerinfo.useperformance.forEach((el, index) => {
useperformanceStr += el + (offerinfo.useperformance.length - 1 == index ? '' : '、')
@ -554,6 +516,7 @@ export default {
// offerinfo['schoolname'] = offerinfo.school.name
this.offerinfo = offerinfo
// this.shareurl = data.shareurl
})
},
@ -575,15 +538,17 @@ export default {
this.info = { ...this.info, ...data.info }
console.log(this.info);
this.collegelist = collegelist
this.shareurl = data.shareurl
})
},
//
// 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 => {
@ -611,6 +576,7 @@ export default {
const reg = new RegExp("\r\n", "g")
info['message'] = info['message'].replaceAll(reg, '<br/>')
info['message'] = info['message'].replace(/<img[^>]*>/g, (match) => {
console.log("match", match);
return match.replace(/width="[^"]*"/g, '').replace(/height="[^"]*"/g, '');
});
@ -621,16 +587,16 @@ export default {
//
getInterviewDetails() {
// https://app.gter.net/InterviewExperience/thread
this.$http.post("/InterviewExperience/thread", {
// token: this.token,
// tid: this.tid
// tid: 2322145,
// uniqid: "--G1tS2SCTOQyoOMiedlLKxTnFvHWjBwQezsJjvVJFwgqOtOFeYr4_LAAG5RV37ETvMl2Zd4tSCc-_dqeKpERxXsx-tPfXrUs0kUysTGLzgxYzU~",
// token: "5e3c42209eebfbab66e6f0d6c70a53c7",
token: this.token
tid: 2322145,
uniqid: "--G1tS2SCTOQyoOMiedlLKxTnFvHWjBwQezsJjvVJFwgqOtOFeYr4_LAAG5RV37ETvMl2Zd4tSCc-_dqeKpERxXsx-tPfXrUs0kUysTGLzgxYzU~",
token: "5e3c42209eebfbab66e6f0d6c70a53c7",
}, "tenement").then(res => {
// console.log(res);
console.log(res);
if (res.code != 200) return
let data = res.data
this.info = { ...this.info, ...data }
@ -657,60 +623,24 @@ export default {
},
//
handleReplyPop(item) {
// console.log(item);
this.popState = "discussionSingle"
},
//
postComment(message) {
this.$http.post("/api/operation/reply", {
token: this.token,
message: this.commentContent
message
}).then(res => {
if (res.code != 200) return
// 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 })
console.log(res);
})
},
//
currentChange() {
// this.getPostList()
let query = {
page: this.postList.page,
tid: this.tid
}
this.$router.push({ path: `/detailIndex`, query })
this.getPostList()
},
//
tapOperate(key) {
// like collect uncollect
if (this.operateState) return
this.operateState = true
let url = ""
if (key == "like") url = "/api/operation/threadLike"
@ -720,13 +650,11 @@ export default {
this.$http.post(url, { tid: this.tid }).then(res => {
console.log(res);
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 == "uncollect") this.info.isfav = 0
this.$message.success(res.message)
}).finally(() => {
this.operateState = false
})
},
@ -744,19 +672,7 @@ export default {
//
postcollect() {
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);
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 {
color: #333;
@ -925,13 +827,6 @@ export default {
padding: .5rem .32rem;
word-break: break-word;
/deep/ {
img {
width: 100% !important;
height: auto !important;
}
}
.quotation {
width: 100%;
color: #333;
@ -967,7 +862,6 @@ export default {
}
}
/deep/ {
.content-unlock {
&.content-unlock-no {
height: 3.2rem;
@ -976,7 +870,6 @@ export default {
width: .64rem;
height: .64rem;
margin-right: 0.2rem;
vertical-align: middle;
}
}
@ -1009,7 +902,7 @@ export default {
}
}
}
}
@ -1022,65 +915,13 @@ export default {
line-height: .6rem;
word-break: break-word;
/deep/ {
strong {
/deep/ strong {
font-weight: bold;
}
img {
/deep/ img {
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 {

View File

@ -7,7 +7,7 @@
</div>
<div class="allSections-right">
<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-title">{{ i.name }}</div>
<div v-if="i.description" class="item-text" v-html="i.description.replace(/<[^>]+>/g, '')"></div>
@ -37,9 +37,8 @@
</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"
:current-page.sync="invitationPage" :page-size="invitationLimit" :total="invitationCount">
</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() {
this.$store.subscribe((mutation, state) => {
if (mutation.type == "setAllForumList") this.list = this.$store.state.allForumList
@ -96,22 +84,26 @@ export default {
if (twofid) this.twofid = twofid
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()
},
methods: {
// query
handQuery() {
a() {
if (this.list.length >= 2) {
let list = this.list
console.log("list", list);
list.forEach((el, index) => {
// console.log(this.twofid);
if (el.fid == this.onefid) this.allActive = index
if (this.twofid) {
el.data.forEach((element, i) => {
console.log(element, i);
if (element.fid == this.twofid) {
this.plate = {
stairname: el.name,
@ -124,9 +116,11 @@ export default {
})
console.log(this.onefid, "onefidonefid");
} else {
setTimeout(() => {
this.handQuery()
this.a()
}, 500)
}
@ -138,7 +132,10 @@ export default {
allClick(index, fid) {
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()
}).finally(() => {
this.postCollectionState = false
this.$store.commit('setHomeRequestState', false)
this.$store.dispatch('getUserInfo', this)
})
},
@ -180,7 +175,7 @@ export default {
//
getInvitationList() {
this.$startupUnderLoading(this)
this.$http.get("/api/home/threadList", {
this.$http.post("/api/home/threadList", {
page: this.invitationPage,
limit: this.invitationLimit,
fid: this.twofid
@ -241,15 +236,6 @@ export default {
overflow-y: auto;
overflow-x: hidden;
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
-webkit-overflow-scrolling: touch;
&::-webkit-scrollbar {
display: none;
}
span {
height: 1.28rem;
line-height: 1.28rem;

View File

@ -2,44 +2,45 @@
<!-- 收藏版块 -->
<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="未收藏" />
<div class="collect-text">收藏你感兴趣的版块迅速浏览相应的帖子</div>
<!-- <div class="collect-btn"> -->
<router-link to="/allSections" class="flexcenter collect-btn">
<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 > 1">
<div class="hot-label" :class="{ active: fid == item.fid }" v-for="(item, index) in favoriteHeadList" :key="index"
@click="hotLabelClick(item.fid)">
{{ item.name }}
<div class="hot-box">
<div class="hot-label" :class="{ active: hotActive == index }" v-for="(item, index) in list" :key="index"
@click="hotLabelClick(index)">
{{ item.label }}
</div>
<!-- 设置按钮 -->
<div class="setting flexcenter" @click="settingClick">
<img src="~assets/img/icon/setting.png" alt="设置" />
设置
</div>
<!-- 设置 收藏版块弹窗 -->
<div class="setting-window" :class="{ 'setting-show': settingShow == true }" @click="settingClose">
<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> {{ list.length - 1 }} </b>个版块</div>
<router-link to="/allSections" class="flexcenter setting-add">
<svg-icon icon-class="settingAdd" class-name="setting-add-img"></svg-icon>添加
</router-link>
</div>
<!-- 弹窗收藏版块内容 -->
<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-title">{{ item.name }}</div>
<div v-for="(item, index) in list" :key="index">
<div v-if="index != 0" class="setting-item" @click.stop="cancelFavoritesSection(index)">
<div class="setting-item-title">{{ item.label }}</div>
<div class="setting-star"></div>
</div>
</div>
@ -49,24 +50,12 @@
</div>
</div>
</div>
<!-- 路径 -->
<template v-if="fid != 0">
<plate-navigation :stairname="plate.stairname" :subsectionsname="plate.subsectionsname"></plate-navigation>
</template>
<plate-navigation stairname="寄托学术类备" subsectionsname="SAT、AP考试、海外本科申…"></plate-navigation>
<!-- 内容区域 -->
<section>
<template v-if="favorite.list.length != 0 || loading">
<index-list :list="favorite.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>
<!-- <index-list :list=""></index-list> -->
<index-list></index-list>
</section>
</div>
</div>
@ -80,146 +69,37 @@ export default {
name: "Collect",
data() {
return {
allForumList: [], //
favoriteHeadList: [],
// {
// name: "",
// fid: 0
// }],
favoriteHeadIdList: [],
// favoriteHeadIdList: this.$store.state.favoriteList,
fid: 0, //
hotActive: 0, //
collect: [1],
settingShow: false, //
settingStar: false,
plate: {
stairname: "",//
subsectionsname: "",//
list: [
//
{
label: "全部",
},
favorite: { //
list: [],
limit: 20,
page: 1,
count: 0
{
label: "香港留学",
},
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() {
let { page, fid } = this.$route.query
if (page) this.favorite.page = Number(page)
if (fid) this.fid = fid
this.init()
},
components: {
plateNavigation,
indexList
},
methods: {
init() {
let { homeRequestState, favoriteList } = this.$store.state
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 })
hotLabelClick(index) {
this.hotActive = index;
},
//
settingClick() {
@ -230,33 +110,11 @@ export default {
this.settingShow = false;
},
//
cancelFavoritesSection(fid, index) {
let url = "/api/operation/unforumFav"
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()
})
cancelFavoritesSection(index) {
this.list.splice(index, 1)
}
},
components: {
plateNavigation,
indexList
},
};
</script>
@ -456,7 +314,6 @@ export default {
.paging {
margin-top: .48rem;
padding-bottom: 1rem;
::v-deep {
.el-pagination.is-background .el-pager li:not(.disabled).active {

View File

@ -34,25 +34,20 @@ export default {
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() {
this.init()
},
components: {
HeaderNav,
},
methods: {
init() {
this.$http.post("/api/home").then(res => {
let data = res.data
this.favorite = data.favorite
this.recommend = data.recommend
})
},
}
};
</script>

View File

@ -2,21 +2,14 @@
<div class="recommend">
<!-- 热门版块 -->
<div class="hot-box">
<div class="hot-label" :class="{ 'active': item.fid == fid }" v-for="(item, index) in hotList" :key="index"
@click="hotLabelClick(item.fid)">{{ item.name }}</div>
<div class="hot-label" :class="{ 'active': hotActive == index }" v-for="(item, index) in list" :key="index"
@click="hotLabelClick(index)">{{ item.label }}</div>
</div>
<!-- 路径 -->
<plate-navigation v-if="fid != 0" :stairname="plate.stairname"
:subsectionsname="plate.subsectionsname"></plate-navigation>
<plate-navigation stairname="香港澳门台湾" subsectionsname="SAT、AP考试、海外本科申…"></plate-navigation>
<section>
<template v-if="list.length != 0 || loading">
<index-list :list="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 v-if="list.length == 0">
<index-list></index-list>
</template>
<div class="result-empty-box flexcenter shadow" v-else>
<img class="result-empty-icon" src="@/assets/img/icon/empty.png">
@ -32,102 +25,30 @@ export default {
name: "Recommend",//
data() {
return {
hotList: [],
list: [],
count: 0, //
limit: 20, //
page: 1, //
fid: 0, // id
plate: {
stairname: "",//
subsectionsname: "",//
hotActive: -1,//
list: [
{
label: "香港留学"
},
loading: null,
allForumList: this.$store.state.allForumList || [],
{
label: "香港留学"
},
{
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() {
let { page, fid } = this.$route.query
if (page) this.page = Number(page)
if (fid) {
this.fid = fid
this.handleForumFid()
}
this.init()
console.log(this.$parent);
},
methods: {
init() {
this.$startupUnderLoading(this)
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 })
hotLabelClick(index) {
this.hotActive = index
}
},
components: {
@ -138,13 +59,8 @@ export default {
</script>
<style lang="scss" scoped>
.path-box {
margin-bottom: 0.2rem;
}
.paging {
margin-top: .48rem;
padding-bottom: 1rem;
::v-deep {
.el-pagination.is-background .el-pager li:not(.disabled).active {
@ -156,25 +72,10 @@ export default {
.el-pagination .btn-prev .el-icon {
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 {
padding-top: 0;
height: 10.3333rem;
}
</style>

View File

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