From 20fb399151060de7ec84e43cd3b2b6d69d7e3ee8 Mon Sep 17 00:00:00 2001 From: daihh Date: Mon, 9 Jan 2023 19:20:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=9B=BE=E7=89=87=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/HomePage/courseList.vue | 2 +- src/views/portal/follow/index.vue | 30 ++++++++++++++++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/components/HomePage/courseList.vue b/src/components/HomePage/courseList.vue index 5c958ba3..bbbfc4b3 100644 --- a/src/components/HomePage/courseList.vue +++ b/src/components/HomePage/courseList.vue @@ -66,7 +66,7 @@ }, components: { courseImage, - }, + }, props:{ list:{ type:Array, diff --git a/src/views/portal/follow/index.vue b/src/views/portal/follow/index.vue index cb7b4e1c..4f4359d3 100644 --- a/src/views/portal/follow/index.vue +++ b/src/views/portal/follow/index.vue @@ -611,15 +611,33 @@ apiCourseStudy.followIds(params).then(res=>{ if(res.status == 200) { list.forEach((item, index) => { - res.result.some(con => { - if (item.contentId == con.courseId && item.aid == con.aid) { + + res.result.some(con => { + if (item.contentId == con.courseId){ + //item.info = con; + if (item.aid == con.aid) { + //不是一个人的进度,如何处理? item.info = con; - return true; - } else { - return false; + } + return true; + }else{ + return false; } - }); }); + + }); + //给没有加的加上课程内容 + list.forEach((item, index) => { + if(!item.info.courseId){ + res.result.some(con => { + if(item.contentId == con.courseId && item.aid != con.aid){ + item.info=con; + return true; + } + return false; + }); + } + }); // this.getArticleUserData(list); } })