|
|
@ -65,7 +65,7 @@ class TopicDetail extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
const topicId = this.props.match.params.topicId
|
|
|
|
const topicId = this.props.match.params.topicId
|
|
|
|
const bid = this.props.match.params.boardId
|
|
|
|
const bid = this.props.match.params.boardId
|
|
|
|
|
|
|
|
|
|
|
|
const memoUrl = `/messages/${topicId}.json`;
|
|
|
|
const memoUrl = `/messages/${topicId}.json`;
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
memoLoading: true
|
|
|
|
memoLoading: true
|
|
|
@ -73,7 +73,7 @@ class TopicDetail extends Component {
|
|
|
|
axios.get(memoUrl,{
|
|
|
|
axios.get(memoUrl,{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then((response) => {
|
|
|
|
.then((response) => {
|
|
|
|
|
|
|
|
|
|
|
|
if (response.data.status === -1) {
|
|
|
|
if (response.data.status === -1) {
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
this.props.showNotification('帖子不存在!')
|
|
|
|
this.props.showNotification('帖子不存在!')
|
|
|
@ -81,7 +81,7 @@ class TopicDetail extends Component {
|
|
|
|
// this.props.toListPage(response.data.data.course_id, bid)
|
|
|
|
// this.props.toListPage(response.data.data.course_id, bid)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
memo: Object.assign({}, {
|
|
|
|
memo: Object.assign({}, {
|
|
|
|
...response.data.data,
|
|
|
|
...response.data.data,
|
|
|
@ -93,7 +93,7 @@ class TopicDetail extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
// const { memo_replies, memo } = response.data;
|
|
|
|
// const { memo_replies, memo } = response.data;
|
|
|
|
// let hasMoreComments = false;
|
|
|
|
// let hasMoreComments = false;
|
|
|
|
// if (memo_replies && memo_replies.length === 10 && memo.total_replies_count > 10) {
|
|
|
|
// if (memo_replies && memo_replies.length === 10 && memo.total_replies_count > 10) {
|
|
|
|
// // 遍历一遍,计算下是否还有评论未加载
|
|
|
|
// // 遍历一遍,计算下是否还有评论未加载
|
|
|
|
// let totalCount = 10;
|
|
|
|
// let totalCount = 10;
|
|
|
|
// memo_replies.forEach(item=>{
|
|
|
|
// memo_replies.forEach(item=>{
|
|
|
@ -123,14 +123,14 @@ class TopicDetail extends Component {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
this.fetchReplies()
|
|
|
|
this.fetchReplies()
|
|
|
|
|
|
|
|
|
|
|
|
$('body>#root').on('onMemoDelete', (event) => {
|
|
|
|
$('body>#root').on('onMemoDelete', (event) => {
|
|
|
|
// const val = $('body>#root').data('onMemoDelete')
|
|
|
|
// const val = $('body>#root').data('onMemoDelete')
|
|
|
|
const val = window.onMemoDelete ;
|
|
|
|
const val = window.onMemoDelete ;
|
|
|
|
this.onMemoDelete( JSON.parse(decodeURIComponent(val)) )
|
|
|
|
this.onMemoDelete( JSON.parse(decodeURIComponent(val)) )
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onPaginationChange = (pageCount) => {
|
|
|
|
onPaginationChange = (pageCount) => {
|
|
|
@ -157,7 +157,7 @@ class TopicDetail extends Component {
|
|
|
|
this.props.showNotification('删除成功');
|
|
|
|
this.props.showNotification('删除成功');
|
|
|
|
const props = Object.assign({}, this.props, {})
|
|
|
|
const props = Object.assign({}, this.props, {})
|
|
|
|
this.props.toListPage( Object.assign({}, this.props.match.params, {'coursesId': this.state.memo.course_id} ) )
|
|
|
|
this.props.toListPage( Object.assign({}, this.props.match.params, {'coursesId': this.state.memo.course_id} ) )
|
|
|
|
|
|
|
|
|
|
|
|
} else if (status === -1) {
|
|
|
|
} else if (status === -1) {
|
|
|
|
this.props.showNotification('帖子已被删除');
|
|
|
|
this.props.showNotification('帖子已被删除');
|
|
|
|
this.props.history.push(`/forums`)
|
|
|
|
this.props.history.push(`/forums`)
|
|
|
@ -168,11 +168,11 @@ class TopicDetail extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
|
|
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
|
|
// if (this.state.memo && this.state.memo.content
|
|
|
|
// if (this.state.memo && this.state.memo.content
|
|
|
|
// && (!prevProps.memo || prevProps.memo.content != this.state.memo.content) ) {
|
|
|
|
// && (!prevProps.memo || prevProps.memo.content != this.state.memo.content) ) {
|
|
|
|
if (this.state.memo && this.state.memo.content && prevState.memoLoading === true && this.state.memoLoading === false) {
|
|
|
|
if (this.state.memo && this.state.memo.content && prevState.memoLoading === true && this.state.memoLoading === false) {
|
|
|
|
// md渲染content,等xhr执行完(即memoLoading变化),memo.content更新后初始化md
|
|
|
|
// md渲染content,等xhr执行完(即memoLoading变化),memo.content更新后初始化md
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
setTimeout(()=>{
|
|
|
|
// var shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", {
|
|
|
|
// var shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", {
|
|
|
|
// htmlDecode: "style,script,iframe", // you can filter tags decode
|
|
|
|
// htmlDecode: "style,script,iframe", // you can filter tags decode
|
|
|
@ -183,7 +183,7 @@ class TopicDetail extends Component {
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
}, 200)
|
|
|
|
}, 200)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
clickPraise(){
|
|
|
|
clickPraise(){
|
|
|
@ -192,7 +192,7 @@ class TopicDetail extends Component {
|
|
|
|
const url = memo.user_praise ? '/praise_tread/unlike.json' : `/praise_tread/like.json`;
|
|
|
|
const url = memo.user_praise ? '/praise_tread/unlike.json' : `/praise_tread/like.json`;
|
|
|
|
const _method = memo.user_praise ? axios.delete : axios.post
|
|
|
|
const _method = memo.user_praise ? axios.delete : axios.post
|
|
|
|
let _data = {
|
|
|
|
let _data = {
|
|
|
|
object_id: memo.id,
|
|
|
|
object_id: memo.id,
|
|
|
|
object_type: 'message', //Discuss
|
|
|
|
object_type: 'message', //Discuss
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (memo.user_praise) {
|
|
|
|
if (memo.user_praise) {
|
|
|
@ -204,10 +204,10 @@ class TopicDetail extends Component {
|
|
|
|
..._data
|
|
|
|
..._data
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
).then((response) => {
|
|
|
|
).then((response) => {
|
|
|
|
|
|
|
|
|
|
|
|
const newMemo = Object.assign({}, this.state.memo)
|
|
|
|
const newMemo = Object.assign({}, this.state.memo)
|
|
|
|
newMemo.praises_count = newMemo.user_praise ? newMemo.praises_count - 1 : newMemo.praises_count + 1
|
|
|
|
newMemo.praises_count = newMemo.user_praise ? newMemo.praises_count - 1 : newMemo.praises_count + 1
|
|
|
|
newMemo.total_praises_count = newMemo.user_praise ? newMemo.total_praises_count - 1 : newMemo.total_praises_count + 1
|
|
|
|
newMemo.total_praises_count = newMemo.user_praise ? newMemo.total_praises_count - 1 : newMemo.total_praises_count + 1
|
|
|
@ -248,10 +248,10 @@ class TopicDetail extends Component {
|
|
|
|
className="mr12 color9B9B overflowHidden1" length="58" style={{maxWidth: '480px'}}>
|
|
|
|
className="mr12 color9B9B overflowHidden1" length="58" style={{maxWidth: '480px'}}>
|
|
|
|
{fileName}
|
|
|
|
{fileName}
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
|
|
|
|
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -268,7 +268,7 @@ class TopicDetail extends Component {
|
|
|
|
permission: true, //
|
|
|
|
permission: true, //
|
|
|
|
children: children,
|
|
|
|
children: children,
|
|
|
|
child_message_count: reply.total_count,
|
|
|
|
child_message_count: reply.total_count,
|
|
|
|
hidden: reply.is_hidden,
|
|
|
|
hidden: reply.is_hidden,
|
|
|
|
id: reply.id,
|
|
|
|
id: reply.id,
|
|
|
|
image_url: reply.author.image_url,
|
|
|
|
image_url: reply.author.image_url,
|
|
|
|
reward: null, //
|
|
|
|
reward: null, //
|
|
|
@ -289,7 +289,7 @@ class TopicDetail extends Component {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then((response) => {
|
|
|
|
.then((response) => {
|
|
|
|
const { replies, liked, total_replies_count, total_count } = response.data.data
|
|
|
|
const { replies, liked, total_replies_count, total_count } = response.data.data
|
|
|
|
|
|
|
|
|
|
|
|
const memo = Object.assign({}, this.state.memo)
|
|
|
|
const memo = Object.assign({}, this.state.memo)
|
|
|
|
memo.user_praise = liked
|
|
|
|
memo.user_praise = liked
|
|
|
|
memo.total_replies_count = total_replies_count;
|
|
|
|
memo.total_replies_count = total_replies_count;
|
|
|
@ -322,15 +322,15 @@ class TopicDetail extends Component {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const url = `/messages/${id}/reply.json`;
|
|
|
|
const url = `/messages/${id}/reply.json`;
|
|
|
|
|
|
|
|
|
|
|
|
const { comments } = this.state;
|
|
|
|
const { comments } = this.state;
|
|
|
|
const user = this._getUser();
|
|
|
|
const user = this._getUser();
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
移除末尾的空行
|
|
|
|
移除末尾的空行
|
|
|
|
.replace(/(\n<p>\n\t<br \/>\n<\/p>)*$/g,'');
|
|
|
|
.replace(/(\n<p>\n\t<br \/>\n<\/p>)*$/g,'');
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
commentContent = handleContentBeforeCreateSecondLevelComment(commentContent)
|
|
|
|
commentContent = handleContentBeforeCreateSecondLevelComment(commentContent)
|
|
|
|
if (!commentContent) {
|
|
|
|
if (!commentContent) {
|
|
|
|
this.props.showNotification('不能为空')
|
|
|
|
this.props.showNotification('不能为空')
|
|
|
@ -340,9 +340,9 @@ class TopicDetail extends Component {
|
|
|
|
content: commentContent
|
|
|
|
content: commentContent
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
).then((response) => {
|
|
|
|
).then((response) => {
|
|
|
|
if (response.data.data.id) {
|
|
|
|
if (response.data.data.id) {
|
|
|
|
let newId = response.data.data.id;
|
|
|
|
let newId = response.data.data.id;
|
|
|
|
const commentIndex = this._findById(id, comments);
|
|
|
|
const commentIndex = this._findById(id, comments);
|
|
|
|
const parentComment = comments[commentIndex]
|
|
|
|
const parentComment = comments[commentIndex]
|
|
|
@ -361,7 +361,7 @@ class TopicDetail extends Component {
|
|
|
|
memo: newMemo2
|
|
|
|
memo: newMemo2
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
}).catch((error) => {
|
|
|
|
console.log(error)
|
|
|
|
console.log(error)
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -369,14 +369,14 @@ class TopicDetail extends Component {
|
|
|
|
// 公共接口 --- 删除回复
|
|
|
|
// 公共接口 --- 删除回复
|
|
|
|
deleteComment = (parrentComment, childCommentId) => {
|
|
|
|
deleteComment = (parrentComment, childCommentId) => {
|
|
|
|
handleDeleteComment(this, parrentComment, childCommentId, 'message')
|
|
|
|
handleDeleteComment(this, parrentComment, childCommentId, 'message')
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 公共接口 --- 回复点赞
|
|
|
|
// 公共接口 --- 回复点赞
|
|
|
|
commentPraise = (discussId) => {
|
|
|
|
commentPraise = (discussId) => {
|
|
|
|
handleCommentPraise(this, discussId, 'message', (old_user_praise) => {
|
|
|
|
handleCommentPraise(this, discussId, 'message', (old_user_praise) => {
|
|
|
|
const newMemo2 = Object.assign({}, this.state.memo);
|
|
|
|
const newMemo2 = Object.assign({}, this.state.memo);
|
|
|
|
|
|
|
|
|
|
|
|
newMemo2.total_praises_count = old_user_praise
|
|
|
|
newMemo2.total_praises_count = old_user_praise
|
|
|
|
? newMemo2.total_praises_count - 1 : newMemo2.total_praises_count + 1;
|
|
|
|
? newMemo2.total_praises_count - 1 : newMemo2.total_praises_count + 1;
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
memo: newMemo2
|
|
|
|
memo: newMemo2
|
|
|
@ -390,7 +390,7 @@ class TopicDetail extends Component {
|
|
|
|
createNewComment = (commentContent, id, editor) => {
|
|
|
|
createNewComment = (commentContent, id, editor) => {
|
|
|
|
let content = handleContentBeforeCreateNew(commentContent);
|
|
|
|
let content = handleContentBeforeCreateNew(commentContent);
|
|
|
|
const { memo } = this.props;
|
|
|
|
const { memo } = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
const url = `/messages/${id}/reply.json`;
|
|
|
|
const url = `/messages/${id}/reply.json`;
|
|
|
|
|
|
|
|
|
|
|
|
// const url = `/api/v1/memos/${memo.id}/reply`;
|
|
|
|
// const url = `/api/v1/memos/${memo.id}/reply`;
|
|
|
@ -399,7 +399,7 @@ class TopicDetail extends Component {
|
|
|
|
content: content
|
|
|
|
content: content
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
).then((response) => {
|
|
|
|
).then((response) => {
|
|
|
|
if (response.data.status === -1) {
|
|
|
|
if (response.data.status === -1) {
|
|
|
|
console.error('服务端异常')
|
|
|
|
console.error('服务端异常')
|
|
|
@ -407,15 +407,15 @@ class TopicDetail extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// this.props.showNotification('帖子发表成功')
|
|
|
|
// this.props.showNotification('帖子发表成功')
|
|
|
|
|
|
|
|
|
|
|
|
if (response.data) {
|
|
|
|
if (response.data) {
|
|
|
|
const _id = response.data.data.id;
|
|
|
|
const _id = response.data.data.id;
|
|
|
|
// ke
|
|
|
|
// ke
|
|
|
|
editor.html && editor.html('');
|
|
|
|
editor.html && editor.html('');
|
|
|
|
editor.afterBlur && editor.afterBlur()
|
|
|
|
editor.afterBlur && editor.afterBlur()
|
|
|
|
// md
|
|
|
|
// md
|
|
|
|
editor.setValue && editor.setValue('')
|
|
|
|
editor.setValue && editor.setValue('')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const user = this._getUser();
|
|
|
|
const user = this._getUser();
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
comments: addNewComment(comments, _id, content, user, this.props.isSuperAdmin(), this)
|
|
|
|
comments: addNewComment(comments, _id, content, user, this.props.isSuperAdmin(), this)
|
|
|
@ -427,8 +427,8 @@ class TopicDetail extends Component {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.refs.editor.showEditor();
|
|
|
|
this.refs.editor.showEditor();
|
|
|
|
this.refs.editor.close();
|
|
|
|
this.refs.editor.close();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch((error) => {
|
|
|
|
}).catch((error) => {
|
|
|
|
console.log(error)
|
|
|
|
console.log(error)
|
|
|
@ -444,7 +444,7 @@ class TopicDetail extends Component {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then((response) => {
|
|
|
|
.then((response) => {
|
|
|
|
const { replies, liked, total_replies_count } = response.data.data
|
|
|
|
const { replies, liked, total_replies_count } = response.data.data
|
|
|
|
|
|
|
|
|
|
|
|
// const memo = Object.assign({}, this.state.memo)
|
|
|
|
// const memo = Object.assign({}, this.state.memo)
|
|
|
|
// memo.total_replies_count = total_replies_count;
|
|
|
|
// memo.total_replies_count = total_replies_count;
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -460,19 +460,19 @@ class TopicDetail extends Component {
|
|
|
|
// 置顶
|
|
|
|
// 置顶
|
|
|
|
setTop(memo) {
|
|
|
|
setTop(memo) {
|
|
|
|
// const params = {
|
|
|
|
// const params = {
|
|
|
|
// sticky: memo.sticky ? 0 : 1,
|
|
|
|
// sticky: memo.sticky ? 0 : 1,
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (this.state.p_s_order) {
|
|
|
|
// if (this.state.p_s_order) {
|
|
|
|
// params.order = this.state.p_s_order;
|
|
|
|
// params.order = this.state.p_s_order;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (this.state.p_forum_id) {
|
|
|
|
// if (this.state.p_forum_id) {
|
|
|
|
// params.forum_id = this.state.p_forum_id;
|
|
|
|
// params.forum_id = this.state.p_forum_id;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// let paramsUrl = urlStringify(params)
|
|
|
|
// let paramsUrl = urlStringify(params)
|
|
|
|
const set_top_or_down_Url = `/messages/${memo.id}/sticky_top.json`;
|
|
|
|
const set_top_or_down_Url = `/messages/${memo.id}/sticky_top.json`;
|
|
|
|
// 获取memo list
|
|
|
|
// 获取memo list
|
|
|
|
axios.put(set_top_or_down_Url, {
|
|
|
|
axios.put(set_top_or_down_Url, {
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then((response) => {
|
|
|
|
.then((response) => {
|
|
|
|
const status = response.data.status
|
|
|
|
const status = response.data.status
|
|
|
@ -487,7 +487,7 @@ class TopicDetail extends Component {
|
|
|
|
console.log(error)
|
|
|
|
console.log(error)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setRewardDialogVisible = (visible) => {
|
|
|
|
setRewardDialogVisible = (visible) => {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
goldRewardDialogOpen: visible
|
|
|
|
goldRewardDialogOpen: visible
|
|
|
@ -512,7 +512,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;
|
|
|
@ -567,7 +567,7 @@ class TopicDetail extends Component {
|
|
|
|
<div className="padding30 bor-bottom-greyE" style={{paddingBottom: '20px'}}>
|
|
|
|
<div className="padding30 bor-bottom-greyE" style={{paddingBottom: '20px'}}>
|
|
|
|
<div className="font-16 cdefault clearfix pr pr35">
|
|
|
|
<div className="font-16 cdefault clearfix pr pr35">
|
|
|
|
<span className="noteDetailTitle">{memo.subject}</span>
|
|
|
|
<span className="noteDetailTitle">{memo.subject}</span>
|
|
|
|
{ !!memo.sticky && <span className="btn-cir btn-cir-red ml10"
|
|
|
|
{ !!memo.sticky && <span className="btn-cir btn-cir-red ml10"
|
|
|
|
style={{position: 'relative', bottom: '4px'}}>置顶</span>}
|
|
|
|
style={{position: 'relative', bottom: '4px'}}>置顶</span>}
|
|
|
|
{ !!memo.reward && <span className="color-orange font-14 ml15"
|
|
|
|
{ !!memo.reward && <span className="color-orange font-14 ml15"
|
|
|
|
data-tip-down={`获得平台奖励金币:${memo.reward}`} >
|
|
|
|
data-tip-down={`获得平台奖励金币:${memo.reward}`} >
|
|
|
@ -578,9 +578,9 @@ class TopicDetail extends Component {
|
|
|
|
<div className="edu-position-hidebox" style={{position: 'absolute', right: '2px',top:'4px'}}>
|
|
|
|
<div className="edu-position-hidebox" style={{position: 'absolute', right: '2px',top:'4px'}}>
|
|
|
|
<a href="javascript:void(0);"><i className="fa fa-bars font-16"></i></a>
|
|
|
|
<a href="javascript:void(0);"><i className="fa fa-bars font-16"></i></a>
|
|
|
|
<ul className="edu-position-hide undis">
|
|
|
|
<ul className="edu-position-hide undis">
|
|
|
|
|
|
|
|
|
|
|
|
{ ( isCurrentUserTheAuthor || isAdmin ) &&
|
|
|
|
{ ( isCurrentUserTheAuthor || isAdmin ) &&
|
|
|
|
<li><a
|
|
|
|
<li><a
|
|
|
|
onClick={() => this.props.toEditPage( Object.assign({}, this.props.match.params, {'coursesId': this.state.memo.course_id}) ) }
|
|
|
|
onClick={() => this.props.toEditPage( Object.assign({}, this.props.match.params, {'coursesId': this.state.memo.course_id}) ) }
|
|
|
|
>编 辑</a></li>}
|
|
|
|
>编 辑</a></li>}
|
|
|
|
{ isAdmin &&
|
|
|
|
{ isAdmin &&
|
|
|
@ -590,7 +590,7 @@ class TopicDetail extends Component {
|
|
|
|
<li><a href="javascript:void(0);" onClick={() => this.setTop(memo)}>置 顶</a></li> )
|
|
|
|
<li><a href="javascript:void(0);" onClick={() => this.setTop(memo)}>置 顶</a></li> )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{ isAdmin &&
|
|
|
|
{ isAdmin &&
|
|
|
|
<li><a href="javascript:void(0);" onClick={() => this.refs.sendToCourseModal.setVisible(true)}>发 送</a></li>
|
|
|
|
<li><a href="javascript:void(0);" onClick={() => this.refs.sendToCourseModal.setVisible(true)}>发 送</a></li>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{ ( isCurrentUserTheAuthor || isAdmin ) && <li>
|
|
|
|
{ ( isCurrentUserTheAuthor || isAdmin ) && <li>
|
|
|
|
<a href="javascript:void(0)" onClick={() =>
|
|
|
|
<a href="javascript:void(0)" onClick={() =>
|
|
|
@ -602,9 +602,9 @@ class TopicDetail extends Component {
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="df mt20">
|
|
|
|
<div className="df mt20">
|
|
|
|
<img src={setImagesUrl(`/images/${author && author.image_url}`)} className="radius mr10 mt2" width="40px" height="40px"/>
|
|
|
|
<img src={setImagesUrl(`/images/${author && author.image_url}`)} className="radius mr10 mt2" width="40px" height="40px"/>
|
|
|
|
<div className="flex1">
|
|
|
|
<div className="flex1">
|
|
|
|
<div className="color-grey-9 lineh-20">
|
|
|
|
<div className="color-grey-9 lineh-20">
|
|
|
@ -625,7 +625,7 @@ class TopicDetail extends Component {
|
|
|
|
<span style={{ top: "1px", position: "relative" }}>{memo.visits || '1'}</span>
|
|
|
|
<span style={{ top: "1px", position: "relative" }}>{memo.visits || '1'}</span>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>
|
|
|
|
{ !!memo.total_replies_count &&
|
|
|
|
{ !!memo.total_replies_count &&
|
|
|
|
<Tooltip title={"回复数"}>
|
|
|
|
<Tooltip title={"回复数"}>
|
|
|
|
<a href="javascript:void(0)" className="noteDetailNum">
|
|
|
|
<a href="javascript:void(0)" className="noteDetailNum">
|
|
|
|
<i className="iconfont icon-huifu1 mr5" onClick={this.showCommentInput}></i>
|
|
|
|
<i className="iconfont icon-huifu1 mr5" onClick={this.showCommentInput}></i>
|
|
|
@ -633,8 +633,8 @@ class TopicDetail extends Component {
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{!!memo.total_praises_count &&
|
|
|
|
{!!memo.total_praises_count &&
|
|
|
|
<Tooltip title={"点赞数"}>
|
|
|
|
<Tooltip title={"点赞数"}>
|
|
|
|
<span className={`noteDetailNum `} style={{}}>
|
|
|
|
<span className={`noteDetailNum `} style={{}}>
|
|
|
|
<i className="iconfont icon-dianzan-xian mr5"></i>
|
|
|
|
<i className="iconfont icon-dianzan-xian mr5"></i>
|
|
|
|
<span style={{ top: "2px", position: "relative" }}>{ memo.total_praises_count }</span>
|
|
|
|
<span style={{ top: "2px", position: "relative" }}>{ memo.total_praises_count }</span>
|
|
|
@ -654,12 +654,12 @@ class TopicDetail extends Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="padding30 memoContent new_li" style={{ paddingBottom: '10px'}}>
|
|
|
|
<div className="padding30 memoContent new_li" style={{ paddingBottom: '10px'}}>
|
|
|
|
{/* <MarkdownToHtml content={memo.content}></MarkdownToHtml> */}
|
|
|
|
{/* <MarkdownToHtml content={memo.content}></MarkdownToHtml> */}
|
|
|
|
{memo.is_md == true ?
|
|
|
|
{memo.is_md == true ?
|
|
|
|
<MarkdownToHtml content={memo.content}></MarkdownToHtml>
|
|
|
|
<MarkdownToHtml content={memo.content}></MarkdownToHtml>
|
|
|
|
:
|
|
|
|
:
|
|
|
|
<div dangerouslySetInnerHTML={{ __html: memo.content }}></div>
|
|
|
|
<div dangerouslySetInnerHTML={{ __html: memo.content }}></div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -674,17 +674,17 @@ class TopicDetail extends Component {
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{ memo.attachments && !!memo.attachments.length &&
|
|
|
|
{ memo.attachments && !!memo.attachments.length &&
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
{this.renderAttachment()}
|
|
|
|
{this.renderAttachment()}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{!isCourseEnd && <MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
|
|
|
|
{!isCourseEnd && <MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
|
|
|
|
height={160} showError={true} buttonText={'发表'} className={comments && comments.length && 'borderBottom'}></MemoDetailMDEditor>}
|
|
|
|
height={160} showError={true} buttonText={'发表'} className={comments && comments.length && 'borderBottom'}></MemoDetailMDEditor>}
|
|
|
|
|
|
|
|
|
|
|
|
{/* onClick={ this.createNewComment }
|
|
|
|
{/* onClick={ this.createNewComment }
|
|
|
|
enableReplyTo={true}
|
|
|
|
enableReplyTo={true}
|
|
|
|
*/}
|
|
|
|
*/}
|
|
|
|
<div className="padding20 memoReplies commentsDelegateParent comments_hideSecondReplyUserHeader"
|
|
|
|
<div className="padding20 memoReplies commentsDelegateParent comments_hideSecondReplyUserHeader"
|
|
|
@ -711,22 +711,22 @@ class TopicDetail extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
onlySuperAdminCouldHide={true}
|
|
|
|
onlySuperAdminCouldHide={true}
|
|
|
|
></Comments>
|
|
|
|
></Comments>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* { true ? :
|
|
|
|
{/* { true ? :
|
|
|
|
<div className="memoMore">
|
|
|
|
<div className="memoMore">
|
|
|
|
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
|
|
|
|
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
|
|
|
|
</div>} */}
|
|
|
|
</div>} */}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="memoMore" style={{'margin-top': '20px'}}>
|
|
|
|
<div className="memoMore" style={{'margin-top': '20px'}}>
|
|
|
|
{ total_count > REPLY_PAGE_COUNT &&
|
|
|
|
{ total_count > REPLY_PAGE_COUNT &&
|
|
|
|
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
|
|
|
|
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{!isCourseEnd && <div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>}
|
|
|
|
{!isCourseEnd && <div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|