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 @@ + + + + + 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 @@ + + + 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 @@ + + + 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 @@ + + + + + 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