diff --git a/public/react/src/modules/courses/boards/TopicDetail.js b/public/react/src/modules/courses/boards/TopicDetail.js index f4df177c7..483dafe18 100644 --- a/public/react/src/modules/courses/boards/TopicDetail.js +++ b/public/react/src/modules/courses/boards/TopicDetail.js @@ -1,29 +1,15 @@ import React, { Component } from 'react'; -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames' - import axios from 'axios' - import moment from 'moment' - import Comments from '../../comment/Comments' - -import update from 'immutability-helper' -import RewardDialog from '../../common/RewardDialog'; import {ImageLayerOfCommentHOC} from '../../page/layers/ImageLayerOfCommentHOC' - import MemoDetailMDEditor from '../../forums/MemoDetailMDEditor' import { RouteHOC } from './common.js' import '../../forums/Post.css' import '../../forums/RightSection.css' import './TopicDetail.css' import '../common/courseMessage.css' -import { Pagination, Tooltip } from 'antd' +import { Pagination, Tooltip,Button } from 'antd' import { bytesToSize, ConditionToolTip, markdownToHTML, MarkdownToHtml , setImagesUrl } from 'educoder' import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal' import CBreadcrumb from '../common/CBreadcrumb' @@ -32,7 +18,8 @@ import { generateComments, generateChildComments, _findById, handleContentBefore , handleDeleteComment, handleCommentPraise, handleHiddenComment } from '../common/CommentsHelper' const $ = window.$ -const REPLY_PAGE_COUNT = 10 +const REPLY_PAGE_COUNT = 10; +let setTime; function urlStringify(params) { let noParams = true; let paramsUrl = ''; @@ -57,7 +44,8 @@ class TopicDetail extends Component { pageCount: 1, comments: [], goldRewardDialogOpen: false, - author:undefined + author:undefined, + commentstype:false } } componentDidMount() { @@ -512,11 +500,26 @@ class TopicDetail extends Component { } } + startcomments=()=>{ + setTime = setInterval( ()=> { + this.fetchReplies() + }, 5000); + this.setState({ + commentstype:true + }) + } + + clearcomments=()=>{ + clearInterval(setTime); + this.setState({ + commentstype:false + }) + } render() { const { match, history } = this.props const { recommend_shixun, current_user,author_info } = this.props; - const { memo, comments, hasMoreComments, goldRewardDialogOpen, pageCount, total_count , author } = this.state; + const { memo, comments, hasMoreComments, commentstype, pageCount, total_count , author } = this.state; const messageId = match.params.topicId if (this.state.memoLoading || !current_user) { return
@@ -560,7 +563,7 @@ class TopicDetail extends Component { ref="sendToCourseModal" {...this.props} moduleName="帖子" - selectedMessageIds={[messageId]} + seletedMessageIds={[messageId]} >
@@ -690,9 +693,15 @@ class TopicDetail extends Component { */}
-
+
+ {this.props.isAdmin()===true? + {this.state.commentstype===false? + :} + :""} + 全部回复 ({memo.total_replies_count}) +