|
|
@ -24,7 +24,7 @@ import '../../forums/RightSection.css'
|
|
|
|
import './TopicDetail.css'
|
|
|
|
import './TopicDetail.css'
|
|
|
|
import '../common/courseMessage.css'
|
|
|
|
import '../common/courseMessage.css'
|
|
|
|
import { Pagination, Tooltip } from 'antd'
|
|
|
|
import { Pagination, Tooltip } from 'antd'
|
|
|
|
import { bytesToSize, ConditionToolTip, markdownToHTML, MarkdownToHtml } from 'educoder'
|
|
|
|
import { bytesToSize, ConditionToolTip, markdownToHTML, MarkdownToHtml , setImagesUrl } from 'educoder'
|
|
|
|
import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal'
|
|
|
|
import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal'
|
|
|
|
import CBreadcrumb from '../common/CBreadcrumb'
|
|
|
|
import CBreadcrumb from '../common/CBreadcrumb'
|
|
|
|
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
|
|
|
|
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
|
|
|
@ -57,6 +57,7 @@ class TopicDetail extends Component {
|
|
|
|
pageCount: 1,
|
|
|
|
pageCount: 1,
|
|
|
|
comments: [],
|
|
|
|
comments: [],
|
|
|
|
goldRewardDialogOpen: false,
|
|
|
|
goldRewardDialogOpen: false,
|
|
|
|
|
|
|
|
author:undefined
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
@ -85,7 +86,8 @@ class TopicDetail extends Component {
|
|
|
|
memo: Object.assign({}, {
|
|
|
|
memo: Object.assign({}, {
|
|
|
|
...response.data.data,
|
|
|
|
...response.data.data,
|
|
|
|
replies_count: response.data.data.total_replies_count
|
|
|
|
replies_count: response.data.data.total_replies_count
|
|
|
|
}, {...this.state.memo})
|
|
|
|
}, {...this.state.memo}),
|
|
|
|
|
|
|
|
author:response.data.data.author
|
|
|
|
}, () => {
|
|
|
|
}, () => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
@ -514,7 +516,7 @@ class TopicDetail extends Component {
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const { match, history } = this.props
|
|
|
|
const { match, history } = this.props
|
|
|
|
const { recommend_shixun, current_user,author_info } = this.props;
|
|
|
|
const { recommend_shixun, current_user,author_info } = this.props;
|
|
|
|
const { memo, comments, hasMoreComments, goldRewardDialogOpen, pageCount, total_count } = this.state;
|
|
|
|
const { memo, comments, hasMoreComments, goldRewardDialogOpen, pageCount, total_count , author } = this.state;
|
|
|
|
const messageId = match.params.topicId
|
|
|
|
const messageId = match.params.topicId
|
|
|
|
if (this.state.memoLoading || !current_user) {
|
|
|
|
if (this.state.memoLoading || !current_user) {
|
|
|
|
return <div className="edu-back-white" id="forum_index_list"></div>
|
|
|
|
return <div className="edu-back-white" id="forum_index_list"></div>
|
|
|
@ -599,51 +601,54 @@ class TopicDetail extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="color-grey-9 clearfix">
|
|
|
|
<div className="df mt20">
|
|
|
|
<span className="fl" style={{marginTop: "2px"}}>{moment(memo.created_on).fromNow()} 发布</span>
|
|
|
|
<img src={setImagesUrl(`/images/${author && author.image_url}`)} className="radius mr10 mt2" width="40px" height="40px"/>
|
|
|
|
<div className="fr">
|
|
|
|
<div className="flex1">
|
|
|
|
|
|
|
|
<div className="color-grey-9 lineh-20">
|
|
|
|
</div>
|
|
|
|
<span class="color-grey-3 mr20 fl" style={{"fontWeight":"400"}}>{author && author.name}</span>
|
|
|
|
</div>
|
|
|
|
<span className="fl">{moment(memo.created_on).fromNow()} 发布</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div className="color-grey-9 clearfix">
|
|
|
|
|
|
|
|
<span className="fl" style={{marginTop: '4px'}}>
|
|
|
|
<div className="color-grey-9 clearfix">
|
|
|
|
{/* { current_user.admin && <Tooltip title={ "帖子奖励" }>
|
|
|
|
<span className="fl" style={{marginTop: '4px'}}>
|
|
|
|
<span className="noteDetailNum rightline cdefault" style={{padding: '0 4px', cursor: 'pointer'}}>
|
|
|
|
{/* { current_user.admin && <Tooltip title={ "帖子奖励" }>
|
|
|
|
<i className="iconfont icon-jiangli mr5" onClick={this.showRewardDialog}></i>
|
|
|
|
<span className="noteDetailNum rightline cdefault" style={{padding: '0 4px', cursor: 'pointer'}}>
|
|
|
|
</span>
|
|
|
|
<i className="iconfont icon-jiangli mr5" onClick={this.showRewardDialog}></i>
|
|
|
|
</Tooltip> } */}
|
|
|
|
|
|
|
|
<Tooltip title={"浏览数"}>
|
|
|
|
|
|
|
|
<span className={`noteDetailNum `} style={{paddingLeft: '0px'}}>
|
|
|
|
|
|
|
|
<i className="iconfont icon-liulanyan mr5"></i>
|
|
|
|
|
|
|
|
<span style={{ top: "1px", position: "relative" }}>{memo.visits || '1'}</span>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
|
|
{ !!memo.total_replies_count &&
|
|
|
|
|
|
|
|
<Tooltip title={"回复数"}>
|
|
|
|
|
|
|
|
<a href="javascript:void(0)" className="noteDetailNum">
|
|
|
|
|
|
|
|
<i className="iconfont icon-huifu1 mr5" onClick={this.showCommentInput}></i>
|
|
|
|
|
|
|
|
<span style={{ top: "2px", position: "relative" }}>{ memo.total_replies_count }</span>
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
{!!memo.total_praises_count &&
|
|
|
|
|
|
|
|
<Tooltip title={"点赞数"}>
|
|
|
|
|
|
|
|
<span className={`noteDetailNum `} style={{}}>
|
|
|
|
|
|
|
|
<i className="iconfont icon-dianzan-xian mr5"></i>
|
|
|
|
|
|
|
|
<span style={{ top: "2px", position: "relative" }}>{ memo.total_praises_count }</span>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip> } */}
|
|
|
|
|
|
|
|
<Tooltip title={"浏览数"}>
|
|
|
|
|
|
|
|
<span className={`noteDetailNum `} style={{paddingLeft: '0px'}}>
|
|
|
|
|
|
|
|
<i className="iconfont icon-liulanyan mr5"></i>
|
|
|
|
|
|
|
|
<span style={{ top: "1px", position: "relative" }}>{memo.visits || '1'}</span>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
|
|
{ !!memo.total_replies_count &&
|
|
|
|
|
|
|
|
<Tooltip title={"回复数"}>
|
|
|
|
|
|
|
|
<a href="javascript:void(0)" className="noteDetailNum">
|
|
|
|
|
|
|
|
<i className="iconfont icon-huifu1 mr5" onClick={this.showCommentInput}></i>
|
|
|
|
|
|
|
|
<span style={{ top: "2px", position: "relative" }}>{ memo.total_replies_count }</span>
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</Tooltip>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</span>
|
|
|
|
{!!memo.total_praises_count &&
|
|
|
|
<div className="fr">
|
|
|
|
<Tooltip title={"点赞数"}>
|
|
|
|
{/* || current_user.user_id === author_info.user_id */}
|
|
|
|
<span className={`noteDetailNum `} style={{}}>
|
|
|
|
<a className={`task-hide fr return_btn color-grey-6 ${ current_user && (isAdmin
|
|
|
|
<i className="iconfont icon-dianzan-xian mr5"></i>
|
|
|
|
) ? '': 'no_mr'} `} onClick={() => this.props.toListPage(Object.assign({}, this.props.match.params, {'coursesId': this.state.memo.course_id})) } >
|
|
|
|
<span style={{ top: "2px", position: "relative" }}>{ memo.total_praises_count }</span>
|
|
|
|
返回
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</Tooltip>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<div className="fr">
|
|
|
|
|
|
|
|
{/* || current_user.user_id === author_info.user_id */}
|
|
|
|
|
|
|
|
<a className={`task-hide fr return_btn color-grey-6 ${ current_user && (isAdmin
|
|
|
|
|
|
|
|
) ? '': 'no_mr'} `} onClick={() => this.props.toListPage(Object.assign({}, this.props.match.params, {'coursesId': this.state.memo.course_id})) } >
|
|
|
|
|
|
|
|
返回
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|