|
|
|
@ -24,9 +24,19 @@
|
|
|
|
|
<h1 class="post-title">{{ postDetailStore.post?.title || '' }}</h1>
|
|
|
|
|
<p class="post-body">{{ postDetailStore.post?.content || '' }}</p>
|
|
|
|
|
<div class="post-stats">
|
|
|
|
|
<span> 浏览量 {{ postDetailStore.post?.viewCount ?? 0 }}</span>
|
|
|
|
|
<span> 点赞 {{ postDetailStore.post?.likeCount ?? 0 }}</span>
|
|
|
|
|
<span> 评论 {{ postDetailStore.post?.commentCount ?? 0 }}</span>
|
|
|
|
|
<span> 👁 {{ postDetailStore.post?.viewCount ?? 0 }}</span>
|
|
|
|
|
<span> 🗨 {{ postDetailStore.post?.commentCount ?? 0 }}</span>
|
|
|
|
|
<span>
|
|
|
|
|
<button
|
|
|
|
|
@click="postDetailStore.PostLike"
|
|
|
|
|
class="like-btn"
|
|
|
|
|
:class="{ liked: postDetailStore.isLike }"
|
|
|
|
|
>
|
|
|
|
|
<span v-if="!postDetailStore.isLike">♡</span>
|
|
|
|
|
<span v-else>♥</span>
|
|
|
|
|
{{ postDetailStore.post?.likeCount ?? 0 }}
|
|
|
|
|
</button>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="post-time">
|
|
|
|
|
发布时间:{{ postDetailStore.post?.createTime ? formatTime(postDetailStore.post.createTime) : '' }}
|
|
|
|
@ -50,7 +60,14 @@
|
|
|
|
|
<p class="comment-text">{{ comment.content || '' }}</p>
|
|
|
|
|
<div class="comment-meta">
|
|
|
|
|
<span class="comment-time">{{ comment.createTime ? formatTime(comment.createTime) : '' }}</span>
|
|
|
|
|
<span class="comment-likes">赞 {{ comment.likeCount ?? 0 }}</span>
|
|
|
|
|
<button
|
|
|
|
|
@click="postDetailStore.CommentLike(comment)"
|
|
|
|
|
:class="['like-btn', { liked: comment.isLike }]"
|
|
|
|
|
>
|
|
|
|
|
<span v-if="!comment.isLike">♡</span>
|
|
|
|
|
<span v-else>♥</span>
|
|
|
|
|
{{ comment.likeCount ?? 0 }}
|
|
|
|
|
</button>
|
|
|
|
|
<span v-if="comment.replyCount > 0">
|
|
|
|
|
<button @click="loadReplies(comment)">
|
|
|
|
|
{{ comment.showReplies> 0 ? '收起回复' : '展开回复' }} ({{ comment.replyCount }})
|
|
|
|
@ -81,7 +98,14 @@
|
|
|
|
|
<p class="comment-text">{{ reply.content || '' }}</p>
|
|
|
|
|
<div class="comment-meta">
|
|
|
|
|
<span class="comment-time">{{ reply.createTime ? formatTime(reply.createTime) : '' }}</span>
|
|
|
|
|
<span class="comment-likes">赞 {{ reply.likeCount ?? 0 }}</span>
|
|
|
|
|
<button
|
|
|
|
|
@click="postDetailStore.CommentLike(reply)"
|
|
|
|
|
:class="['like-btn', { liked: reply.isLike }]"
|
|
|
|
|
>
|
|
|
|
|
<span v-if="!reply.isLike">♡</span>
|
|
|
|
|
<span v-else>♥</span>
|
|
|
|
|
{{ reply.likeCount ?? 0 }}
|
|
|
|
|
</button>
|
|
|
|
|
<button class="reply-btn" @click="startReply(reply)">回复</button>
|
|
|
|
|
<button
|
|
|
|
|
class="delete-btn"
|
|
|
|
@ -540,4 +564,15 @@ onUnmounted(() => {
|
|
|
|
|
.delete-btn:hover {
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
}
|
|
|
|
|
.like-btn {
|
|
|
|
|
margin-left: 8px;
|
|
|
|
|
background: none;
|
|
|
|
|
border: none;
|
|
|
|
|
color: #409eff;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
.like-btn.liked {
|
|
|
|
|
color: #f56c6c;
|
|
|
|
|
}
|
|
|
|
|
</style>
|