This commit is contained in:
zhaofang
2022-09-21 19:59:30 +08:00
parent 6ff4c51444
commit 8dc374cb65
11 changed files with 401 additions and 59 deletions

View File

@@ -12,14 +12,14 @@ const baseURL = process.env.VUE_APP_CESOURCE_BASE_API;
* }
* */
const save=function (data){
return ajax.postJson('/xboe/subgroup/m/guest/save',data);
return ajax.postJson(baseURL,'/xboe/subgroup/m/guest/save',data);
}
/**
* 删除留言
* */
const del=function (id){
return ajax.get('/xboe/subgroup/m/guest/delete?id='+id);
return ajax.get(baseURL,'/xboe/subgroup/m/guest/delete?id='+id);
}
/**
@@ -30,7 +30,7 @@ const del=function (id){
* }
* */
const answer=function (data){
return ajax.post('/xboe/subgroup/m/guest/answer',data);
return ajax.post(baseURL,'/xboe/subgroup/m/guest/answer',data);
}
/**
@@ -42,7 +42,7 @@ const answer=function (data){
* }
* */
const givelist=function (query){
return ajax.post('/xboe/subgroup/m/guest/givelist',query);
return ajax.post(baseURL,'/xboe/subgroup/m/guest/givelist',query);
}
/**
@@ -54,7 +54,7 @@ const givelist=function (query){
* }
* */
const mylist=function (query){
return ajax.post('/xboe/subgroup/m/guest/mylist',query);
return ajax.post(baseURL,'/xboe/subgroup/m/guest/mylist',query);
}
export default {

View File

@@ -69,7 +69,7 @@ const counts=function (aid){
* }
* */
const has=function (followId){
return ajax.get('/xboe/subgroup/m/userfollow/has?followId='+followId);
return ajax.get(baseURL,'/xboe/subgroup/m/userfollow/has?followId='+followId);
}
export default {

View File

@@ -1,19 +1,32 @@
<template>
<div>
<ul class="follow-top-tabs">
<li class="follow-home-title tabs-index" @click="tagTab(1)">他关注的人<span v-if="active == 1" class="line"></span></li>
<li class="follow-home-title tabs-index" @click="tagTab(2)">关注他的人<span v-if="active == 2" 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>
</ul>
<div v-if="followList.length > 0">
<div class="follow-list" v-for="item in followList">
<div><img style="width:60px;height:60" src="/images/Avatarwoman.png"/></div>
<div class="follow-list" v-for="item in followList" :key="item.id">
<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>
<div v-else class="uavatar">
<div v-if="item.authorInfo.sex == null" style="border-radius: 50%;width: 60px;height: 60px;"></div>
<div v-else>
<div v-if="item.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;">小王<img style="width:22px;height:22;vertical-align:middle" src="/images/homeWu/man.png" /></p>
<p class="portal-summary-text">你必须非常努力才能看起来毫不费力</p>
<p class="follow-home-title" style="font-size: 20px;margin-bottom: 12px;">{{item.authorInfo.name}}
<!-- <img style="width:22px;height:22;vertical-align:middle" src="/images/homeWu/man.png" /> -->
</p>
<p class="portal-summary-text">{{item.authorInfo.sign}}</p>
</div>
<div>
<!-- <el-button plain class="btn" icon="el-icon-check">关注</el-button> -->
<el-button type="primary" class="btn" icon="el-icon-plus">关注他</el-button>
<el-button plain class="btn" icon="el-icon-check" v-if="pageId == userInfo.aid && active == 1" @click="cancel(item)">取消关注</el-button>
<el-button type="primary" class="btn" v-if="active == 2" icon="el-icon-plus">关注他</el-button>
<el-button class="btn" icon="el-icon-plus" v-if="active == 2">已关注</el-button>
</div>
</div>
</div>
@@ -27,6 +40,8 @@
import interactBar from "@/components/Portal/interactBar.vue";
import author from "@/components/Portal/authorInfo.vue";
import apiFollow from "@/api/phase2/userfollow.js"
import { mapGetters,mapActions } from 'vuex';
import apiUser from "@/api/system/user.js";
export default{
name:"articleList",
components: {
@@ -34,13 +49,20 @@ import apiFollow from "@/api/phase2/userfollow.js"
// timeShow,
author
},
computed:{
...mapGetters(['userInfo']),
avatarText(){
return userAvatarText(this.userInfo.name);
}
},
data(){
return{
baseUrl:process.env.VUE_APP_FILE_BASE_URL,
followList:[],
active:1,
pageId:'',
pageList:[],
mypageList:[],
// pageList:[],
// mypageList:[],
page:{
pageIndex:1,
pageSize:10,
@@ -50,20 +72,34 @@ import apiFollow from "@/api/phase2/userfollow.js"
},
mounted() {
this.pageId = this.$route.query.id;
this.getMyPage();
this.getPage();
},
methods:{
cancel(item) {
apiFollow.remove(item.followId).then(res=>{
if(res.status == 200) {
this.getPage()
}
})
},
//展示全部
tagTab(num) {
this.active = num;
if(num == 1) {
this.getPage()
} else {
this.getMyPage()
}
},
getMyPage() {//关注我的,关注他的
this.page.aid = this.pageId;
apiFollow.mypage(this.page).then(res=>{
if(res.status== 200) {
this.count = res.result.count;
this.mypageList = res.result.list;
res.result.list.forEach(item=>{
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null }
})
this.followList = res.result.list;
this.getUserData(res.result.list);
}
})
},
@@ -72,11 +108,41 @@ import apiFollow from "@/api/phase2/userfollow.js"
apiFollow.page(this.page).then(res=>{
if(res.status== 200) {
this.count = res.result.count;
this.pageList = res.result.list;
res.result.list.forEach(item=>{
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null }
})
this.followList = res.result.list;
this.getUserData(res.result.list);
}
})
}
},
getUserData(list) {
let ids = [];
if(this.active == 1) {
ids = list.map(item=> item.followId);
} else {
ids = list.map(item=> item.aid);
}
apiUser.getByIds(ids).then(res => {
if (res.status == 200) {
list.forEach((item, index) => {
res.result.some(author => {
if (this.active == 1 && author.aid == item.followId) {
item.authorInfo = author;
return true;
} else if ( this.active == 2 && author.aid == item.aid) {
item.authorInfo = author;
return true;
} else {
return false;
}
});
});
} else {
this.$message.error(res.message);
}
});
},
}
}
</script>

