diff --git a/src/components/search.vue b/src/components/search.vue
index 8cd4874..f83c455 100644
--- a/src/components/search.vue
+++ b/src/components/search.vue
@@ -67,6 +67,7 @@ watch(() => route.params.keyword, (value) => {
}
i {
+ cursor: pointer;
font-size: 20px;
color: rgb(107, 167, 232);
}
diff --git a/src/utils/utils.ts b/src/utils/utils.ts
index ab73753..3d5f495 100644
--- a/src/utils/utils.ts
+++ b/src/utils/utils.ts
@@ -297,6 +297,7 @@ export const likeComment = async (comment: Comment) => {
relationType: RelationType.Like,
}).then(() => {
comment.commentRelation.liked = true
+ comment.commentRelation.hated = false
comment.like++
})
}
@@ -310,4 +311,27 @@ export const unLikeComment = async (comment: Comment) => {
comment.commentRelation.liked = false
comment.like--
})
-}
\ No newline at end of file
+}
+
+export const hateComment = async(comment: Comment) => {
+ await CreateRelation({
+ toId: comment.commentId,
+ toType: TargetType.Comment,
+ relationType: RelationType.Hate,
+ }).then(() => {
+ comment.commentRelation.hated = true
+ if(comment.commentRelation.liked) comment.like --
+ comment.commentRelation.liked = false
+ })
+}
+
+
+export const unHateComment = async(comment: Comment) => {
+ await DeleteRelation({
+ toId: comment.commentId,
+ toType: TargetType.Comment,
+ relationType: RelationType.Hate,
+ }).then(() => {
+ comment.commentRelation.hated = false
+ })
+}
diff --git a/src/views/posts/comment.vue b/src/views/posts/comment.vue
index f79c2a9..8d9ff37 100644
--- a/src/views/posts/comment.vue
+++ b/src/views/posts/comment.vue
@@ -48,7 +48,21 @@
{{ commentBlock.comment.like }}
-
+
+
+
+
+
+ 回复
- 删除
+ 删除
@@ -67,7 +81,10 @@
{{ reply.author.name }}
- {{reply.author.name}} @ {{reply.atUserId}}
+
+ {{reply.author.name}}
+ @{{reply.atUser.name}} :
+
{{reply.content}}
@@ -148,7 +165,7 @@ import {useStore} from "@/store";
import {CreateCommentUrl, DeleteCommentUrl, GetCommentBlocksUrl } from "@/utils/consts";
import {get, post} from "@/utils/request";
import type {CommentBlock} from "@/utils/type"
-import {enterUser, likeComment, turnTime, unLikeComment} from "@/utils/utils";
+import {enterUser, hateComment, likeComment, turnTime, unHateComment, unLikeComment} from "@/utils/utils";
import {errorMsg} from "@/utils/message";
const store = useStore()
const commentList = ref
([])
@@ -396,6 +413,7 @@ const submitComment = async (subjectId: string,rootId: string, fatherId: string,
flex-direction: column;
.name {
+ cursor: pointer;
font-size: 18px;
padding: 0;
margin-top: 10px;
@@ -427,15 +445,18 @@ const submitComment = async (subjectId: string,rootId: string, fatherId: string,
margin-right: 3px;
}
}
+
+ .disagree-like,
.agree-like {
margin-right: 10px;
cursor: pointer;
i {
- color: #7baaef;
+ color: #0000ff;
margin-right: 3px;
}
}
+
}
.reply-item {
@@ -509,4 +530,9 @@ const submitComment = async (subjectId: string,rootId: string, fatherId: string,
.pagination-container span {
margin-right: 20px; /* 为页数信息添加一些右边距 */
}
+
+.highlight {
+ color: #008ac5; /* 蓝色 */
+}
+
\ No newline at end of file
diff --git a/src/views/posts/post-information.vue b/src/views/posts/post-information.vue
index 65d0698..54a3528 100644
--- a/src/views/posts/post-information.vue
+++ b/src/views/posts/post-information.vue
@@ -86,6 +86,7 @@ const props = defineProps<{
display: flex;
button {
+ cursor: pointer;
background-color: #b0d3f8;
color: #fff;
border: none;
diff --git a/src/views/posts/post.vue b/src/views/posts/post.vue
index 2885912..0eea262 100644
--- a/src/views/posts/post.vue
+++ b/src/views/posts/post.vue
@@ -496,6 +496,7 @@ const changePost = async (nowPostId: string) => {
padding: 10px;
li {
+ cursor: pointer;
border-bottom: 1px solid #f0f0f0;
padding-bottom: 10px;
font-size: 15px;
diff --git a/src/views/posts/posts.vue b/src/views/posts/posts.vue
index 6c20e90..31f2827 100644
--- a/src/views/posts/posts.vue
+++ b/src/views/posts/posts.vue
@@ -392,6 +392,7 @@ const loadMoreComments = async () => {
}
label {
+ cursor: pointer;
width: 100%;
padding: 10px;
font-size: 16px;
@@ -844,6 +845,7 @@ const loadMoreComments = async () => {
}
.checked {
+ cursor: pointer;
color: #1890ff; /* 蓝色 */
}