个人主页隐藏功能无法使用

This commit is contained in:
zhaofang
2022-10-22 10:50:02 +08:00
parent 28d68c341e
commit 040548f15f
5 changed files with 25 additions and 6 deletions

View File

@@ -16,7 +16,6 @@
<answer-list v-if="item.contentType == 5" :list="[item]" :isDynamic="true" :personal="personal" @hideIndex="dynamicHide"></answer-list>
<article-list v-if="item.contentType == 2" :list="[item]" :isDynamic="true" :personal="personal" @hideIndex="dynamicHide"></article-list>
</template>
</el-tab-pane>
<el-tab-pane name="1">
<span slot="label"><svg-icon icon-class="home-course" style="font-size: 30px;"></svg-icon><span class="tabs-info">课程</span></span>
@@ -80,6 +79,7 @@
import BookList from "@/components/HomePage/bookList.vue"
import apiStat from '@/api/phase2/stat.js';
import apiCourse from '@/api/modules/course.js'
import apiCourseStudy from '@/api/modules/courseStudy.js'
import apiArticle from '@/api/modules/article.js'
import apiCases from '@/api/modules/cases.js'
import apiQa from '@/api/modules/qa.js'
@@ -157,6 +157,7 @@
apiStat.dynamicHide(id).then(res=>{
if(res.status == 200){
this.$message.success('动态隐藏成功')
this.getList();
} else {
this.$message.error(res.message);
}
@@ -189,6 +190,8 @@
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,6 +208,7 @@
if(this.activeName == 1){
this.cousrePageList = res.result.list
this.getCourse(noReapetIds,res.result.list);
this.getCourseProgress(noReapetIds,res.result.list);
}
if(this.activeName == 2) {
this.articlePageList = res.result.list;
@@ -302,6 +306,21 @@
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