...
|
...
|
@@ -14,9 +14,15 @@ |
|
|
:option="favOption"></WidgetFav>
|
|
|
</div>
|
|
|
|
|
|
<div class="comment-cont" @click="replyComment(parentComment.id)" :data-parent-id="parentComment.parentId" :data-root-id="parentComment.rootId">
|
|
|
<CommentPlaceholder
|
|
|
class="comment-cont"
|
|
|
:dest-id="parentComment.id"
|
|
|
:add-type="1"
|
|
|
:user="parentComment.userName"
|
|
|
:column-type="columnType"
|
|
|
@on-comment="onReply">
|
|
|
{{parentComment.content}}
|
|
|
</div>
|
|
|
</CommentPlaceholder>
|
|
|
<div class="reply-main" v-if="replayShowList.length">
|
|
|
<p class="reply-item" v-for="(reply, replyIndex) in replayShowList" :key="replyIndex">
|
|
|
<span class="reply-user">
|
...
|
...
|
@@ -25,9 +31,15 @@ |
|
|
<span v-if="reply.parentUserName">
|
|
|
回复<em class="reply-to-user">@{{reply.parentUserName}}</em>
|
|
|
</span>:
|
|
|
<span @click="replyComment(reply.id)" :data-parent-id="reply.parentId" :data-root-id="reply.rootId">
|
|
|
{{reply.content}}
|
|
|
</span>
|
|
|
<CommentPlaceholder
|
|
|
tag="span"
|
|
|
:dest-id="reply.id"
|
|
|
:add-type="1"
|
|
|
:user="reply.userName"
|
|
|
:column-type="columnType"
|
|
|
@on-comment="onReply">
|
|
|
{{reply.content}}
|
|
|
</CommentPlaceholder>
|
|
|
</p>
|
|
|
<p class="reply-more" v-if="moreReplyNum > 0" @click="onShowMore">
|
|
|
{{replyMoreText}}
|
...
|
...
|
@@ -85,17 +97,8 @@ export default { |
|
|
onShowMore() {
|
|
|
this.isShowAllReply = !this.isShowAllReply;
|
|
|
},
|
|
|
async replyComment(commentId) {
|
|
|
const result = await this.postComment({
|
|
|
content: '这还是一条测试回复',
|
|
|
commentId: commentId,
|
|
|
addType: 1,
|
|
|
columnType: this.columnType
|
|
|
});
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
this.$emit('on-reply', {commentId: this.parentComment.id});
|
|
|
}
|
|
|
async onReply({destId}) {
|
|
|
this.$emit('on-reply', {commentId: destId});
|
|
|
}
|
|
|
}
|
|
|
};
|
...
|
...
|
|