View File

@@ -21,8 +21,9 @@
<div>LV.1</div>
<span style="color: #A3680A;margin-left:12px;line-height: 24px;">经验值367</span>
</div>
<el-button round plain class="btn-user" size="small">关注TA</el-button>
<el-button round plain class="btn-user" size="small"><router-link to="/homePage/leavingMessage">去留言</router-link></el-button>
<el-button round plain class="btn-user" size="small" v-if="pageId != userInfo.aid && !isFollowHas" @click="toFollow()">关注TA</el-button>
<el-button round plain class="btn-user" size="small" v-if="isFollowHas">已关注</el-button>
<el-button round plain class="btn-user" size="small"><router-link :to="'/homePage/leavingMessage?id='+pageId">去留言</router-link></el-button>
</div>
<div class="content-bottom">
<p class="portal-summary-text">你必须非常努力才能看起来毫不费力</p>
@@ -64,7 +65,8 @@
<script>
import {userAvatarText,cutFullName} from "@/utils/tools.js";
import { mapGetters } from 'vuex'
import apiStart from '@/api/phase2/stat.js'
import apiStart from '@/api/phase2/stat.js';
import apiFollow from "@/api/phase2/userfollow.js"
export default {
name: 'UcHeader',
computed:{
@@ -85,20 +87,43 @@
},
orgInfo:'',
sex:'',
pageId:'',
isFollowHas:false,
}
},
mounted() {
this.pageId = this.$route.query.id;
this.sex = this.userInfo.sex;
// 判断路由是进入的学员默认页面就重置setCurIdentity
if(this.$route.path == '/uc/study/task' || this.$route.path == '/study/index'){
this.setCurIdentity(1);
}
//let testName='京东方科技集团股份有限公司/北京中祥英科技有限公司/技术中心';
//this.orgInfo=cutFullName(testName,1);
this.orgInfo=cutFullName(this.userInfo.departFullName,1);
this.getInfo();
if(this.pageId !== this.userInfo.aid) {
this.followHas();
}
},
methods:{
followHas() {
apiFollow.has(this.pageId).then(res=>{
if(res.status == 200) {
this.isFollowHas = res.result;
} else {
this.$message.error(res.message);
}
})
},
toFollow() {
apiFollow.save(this.pageId).then(res=>{
if(res.status == 200) {
this.$message.success(res.message);
this.followHas();
} else {
this.$message.error(res.message);
}
})
},
getInfo(){
apiStart.userTotal(this.userInfo.aid,[10,11,30]).then(res=>{
if(res.status == 200 && res.result.length > 0) {

View File

@@ -0,0 +1,107 @@
<template>
<div class="item-author">
<div style="width:40px;height:40px;" @click="toHome()">
<el-avatar shape="circle" :src="userAvatar" v-if="userAvatar"></el-avatar>
<div v-else class="uavatar">
<div v-if="sex == null" style="border-radius: 50%;width: 40px;height: 40px;"></div>
<div v-else>
<div v-if="sex === 1 "><img src="../../../public/images/Avatarman.png" alt=""></div>
<div v-else><img src="../../../public/images/Avatarwoman.png" alt=""></div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props:{
avatar:{
type:String,
default:''
},
width:{
type:String,
default:'200px'
},
sex:{
type:Number,
},
aid:{
type:String,
default:''
},
},
data(){
return {
baseUrl:process.env.VUE_APP_FILE_BASE_URL,
userAvatar:'',
userName:'',
usersex:null,
}
},
created() {
// this.userAvatar=require("@/assets/images/user/default.png");
},
mounted() {
this.userName=this.name;
if(this.avatar && this.avatar!=''){
this.userAvatar=this.avatar;
}
this.usersex = this.sex;
},
methods:{
toHome() {
// ,query:{id:item.objId || item.id}
this.$router.push({path:'/homePage?id='+this.aid})
}
},
watch:{
name(newVal,oldVal){
this.userName=newVal;
},
avatar(newVal,oldVal){
if(newVal){
this.userAvatar=this.baseUrl+newVal;
}
},
sex(newVal,oldVal){
this.usersex=newVal;
},
},
computed:{
},
}
</script>
<style scoped lang="scss">
.item-author{
// font-size: 0.9em;
line-height: 18px;
display: flex;
.author-text{
font-size: 12px;
color: #666666;
margin-left: 4px;
}
.uavatar{
// border: 1px solid #73adfe;
width: 28px;
height: 28px;
// background: #d9e9ff;
display: flex;
justify-content: center;
align-items: center;
.uavatar-text{
transform: scale(0.8);
font-size: 12px;
color: #73adfe;
}
img{
border-radius: 50%;
width: 28px;
height: 28px;
}
}
}
</style>

View File

@@ -37,6 +37,10 @@ import { userAvatarText } from "@/utils/tools.js";
type:String,
default:''
},
aid:{
type:String,
default:''
},
info:{
type:String,
default:''
@@ -69,7 +73,7 @@ import { userAvatarText } from "@/utils/tools.js";
methods:{
toHome() {
// ,query:{id:item.objId || item.id}
this.$router.push({path:'/homePage'})
this.$router.push({path:'/homePage?id='+this.aid})
}
},
watch:{

View File

@@ -9,11 +9,11 @@
<div class="home-page-right">
<ul class="total-per">
<li class="per-li">
<span class="per-info">456</span>
<span class="per-info">{{follow.passive}}</span>
<span class="per-text">关注他的人</span>
</li>
<li class="per-li">
<span class="per-info">456</span>
<span class="per-info">{{follow.initiative}}</span>
<span class="per-text">他关注的人</span>
</li>
</ul>
@@ -64,7 +64,11 @@
activeName:'first',
pageId:'',
medalList:[],
interestedList:[]
interestedList:[],
follow:{
initiative: 0,
passive: 0
}
}
},
mounted() {
@@ -77,7 +81,7 @@
getFollow(){
apiFollow.counts(this.pageId).then(res=>{
if(res.status == 200) {
this.follow = res.result;
}
})
},

View File

@@ -2,39 +2,58 @@
<!--评论组件-->
<div class="leaving-message">
<div>
<el-input
type="textarea"
:rows="4"
placeholder="请输入内容"
v-model="textarea">
</el-input>
<el-button class="lea-btn" type="primary">发布</el-button>
<el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="textarea"></el-input>
<el-button class="lea-btn" type="primary" @click="add()">发布</el-button>
</div>
<h6 class="lea-num">12条留言</h6>
<h6 class="lea-num">{{count}}条留言</h6>
<div>
<ul class="lea-ul">
<li class="lea-li" v-for="item in 2">
<li class="lea-li" v-for="(item, idx) in leavingList" :key="item.id">
<div class="lev-li">
<div class="li-img"><img src="/images/Avatarman.png"/></div>
<div class="li-text">
<p class="portal-title-tow">小张 <span class="portal-summary-text">个性签名不要期待,不要假想</span></p>
<p>在学习课程的过程中我常常惊叹于老师的知识面之广对技术的理解之深这么多的知识点老师都能讲得驾轻就熟把复这么多的知识驾轻就熟把复这么多的知点老杂的知识概念解释得通俗的知识面之广对技术的理解之深这么多的易懂</p>
<div class="li-img">
<author-img :avatar="item.authorInfo.avatar" :aid="item.authorInfo.aid" :sex="item.authorInfo.sex"></author-img>
<!-- <img src="/images/Avatarman.png"/> -->
</div>
<div class="li-text">
<p class="portal-title-tow">{{item.authorInfo.name}} <span class="portal-summary-text">个性签名{{item.authorInfo.sign}}</span></p>
<p>{{item.content}}</p>
</div>
<div class="li-right">
<div class="replys-icon" @click="isReplys(item, idx)"><svg-icon style="margin-right: 4px;font-size: 14px;" icon-class="comment"></svg-icon>回复</div>
<interactBar :type="7" :data="item" :comments="false" :shares="false" :views="false" :favorites="false"></interactBar>
</div>
<div class="li-right"><interactBar :type="7" :shares="false" :views="false" :favorites="false"></interactBar></div>
</div>
<div class="lev-li-tow">
<!-- 回复框 -->
<div class="replys-input" style="padding-left: 60px;margin:10px 0" v-if="item.isReplys">
<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="replysContent"></el-input>
<el-button class="lea-btn" type="primary" @click="addReplys()">回复</el-button>
</div>
<!-- 回复框 -->
<div class="lev-li-tow" style="display:none">
<div class="lev-li">
<div class="li-img"><img src="/images/Avatarman.png"/></div>
<div class="li-text">
<p class="portal-title-tow">小张 <span class="portal-summary-text">个性签名不要期待,不要假想</span></p>
<p>在学习课程的过程中我常常惊叹于老师的知识面之广对技术的理解之深这么多的知识点老师都能讲得驾轻就熟把复这么多的知识驾轻就熟把复这么多的知点老杂的知识概念解释得通俗的知识面之广对技术的理解之深这么多的易懂</p>
</div>
<div class="li-right"><interactBar :type="7" :shares="false" :views="false" :favorites="false"></interactBar></div>
<div class="li-right"><interactBar :type="7" :comments="false" :shares="false" :views="false" :favorites="false"></interactBar></div>
</div>
</div>
</li>
</ul>
<div style="text-align: center; margin-top:57px;" v-show="count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="count">
</el-pagination>
</div>
</div>
</div>
</template>
@@ -42,7 +61,8 @@
import showTime from '@/components/Portal/datetimeShow.vue'
import apiComment from '@/api/modules/comments.js'
import apiUser from '@/api/system/user.js'
import authorInfo from '@/components/Portal/authorInfo.vue';
import apiGuestbook from '@/api/phase2/guestbook.js'
import authorImg from '@/components/Portal/authorImg.vue';
// import author from '@/components/Portal/author.vue';
import interactBar from "@/components/Portal/interactBar.vue";
import { mapGetters } from 'vuex';
@@ -50,13 +70,25 @@
props:{
},
components:{showTime,authorInfo,interactBar},
components:{showTime,authorImg,interactBar},
computed: {
...mapGetters(['userInfo'])
},
data() {
return {
textarea:'',
replysContent:'',
leavingList:[],
count:0,
page:{
pageIndex:1,
pageSize:10,
aid:''
},
replys:{
id:'',
reply:[],
}
}
},
watch:{
@@ -64,11 +96,87 @@
},
mounted() {
this.pageId = this.$route.query.id;
this.getList();
},
methods: {
}
methods: {
isReplys(item,idx) {
item.isReplys = true;
this.replys.id = item.id;
},
addReplys() {
this.replys.reply.content = this.replysContent;
this.replys.reply.push({
content: this.replysContent,
aid:this.userInfo.aid
})
this.replys.reply = JSON.stringify(this.replys.reply);
apiGuestbook.answer(this.replys).then(res=>{
})
},
getList() {
this.page.aid = this.pageId;
apiGuestbook.givelist(this.page).then(res=>{
if(res.status == 200) {
this.count = res.result.count;
res.result.list.forEach(item=>{
// item.replysList = [];
// item.replys = JSON.parse(item.replys);
item.isReplys = false;
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null }
})
this.leavingList = res.result.list;
this.getUserData(res.result.list);
console.log(this.leavingList,'this.leavingList ');
}
})
},
add() {
let data = {
content:this.textarea,//留言内容
aid:this.pageId,// 要留言的人的id
}
apiGuestbook.save(data).then(res=>{
if(res.status == 200) {
this.textarea = '';
this.leavingList.push(res.result);
this.$message.success('留言发布成功');
} else {
this.$message.error(res.message);
}
})
},
getUserData(list) {
let ids = list.map(item=> item.aid);
const noReapetIds = [...new Set(ids)];
apiUser.getByIds(noReapetIds).then(res => {
if (res.status == 200) {
list.forEach((item, index) => {
res.result.some(author => {
if (author.aid == item.aid) {
item.authorInfo = author;
return true;
} else {
return false;
}
});
});
} else {
this.$message.error(res.message);
}
});
},
handleSizeChange(val) {
this.page.pageSize = val;
this.page.pageIndex = 1;
this.getList();
},
handleCurrentChange(val) {
this.page.pageIndex = val;
this.getList();
},
}
}
</script>
@@ -124,8 +232,23 @@
color: #333333;
}
}
.replys-input{
padding-left: 50px;
// display: flex;
// .el-textarea{
// width: 80%;
// }
}
.li-right{
margin-top: 40px;
display: flex;
margin-top: 40px;
.replys-icon{
width: 50px;
color: #6E7B84;
font-size: 12px;
margin-right: 22px;
margin-top: 8px;
}
}
}
}

