From 214207eb22cd59f803f6e4b96d6fa52e60ec6f15 Mon Sep 17 00:00:00 2001
From: zhaofang <752743406@qq.com>
Date: Wed, 8 Jun 2022 13:55:48 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=A4=B4=E5=83=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Index.vue | 50 +++-
src/views/portal/case/Index.vue | 502 ++++++++++++++++----------------
2 files changed, 281 insertions(+), 271 deletions(-)
diff --git a/src/views/Index.vue b/src/views/Index.vue
index 10370e6f..942ad5ed 100644
--- a/src/views/Index.vue
+++ b/src/views/Index.vue
@@ -109,7 +109,7 @@
-
+
推荐案例
最热
@@ -122,9 +122,9 @@
-
-
-
-
+
@@ -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{
diff --git a/src/views/portal/case/Index.vue b/src/views/portal/case/Index.vue
index 76434d56..7fb61418 100644
--- a/src/views/portal/case/Index.vue
+++ b/src/views/portal/case/Index.vue
@@ -93,29 +93,18 @@
-
-
-
+
-
{{displayAll(item)}}
{{item.isAll?'收起':'展开'}}
-
-
-
@@ -238,24 +227,31 @@