1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| const defaultList = [ { rpid: 3, user: { uid: '13258165', avatar: '', uname: 'Jack', }, content: 'jjjjjjj', ctime: '10-18 08:15', like: 88, }, { rpid: 2, user: { uid: '36080105', avatar: '', uname: 'Tom', }, content: 'ttttttt', ctime: '11-13 11:29', like: 88, }, { rpid: 1, user: { uid: '30009257', avatar, uname: 'Kelly', }, content: 'kkkkkkkkk', ctime: '10-19 09:00', like: 66, }, ]
function CommentItemList() { return commentList.map(item=><div className="reply-item" key = {item.user.uid}> {/* 头像 */} <div className="root-reply-avatar"> <div className="bili-avatar"> <img className="bili-avatar-img" alt="" /> </div> </div>
<div className="content-wrap"> {/* 用户名 */} <div className="user-info"> <div className="user-name">{item.user.uname}</div> </div> {/* 评论内容 */} <div className="root-reply"> <span className="reply-content">{item.content}</span> <div className="reply-info"> {/* 评论时间 */} <span className="reply-time">{item.ctime}</span> {/* 评论数量 */} <span className="reply-time">点赞数:{item.like}</span> {item.user.uid !== user.uid && <span className="delete-btn" onClick={()=>onDeletClicked(item.user.uid)}> 删除 </span>}
</div> </div> </div> </div>) }
<div className="reply-list"> <CommentItemList/> </div>
|