|
@@ -81,6 +81,7 @@ import ImgThree from "@/pages/common/img/img-three";
|
|
import DynamicTag from "@/pages/common/tag/dynamic-tag";
|
|
import DynamicTag from "@/pages/common/tag/dynamic-tag";
|
|
import {getMoments} from "@/api/discovery";
|
|
import {getMoments} from "@/api/discovery";
|
|
import tools from "@/service/tools";
|
|
import tools from "@/service/tools";
|
|
|
|
+import {setLike, setUnLike} from "@/api/community";
|
|
export default {
|
|
export default {
|
|
name: "dynamic-items",
|
|
name: "dynamic-items",
|
|
components: {DynamicTag, ImgThree, ImgTwo, ImgOne},
|
|
components: {DynamicTag, ImgThree, ImgTwo, ImgOne},
|
|
@@ -159,11 +160,13 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
setLike(index){
|
|
setLike(index){
|
|
- this.dynamicList[index].liked=!this.dynamicList[index].liked
|
|
|
|
- if(this.dynamicListdynamicList[index].liked){
|
|
|
|
- ++this.dynamicList[index].likeCount
|
|
|
|
|
|
+ this.list[index].liked=!this.list[index].liked
|
|
|
|
+ if(this.list[index].liked){
|
|
|
|
+ ++this.list[index].likeCount
|
|
|
|
+ setLike( this.list[index].id).then((res)=>{})
|
|
}else {
|
|
}else {
|
|
- --this.dynamicList[index].likeCount
|
|
|
|
|
|
+ --this.list[index].likeCount
|
|
|
|
+ setUnLike( this.list[index].id).then((res)=>{})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|