fix:点赞,已购买bug

fix/comment-0701
ch 2 years ago
parent 8142659b0c
commit 64287e9c3f

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-06-24 11:43:04
* @LastEditors: ch
* @LastEditTime: 2022-06-30 19:46:42
* @LastEditTime: 2022-07-01 18:13:33
* @Description: file content
-->
<template>
@ -24,7 +24,7 @@
<el-rate :value="commentDetail.commentScore" disabled/>
<span class="time">{{FormatDate(commentDetail.createTime, 'yyyy-mm-dd hh:ii')}}</span>
</div>
<p class="sku">已购买{{commentDetail.skuName}}</p>
<p class="sku" v-if="commentDetail.skuName">{{commentDetail.skuName}}</p>
<div class="ctx">{{commentDetail.commentContent}}</div>
<!-- 图片预览 -->
<UiImgs v-if="imgs.length" :list="imgs" class="imgs" />
@ -118,8 +118,8 @@ export default {
answerVisible : false,
answerContent : '',
answer : null,
isLike : false,
usefulCount : 0,
isLike : this.commentDetail.isLike,
usefulCount : this.commentDetail.usefulCount,
replyCount : this.commentDetail.replyCount,
showFollowForm : this.isFollowForm,
followComment : this.commentDetail.followComment || null
@ -147,12 +147,16 @@ export default {
}
},
watch:{
commentDetail(){
this.followComment = this.commentDetail.followComment;
this.replyCount = this.commentDetail.replyCount || 0;
this.answerCommentList = this.commentDetail.answerCommentList || [];
this.isLike = this.commentDetail.isLike;
this.usefulCount = this.commentDetail.usefulCount;
commentDetail:{
handler(){
this.followComment = this.commentDetail.followComment;
this.replyCount = this.commentDetail.replyCount || 0;
this.answerCommentList = this.commentDetail.answerCommentList || [];
this.isLike = this.commentDetail.isLike;
this.usefulCount = this.commentDetail.usefulCount;
},
deep : true
}
},
mounted(){

@ -96,7 +96,7 @@ export default {
},
methods: {
getList(id) {
let list = this.list.filter((item) => item.id == id);
let list = this.list.filter((item) => item && item.id == id);
// console.log(`list[0]?.list`, list[0]?.list);
return list[0]?.list || [];
},

Loading…
Cancel
Save