提交个人主页内容的修改

This commit is contained in:
daihh
2022-10-14 20:43:39 +08:00
parent cbb082ba33
commit 85d74637f3
4 changed files with 128 additions and 110 deletions

View File

@@ -4,10 +4,10 @@
} }
.qa-solve{ .qa-solve{
color:#387df7; color:#387df7;
margin-left: -10px; margin-left: -8px;
} }
.qa-unSolve{ .qa-unSolve{
color:#333; color:#333;
margin-left: -10px; margin-left: -8px;
} }

View File

@@ -4,35 +4,37 @@
<div :span="24" v-for="item in list" :key="item.id" class="case-list"> <div :span="24" v-for="item in list" :key="item.id" class="case-list">
<div class="case-info"> <div class="case-info">
<p v-if="isDynamic" class="portal-summary-text"> <p v-if="isDynamic" class="portal-summary-text">
<span v-if="!personal">{{item.aname}}</span>{{item.cusInfo}} <span v-if="!personal">{{item.aname}}</span>{{item.cusInfo}}
<span style="margin-left:28px">{{item.eventTime}}</span> <span style="margin-left:28px">{{item.eventTime}}</span>
<span v-if="personal && !item.hidden" class="follow-hide" style="float:right" @click="emitHide(item.id)"> <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>隐藏 <svg-icon style="margin-right: 10px;font-size:22px;padding-top: 4px;" icon-class="eyes"></svg-icon>隐藏
</span> </span>
</p> </p>
<div class="case-info-cont"> <div class="case-info-cont">
<router-link :to="'/case/detail?id='+item.info.id"> <router-link :to="'/case/detail?id='+item.info.id">
<div class="case-info-title"> <div class="case-info-title">
<div class="case-titdiv">
<span class="case-tittext" v-html="item.info.title || item.contentInfo"></span> <div class="case-titdiv" style="">
<div class="follow-hide" style="width:59px" v-if="!isDynamic && personal && !item.hidden" @click="emitHide(item.id)"> <span class="case-tittext" v-html="item.info.title || item.contentInfo"></span>
<svg-icon style="margin-right: 10px;font-size:22px;padding-top: 4px;" icon-class="eyes"></svg-icon>隐藏 <span class="follow-hide" v-if="!isDynamic && personal && !item.hidden" @click="emitHide(item.id)">
</div> <svg-icon style="margin-right: 10px;font-size:22px;padding-top: 4px;" icon-class="eyes"></svg-icon>隐藏
</div> </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> <div style="height:58px;padding-top:18px ">
<div class="keyword-text clearfix"> <author :avatar="item.authorInfo.avatar" :name="item.authorInfo.name" :info="item.authorInfo.orgInfo" :sex="item.authorInfo.sex" :aid="item.authorInfo.aid"></author>
<div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain">{{ orgDomainTranslate(item.info.orgDomain) }}</div> </div>
<div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain == '' && item.orgDomainParent">{{ orgDomainTranslate(item.info.orgDomainParent) }}</div> <div class="keyword-text clearfix">
<div style="color:#2974D6;font-weight: 450;" v-for="item,idx in item.info.majorType" :key="idx" >{{ majorTypeTranslate(item) }}</div> <div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain">{{ orgDomainTranslate(item.info.orgDomain) }}</div>
<div v-if="item.info.keyword1">{{ item.info.keyword1 }}</div> <div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain == '' && item.orgDomainParent">{{ orgDomainTranslate(item.info.orgDomainParent) }}</div>
<div v-if="item.info.keyword2">{{ item.info.keyword2 }}</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.keyword3">{{ item.info.keyword3 }}</div> <div v-if="item.info.keyword1">{{ item.info.keyword1 }}</div>
<div v-if="item.info.keyword4">{{ item.info.keyword4 }}</div> <div v-if="item.info.keyword2">{{ item.info.keyword2 }}</div>
<div v-if="item.info.keyword5">{{ item.info.keyword5 }}</div> <div v-if="item.info.keyword3">{{ item.info.keyword3 }}</div>
</div> <div v-if="item.info.keyword4">{{ item.info.keyword4 }}</div>
<div v-if="item.info.keyword5">{{ item.info.keyword5 }}</div>
</div>
</router-link> </router-link>
<div class="case-info-summary"> <div class="case-info-summary">
{{displayAll(item)}} {{displayAll(item)}}
@@ -54,7 +56,7 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import interactBar from "@/components/Portal/interactBar.vue"; import interactBar from "@/components/Portal/interactBar.vue";
import author from "@/components/Portal/authorInfo.vue"; import author from "@/components/Portal/authorInfo.vue";
@@ -115,7 +117,7 @@
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.clearfix:after{ .clearfix:after{
content: "020"; content: "020";
@@ -143,12 +145,12 @@ div {
width: 100%; width: 100%;
line-height: 30px; line-height: 30px;
display: flex; display: flex;
justify-content: space-between;
margin-top: 16px;
.case-tittext { .case-tittext {
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
margin-top: 16px;
color: #333333; color: #333333;
width: 100%;
display: -webkit-box; display: -webkit-box;
overflow: hidden; overflow: hidden;
word-break: break-all; word-break: break-all;
@@ -194,6 +196,7 @@ div {
color: #333; color: #333;
font-weight: 600; font-weight: 600;
height: 30px; height: 30px;
line-height: 30px;
.case-info-date { .case-info-date {
flex: 1; flex: 1;
text-align: right; text-align: right;
@@ -240,6 +243,5 @@ div {
} }
} }
} }
</style> </style>

View File

@@ -17,7 +17,7 @@
</div> </div>
<!-- <img style="width:60px;height:60" :src="item.authorInfo.avatar"/> --> <!-- <img style="width:60px;height:60" :src="item.authorInfo.avatar"/> -->
</div> </div>
<div class="follow-center"> <div class="follow-center">
<p class="follow-home-title" style="font-size: 20px;margin-bottom: 12px;">{{item.authorInfo.name}} <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" /> --> <!-- <img style="width:22px;height:22;vertical-align:middle" src="/images/homeWu/man.png" /> -->
</p> </p>
@@ -29,8 +29,9 @@
<el-button class="btn" icon="el-icon-plus" v-if="active == 2">已关注</el-button> <el-button class="btn" icon="el-icon-plus" v-if="active == 2">已关注</el-button>
</div> </div>
</div> </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=""> <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>
@@ -47,7 +48,7 @@
</div> </div>
<!-- <img style="width:60px;height:60" :src="item.authorInfo.avatar"/> --> <!-- <img style="width:60px;height:60" :src="item.authorInfo.avatar"/> -->
</div> </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}} <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" /> --> <!-- <img style="width:22px;height:22;vertical-align:middle" src="/images/homeWu/man.png" /> -->
</p> </p>
@@ -58,8 +59,9 @@
<el-button type="primary" class="btn" v-else icon="el-icon-plus">关注他</el-button> <el-button type="primary" class="btn" v-else icon="el-icon-plus">关注他</el-button>
</div> </div>
</div> </div>
<!--分页没有加-->
</div> </div>
</div> </div>
</template> </template>
<script> <script>
@@ -76,9 +78,17 @@ import apiUser from "@/api/system/user.js";
author author
}, },
computed:{ computed:{
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
avatarText(){ avatarText(){
return userAvatarText(this.userInfo.name); 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(){ data(){
@@ -97,80 +107,85 @@ import apiUser from "@/api/system/user.js";
} }
}, },
mounted() { mounted() {
this.pageId = this.$route.query.id; this.pageId = this.$xpage.getHomeId(this.$route);
}, },
methods:{ methods:{
cancel(item) { cancel(item) {
apiFollow.remove(item.followId).then(res=>{ apiFollow.remove(item.followId).then(res=>{
if(res.status == 200) { if(res.status == 200) {
this.getPage() 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -179,6 +194,7 @@ import apiUser from "@/api/system/user.js";
padding: 4px 0; padding: 4px 0;
.tabs-index{ .tabs-index{
padding:0 60px 10px 10px; padding:0 60px 10px 10px;
cursor: pointer;
.line{ .line{
display: inline-block; display: inline-block;
width: 100%; width: 100%;
@@ -202,4 +218,4 @@ import apiUser from "@/api/system/user.js";
width: 140px; width: 140px;
} }
} }
</style> </style>

View File

@@ -99,7 +99,7 @@
this.$store.dispatch("Login", this.form).then(rs => { this.$store.dispatch("Login", this.form).then(rs => {
if(rs.status == 200){ if(rs.status == 200){
// 记住密码 // 记住密码
localStorage.setItem(this.$Constants.newLoginKey,1); localStorage.setItem(this.$xpage.constants.newLoginKey,1);
if(this.rememberMe){ if(this.rememberMe){
let rememberMeOjb = {rememberMe:true,loginName:this.form.loginName,password:this.form.password}; let rememberMeOjb = {rememberMe:true,loginName:this.form.loginName,password:this.form.password};
this.$store.dispatch("portal/SetLoginRememberMe", rememberMeOjb) this.$store.dispatch("portal/SetLoginRememberMe", rememberMeOjb)