|
|
|
@ -44,7 +44,7 @@ class MemoDetail extends Component {
|
|
|
|
|
this.state = {
|
|
|
|
|
memoLoading: true,
|
|
|
|
|
hasMoreComments: false,
|
|
|
|
|
pageCount: 1,
|
|
|
|
|
pageCount: 2,
|
|
|
|
|
|
|
|
|
|
goldRewardDialogOpen: false
|
|
|
|
|
}
|
|
|
|
@ -54,18 +54,18 @@ class MemoDetail extends Component {
|
|
|
|
|
|
|
|
|
|
const { match } = this.props
|
|
|
|
|
|
|
|
|
|
const memoUrl = `/api/v1/memos/${match.params.memoId}`;
|
|
|
|
|
const memoUrl = `/memos/${match.params.memoId}.json`;
|
|
|
|
|
this.setState({
|
|
|
|
|
memoLoading: true
|
|
|
|
|
})
|
|
|
|
|
axios.get(memoUrl,{
|
|
|
|
|
withCredentials: true,
|
|
|
|
|
// withCredentials: true,
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
const memo = response.data.memo
|
|
|
|
|
if (response.data.status === -1) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.props.showSnackbar('帖子不存在!')
|
|
|
|
|
this.props.showNotification('帖子不存在!')
|
|
|
|
|
}, 300)
|
|
|
|
|
this.props.history.push(`/forums`)
|
|
|
|
|
return;
|
|
|
|
@ -86,14 +86,16 @@ class MemoDetail extends Component {
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
hasMoreComments,
|
|
|
|
|
pageCount: 1,
|
|
|
|
|
pageCount: 2,
|
|
|
|
|
comments: memo_replies
|
|
|
|
|
})
|
|
|
|
|
delete response.data.memo_replies;
|
|
|
|
|
// reset
|
|
|
|
|
response.data.memo.praise_count = response.data.memo.memo_praise_count
|
|
|
|
|
this.props.initForumState(response.data)
|
|
|
|
|
const user = response.data.current_user;
|
|
|
|
|
user.tidding_count = response.data.tidding_count;
|
|
|
|
|
this.props.initCommonState(user)
|
|
|
|
|
// const user = response.data.current_user;
|
|
|
|
|
// user.tidding_count = response.data.tidding_count;
|
|
|
|
|
// this.props.initCommonState(user)
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
memoLoading: false
|
|
|
|
@ -116,20 +118,20 @@ class MemoDetail extends Component {
|
|
|
|
|
$('body>#root').off('onMemoDelete')
|
|
|
|
|
}
|
|
|
|
|
onMemoDelete(memo) {
|
|
|
|
|
const deleteUrl = `/api/v1/memos/${memo.id}`;
|
|
|
|
|
const deleteUrl = `/memos/${memo.id}.json`;
|
|
|
|
|
// 获取memo list
|
|
|
|
|
axios.delete(deleteUrl, {
|
|
|
|
|
withCredentials: true,
|
|
|
|
|
// withCredentials: true,
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
const status = response.data.status
|
|
|
|
|
if (status === 0) {
|
|
|
|
|
|
|
|
|
|
this.props.showSnackbar('删除成功');
|
|
|
|
|
this.props.showNotification('删除成功');
|
|
|
|
|
this.props.history.push(`/forums`)
|
|
|
|
|
|
|
|
|
|
} else if (status === -1) {
|
|
|
|
|
this.props.showSnackbar('帖子已被删除');
|
|
|
|
|
this.props.showNotification('帖子已被删除');
|
|
|
|
|
this.props.history.push(`/forums`)
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
@ -158,14 +160,14 @@ class MemoDetail extends Component {
|
|
|
|
|
|
|
|
|
|
clickPraise(){
|
|
|
|
|
const { memo } = this.props;
|
|
|
|
|
const url = `/api/v1/discusses/${memo.id}/plus`;
|
|
|
|
|
const url = `/discusses/${memo.id}/plus.json`;
|
|
|
|
|
console.log(url)
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
container_type: 'Memo',
|
|
|
|
|
type: 1 // "踩0;赞1"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
withCredentials: true
|
|
|
|
|
// withCredentials: true
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
console.log(response);
|
|
|
|
@ -178,18 +180,16 @@ class MemoDetail extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
renderAttachment() {
|
|
|
|
|
const { memo } = this.props;
|
|
|
|
|
const { memo, attachments_list } = this.props;
|
|
|
|
|
const attachments = []
|
|
|
|
|
memo.attachment_url.forEach((item, index) => {
|
|
|
|
|
attachments_list.forEach((item, index) => {
|
|
|
|
|
const ar = item.url.split('/')
|
|
|
|
|
const fileName = item.filename || ar[ar.length - 1]
|
|
|
|
|
let filesize = 0
|
|
|
|
|
if (item.filesize) {
|
|
|
|
|
filesize = bytesToSize(item.filesize)
|
|
|
|
|
}
|
|
|
|
|
const fileName = item.title
|
|
|
|
|
let filesize = item.filesize
|
|
|
|
|
|
|
|
|
|
attachments.push(
|
|
|
|
|
<p className="clearfix" key={index} >
|
|
|
|
|
<a href={item.url} className="color-green clearfix notefileDownload">
|
|
|
|
|
<a href={item.url} className="color-green clearfix notefileDownload" target="_blank">
|
|
|
|
|
<i className="iconfont icon-xiazai color-green ml5 fl"></i><span className="fl">{fileName}{filesize? ` ${filesize}` : ''}</span>
|
|
|
|
|
</a>
|
|
|
|
|
</p>
|
|
|
|
@ -213,9 +213,9 @@ class MemoDetail extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
replyComment = (commentContent, id, editor) => {
|
|
|
|
|
const { showSnackbar } = this.props;
|
|
|
|
|
const { showNotification } = this.props;
|
|
|
|
|
if (!commentContent || commentContent.length === 0) {
|
|
|
|
|
showSnackbar('必须填写内容!')
|
|
|
|
|
showNotification('必须填写内容!')
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -223,7 +223,8 @@ class MemoDetail extends Component {
|
|
|
|
|
this.createNewComment(commentContent, id, editor);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const url = `/api/v1/memos/${id}/reply`;
|
|
|
|
|
// /${id}
|
|
|
|
|
const url = `/memos/reply.json`;
|
|
|
|
|
const { comments } = this.state;
|
|
|
|
|
const user = this._getUser();
|
|
|
|
|
/*
|
|
|
|
@ -235,12 +236,14 @@ class MemoDetail extends Component {
|
|
|
|
|
commentContent = commentContent.replace(/(\n<p>\n\t<br \/>\n<\/p>)*$/g,'');
|
|
|
|
|
}
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
parent_id: id,
|
|
|
|
|
content: commentContent
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
withCredentials: true
|
|
|
|
|
// withCredentials: true
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
response.data.memo = response.data
|
|
|
|
|
if (response.data.memo) {
|
|
|
|
|
let newDiscuss = response.data.memo;
|
|
|
|
|
|
|
|
|
@ -303,12 +306,12 @@ class MemoDetail extends Component {
|
|
|
|
|
if (childCommentId) {
|
|
|
|
|
deleteCommentId = childCommentId;
|
|
|
|
|
}
|
|
|
|
|
const url = `/api/v1/memos/${deleteCommentId}`
|
|
|
|
|
const url = `/memos/${deleteCommentId}.json`
|
|
|
|
|
let comments = this.state.comments;
|
|
|
|
|
|
|
|
|
|
axios.delete(url,
|
|
|
|
|
{
|
|
|
|
|
withCredentials: true
|
|
|
|
|
// withCredentials: true
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
// TODO 删除成功或失败
|
|
|
|
@ -346,7 +349,7 @@ class MemoDetail extends Component {
|
|
|
|
|
const { comments } = this.state;
|
|
|
|
|
const commentIndex = this._findById(discussId, comments);
|
|
|
|
|
|
|
|
|
|
const url = `/api/v1/discusses/${discussId}/plus`
|
|
|
|
|
const url = `/discusses/${discussId}/plus.json`
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
// id: discussId,
|
|
|
|
|
// container_id: challenge.id,
|
|
|
|
@ -354,7 +357,7 @@ class MemoDetail extends Component {
|
|
|
|
|
type: comments[commentIndex].user_praise === true ? 0 : 1, // "踩0;赞1"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
withCredentials: true
|
|
|
|
|
// withCredentials: true
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if (response.data.praise_count === 0 || response.data.praise_count) {
|
|
|
|
@ -372,14 +375,14 @@ class MemoDetail extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
rewardCode = (parrentComment, childComment, amount) => {
|
|
|
|
|
const { showSnackbar } = this.props;
|
|
|
|
|
const { showNotification } = this.props;
|
|
|
|
|
const { comments } = this.state;
|
|
|
|
|
let handleComment = parrentComment
|
|
|
|
|
if (childComment) {
|
|
|
|
|
handleComment = childComment;
|
|
|
|
|
}
|
|
|
|
|
let handleCommentId = handleComment.id;
|
|
|
|
|
const url = `/api/v1/discusses/${handleCommentId}/reward_code`
|
|
|
|
|
const url = `/discusses/${handleCommentId}/reward_code.json`
|
|
|
|
|
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
id: handleCommentId,
|
|
|
|
@ -389,7 +392,7 @@ class MemoDetail extends Component {
|
|
|
|
|
user_id: handleComment.user_id
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
withCredentials: true
|
|
|
|
|
// withCredentials: true
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if (response.data && response.data.code) {
|
|
|
|
@ -416,14 +419,14 @@ class MemoDetail extends Component {
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
showSnackbar('奖励失败,请联系系统管理员!')
|
|
|
|
|
showNotification('奖励失败,请联系系统管理员!')
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
hiddenComment = (item, childCommentId) => {
|
|
|
|
|
const id = item.id
|
|
|
|
|
const { showSnackbar } = this.props;
|
|
|
|
|
const { showNotification } = this.props;
|
|
|
|
|
const user = this._getUser();
|
|
|
|
|
const url = `/api/v1/memos/${id}/hidden`
|
|
|
|
|
const url = `/memos/${id}/hidden.json`
|
|
|
|
|
const { comments } = this.state;
|
|
|
|
|
|
|
|
|
|
const commentIndex = this._findById(id, comments);
|
|
|
|
@ -432,14 +435,14 @@ class MemoDetail extends Component {
|
|
|
|
|
hidden: !comment.hidden ? "1" : "0"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
withCredentials: true
|
|
|
|
|
// withCredentials: true
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if (response.data.status === -1) {
|
|
|
|
|
showSnackbar(response.data.message)
|
|
|
|
|
showNotification(response.data.message)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (response.data.status === 1) {
|
|
|
|
|
if (response.data.status === 0) {
|
|
|
|
|
|
|
|
|
|
if (!childCommentId) {
|
|
|
|
|
comment.hidden = !comment.hidden;
|
|
|
|
@ -473,14 +476,16 @@ class MemoDetail extends Component {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const url = `/api/v1/memos/${memo.id}/reply`;
|
|
|
|
|
// /${memo.id}
|
|
|
|
|
const url = `/memos/reply.json`;
|
|
|
|
|
let { comments } = this.state;
|
|
|
|
|
const user = this._getUser();
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
parent_id: memo.id,
|
|
|
|
|
content: content
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
withCredentials: true
|
|
|
|
|
// withCredentials: true
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if (response.data.status === -1) {
|
|
|
|
@ -488,6 +493,7 @@ class MemoDetail extends Component {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (response.data) {
|
|
|
|
|
response.data.memo = response.data
|
|
|
|
|
const newMemo = response.data.memo;
|
|
|
|
|
// ke
|
|
|
|
|
editor.html && editor.html('');
|
|
|
|
@ -536,12 +542,12 @@ class MemoDetail extends Component {
|
|
|
|
|
let { comments, pageCount } = this.state;
|
|
|
|
|
let { memo } = this.props;
|
|
|
|
|
const user = this._getUser();
|
|
|
|
|
const url = `/api/v1/memos/${memo.id}/more_reply?page=${pageCount}`;
|
|
|
|
|
const url = `/memos/${memo.id}/more_reply.json?page=${pageCount}`;
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
withCredentials: true
|
|
|
|
|
// withCredentials: true
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if (response.data.status === -1) {
|
|
|
|
@ -584,15 +590,15 @@ class MemoDetail extends Component {
|
|
|
|
|
params.forum_id = this.state.p_forum_id;
|
|
|
|
|
}
|
|
|
|
|
let paramsUrl = urlStringify(params)
|
|
|
|
|
const set_top_or_down_Url = `/api/v1/memos/${memo.id}/set-top-or-down?${paramsUrl}`;
|
|
|
|
|
const set_top_or_down_Url = `/memos/${memo.id}/sticky_or_cancel.json?${paramsUrl}`;
|
|
|
|
|
// 获取memo list
|
|
|
|
|
axios.get(set_top_or_down_Url, {
|
|
|
|
|
withCredentials: true,
|
|
|
|
|
axios.post(set_top_or_down_Url, {
|
|
|
|
|
// withCredentials: true,
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
const status = response.data.status
|
|
|
|
|
if (status === 0) {
|
|
|
|
|
this.props.showSnackbar( memo.sticky ? '取消置顶成功' : '置顶成功');
|
|
|
|
|
this.props.showNotification( memo.sticky ? '取消置顶成功' : '置顶成功');
|
|
|
|
|
memo.sticky = memo.sticky ? false : true
|
|
|
|
|
this.setState({
|
|
|
|
|
memo: Object.assign({}, memo)
|
|
|
|
@ -608,9 +614,8 @@ class MemoDetail extends Component {
|
|
|
|
|
const { memo, author_info } = this.props;
|
|
|
|
|
const newMemo = Object.assign({}, memo);
|
|
|
|
|
const _reward = parseInt(inputVal)
|
|
|
|
|
const newMemoUrl = `/api/v1/memos/${memo.id}/update`
|
|
|
|
|
|
|
|
|
|
const url = `/api/v1/discusses/${memo.id}/reward_code`
|
|
|
|
|
const url = `/discusses/${memo.id}/reward_code.json`
|
|
|
|
|
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
id: memo.id,
|
|
|
|
@ -619,7 +624,7 @@ class MemoDetail extends Component {
|
|
|
|
|
score: _reward,
|
|
|
|
|
user_id: author_info.user_id
|
|
|
|
|
}, {
|
|
|
|
|
withCredentials: true,
|
|
|
|
|
// withCredentials: true,
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
const { code } = response.data;
|
|
|
|
@ -628,9 +633,9 @@ class MemoDetail extends Component {
|
|
|
|
|
this.props.initForumState({
|
|
|
|
|
memo: newMemo
|
|
|
|
|
})
|
|
|
|
|
this.props.showSnackbar( '奖励成功' );
|
|
|
|
|
this.props.showNotification( '奖励成功' );
|
|
|
|
|
} else {
|
|
|
|
|
this.props.showSnackbar( '奖励失败,请联系系统管理员!' );
|
|
|
|
|
this.props.showNotification( '奖励失败,请联系系统管理员!' );
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
@ -659,14 +664,24 @@ class MemoDetail extends Component {
|
|
|
|
|
const { memo, recommend_shixun, current_user,author_info } = this.props;
|
|
|
|
|
const { comments, hasMoreComments, goldRewardDialogOpen } = this.state;
|
|
|
|
|
|
|
|
|
|
if (this.state.memoLoading) {
|
|
|
|
|
if (!memo || this.state.memoLoading) {
|
|
|
|
|
return <div className="edu-back-white" id="forum_index_list"></div>
|
|
|
|
|
}
|
|
|
|
|
current_user.user_url = `/users/${current_user.login}`;
|
|
|
|
|
let _current_user = {}
|
|
|
|
|
if (current_user) {
|
|
|
|
|
_current_user = current_user
|
|
|
|
|
}
|
|
|
|
|
(_current_user.user_url = `/users/${_current_user.login}`);
|
|
|
|
|
memo.isDetailPage = true;
|
|
|
|
|
// TODO 图片上传地址
|
|
|
|
|
return (
|
|
|
|
|
<div className="edu-back-white" id="forum_index_list"> {/* fl with100 */}
|
|
|
|
|
<div className="edu-back-white memoDetail" id="forum_index_list"> {/* fl with100 */}
|
|
|
|
|
<style>{`
|
|
|
|
|
.memoDetail .commentsbtn {
|
|
|
|
|
margin-top: 6px;
|
|
|
|
|
}
|
|
|
|
|
`}</style>
|
|
|
|
|
|
|
|
|
|
<RewardDialog goldRewardDialogOpen={goldRewardDialogOpen}
|
|
|
|
|
setRewardDialogVisible={this.setRewardDialogVisible}
|
|
|
|
|
rewardCode={this.rewardCodeMemo}
|
|
|
|
@ -674,42 +689,52 @@ class MemoDetail extends Component {
|
|
|
|
|
<div className="clearfix">
|
|
|
|
|
<div id="forum_list" className="forum_table mh650">
|
|
|
|
|
<div className="padding40-30 bor-bottom-greyE">
|
|
|
|
|
<div className="font-16 mb5 cdefault clearfix pr pr35">
|
|
|
|
|
<div className="font-16 mb5 cdefault clearfix pr pr35" style={{display: 'flex', alignItems: 'center'}}>
|
|
|
|
|
<span className="noteDetailTitle">{memo.subject}</span>
|
|
|
|
|
{ memo.sticky && <span className="btn-cir btn-cir-red ml10 mt10">置顶</span>}
|
|
|
|
|
{ memo.sticky && <span className="btn-cir btn-cir-red ml10 " style={{ height: '20px' }}>置顶</span>}
|
|
|
|
|
{ !!memo.reward && <span className="color-orange font-14 ml15"
|
|
|
|
|
data-tip-down={`获得平台奖励金币:${memo.reward}`} >
|
|
|
|
|
<i className="iconfont icon-gift mr5"></i>{memo.reward}
|
|
|
|
|
</span> }
|
|
|
|
|
{ current_user && (current_user.admin === true || current_user.user_id === author_info.user_id) &&
|
|
|
|
|
<div className="edu-position-hidebox" style={{position: 'absolute', right: '18px',top:'4px'}}>
|
|
|
|
|
<a href="javascript:void(0);"><i className="fa fa-bars font-16"></i></a>
|
|
|
|
|
<ul className="edu-position-hide undis">
|
|
|
|
|
{ current_user.admin === true &&
|
|
|
|
|
( memo.sticky === true ?
|
|
|
|
|
<li><a href="javascript:void(0);" onClick={() => this.setTop(memo)}>取消置顶</a></li>
|
|
|
|
|
:
|
|
|
|
|
<li><a href="javascript:void(0);" onClick={() => this.setTop(memo)}>置 顶</a></li> )
|
|
|
|
|
}
|
|
|
|
|
<li><Link to={`/forums/${memo.id}/edit`}>编 辑</Link></li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="javascript:void(0)" onClick={() =>
|
|
|
|
|
window.delete_confirm_box_2_react(`onMemoDelete`, '您确定要删除吗?' , memo)}>
|
|
|
|
|
|
|
|
|
|
删 除</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
<Link className={`task-hide fr return_btn color-grey-6 mt2 ${ current_user && (current_user.admin === true
|
|
|
|
|
|| current_user.user_id === author_info.user_id) ? '': 'no_mr'} `} to="/forums" >
|
|
|
|
|
返回
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
|
|
<div style={{ flex: 1 }}>
|
|
|
|
|
{ _current_user && (_current_user.admin === true || _current_user.user_id === author_info.user_id) &&
|
|
|
|
|
<div className="edu-position-hidebox" style={{position: 'absolute', right: '12px',top:'4px'}}>
|
|
|
|
|
<a href="javascript:void(0);"><i className="fa fa-bars font-16"></i></a>
|
|
|
|
|
<ul className="edu-position-hide undis">
|
|
|
|
|
{ _current_user.admin === true &&
|
|
|
|
|
( memo.sticky === true ?
|
|
|
|
|
<li><a href="javascript:void(0);" onClick={() => this.setTop(memo)}>取消置顶</a></li>
|
|
|
|
|
:
|
|
|
|
|
<li><a href="javascript:void(0);" onClick={() => this.setTop(memo)}>置 顶</a></li> )
|
|
|
|
|
}
|
|
|
|
|
<li><Link to={`/forums/${memo.id}/edit`}>编 辑</Link></li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="javascript:void(0)" onClick={() =>
|
|
|
|
|
window.delete_confirm_box_2_react(`onMemoDelete`, '您确定要删除吗?' , memo)}>
|
|
|
|
|
|
|
|
|
|
删 除</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
<Link className={`task-hide fr return_btn color-grey-6 mt2 ${ _current_user && (_current_user.admin === true
|
|
|
|
|
|| _current_user.user_id === author_info.user_id) ? '': 'no_mr'} `} to="/forums"
|
|
|
|
|
style={{ marginRight: '10px'}}
|
|
|
|
|
>
|
|
|
|
|
返回
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="color-grey-9 clearfix">
|
|
|
|
|
<span className="fl">{moment(memo.time).fromNow()} 发布</span>
|
|
|
|
|
<div className="fr">
|
|
|
|
|
{ current_user.admin && <Tooltip title={ "帖子奖励" }>
|
|
|
|
|
<div className="fr detailIcons">
|
|
|
|
|
<style>{`
|
|
|
|
|
.detailIcons i{
|
|
|
|
|
vertical-align: sub;
|
|
|
|
|
}
|
|
|
|
|
`}</style>
|
|
|
|
|
{ _current_user.admin && <Tooltip title={ "帖子奖励" }>
|
|
|
|
|
<span className="noteDetailNum rightline cdefault" style={{padding: '0 4px', cursor: 'pointer'}}>
|
|
|
|
|
<i className="iconfont icon-jiangli mr5" onClick={this.showRewardDialog}></i>
|
|
|
|
|
</span>
|
|
|
|
@ -750,7 +775,7 @@ class MemoDetail extends Component {
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{ memo.attachment_url && !!memo.attachment_url.length &&
|
|
|
|
|
{ this.props.attachments_list &&
|
|
|
|
|
<div>
|
|
|
|
|
{this.renderAttachment()}
|
|
|
|
|
</div>
|
|
|
|
@ -770,7 +795,7 @@ class MemoDetail extends Component {
|
|
|
|
|
<span className="count">{memo.replies_count}</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Comments comments={comments} user={current_user}
|
|
|
|
|
<Comments comments={comments} user={_current_user}
|
|
|
|
|
replyComment={this.replyComment}
|
|
|
|
|
deleteComment={this.deleteComment}
|
|
|
|
|
commentPraise={this.commentPraise}
|
|
|
|
@ -780,7 +805,7 @@ class MemoDetail extends Component {
|
|
|
|
|
|
|
|
|
|
></Comments>
|
|
|
|
|
{ hasMoreComments ?
|
|
|
|
|
<div className="memoMore">
|
|
|
|
|
<div className="memoMore" style={{ cursor: 'default' }}>
|
|
|
|
|
<a onClick={this.moreMemos}>查看更多评论</a>
|
|
|
|
|
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
|
|
|
|
|
</div>
|
|
|
|
|