View File

@@ -44,7 +44,7 @@
</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>
<follow-list></follow-list>
<follow-list ref="followList"></follow-list>
</el-tab-pane>
<el-tab-pane name="8">
<span slot="label"><svg-icon icon-class="home-book" style="font-size: 30px;"></svg-icon><span class="tabs-info">书籍</span></span>
@@ -125,7 +125,6 @@
}
this.loadMajorType();
this.loadOrgDomain();
console.log(this.orgDomainMap,'orgDomainMap');
},
methods:{
...mapActions({
@@ -426,7 +425,18 @@
}
})
},
handleClick(e) {
handleClick() {
if(this.activeName == '7') {
this.$refs.followList.getPage();
this.page.count = 0;
return
}
if(this.activeName == '8') {
this.page.count = 0;
// console.log(this.$refs.followList,'this.$refs.followList');
// this.$refs.followList.getPage();
return
}
this.getList();
}
},

View File

@@ -125,6 +125,9 @@
let data = this.medalConfig.find(it=>it.id ==item.medalId);
this.rules = JSON.parse(data.rules);
console.log(data,'data');
apiStat.userMedalLevelInfo(item.id).then(res=>{
})
},
getMedal() {
apiStat.userMedal(this.userInfo.aid).then(res=>{

View File

@@ -70,7 +70,7 @@
<!--互动内容-->
<div style="display: flex;justify-content:flex-start;align-items: center;margin-top: 0px;">
<div style="flex:1;">
<author :avatar="article.authorInfo.avatar" :name="article.sysCreateBy" :sex="article.authorInfo.sex" ></author>
<author :avatar="article.authorInfo.avatar" :name="article.sysCreateBy" :sex="article.authorInfo.sex" :aid="article.authorInfo.aid"></author>
</div>
<div style="">
<interactBar nodeWidth="60px" :readonly="true" :type="2" :data="article" :views="false"></interactBar>