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