个人主页

This commit is contained in:
zhaofang
2022-09-21 16:05:51 +08:00
parent 933fd7e191
commit cbffa341e2
17 changed files with 463 additions and 64 deletions

View File

@@ -31,11 +31,11 @@
<div style="padding-top:16px">
<p class="ach-title">可能感兴趣</p>
<ul>
<li class="ava-info" v-for="ava in 3">
<img src="/images/Avatarwoman.png" />
<li class="ava-info" v-for="ava in interestedList" :key="ava.aid">
<img :src="baseUrl + ava.avatar" />
<div class="ava-text">
<p style="color: #333333;">王明</p>
<p style="color: #666666;">你必须非常努力才能看起来毫不费力</p>
<p style="color: #333333;">{{ava.name}}</p>
<p style="color: #666666;">{{ava.sign}}</p>
</div>
</li>
</ul>
@@ -51,31 +51,49 @@
import MedalImg from '@/components/Portal/medalImg.vue';
import apiStat from '@/api/phase2/stat.js';
import apiUserhobby from '@/api/phase2/userhobby.js';
import apiUser from "@/api/system/user.js";
import apiFollow from "@/api/phase2/userfollow.js";
import { mapGetters } from 'vuex';
export default{
components:{top,UcHeader,MedalImg},
data(){
return{
baseUrl:process.env.VUE_APP_FILE_BASE_URL,
input:'',
activeName:'first',
pageId:'',
medalList:[]
medalList:[],
interestedList:[]
}
},
mounted() {
this.pageId = this.$route.query.id;
this.pageId = this.$route.query.id;
this.getMedal();
this.userhobbyInfo();
this.getFollow();
},
methods:{
getFollow(){
apiFollow.counts(this.pageId).then(res=>{
if(res.status == 200) {
}
})
},
userhobbyInfo() {
apiUserhobby.info(this.pageId).then(res=>{
// if() {
apiUserhobby.list(res.result).then(res=>{
})
// }
if(res.status == 200) {
let ids = res.result.map(item=>item.aid);
const noReapetIds = [...new Set(ids)];
apiUser.getByIds(noReapetIds).then(res => {
if (res.status == 200) {
this.interestedList = res.result;
} else {
this.$message.error(res.message);
}
});
}
})
},
getMedal() {

View File

@@ -8,31 +8,39 @@
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane name="">
<span slot="label"><svg-icon icon-class="home-dynamic" style="font-size: 30px;"></svg-icon> <span class="tabs-info">动态</span></span>
动态
<template v-for="item in allPageList">
<course-list v-if="item.contentType == 1" :list="[item]" :isDynamic="true" :personal="personal"></course-list>
<case-list v-if="item.contentType == 3" :list="[item]" :isDynamic="true" :personal="personal"></case-list>
<note-list v-if="item.contentType == 6" :list="[item]" :isDynamic="true" :personal="personal"></note-list>
<put-list v-if="item.contentType == 4" :list="[item]" :isDynamic="true" :personal="personal"></put-list>
<answer-list v-if="item.contentType == 5" :list="[item]" :isDynamic="true" :personal="personal"></answer-list>
<article-list v-if="item.contentType == 2" :list="[item]" :isDynamic="true" :personal="personal"></article-list>
</template>
</el-tab-pane>
<el-tab-pane name="1">
<span slot="label"><svg-icon icon-class="home-course" style="font-size: 30px;"></svg-icon><span class="tabs-info">课程</span></span>
<course-list :list="cousrePageList"></course-list>
<course-list :list="cousrePageList" :isDynamic="false" :personal="personal"></course-list>
</el-tab-pane>
<el-tab-pane name="3">
<span slot="label"><svg-icon icon-class="home-case" style="font-size: 30px;"></svg-icon><span class="tabs-info">案例</span></span>
<case-list :list="casePageList"></case-list>
<case-list :list="casePageList" :isDynamic="false" :personal="personal"></case-list>
</el-tab-pane>
<el-tab-pane name="6">
<span slot="label"><svg-icon icon-class="home-note" style="font-size: 30px;"></svg-icon><span class="tabs-info">笔记</span></span>
<note-list :list="notePageList"></note-list>
<note-list :list="notePageList" :isDynamic="false" :personal="personal"></note-list>
</el-tab-pane>
<el-tab-pane name="4">
<span slot="label"><svg-icon icon-class="home-qa" style="font-size: 30px;"></svg-icon><span class="tabs-info">提问</span></span>
<put-list :list="qaPageList"></put-list>
<put-list :list="qaPageList" :isDynamic="false" :personal="personal"></put-list>
</el-tab-pane>
<el-tab-pane name="5">
<span slot="label"><svg-icon icon-class="home-answer" style="font-size: 30px;"></svg-icon><span class="tabs-info">回答</span></span>
<answer-list :list="answerPageList"></answer-list>
<answer-list :list="answerPageList" :isDynamic="false" :personal="personal"></answer-list>
</el-tab-pane>
<el-tab-pane name="2">
<span slot="label"><svg-icon icon-class="home-article" style="font-size: 30px;"></svg-icon><span class="tabs-info">文章</span></span>
<article-list :list="articlePageList"></article-list>
<article-list :list="articlePageList" :isDynamic="false" :personal="personal"></article-list>
</el-tab-pane>
<el-tab-pane name="7">
<span slot="label"><svg-icon icon-class="home-follow" style="font-size: 30px;"></svg-icon><span class="tabs-info">关注</span></span>
@@ -76,14 +84,15 @@
import apiCases from '@/api/modules/cases.js'
import apiQa from '@/api/modules/qa.js'
import apiNote from '@/api/phase2/note.js'
import { mapGetters } from 'vuex';
import { mapGetters,mapActions } from 'vuex';
import apiUser from "@/api/system/user.js";
import {cutFullName} from "@/utils/tools.js";
import apiDict from "@/api/modules/dict.js";
export default{
components:{top,UcHeader,CaseList,CourseList,NoteList,PutList,AnswerList,ArticleList,FollowList,BookList},
computed: {
...mapGetters(['userInfo']),
...mapGetters(['userInfo','majorTypeMap','orgDomainMap']),
},
data(){
return{
@@ -95,20 +104,34 @@
input:'',
activeName:'',
pageId:'',
pageList:[],
// pageList:[],
casePageList:[],
notePageList:[],
articlePageList:[],
qaPageList:[],
answerPageList:[],
cousrePageList:[],
allPageList:[],
personal:false,
orgData:[],
Profess:[]
}
},
mounted() {
this.pageId = this.$route.query.id;
this.getList();
if(this.pageId == this.userInfo.aid) {
this.personal = true;
}
this.loadMajorType();
this.loadOrgDomain();
console.log(this.orgDomainMap,'orgDomainMap');
},
methods:{
...mapActions({
loadMajorType:'majorType/loadMajorTypes',
loadOrgDomain:'orgDomain/loadOrgDomains'
}),
handleSizeChange(val) {
this.page.pageSize = val;
this.page.pageIndex = 1;
@@ -122,9 +145,9 @@
let data = {
pageIndex:this.page.pageIndex,
pageSize:this.page.pageSize,
contentType:this.activeName,//内容类型
contentType:this.activeName == 0? '':this.activeName,//内容类型
aid:this.pageId, //指定用户的动态,
hidden:true,//是否隐藏,不指定,查询全部
hidden:this.pageId == this.userInfo.aid?'':true,//是否隐藏,不指定,查询全部
}
apiStat.userDynamicList(data).then(res=>{
if(res.status == 200) {
@@ -142,6 +165,9 @@
}
item.isAll = false;
})
if(this.activeName == 0) {// 动态处理
this.getAllList(res.result.list)
}
if(this.activeName == 1){
this.cousrePageList = res.result.list
this.getCourse(noReapetIds,res.result.list);
@@ -153,7 +179,6 @@
if(this.activeName == 3) {
this.casePageList = res.result.list;
this.getCase(noReapetIds,res.result.list);
}
if(this.activeName == 6) { // 笔记
this.getNote(noReapetIds,res.result.list);
@@ -170,6 +195,79 @@
}
})
},
getAllList(list) {
this.allPageList = [];
let casePageList=[];
let notePageList=[];
let articlePageList=[];
let qaPageList=[];
let answerPageList=[];
let cousrePageList=[];
list.forEach(item=>{
if(item.contentType == 1) {
cousrePageList.push(item);
}
if(item.contentType == 2) {
articlePageList.push(item);
}
if(item.contentType == 3) {
casePageList.push(item);
}
if(item.contentType == 4) {
qaPageList.push(item);
}
if(item.contentType == 5) {
answerPageList.push(item);
}
if(item.contentType == 6) {
notePageList.push(item);
}
})
let caseIds = casePageList.map(item=>item.contentId);
const noReapetCaseIds = [...new Set(caseIds)];
let articleIds = articlePageList.map(item=>item.contentId);
const noReapetArticleIds = [...new Set(articleIds)];
let cousreIds = cousrePageList.map(item=>item.contentId);
const noReapetCousreIds = [...new Set(cousreIds)];
let qaIds = qaPageList.map(item=>item.contentId);
const noReapetQaIds = [...new Set(qaIds)];
let anwerIds = answerPageList.map(item=>item.contentId);
const noReapetAnwerIds = [...new Set(anwerIds)];
let noteIds = notePageList.map(item=>item.contentId);
const noReapetNoteIds = [...new Set(noteIds)];
if(noReapetCaseIds.length > 0) {
this.getCase(noReapetCaseIds,casePageList);
}
if(noReapetArticleIds.length > 0) {
this.getArticle(noReapetArticleIds,articlePageList);
}
if(noReapetCousreIds.length > 0) {
this.getCourse(noReapetCousreIds,cousrePageList);
}
if(noReapetQaIds.length > 0) {
this.getQa(noReapetQaIds,qaPageList);
}
if(noReapetAnwerIds.length > 0) {
this.getAnswer(noReapetAnwerIds,answerPageList);
}
if(noReapetNoteIds.length > 0) {
this.getNote(noReapetNoteIds,notePageList);
}
this.allPageList.push(...casePageList,...articlePageList,...cousrePageList,...qaPageList,...answerPageList,...notePageList);
this.allPageList.sort(this.pcompare("eventTime", false))
},
pcompare(prop, rev) {
if (rev === undefined) {
rev = 1;
} else {
rev = rev ? 1 : -1;
}
return function(obj1, obj2) {
let val1 = obj1[prop],
val2 = obj2[prop];
return val1 < val2 ? rev * -1 : rev * 1;
};
},
getAnswer(ids,list){
if(ids.length == 0){
return
@@ -328,7 +426,7 @@
}
})
},
handleClick() {
handleClick(e) {
this.getList();
}
},

View File

@@ -152,7 +152,7 @@
</div>
<!-- 我的笔记 -->
<div class="mynote" v-if="tab == 2">
<my-note :data="contentData" @videoLocation="videoLocation" @onPlayVideo="onPlayVideo"></my-note>
<my-note :data="contentData" @videoLocation="videoLocation" @onPlayVideo="onPlayVideo" :score="courseInfo.score"></my-note>
</div>
</div>
<div class="coures-tearch">