mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 03:16:42 +08:00
提交个人主页内容的修改
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
}
|
||||
.qa-solve{
|
||||
color:#387df7;
|
||||
margin-left: -10px;
|
||||
margin-left: -8px;
|
||||
}
|
||||
.qa-unSolve{
|
||||
color:#333;
|
||||
margin-left: -10px;
|
||||
margin-left: -8px;
|
||||
|
||||
}
|
||||
@@ -4,35 +4,37 @@
|
||||
<div :span="24" v-for="item in list" :key="item.id" class="case-list">
|
||||
<div class="case-info">
|
||||
<p v-if="isDynamic" class="portal-summary-text">
|
||||
<span v-if="!personal">{{item.aname}}</span>{{item.cusInfo}}
|
||||
<span style="margin-left:28px">{{item.eventTime}}</span>
|
||||
<span v-if="!personal">{{item.aname}}</span>{{item.cusInfo}}
|
||||
<span style="margin-left:28px">{{item.eventTime}}</span>
|
||||
<span v-if="personal && !item.hidden" class="follow-hide" style="float:right" @click="emitHide(item.id)">
|
||||
<svg-icon style="margin-right: 10px;font-size:22px;padding-top: 4px;" icon-class="eyes"></svg-icon>隐藏
|
||||
</span>
|
||||
</p>
|
||||
<div class="case-info-cont">
|
||||
<router-link :to="'/case/detail?id='+item.info.id">
|
||||
<div class="case-info-title">
|
||||
<div class="case-titdiv">
|
||||
<span class="case-tittext" v-html="item.info.title || item.contentInfo"></span>
|
||||
<div class="follow-hide" style="width:59px" v-if="!isDynamic && personal && !item.hidden" @click="emitHide(item.id)">
|
||||
<svg-icon style="margin-right: 10px;font-size:22px;padding-top: 4px;" icon-class="eyes"></svg-icon>隐藏
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height:58px;padding-top:18px ">
|
||||
<author :avatar="item.authorInfo.avatar" :name="item.authorInfo.name" :info="item.authorInfo.orgInfo" :sex="item.authorInfo.sex" :aid="item.authorInfo.aid"></author>
|
||||
</div>
|
||||
<div class="keyword-text clearfix">
|
||||
<div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain">{{ orgDomainTranslate(item.info.orgDomain) }}</div>
|
||||
<div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain == '' && item.orgDomainParent">{{ orgDomainTranslate(item.info.orgDomainParent) }}</div>
|
||||
<div style="color:#2974D6;font-weight: 450;" v-for="item,idx in item.info.majorType" :key="idx" >{{ majorTypeTranslate(item) }}</div>
|
||||
<div v-if="item.info.keyword1">{{ item.info.keyword1 }}</div>
|
||||
<div v-if="item.info.keyword2">{{ item.info.keyword2 }}</div>
|
||||
<div v-if="item.info.keyword3">{{ item.info.keyword3 }}</div>
|
||||
<div v-if="item.info.keyword4">{{ item.info.keyword4 }}</div>
|
||||
<div v-if="item.info.keyword5">{{ item.info.keyword5 }}</div>
|
||||
</div>
|
||||
<router-link :to="'/case/detail?id='+item.info.id">
|
||||
<div class="case-info-title">
|
||||
|
||||
<div class="case-titdiv" style="">
|
||||
<span class="case-tittext" v-html="item.info.title || item.contentInfo"></span>
|
||||
<span class="follow-hide" v-if="!isDynamic && personal && !item.hidden" @click="emitHide(item.id)">
|
||||
<svg-icon style="margin-right: 10px;font-size:22px;padding-top: 4px;" icon-class="eyes"></svg-icon>隐藏
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="height:58px;padding-top:18px ">
|
||||
<author :avatar="item.authorInfo.avatar" :name="item.authorInfo.name" :info="item.authorInfo.orgInfo" :sex="item.authorInfo.sex" :aid="item.authorInfo.aid"></author>
|
||||
</div>
|
||||
<div class="keyword-text clearfix">
|
||||
<div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain">{{ orgDomainTranslate(item.info.orgDomain) }}</div>
|
||||
<div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain == '' && item.orgDomainParent">{{ orgDomainTranslate(item.info.orgDomainParent) }}</div>
|
||||
<div style="color:#2974D6;font-weight: 450;" v-for="item,idx in item.info.majorType" :key="idx" >{{ majorTypeTranslate(item) }}</div>
|
||||
<div v-if="item.info.keyword1">{{ item.info.keyword1 }}</div>
|
||||
<div v-if="item.info.keyword2">{{ item.info.keyword2 }}</div>
|
||||
<div v-if="item.info.keyword3">{{ item.info.keyword3 }}</div>
|
||||
<div v-if="item.info.keyword4">{{ item.info.keyword4 }}</div>
|
||||
<div v-if="item.info.keyword5">{{ item.info.keyword5 }}</div>
|
||||
</div>
|
||||
</router-link>
|
||||
<div class="case-info-summary">
|
||||
{{displayAll(item)}}
|
||||
@@ -54,7 +56,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import interactBar from "@/components/Portal/interactBar.vue";
|
||||
import author from "@/components/Portal/authorInfo.vue";
|
||||
@@ -115,7 +117,7 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.clearfix:after{
|
||||
content: "020";
|
||||
@@ -143,12 +145,12 @@ div {
|
||||
width: 100%;
|
||||
line-height: 30px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 16px;
|
||||
.case-tittext {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
margin-top: 16px;
|
||||
color: #333333;
|
||||
width: 100%;
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
word-break: break-all;
|
||||
@@ -194,6 +196,7 @@ div {
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
.case-info-date {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
@@ -240,6 +243,5 @@ div {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<!-- <img style="width:60px;height:60" :src="item.authorInfo.avatar"/> -->
|
||||
</div>
|
||||
<div class="follow-center">
|
||||
<div class="follow-center">
|
||||
<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>
|
||||
@@ -29,8 +29,9 @@
|
||||
<el-button class="btn" icon="el-icon-plus" v-if="active == 2">已关注</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--分页没有加-->
|
||||
</div>
|
||||
<div v-if="followList.length == 0">
|
||||
<div v-if="showEmpty">
|
||||
<img class="img" style="width:186px;height:160px" src="/images/homeWu/no-follow.png" alt="" srcset="">
|
||||
<p class="text">还没有关注的人</p>
|
||||
</div>
|
||||
@@ -47,7 +48,7 @@
|
||||
</div>
|
||||
<!-- <img style="width:60px;height:60" :src="item.authorInfo.avatar"/> -->
|
||||
</div>
|
||||
<div class="follow-center">
|
||||
<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>
|
||||
@@ -58,8 +59,9 @@
|
||||
<el-button type="primary" class="btn" v-else icon="el-icon-plus">关注他</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--分页没有加-->
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -76,9 +78,17 @@ import apiUser from "@/api/system/user.js";
|
||||
author
|
||||
},
|
||||
computed:{
|
||||
...mapGetters(['userInfo']),
|
||||
...mapGetters(['userInfo']),
|
||||
avatarText(){
|
||||
return userAvatarText(this.userInfo.name);
|
||||
},
|
||||
showEmpty(){ //是否显示空信息内容
|
||||
if(this.active==1 && this.followList.length==0){
|
||||
return true;
|
||||
}else if(this.active==2 && this.mypageList.length==0){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
},
|
||||
data(){
|
||||
@@ -97,80 +107,85 @@ import apiUser from "@/api/system/user.js";
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.pageId = this.$route.query.id;
|
||||
this.pageId = this.$xpage.getHomeId(this.$route);
|
||||
},
|
||||
methods:{
|
||||
cancel(item) {
|
||||
apiFollow.remove(item.followId).then(res=>{
|
||||
if(res.status == 200) {
|
||||
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) {
|
||||
if(this.followList.length==0){
|
||||
this.getPage()
|
||||
}
|
||||
|
||||
} else {
|
||||
if(this.mypageList.length==0){
|
||||
this.getMyPage()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//展示全部
|
||||
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;
|
||||
res.result.list.forEach(item=>{
|
||||
item.userFollow.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
|
||||
})
|
||||
this.mypageList = res.result.list;
|
||||
console.log(this.mypageList,'this.mypageList');
|
||||
this.getUserData(res.result.list);
|
||||
}
|
||||
})
|
||||
},
|
||||
getPage() { //我关注的,他关注的
|
||||
this.page.aid = this.pageId;
|
||||
apiFollow.page(this.page).then(res=>{
|
||||
if(res.status== 200) {
|
||||
this.count = res.result.count;
|
||||
res.result.list.forEach(item=>{
|
||||
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
|
||||
})
|
||||
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.userFollow.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.userFollow.aid) {
|
||||
item.userFollow.authorInfo = author;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
getMyPage() {//关注我的,关注他的
|
||||
this.page.aid = this.pageId;
|
||||
apiFollow.mypage(this.page).then(res=>{
|
||||
if(res.status== 200) {
|
||||
this.count = res.result.count;
|
||||
res.result.list.forEach(item=>{
|
||||
item.userFollow.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
|
||||
})
|
||||
this.mypageList = res.result.list;
|
||||
//console.log(this.mypageList,'this.mypageList');
|
||||
this.getUserData(res.result.list);
|
||||
}
|
||||
})
|
||||
},
|
||||
getPage() { //我关注的,他关注的
|
||||
this.page.aid = this.pageId;
|
||||
apiFollow.page(this.page).then(res=>{
|
||||
if(res.status== 200) {
|
||||
this.count = res.result.count;
|
||||
res.result.list.forEach(item=>{
|
||||
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
|
||||
})
|
||||
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.userFollow.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.userFollow.aid) {
|
||||
item.userFollow.authorInfo = author;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@@ -179,6 +194,7 @@ import apiUser from "@/api/system/user.js";
|
||||
padding: 4px 0;
|
||||
.tabs-index{
|
||||
padding:0 60px 10px 10px;
|
||||
cursor: pointer;
|
||||
.line{
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
@@ -202,4 +218,4 @@ import apiUser from "@/api/system/user.js";
|
||||
width: 140px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
this.$store.dispatch("Login", this.form).then(rs => {
|
||||
if(rs.status == 200){
|
||||
// 记住密码
|
||||
localStorage.setItem(this.$Constants.newLoginKey,1);
|
||||
localStorage.setItem(this.$xpage.constants.newLoginKey,1);
|
||||
if(this.rememberMe){
|
||||
let rememberMeOjb = {rememberMe:true,loginName:this.form.loginName,password:this.form.password};
|
||||
this.$store.dispatch("portal/SetLoginRememberMe", rememberMeOjb)
|
||||
|
||||
Reference in New Issue
Block a user