mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 04:16:45 +08:00
修改收藏
This commit is contained in:
@@ -114,6 +114,8 @@ export default {
|
|||||||
shares:0,
|
shares:0,
|
||||||
praises:0,
|
praises:0,
|
||||||
views:0,
|
views:0,
|
||||||
|
courseId:'',
|
||||||
|
courseName:''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -506,11 +508,11 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//需要判断是否已点赞,已点赞的不再加
|
//需要判断是否已点赞,已点赞的不再加
|
||||||
console.log(data,'---------------');
|
console.log(this.data,'---------------');
|
||||||
|
|
||||||
let postData={
|
let postData={
|
||||||
objType:this.type,
|
objType:this.type,
|
||||||
objId:this.data.id || this.data.courseId,
|
objId:this.data.id ?this.data.id: this.data.courseId,
|
||||||
title:'',
|
title:'',
|
||||||
}
|
}
|
||||||
if(this.loading) {
|
if(this.loading) {
|
||||||
@@ -518,7 +520,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.loading=true;
|
this.loading=true;
|
||||||
if(this.type==1){
|
if(this.type==1){
|
||||||
postData.title=this.data.name||this.data.courseName;
|
postData.title=this.data.name?this.data.name:this.data.courseName;
|
||||||
}else if(this.type==60){
|
}else if(this.type==60){
|
||||||
postData.title=this.data.content;
|
postData.title=this.data.content;
|
||||||
} else if(this.type==5){
|
} else if(this.type==5){
|
||||||
@@ -527,7 +529,7 @@ export default {
|
|||||||
postData.title=this.data.title;
|
postData.title=this.data.title;
|
||||||
}
|
}
|
||||||
if(this.isFavorite) {// 已经收藏,再次点击取消收藏
|
if(this.isFavorite) {// 已经收藏,再次点击取消收藏
|
||||||
apiFavorites.remove(this.type,this.data.id||this.data.courseId).then(res=>{
|
apiFavorites.remove(this.type,this.data.id ?this.data.id: this.data.courseId).then(res=>{
|
||||||
this.loading=false;
|
this.loading=false;
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
this.isFavorite=false;
|
this.isFavorite=false;
|
||||||
|
|||||||
Reference in New Issue
Block a user