diff --git a/src/components/HomePage/courseList.vue b/src/components/HomePage/courseList.vue
index 5f14d3c6..202be7ea 100644
--- a/src/components/HomePage/courseList.vue
+++ b/src/components/HomePage/courseList.vue
@@ -13,20 +13,18 @@
-
-
-
{{item.info.name || item.contentInfo}} {{toScore(item.info.score)}}分
+
{{item.info.name || item.contentInfo}} {{toScore(item.info.lastScore)}}分
{{item.info.summary}}
-
-
最新一次学习时间:{{item.eventTime}}
+
+
最新一次学习时间:{{item.info.lastTime}}
隐藏
-
-
{{pageId == userInfo.aid || isFollow? '继续学习' : '我也去学'}}
+
+ {{isFollow ? '我也去学':pageId == userInfo.aid? '继续学习' : '我也去学'}}
diff --git a/src/views/homepage/page.vue b/src/views/homepage/page.vue
index f3d58569..d2af2d3d 100644
--- a/src/views/homepage/page.vue
+++ b/src/views/homepage/page.vue
@@ -130,7 +130,6 @@
},
watch:{
'$route' (to, from) { //监听路由是否变化
- //console.log(from,'from')
if(to.params.id != from.params.id){
this.pageId = to.params.id;
let urlPre=window.location.protocol+'//'+window.location.host;
@@ -189,8 +188,6 @@
let ids = res.result.list.map(item=>item.contentId);
const noReapetIds = [...new Set(ids)];
res.result.list.forEach(item=>{
- item.lastTime = '';
- item.progress = null;
item.info = {};
item.authorInfo = {
aid: "",
@@ -205,9 +202,8 @@
this.getAllList(res.result.list)
}
if(this.activeName == 1){
- this.cousrePageList = res.result.list
- this.getCourse(noReapetIds,res.result.list);
- this.getCourseProgress(noReapetIds,res.result.list);
+ this.cousrePageList = res.result.list
+ this.getCourse(noReapetIds,res.result.list);
}
if(this.activeName == 2) {
this.articlePageList = res.result.list;
@@ -305,21 +301,6 @@
return val1 < val2 ? rev * -1 : rev * 1;
};
},
- getCourseProgress(ids,list) {
- apiCourseStudy.ids(ids).then((res)=>{
- console.log(res,'res');
- // list.forEach((item, index) => {
- // res.result.some(con => {
- // if (con.id == item.contentId) {
- // item.info = con;
- // return true;
- // } else {
- // return false;
- // }
- // });
- // });
- })
- },
getAnswer(ids,list){
if(ids.length == 0){
return
@@ -465,11 +446,19 @@
});
},
getCourse(ids,list) {
- apiCourse.ids(ids).then(res=>{
+ let aid = {}
+ let params = {
+ ids:ids,
+ // aid:[this.pageId]
+ }
+ if(this.pageId != this.userInfo.aid) {
+ params.aid = this.pageId
+ }
+ apiCourseStudy.ids(params).then(res=>{
if(res.status == 200) {
list.forEach((item, index) => {
res.result.some(con => {
- if (con.id == item.contentId) {
+ if (con.courseId == item.contentId) {
item.info = con;
return true;
} else {
@@ -477,7 +466,6 @@
}
});
});
- // this.getArticleUserData(list);
}
})
},
diff --git a/src/views/portal/follow/index.vue b/src/views/portal/follow/index.vue
index d4cad39f..a7f9ca93 100644
--- a/src/views/portal/follow/index.vue
+++ b/src/views/portal/follow/index.vue
@@ -85,6 +85,7 @@
import apiStat from "@/api/phase2/stat.js"
import apiArticle from '@/api/modules/article.js'
import apiCases from '@/api/modules/cases.js'
+ import apiCourseStudy from '@/api/modules/courseStudy.js'
import apiQa from '@/api/modules/qa.js'
import apiCourse from '@/api/modules/course.js'
import apiNote from '@/api/phase2/note.js'
@@ -117,7 +118,7 @@
personal:true,
orgData:[],
Profess:[],
- ids:[],
+ followIds:[],
}
},
computed: {
@@ -126,7 +127,7 @@
created() {
apiFollow.list().then(res=>{
if(res.status == 200) {
- this.ids = res.result.map(item=>item.followId);
+ this.followIds = res.result.map(item=>item.followId);
this.getList()
}
})
@@ -160,19 +161,21 @@
this.page.pageIndex = val;
this.getList();
},
- getList(ids) {
+ getList() {
let data = {
pageIndex:this.page.pageIndex,
pageSize:this.page.pageSize,
contentType:this.activeName == 0? '':this.activeName,//内容类型
- aids:this.ids // 数组
+ aids:this.followIds // 数组
}
apiStat.userDynamicfollows(data).then(res=>{
if(res.status == 200) {
this.page.count = res.result.count;
let ids = res.result.list.map(item=>item.contentId);
+ let aids = [];
const noReapetIds = [...new Set(ids)];
res.result.list.forEach(item=>{
+ aids.push(item.aid);
item.info = {};
item.authorInfo = {
aid: "",
@@ -187,8 +190,9 @@
this.getAllList(res.result.list)
}
if(this.activeName == 1){
- this.cousrePageList = res.result.list
- this.getCourse(noReapetIds,res.result.list);
+ const noReapetAids = [...new Set(aids)];
+ this.cousrePageList = res.result.list;
+ this.getCourse(noReapetIds,res.result.list);
}
if(this.activeName == 2) {
this.articlePageList = res.result.list;
@@ -197,7 +201,6 @@
if(this.activeName == 3) {
this.casePageList = res.result.list;
this.getCase(noReapetIds,res.result.list);
- console.log(this.casePageList,'this.casePageList');
}
if(this.activeName == 6) { // 笔记
this.getNote(noReapetIds,res.result.list);
@@ -429,11 +432,15 @@
});
},
getCourse(ids,list) {
- apiCourse.ids(ids).then(res=>{
+ let params = {
+ ids:ids,
+ aids:this.followIds
+ }
+ apiCourseStudy.followIds(params).then(res=>{
if(res.status == 200) {
list.forEach((item, index) => {
res.result.some(con => {
- if (con.id == item.contentId) {
+ if (item.contentId == con.courseId && item.aid == con.aid) {
item.info = con;
return true;
} else {