mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-13 12:56:43 +08:00
提交
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<li class="follow-home-title tabs-index" @click="tagTab(1)">{{userInfo.aid == pageId ?'我关注的人':'他关注的人'}}<span v-if="active == 1" class="line"></span></li>
|
<li class="follow-home-title tabs-index" @click="tagTab(1)">{{userInfo.aid == pageId ?'我关注的人':'他关注的人'}}<span v-if="active == 1" class="line"></span></li>
|
||||||
<li class="follow-home-title tabs-index" @click="tagTab(2)">{{userInfo.aid == pageId ?'关注我的人':'关注他的人'}}<span v-if="active == 2" class="line"></span></li>
|
<li class="follow-home-title tabs-index" @click="tagTab(2)">{{userInfo.aid == pageId ?'关注我的人':'关注他的人'}}<span v-if="active == 2" class="line"></span></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div v-if="followList.length > 0">
|
<div v-show="active ==1">
|
||||||
<div class="follow-list" v-for="item in followList" :key="item.id">
|
<div class="follow-list" v-for="item in followList" :key="item.id">
|
||||||
<div style="width:60px;height:60">
|
<div style="width:60px;height:60">
|
||||||
<el-avatar shape="circle" style="width:60px;height:60px" size="small" :src="baseUrl+item.authorInfo.avatar" v-if="item.authorInfo.avatar"></el-avatar>
|
<el-avatar shape="circle" style="width:60px;height:60px" size="small" :src="baseUrl+item.authorInfo.avatar" v-if="item.authorInfo.avatar"></el-avatar>
|
||||||
@@ -30,10 +30,36 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="home-no-list">
|
<div v-if="followList.length == 0">
|
||||||
<img class="img" style="width:186px;height:160px" src="/images/homeWu/no-follow.png" alt="" srcset="">
|
<img class="img" style="width:186px;height:160px" src="/images/homeWu/no-follow.png" alt="" srcset="">
|
||||||
<p class="text">还没有关注的人</p>
|
<p class="text">还没有关注的人</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-show="active == 2">
|
||||||
|
<div class="follow-list" v-for="(maPage,index) in mypageList" :key="index">
|
||||||
|
<div style="width:60px;height:60">
|
||||||
|
<el-avatar shape="circle" style="width:60px;height:60px" size="small" :src="baseUrl+maPage.userFollow.authorInfo.avatar" v-if="maPage.userFollow.authorInfo.avatar"></el-avatar>
|
||||||
|
<div v-else class="uavatar">
|
||||||
|
<div v-if="maPage.userFollow.authorInfo.sex == null" style="border-radius: 50%;width: 60px;height: 60px;"></div>
|
||||||
|
<div v-else>
|
||||||
|
<div v-if="maPage.userFollow.authorInfo.sex === 1 "><img style="width:60px;height:60" src="../../../public/images/Avatarman.png" alt=""></div>
|
||||||
|
<div v-else><img style="width:60px;height:60" src="../../../public/images/Avatarwoman.png" alt=""></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <img style="width:60px;height:60" :src="item.authorInfo.avatar"/> -->
|
||||||
|
</div>
|
||||||
|
<div class="follow-center">
|
||||||
|
<p class="follow-home-title" style="font-size: 20px;margin-bottom: 12px;">{{maPage.userFollow.authorInfo.name}}
|
||||||
|
<!-- <img style="width:22px;height:22;vertical-align:middle" src="/images/homeWu/man.png" /> -->
|
||||||
|
</p>
|
||||||
|
<p class="portal-summary-text">{{maPage.userFollow.authorInfo.sign}}</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-button class="btn" icon="el-icon-plus" v-if="maPage.has">已关注</el-button>
|
||||||
|
<el-button type="primary" class="btn" v-else icon="el-icon-plus">关注他</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -62,7 +88,7 @@ import apiUser from "@/api/system/user.js";
|
|||||||
active:1,
|
active:1,
|
||||||
pageId:'',
|
pageId:'',
|
||||||
// pageList:[],
|
// pageList:[],
|
||||||
// mypageList:[],
|
mypageList:[],
|
||||||
page:{
|
page:{
|
||||||
pageIndex:1,
|
pageIndex:1,
|
||||||
pageSize:10,
|
pageSize:10,
|
||||||
@@ -96,9 +122,10 @@ import apiUser from "@/api/system/user.js";
|
|||||||
if(res.status== 200) {
|
if(res.status== 200) {
|
||||||
this.count = res.result.count;
|
this.count = res.result.count;
|
||||||
res.result.list.forEach(item=>{
|
res.result.list.forEach(item=>{
|
||||||
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null }
|
item.userFollow.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
|
||||||
})
|
})
|
||||||
this.followList = res.result.list;
|
this.mypageList = res.result.list;
|
||||||
|
console.log(this.mypageList,'this.mypageList');
|
||||||
this.getUserData(res.result.list);
|
this.getUserData(res.result.list);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -109,7 +136,7 @@ import apiUser from "@/api/system/user.js";
|
|||||||
if(res.status== 200) {
|
if(res.status== 200) {
|
||||||
this.count = res.result.count;
|
this.count = res.result.count;
|
||||||
res.result.list.forEach(item=>{
|
res.result.list.forEach(item=>{
|
||||||
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null }
|
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
|
||||||
})
|
})
|
||||||
this.followList = res.result.list;
|
this.followList = res.result.list;
|
||||||
this.getUserData(res.result.list);
|
this.getUserData(res.result.list);
|
||||||
@@ -121,7 +148,7 @@ import apiUser from "@/api/system/user.js";
|
|||||||
if(this.active == 1) {
|
if(this.active == 1) {
|
||||||
ids = list.map(item=> item.followId);
|
ids = list.map(item=> item.followId);
|
||||||
} else {
|
} else {
|
||||||
ids = list.map(item=> item.aid);
|
ids = list.map(item=> item.userFollow.aid);
|
||||||
}
|
}
|
||||||
apiUser.getByIds(ids).then(res => {
|
apiUser.getByIds(ids).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
@@ -130,8 +157,8 @@ import apiUser from "@/api/system/user.js";
|
|||||||
if (this.active == 1 && author.aid == item.followId) {
|
if (this.active == 1 && author.aid == item.followId) {
|
||||||
item.authorInfo = author;
|
item.authorInfo = author;
|
||||||
return true;
|
return true;
|
||||||
} else if ( this.active == 2 && author.aid == item.aid) {
|
} else if ( this.active == 2 && author.aid == item.userFollow.aid) {
|
||||||
item.authorInfo = author;
|
item.userFollow.authorInfo = author;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="comment-time portal-time">
|
<div class="comment-time portal-time">
|
||||||
<showTime :time="com.sysCreateTime"></showTime>
|
<showTime :time="com.sysCreateTime"></showTime>
|
||||||
<interactBar :type="10" :shares="false" :data="com" @addAnswers="showReply(com)" :favorites="false" :views="false" :comments="false" :answers="true"></interactBar>
|
<interactBar :type="praisesType" :shares="false" :data="com" @addAnswers="showReply(com)" :favorites="false" :views="false" :comments="false" :answers="true"></interactBar>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="comment-btns"> -->
|
<!-- <div class="comment-btns"> -->
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="comment-time portal-time">
|
<div class="comment-time portal-time">
|
||||||
<showTime :time="reply.sysCreateTime"></showTime>
|
<showTime :time="reply.sysCreateTime"></showTime>
|
||||||
<interactBar :type="10" :shares="false" :data="reply" @addAnswers="showReply(reply)" :favorites="false" :views="false" :comments="false" :answers="true"></interactBar>
|
<interactBar :type="praisesType" :shares="false" :data="reply" @addAnswers="showReply(reply)" :favorites="false" :views="false" :comments="false" :answers="true"></interactBar>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="comment-btns"> -->
|
<!-- <div class="comment-btns"> -->
|
||||||
<!-- <a><svg-icon icon-class="like"></svg-icon><span>66</span></a> -->
|
<!-- <a><svg-icon icon-class="like"></svg-icon><span>66</span></a> -->
|
||||||
@@ -277,6 +277,7 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
praisesType:0,//用于设定评论里点赞的type 课程评论点赞为10,文章的为20,案例的为30
|
||||||
radio:1,
|
radio:1,
|
||||||
value:false,
|
value:false,
|
||||||
sex:null,
|
sex:null,
|
||||||
@@ -358,6 +359,15 @@
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.author = this.authorId;
|
this.author = this.authorId;
|
||||||
this.loadData(false);
|
this.loadData(false);
|
||||||
|
if(this.objType == 1) {
|
||||||
|
this.praisesType = 10;
|
||||||
|
}
|
||||||
|
if(this.objType == 2) {
|
||||||
|
this.praisesType = 20;
|
||||||
|
}
|
||||||
|
if(this.objType == 3) {
|
||||||
|
this.praisesType = 30;
|
||||||
|
}
|
||||||
//在中文输入法状态下输入光标不在文字最后,同时会被遮挡两个文字大小的长度
|
//在中文输入法状态下输入光标不在文字最后,同时会被遮挡两个文字大小的长度
|
||||||
// let vm=document.querySelector('.hideControl input')
|
// let vm=document.querySelector('.hideControl input')
|
||||||
// vm.addEventListener('compositionstart',(e)=>{
|
// vm.addEventListener('compositionstart',(e)=>{
|
||||||
@@ -549,7 +559,6 @@
|
|||||||
item.isAll=!item.isAll;
|
item.isAll=!item.isAll;
|
||||||
},
|
},
|
||||||
showReply(item){
|
showReply(item){
|
||||||
console.log("9999999999");
|
|
||||||
this.replyInfo.objType=this.objType;
|
this.replyInfo.objType=this.objType;
|
||||||
this.replyInfo.objId=this.objId;
|
this.replyInfo.objId=this.objId;
|
||||||
this.replyInfo.parentId=item.id;
|
this.replyInfo.parentId=item.id;
|
||||||
|
|||||||
@@ -247,6 +247,16 @@ export default {
|
|||||||
if(this.type==5){
|
if(this.type==5){
|
||||||
content='回答'
|
content='回答'
|
||||||
}
|
}
|
||||||
|
// 点赞type
|
||||||
|
if(this.type==10){
|
||||||
|
content='课程评论点赞'
|
||||||
|
}
|
||||||
|
if(this.type==20){
|
||||||
|
content='文章评论点赞'
|
||||||
|
}
|
||||||
|
if(this.type==30){
|
||||||
|
content='案例评论点赞'
|
||||||
|
}
|
||||||
content=sendName+typeText+content+'-'+title
|
content=sendName+typeText+content+'-'+title
|
||||||
let message={
|
let message={
|
||||||
content,
|
content,
|
||||||
|
|||||||
@@ -156,7 +156,6 @@
|
|||||||
<el-card :body-style="{ padding: '0px' }" class="teachers">
|
<el-card :body-style="{ padding: '0px' }" class="teachers">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
课程讲师
|
课程讲师
|
||||||
<el-button style="float :right;" type="primary" size="small">+ 关注</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="teacher" v-for="(item, idx) in teachers" :key="idx">
|
<div class="teacher" v-for="(item, idx) in teachers" :key="idx">
|
||||||
@@ -173,6 +172,9 @@
|
|||||||
<div class="teacher-name">{{ item.teacherName }}</div>
|
<div class="teacher-name">{{ item.teacherName }}</div>
|
||||||
<div class="teacher-remark" v-html="item.remark"></div>
|
<div class="teacher-remark" v-html="item.remark"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="padding-top:15px">
|
||||||
|
<el-button type="primary" @click="toFollow(item)" size="small">+ 关注</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -209,6 +211,7 @@ import exam from '@/components/Course/exam';
|
|||||||
import homework from '@/components/Course/homework';
|
import homework from '@/components/Course/homework';
|
||||||
import assess from '@/components/Course/assess';
|
import assess from '@/components/Course/assess';
|
||||||
import myNote from '../../components/Course/myNote.vue';
|
import myNote from '../../components/Course/myNote.vue';
|
||||||
|
import apiFollow from "@/api/phase2/userfollow.js"
|
||||||
export default {
|
export default {
|
||||||
name: "atticle",
|
name: "atticle",
|
||||||
components: {courseImage, portalHeader, hyperLink, comments, homework, exam, interactBar, assess, pdfPreview, audioPlayer, videoPlayer,myNote,noteComments },
|
components: {courseImage, portalHeader, hyperLink, comments, homework, exam, interactBar, assess, pdfPreview, audioPlayer, videoPlayer,myNote,noteComments },
|
||||||
@@ -306,6 +309,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
toFollow(item) {
|
||||||
|
apiFollow.save(item.teacherId).then(res=>{
|
||||||
|
if(res.status == 200) {
|
||||||
|
this.$message.success('关注成功!');
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
onPlayVideo(time) {
|
onPlayVideo(time) {
|
||||||
this.playerBoxShow = false;
|
this.playerBoxShow = false;
|
||||||
this.notePlay = null;
|
this.notePlay = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user