|
|
@ -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-29 18:41:01
|
|
|
|
* @LastEditTime: 2022-06-29 19:22:24
|
|
|
|
* @Description: file content
|
|
|
|
* @Description: file content
|
|
|
|
-->
|
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
@ -17,7 +17,8 @@
|
|
|
|
<span>{{commentDetail.skuName}}</span>
|
|
|
|
<span>{{commentDetail.skuName}}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<main>
|
|
|
|
<main>
|
|
|
|
<BsCommentSubmit v-if="!commentDetail.id" :commentDetail="commentDetail" @submit="handleSubmit"/>
|
|
|
|
<BsCommentSubmit v-if="!commentDetail.id" :commentDetail="commentDetail" @submit="handleSubmit"
|
|
|
|
|
|
|
|
@editStatusChange="editStatusChange"/>
|
|
|
|
<template v-else>
|
|
|
|
<template v-else>
|
|
|
|
<div class="top">
|
|
|
|
<div class="top">
|
|
|
|
<el-rate :value="commentDetail.commentScore" disabled/>
|
|
|
|
<el-rate :value="commentDetail.commentScore" disabled/>
|
|
|
@ -31,8 +32,9 @@
|
|
|
|
<!-- 追评 -->
|
|
|
|
<!-- 追评 -->
|
|
|
|
<UiButton class="follow-btn" type="yellow_line" radius="4px"
|
|
|
|
<UiButton class="follow-btn" type="yellow_line" radius="4px"
|
|
|
|
v-if="isCanFollowComment && !showFollowForm" @click="showFollowForm = true">发起追评</UiButton>
|
|
|
|
v-if="isCanFollowComment && !showFollowForm" @click="showFollowForm = true">发起追评</UiButton>
|
|
|
|
|
|
|
|
|
|
|
|
<BsCommentSubmit v-if="showFollowForm && !followComment" :type="COMMENT.TYPE.FOLLOW_COMMENT"
|
|
|
|
<BsCommentSubmit v-if="showFollowForm && !followComment" :type="COMMENT.TYPE.FOLLOW_COMMENT"
|
|
|
|
:commentDetail="commentDetail" @submit="handleSubmitFollow"/>
|
|
|
|
:commentDetail="commentDetail" @submit="handleSubmitFollow" @editStatusChange="editStatusChange"/>
|
|
|
|
|
|
|
|
|
|
|
|
<BsCommentFollowInfo v-if="followComment"
|
|
|
|
<BsCommentFollowInfo v-if="followComment"
|
|
|
|
:followComment="followComment" :commentTime="commentDetail.commentTime"/>
|
|
|
|
:followComment="followComment" :commentTime="commentDetail.commentTime"/>
|
|
|
@ -41,7 +43,7 @@
|
|
|
|
<div class="operation">
|
|
|
|
<div class="operation">
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<span class="operation--chat" @click="answerVisible = !answerVisible">
|
|
|
|
<span class="operation--chat" @click="answerVisible = !answerVisible">
|
|
|
|
<template v-if="commentDetail.replyCount">{{commentDetail.replyCount}}条</template>评论
|
|
|
|
<template v-if="replyCount">{{replyCount}}条</template>评论
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<span class="operation--show" v-if="answerCommentList.length" @click="answerVisible = !answerVisible">
|
|
|
|
<span class="operation--show" v-if="answerCommentList.length" @click="answerVisible = !answerVisible">
|
|
|
|
{{answerVisible ? '收起' : '展开'}}
|
|
|
|
{{answerVisible ? '收起' : '展开'}}
|
|
|
@ -52,7 +54,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 评论内容 -->
|
|
|
|
<!-- 评论内容 -->
|
|
|
|
<div class="answer" v-if="showAnswerBox">
|
|
|
|
<div class="answer" v-if="showAnswerBox">
|
|
|
|
<b class="answer--title">全部评论({{commentDetail.replyCount}})</b>
|
|
|
|
<b class="answer--title">全部评论({{replyCount}})</b>
|
|
|
|
<ul>
|
|
|
|
<ul>
|
|
|
|
<li class="answer--item" v-if="commentDetail.merchantComment">
|
|
|
|
<li class="answer--item" v-if="commentDetail.merchantComment">
|
|
|
|
<div class="answer--name"><b>{{commentDetail.merchantComment.userName}}:</b><span>{{commentDetail.merchantComment.createTime}}</span></div>
|
|
|
|
<div class="answer--name"><b>{{commentDetail.merchantComment.userName}}:</b><span>{{commentDetail.merchantComment.createTime}}</span></div>
|
|
|
@ -118,6 +120,7 @@ export default {
|
|
|
|
answer : null,
|
|
|
|
answer : null,
|
|
|
|
isLike : false,
|
|
|
|
isLike : false,
|
|
|
|
usefulCount : 0,
|
|
|
|
usefulCount : 0,
|
|
|
|
|
|
|
|
replyCount : this.commentDetail.replyCount,
|
|
|
|
showFollowForm : this.isFollowForm,
|
|
|
|
showFollowForm : this.isFollowForm,
|
|
|
|
followComment : this.commentDetail.followComment || null
|
|
|
|
followComment : this.commentDetail.followComment || null
|
|
|
|
|
|
|
|
|
|
|
@ -146,6 +149,7 @@ export default {
|
|
|
|
watch:{
|
|
|
|
watch:{
|
|
|
|
commentDetail(){
|
|
|
|
commentDetail(){
|
|
|
|
this.followComment = this.commentDetail.followComment;
|
|
|
|
this.followComment = this.commentDetail.followComment;
|
|
|
|
|
|
|
|
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;
|
|
|
@ -201,6 +205,7 @@ export default {
|
|
|
|
parentName: this.answer ? this.answer.userName : ''
|
|
|
|
parentName: this.answer ? this.answer.userName : ''
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.answerContent = '';
|
|
|
|
this.answerContent = '';
|
|
|
|
|
|
|
|
this.replyCount++;
|
|
|
|
this.$message.success('评论成功!');
|
|
|
|
this.$message.success('评论成功!');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -231,6 +236,12 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.commentDetail.isLike = this.isLike;
|
|
|
|
this.commentDetail.isLike = this.isLike;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 动态监听是否有输入内容的评价或追评
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
editStatusChange(val){
|
|
|
|
|
|
|
|
this.$emit('editStatusChange', val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|