diff --git a/src/api/rating/pk.js b/src/api/rating/pk.js index 80d6f9e..c20f9e0 100644 --- a/src/api/rating/pk.js +++ b/src/api/rating/pk.js @@ -12,6 +12,18 @@ export function getList(data) { }) } +/** + * 获取PK赛参与人 + * @param { pkId: string, chooseItemId: string, pageNo: number, pageSize: number } data + */ +export function getParticipantList(data) { + return request({ + url: 'management/api/rating/pk/participant', + method: 'get', + params: data, + }) +} + /** * 生成PK赛 * @param {topicId: string, leftItemId: string, rightItemId: string} data @@ -23,3 +35,53 @@ export function generate(data) { data, }) } + +/** + * 获取PK赛评论列表 + * @param { pageNo: number, pageSize: number, pkId: string, status?: number, rootCommentId?: string, orderBy?: string } data + */ +export function getCommentList(data) { + return request({ + url: 'management/api/rating/pk/comment/list', + method: 'get', + params: data, + }) +} + +/** + * PK赛 评论/回复 + * @param { userId: string, pkId: string, content: string, parentCommentId?: string, replyToCommentId?: string } data + * @param { parentCommentId: string } data 评论回复必传 + * @param { replyToCommentId: string } data 回复必传 + */ +export function comment(data) { + return request({ + url: 'management/api/rating/pk/comment', + method: 'post', + data, + }) +} + +/** + * PK赛 评论 点赞 + * @param { userId: string, commentId: string } data + */ +export function like(data) { + return request({ + url: 'management/api/rating/pk/comment/like', + method: 'post', + data, + }) +} + +/** + * PK赛 评论 禁用/启用 + * @param { id: string, enable: boolean } data + */ +export function toggleEnable(data) { + return request({ + url: 'management/api/rating/pk/comment/toggle', + method: 'post', + data, + }) +} diff --git a/src/router/index.js b/src/router/index.js index 0d4f305..6378d4b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -110,10 +110,10 @@ export const asyncRoutes = [ meta: { title: 'PK赛列表', icon: 'setting' }, }, { - path: 'pkRecord', - name: 'PkRecord', - component: () => import('@/views/rating/pk/record/index'), - meta: { title: 'PK赛记录', icon: 'setting' }, + path: 'pkComment', + name: 'PkComment', + component: () => import('@/views/rating/pk/comment/index'), + meta: { title: 'pK赛评论', icon: 'setting' }, }, ], }, diff --git a/src/views/rating/pk/comment/components/CommentReplyList.vue b/src/views/rating/pk/comment/components/CommentReplyList.vue new file mode 100644 index 0000000..07a68d7 --- /dev/null +++ b/src/views/rating/pk/comment/components/CommentReplyList.vue @@ -0,0 +1,233 @@ + + + + + + 点赞 + 回复 + + + + + + + 回复 @{{ row.replyToUser.nickname || '未知用户' }}: + {{ row.content }} + + + + {{ row.likeCount || 0 }} + + 已展示 + 隐藏/待审 + + + + + + + + + + + + + {{ row.user.nickname || '未知用户' }} + 机器人 + 真人 + + + + + {{ row.userId }} + + + + + + + + + + + + + {{ formatTime(row.createdAt) }} + + + + + + + + + + + diff --git a/src/views/rating/pk/comment/components/PkCommentEdit.vue b/src/views/rating/pk/comment/components/PkCommentEdit.vue new file mode 100644 index 0000000..0b8116a --- /dev/null +++ b/src/views/rating/pk/comment/components/PkCommentEdit.vue @@ -0,0 +1,194 @@ + + + + + + + + + {{ item.nickname || '未知用户' }} + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/rating/pk/comment/components/PkCommentLikeEdit.vue b/src/views/rating/pk/comment/components/PkCommentLikeEdit.vue new file mode 100644 index 0000000..7f4d150 --- /dev/null +++ b/src/views/rating/pk/comment/components/PkCommentLikeEdit.vue @@ -0,0 +1,134 @@ + + + + + + + + + {{ item.nickname || '未知用户' }} + + + + + + + + + + + diff --git a/src/views/rating/pk/comment/index.vue b/src/views/rating/pk/comment/index.vue new file mode 100644 index 0000000..56fbc3d --- /dev/null +++ b/src/views/rating/pk/comment/index.vue @@ -0,0 +1,376 @@ + + + + + + + + + + + + + + + + + + + + 查询 + + + 立即评论 + + + + + + + + + 点赞 + 回复 + 查看回复 + + + + + + + {{ row.content }} + + + + {{ row.likeCount || 0 }} + + + + {{ row.replyCount || 0 }} + + 已展示 + 隐藏/待审 + + + + + + + + + [{{ row.pk.topic ? row.pk.topic.title : '未知主题' }}] + + {{ row.pk.leftItem ? row.pk.leftItem.name : '未知' }} + VS + {{ row.pk.rightItem ? row.pk.rightItem.name : '未知' }} + + + {{ row.pkId }} + + + + + + + + + + + {{ row.user.nickname || '未知用户' }} + 机器人 + 真人 + + {{ row.user.id }} + + + + {{ row.userId }} + + + + + + + + + + + + + {{ formatTime(row.createdAt) }} + + + + + + + + + + + + + + + diff --git a/src/views/rating/pk/record/index.vue b/src/views/rating/pk/record/index.vue deleted file mode 100644 index e69de29..0000000