diff --git a/public/react/src/common/components/comment/CommentIcon.js b/public/react/src/common/components/comment/CommentIcon.js index ff3b109e1..97a57da5e 100644 --- a/public/react/src/common/components/comment/CommentIcon.js +++ b/public/react/src/common/components/comment/CommentIcon.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-18 10:49:46 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-24 17:05:14 + * @LastEditTime : 2019-12-24 18:04:52 */ import './index.scss'; import React from 'react'; @@ -26,7 +26,11 @@ function CommentIcon ({ const _className = [undefined, null, ''].includes(count) ? 'comment_count_none' : 'comment_count'; return ( - + { count } diff --git a/public/react/src/common/components/comment/CommentItem.js b/public/react/src/common/components/comment/CommentItem.js index 28341a47c..e3a229c50 100644 --- a/public/react/src/common/components/comment/CommentItem.js +++ b/public/react/src/common/components/comment/CommentItem.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-17 17:35:17 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-24 17:11:59 + * @LastEditTime : 2019-12-24 18:05:18 */ import './index.scss'; import React, { useState } from 'react'; @@ -14,6 +14,7 @@ import { Icon } from 'antd'; import CommentForm from './CommentForm'; function CommentItem ({ + isAdmin, options, confirm, comment, @@ -60,7 +61,7 @@ function CommentItem ({ const commentAvatar = (author) => ( ); @@ -175,7 +176,8 @@ function CommentItem ({ {commentAppend(children)}
- handleShowOrHide(id, !hidden ? 1 : 0)} diff --git a/public/react/src/common/components/comment/CommentList.js b/public/react/src/common/components/comment/CommentList.js index dc93bcc10..d2bc1f6ee 100644 --- a/public/react/src/common/components/comment/CommentList.js +++ b/public/react/src/common/components/comment/CommentList.js @@ -4,13 +4,15 @@ * @Github: * @Date: 2019-12-17 17:34:00 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-24 11:30:14 + * @LastEditTime : 2019-12-24 18:08:07 */ import './index.scss'; import React from 'react'; import CommentItem from './CommentItem'; +import { Empty } from 'antd'; function CommentList (props) { const { + isAdmin, commentLists, // 评论列表 submitChildComment, submitDeleteComment, @@ -21,18 +23,27 @@ function CommentList (props) { const {comments = []} = commentLists; const renderLi = () => { - return comments.map((item, index) => { + if (comments.length > 0) { + return comments.map((item, index) => { + return ( + + ); + }); + } else { return ( - +
+ +
); - }); + } } return ( diff --git a/public/react/src/common/components/comment/index.js b/public/react/src/common/components/comment/index.js index 15e86c980..5efa8c5ad 100644 --- a/public/react/src/common/components/comment/index.js +++ b/public/react/src/common/components/comment/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-17 17:31:33 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-24 15:47:07 + * @LastEditTime : 2019-12-24 18:03:21 */ import React from 'react'; // import CommentForm from './CommentForm'; @@ -15,6 +15,7 @@ function Comment (props) { commentLists, // addComment, // cancelComment, + isAdmin, addChildComment, likeComment, showOrHideComment, @@ -31,6 +32,7 @@ function Comment (props) { onSubmit={addComment} /> */} { const { + isAdmin, identifier, commentLists, addComment, @@ -74,6 +75,7 @@ const CommentTask = (props) => { return (
{ const { comment_identifier } = state.ojForUserReducer; + const { userInfo } = state.userReducer; return { commentLists, + isAdmin: userInfo.admin, identifier: comment_identifier } }