fix:点赞,已购买bug

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

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

@ -96,7 +96,7 @@ export default {
}, },
methods: { methods: {
getList(id) { 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); // console.log(`list[0]?.list`, list[0]?.list);
return list[0]?.list || []; return list[0]?.list || [];
}, },

Loading…
Cancel
Save