Commit 11c35213 by yanju

Merge branch 'master' of coding.yundingshuyuan.com:pigbigbig/beyond-clouds-front

parents c6c09fa7 4d7102df
......@@ -78,7 +78,7 @@ export default {
search:'/api/topic/search',//检索话题
list:'/api/topics' , //话题列表
postList:'/api/topic/' ,//获取话题下的所有动态 +{topicName}/posts
hotList:'/api/topic/hots',//获取热门动态
hotList:'/api/topic/hots',//获取热门话题
hotSearch:'/api/topic/hotSearch',//获取热搜话题
recommendsPost:'/api/topic/',//获取话题下的推荐动态 +{topicName}/post/recommends
contributes:'/api/topic/',//话题贡献榜 +{topicId}/contributes
......
......@@ -15,7 +15,8 @@
v-if="reload"
></alerts-content>
</div>
<div class="alerts-card__footer" >
<div class="alerts-card__footer">
<nuxt-link to="/personal-center/message">查看全部 ( {{ unread }}</nuxt-link>
</div>
</div>
......
......@@ -46,14 +46,8 @@
<div class="article__content" v-html="articleDetail.content">
</div>
<div class="article__like">
<yun-icon name="like_egg" class="egg"></yun-icon>
<yun-icon name="like1" class="heart"></yun-icon>
<p class="num">122</p>
</div>
<div class="article__footer">
<!-- <p class="link">原文链接:<a target="_blank" :href="articleDetail.link"> <span>{{articleDetail.link}}</span></a></p>-->
<p></p>
<p class="link">本文编辑:<span>{{articleDetail.author}}</span></p>
<p class="report" @click="$router.push({path:'/web/report',query:{type:'news',id:articleDetail.contentId}})">举报</p>
<div class="project" v-if="false">
<p>
......
......@@ -12,10 +12,12 @@
width="816px"
:title="labelTitle"
>
<!--<empty-card v-if="topicList.length === 0" height="556px"></empty-card>-->
<topic-card v-for="(val,index) in topicList" :key="val.topicId" :info="val"></topic-card>
</card-container>
<div class="pagination">
<pagination style="margin: 0 auto;" :pages="pages" v-on:listenPageChange="changePage"></pagination>
<pagination style="margin: 0 auto;" ref="pagination" :pages="pages" v-on:listenPageChange="changePage"></pagination>
</div>
</div>
<div class="topic-container__right">
......@@ -42,9 +44,10 @@ import CardContainer from "../../components/pc/cardContainer";
import Pagination from "../../components/pc/pagination";
import TopicCard from "../../components/pc/topicCard";
import config from '../../action/config';
import EmptyCard from "../../components/pc/emptyCard";
export default {
components: {TopicCard, Pagination, CardContainer, NavWrap},
components: {EmptyCard, TopicCard, Pagination, CardContainer, NavWrap},
data(){
return{
list: [
......@@ -70,7 +73,6 @@ export default {
}
],
topicList:[],
currentPage:1,
pages:1,
hotTopicList:[],
}
......@@ -84,19 +86,20 @@ export default {
});
this.dataGetHotTopic();
},
computed: {
labelTitle: function () {
return this.$route.query.type + '话题'
}
},
mounted(){
watch: {
$route: function (val) {
this.restartPagination();
}
},
methods:{
// 最新的话题列表
dataGetTopicList(currentPage){
this.$axios.$get(config.api.get.Topic.list,{
params:{
page:currentPage,
......@@ -108,6 +111,45 @@ export default {
})
},
// 推荐话题
dataGetRecommendTopicList(currentPage){
this.$axios.$get(config.api.get.Topic.hotSearch,{
params:{
page:currentPage,
size:10
}
}).then((response)=>{
this.topicList = response.data.dataList;
this.pages = response.data.totalPage;
})
},
// 关注的话题
dataGetFollowedTopicList(currentPage) {
this.$axios.$get(config.api.get.Topic.myfollowedList,{
params:{
page:currentPage,
size:10
}
}).then((response)=>{
this.topicList = response.data.records;
this.topicList.forEach(item => {
item.followedTopic = item.userId !== this.$store.state.userProfile.userId;
});
this.pages = response.data.pages;
})
},
// 热门话题
dataGetHotTopicList(currentPage) {
this.$axios.$get(config.api.get.Topic.hotList,{
params:{
page:currentPage,
size:10
}
}).then((response)=>{
this.topicList = response.data.dataList;
this.pages = response.data.totalPage;
})
},
dataGetHotTopic(){
this.$axios.$get(config.api.get.Topic.hotSearch,{
......@@ -119,9 +161,22 @@ export default {
this.hotTopicList = response.data.dataList;
})
},
restartPagination(){
if(process.browser){
this.$refs.pagination.setCurrentPage(1)
}
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetTopicList(currentPage);
if (this.$route.query.type === '最新') {
this.dataGetTopicList(currentPage);
} else if (this.$route.query.type === '热门') {
this.dataGetHotTopicList(currentPage);
} else if (this.$route.query.type === '关注') {
this.dataGetFollowedTopicList(currentPage);
} else if (this.$route.query.type === '推荐') {
this.dataGetRecommendTopicList(currentPage);
}
}
},
}
......
......@@ -195,10 +195,14 @@ export default {
// 注册成功
if (registerResponse !== undefined && registerResponse.code === 0) {
this.success = true;
setTimeout(() => {
if (this.isEmail) {
this.success = true;
setTimeout(() => {
this.$router.push('/users/login');
}, 2500)
} else {
this.$router.push('/users/login');
}, 2500)
}
} else if(registerResponse !== undefined) {
this.errMessage = registerResponse.msg;
// 注册失败
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment