mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-16 14:26:43 +08:00
首页头像
This commit is contained in:
@@ -109,7 +109,7 @@
|
||||
<!-- 推荐案例2版 -->
|
||||
<div class="modules">
|
||||
<div class="modules-title">
|
||||
|
||||
|
||||
<span class="modules-text">推荐案例</span>
|
||||
<span class="quyer-tag">
|
||||
<a :class="caseList.orderType==2?'current':''" @click="changeCaseOrder(2)">最热</a>
|
||||
@@ -122,9 +122,9 @@
|
||||
<div class="casetwo" :body-style="{ padding: '0px' }">
|
||||
<!-- <div class="case-top"></div> -->
|
||||
<div class="case-conent">
|
||||
<div class="case-time">
|
||||
<!-- <div class="case-time">
|
||||
{{ca.sysCreateTime.substring(0,10)}}
|
||||
</div>
|
||||
</div> -->
|
||||
<a :href="'case/detail?id='+ca.id" >
|
||||
<span class="case-title one-line-ellipsis">
|
||||
{{ca.title}}
|
||||
@@ -135,17 +135,13 @@
|
||||
</a>
|
||||
<div class="case-inter">
|
||||
<interactBar style="width:180px" :type="3" :readonly="true" :data="ca" :shares="false" :views="false"></interactBar>
|
||||
|
||||
</div>
|
||||
<div style="height:40px">
|
||||
<authorInfo :avatar="ca.authorInfo.avatar" :name="ca.authorInfo.name" :info="ca.authorInfo.orgInfo" :sex="ca.authorInfo.sex"></authorInfo></div>
|
||||
</div>
|
||||
<div style="height:40px;margin-top:10px">
|
||||
<authorInfo :avatar="ca.authorInfo.avatar" :name="ca.authorInfo.name" :info="ca.authorInfo.orgInfo" :sex="ca.authorInfo.sex"></authorInfo></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 推荐案例 -->
|
||||
<!-- <div class="modules">
|
||||
@@ -194,7 +190,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div> -->
|
||||
|
||||
|
||||
<!-- 推荐文章 -->
|
||||
<div class="modules">
|
||||
<!--内容块-->
|
||||
@@ -472,20 +468,44 @@ export default {
|
||||
let userIds = [];
|
||||
res.result.forEach(item => {
|
||||
item.authorInfo = { aid: '', name: '', orgInfo: '', avatar: '', code: '',sex:null };
|
||||
|
||||
|
||||
if (item.authorId && item.authorId != '') {
|
||||
userIds.push(item.authorId);
|
||||
}
|
||||
});
|
||||
this.caseList.list = res.result;
|
||||
this.loadAuthorInfo(res.result, userIds);
|
||||
this.loadCaseAuthorInfo(res.result, userIds);
|
||||
}
|
||||
this.caseList.list = res.result;
|
||||
// this.caseList.list = res.result;
|
||||
} else {
|
||||
console.log('加载案例错误:' + res.error);
|
||||
}
|
||||
});
|
||||
},
|
||||
loadCaseAuthorInfo(list, ids) {
|
||||
//加载作者信息,头像,机构信息
|
||||
if (ids.length == 0) {
|
||||
return;
|
||||
}
|
||||
const noReapetIds = [...new Set(ids)];
|
||||
apiUser.getByIds(ids).then(res => {
|
||||
if (res.status == 200) {
|
||||
list.forEach((item, index) => {
|
||||
res.result.some(author => {
|
||||
if (author.aid == item.authorId) {
|
||||
item.authorInfo = author;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
console.log('加载用户信息失败:' + res.error);
|
||||
//this.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
getArticleData() {
|
||||
let $this = this;
|
||||
this.articleList.list = [];
|
||||
@@ -678,7 +698,7 @@ export default {
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #f3f3f3;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
// .qa-dai{
|
||||
|
||||
Reference in New Issue
Block a user