Commit b11ab630 by yanju

完善粉丝卡片, 个人中心我关注的话题

parent d48cebfd
......@@ -42,6 +42,7 @@ export default {
this.$emit(config.event.listenCardConLabel,1)
},
moreFunc(){
this.$emit(config.event.listenCardConMore,1)
},
......
......@@ -25,7 +25,7 @@
</div>
</div>
<div class="fan-card__right" v-if="!isBlacklist">
<yun-icon class="icon-menu" v-if="info.userId===$store.state.userProfile.userId" name="down_arrow" size="8px" @mouseover.native="changeStateMenu1" @mouseleave.native="changeStateMenu2"></yun-icon>
<yun-icon class="icon-menu" v-if="!from" name="down_arrow" size="8px" @mouseover.native="changeStateMenu1" @mouseleave.native="changeStateMenu2"></yun-icon>
<transition name="fade">
<div class="fan-card__right-menu" @mouseover="changeStateMenu1" @mouseleave="changeStateMenu2" v-if="showMenu">
<ul >
......@@ -66,7 +66,11 @@ export default {
props:{
info:Object,
cardType:String
cardType:String,
from:{
type:String,
default:''
}
},
created(){
......
......@@ -46,7 +46,7 @@
if (this.$route.query.type) {
this.isBlue = this.$route.query.type===this.labelId;
} else {
// this.isBlue = this.$route.path.indexOf(this.navAddress) !== -1;
this.isBlue = this.$route.path.indexOf(this.navAddress) !== -1 &&this.$route.path.indexOf('personal-center') !== -1;
}
},
watch:{
......@@ -54,7 +54,7 @@
if (this.$route.query.type) {
this.isBlue = this.$route.query.type===this.labelId;
} else {
// this.isBlue = this.$route.path.indexOf(this.navAddress) !== -1;
this.isBlue = this.$route.path.indexOf(this.navAddress) !== -1 &&this.$route.path.indexOf('personal-center') !== -1;
}
}
},
......
......@@ -184,9 +184,7 @@
},
created(){
if(this.initWord){
this.releaseWord ='#'+ this.initWord +'#';
}
if(process.browser){
document.addEventListener('click',(e)=>{
if(this.$refs.topicCard){
......@@ -388,10 +386,14 @@
})
},
dataPostContent(){
if(this.initWord){
this.releaseWord ='#'+ this.initWord +'#'+this.releaseWord;
}
let postFrom = {
"content": this.releaseWord,
};
if(this.imgArr.length>0){
postFrom.pictures = this.imgArr;
}
......
......@@ -44,57 +44,43 @@
{
label: '推荐',
address: '/dynamic',
id: '推荐'
type: '推荐'
},
{
label: '热门',
address: '/dynamic',
id: '热门'
type: '热门'
},
{
label: '关注',
address: '/dynamic',
id: '关注'
type: '关注'
},
{
label: '我的',
address: '/dynamic',
id: '我的'
type: '我的'
},
{
label: '文字',
address: '/dynamic',
id: '文字'
type: '文字'
},
{
label: '视频',
address: '/dynamic',
id: '视频'
type: '视频'
},
{
label: '图片',
address: '/dynamic',
id: '图片'
},
{
label: '项目',
address: '/dynamic',
id: '项目'
},
{
label: '代码',
address: '/dynamic',
id: '代码'
},
type: '图片'
}
],
postList:[],
pages:1,
......@@ -111,7 +97,7 @@
this.$router.replace({
path: '/dynamic',
query: {
id: '推荐'
type: '推荐'
}
});
......
......@@ -9,6 +9,19 @@
<div class="bottom-container">
<div class="bottom-left">
<user-card from="my" :userId="this.$store.state.userProfile.userId"></user-card>
<card-container v-if="myTopicList.length>0" style="margin-top: 16px" title="我创建的话题" @listenCardConMore="$router.push({path:'/personal-center/home/topic',query:{type:'my'}})" more="更多">
<nuxt-link tag="div" :to="'/topic/detail/'+val.topicName" class="topic-content__c" v-for="(val,index) in myTopicList" :key="val.topicId" >
<p>#{{val.topicName}}#</p>
<h6>{{val.referenceCount}}</h6>
</nuxt-link>
</card-container>
<card-container v-if="noticeTopicList.length>0" style="margin-top: 16px" title="我关注的话题" @listenCardConMore="$router.push({path:'/personal-center/home/topic',query:{type:'notice'}})" more="更多">
<nuxt-link tag="div" :to="'/topic/detail/'+val.topicName" class="topic-content__c" v-for="(val,index) in noticeTopicList" :key="val.topicId" >
<p>#{{val.topicName}}#</p>
<h6>{{val.referenceCount}}</h6>
</nuxt-link>
</card-container>
</div>
<div class="bottom-right">
<div class="bottom-right__tab">
......@@ -71,12 +84,14 @@
import ProjectCard from '../../components/pc/projectCard';
import CardContainer from '../../components/pc/cardContainer';
import PageFooter from '../../components/pc/pageFooter';
import config from "../../action/config";
export default {
layout: 'only-header',
data(){
return{
labelList: ['我的消息','私信'],
userId:'',
myTopicList:[],
noticeTopicList:[],
// selected: this.$route.name
}
},
......@@ -86,32 +101,54 @@
watch:{
$route(to,from){
this.myTopicList = [];
this.noticeTopicList = [];
if(this.$route.name){
this.selected = this.$route.name
this.selected = this.$route.name;
if(this.$route.name==='personal-center-home-topic'&&this.$route.query.type==='my'){
this.dataGetNoticeTopic();
}
if(this.$route.name==='personal-center-home-topic'&&this.$route.query.type==='notice'){
this.dataGetMyTopic();
}
}
}
},
created(){
this.selected = this.$route.name;
if(this.$route.name==='personal-center-home-topic'&&this.$route.query.type==='my'){
this.dataGetNoticeTopic();
}
if(this.$route.name==='personal-center-home-topic'&&this.$route.query.type==='notice'){
this.dataGetMyTopic();
}
},
methods:{
showAlert(){
// $alert 使用方法
this.$alert('确认清空消息列表?', '', {
confirmButtonText: '确定',
// callback: action => {
// this.$message({
// type: 'info',
// message: `action: ${ action }`,
// confirmButtonPosition: 'left',
// });
// }
});
dataGetMyTopic(){
this.$axios.$get(config.api.get.Topic.myList, {
params: {
page: 1,
size: 10
}
}).then((response) => {
this.myTopicList = response.data.dataList;
})
},
dataGetNoticeTopic(){
this.$axios.$get(config.api.get.Topic.myfollowedList,{
params:{
page:1,
size:10
}
}).then((response)=>{
this.noticeTopicList = response.data.records;
})
},
......@@ -174,6 +211,29 @@
.bottom-left{
width:302*$length;
.topic-content__c{
@extend %flex-row-spb;
@extend %cursorPointer;
padding:0 16*$length;
box-sizing: border-box;
margin-top:20*$length;
p{
width:190*$length;
@include fontStyle(12,16,500,#333,left);
@extend %nowrap;
@extend %animate-transition;
&:hover{
color:#00AAE6
}
}
h6{
@include fontStyle(12,16,500,#ccc,left);
@extend %nowrap;
}
}
}
.bottom-right{
width:938*$length;
......
<template>
<div>
<card-container key="container3" style="margin-top: 16px" :title="rightConTitle" label="换一换">
<card-container key="container3" style="margin-top: 16px" :title="rightConTitle" >
<answer-card v-if="rightList.length>0" :isMy="true" v-for="(val,index) in rightList" :key="val.questionId" :info="val"></answer-card>
<empty-card v-if="rightList.length===0" height="556px"></empty-card>
......
<template>
<div>
<card-container key="container3" style="margin-top: 16px" :title="rightConTitle" label="换一换">
<card-container key="container3" style="margin-top: 16px" :title="rightConTitle" >
<blog-card :isMy="true" v-if="rightList.length>0" v-for="(val,index) in rightList" :key="val.blogId" :info="val"></blog-card>
<empty-card v-if="rightList.length===0" height="556px"></empty-card>
......
<template>
<div>
<card-container key="container3" style="margin-top: 16px" :title="rightConTitle" label="换一换">
<card-container key="container3" style="margin-top: 16px" :title="rightConTitle" >
<project-card @listenProjectCardUpdate="dataGetProject(1)" :isMy="true" v-if="rightList.length>0" v-for="(val,index) in rightList" :key="val.projectId" :info="val"></project-card>
<empty-card v-if="rightList.length===0" height="556px"></empty-card>
......
<template>
<div>
<div>
<card-container key="container3" style="margin-top: 16px" :title="rightConTitle" label="换一换">
<card-container key="container3" style="margin-top: 16px" :title="rightConTitle">
<topic-card v-if="rightList.length>0" v-for="(val,index) in rightList" :key="val.topicId" :info="val"></topic-card>
<empty-card v-if="rightList.length===0" height="556px"></empty-card>
......@@ -35,7 +35,7 @@
return '我创建的话题'
}
if(this.$route.query.type==="notice"){
return '我参与的话题'
return '我关注的话题'
}
}, },
components:{
......@@ -43,8 +43,6 @@
},
methods:{
dataGetMyTopic(currentPage){
if(this.$store.state.userProfile.userId===this.$route.query.user) {
this.$axios.$get(config.api.get.Topic.myList, {
params: {
page: currentPage,
......@@ -54,7 +52,6 @@
this.rightList = response.data.dataList;
this.pages = response.data.totalPage;
})
}
},
dataGetNoticeTopic(currentPage){
......
......@@ -11,7 +11,7 @@
<p style="color:#6d61bee8">找不到该话题</p>
</div>
</div>
<input ref="searchInput" type="text" v-model="searchWord"/>
<input ref="searchInput" placeholder="请输入话题名称" type="text" v-model="searchWord"/>
<div class="icon-box">
<yun-icon name="search"></yun-icon>
</div>
......@@ -82,45 +82,44 @@
list: [
{
label: '推荐',
address: '/topic/detail',
address: this.$route.path,
type: '推荐'
},
{
label: '热门',
address: '/topic/detail',
address: this.$route.path,
type: '热门'
},
{
label: '关注',
address: '/topic/detail',
address: this.$route.path,
type: '关注'
},
{
label: '我的',
address: '/topic/detail',
address: this.$route.path,
type: '我的'
},
{
label: '文字',
address: '/topic/detail',
address: this.$route.path,
type: '文字'
},
{
label: '视频',
address: '/topic/detail',
address: this.$route.path,
type: '视频'
},
{
label: '图片',
address: '/topic/detail',
address: this.$route.path,
type: '图片'
},
}
],
topicCardInfo:{},
postList:[],
......@@ -140,7 +139,7 @@
this.$router.replace({
path: this.$route.path,
query: {
id: '推荐'
type: '推荐'
}
});
......@@ -210,11 +209,6 @@
this.dataGetDynamic(currentPage);
},
dataGetOwner(id){
this.$axios.$get(config.api.get.User.otherInfo+id+'/baseinfo').then((response)=>{
this.ownerInfo= response.data;
})
},
dataGetUsers(id){
this.$axios.$get(config.api.get.Topic.topicFollowerList+id+'/follower',{
......
......@@ -50,22 +50,22 @@ export default {
{
label: '推荐',
address: '/topic',
id: '推荐'
type: '推荐'
},
{
label: '热门',
address: '/topic',
id: '热门'
type: '热门'
},
{
label: '关注',
address: '/topic',
id: '关注'
type: '关注'
},
{
label: '最新',
address: '/topic',
id: '最新'
type: '最新'
}
],
topicList:[],
......@@ -78,7 +78,7 @@ export default {
this.$router.replace({
path: '/topic',
query: {
id: '推荐'
type: '推荐'
}
});
......@@ -87,7 +87,7 @@ export default {
},
computed: {
labelTitle: function () {
return this.$route.query.id + '话题'
return this.$route.query.type + '话题'
}
},
mounted(){
......
......@@ -89,7 +89,7 @@
<transition name="fade-transform" mode="out-in">
<div v-if="selected==='fans'" style="margin-top:16px">
<card-container key="container3" style="margin-top: 16px" :title="rightConTitle" >
<fan-card v-for="(val,index) in rightList" :key="val.userId" :info="val"></fan-card>
<fan-card from="other" v-for="(val,index) in rightList" :key="val.userId" :info="val"></fan-card>
<empty-card v-if="rightList.length===0" height="556px"></empty-card>
<pagination key="container5" style="margin:20px auto;" :pages="pages" v-on:listenPageChange="changePage"></pagination>
</card-container>
......@@ -100,7 +100,7 @@
<div v-if="selected==='following'" style="margin-top:16px">
<card-container key="container3" style="margin-top: 16px" :title="rightConTitle" >
<fan-card v-for="(val,index) in rightList" :key="val.userId" :info="val"></fan-card>
<fan-card from="other" v-for="(val,index) in rightList" :key="val.userId" :info="val"></fan-card>
<empty-card v-if="rightList.length===0" height="556px"></empty-card>
<pagination key="container5" style="margin:20px auto;" :pages="pages" v-on:listenPageChange="changePage"></pagination>
</card-container>
......
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