diff --git a/public/react/public/index.html b/public/react/public/index.html index 303128b18..4aa03bc6b 100755 --- a/public/react/public/index.html +++ b/public/react/public/index.html @@ -7,6 +7,18 @@ + + + + + + + + + + + + diff --git a/public/react/src/modules/courses/boards/TopicDetail.js b/public/react/src/modules/courses/boards/TopicDetail.js index d42b68c17..e8767fb87 100644 --- a/public/react/src/modules/courses/boards/TopicDetail.js +++ b/public/react/src/modules/courses/boards/TopicDetail.js @@ -65,7 +65,7 @@ class TopicDetail extends Component { const topicId = this.props.match.params.topicId const bid = this.props.match.params.boardId - + const memoUrl = `/messages/${topicId}.json`; this.setState({ memoLoading: true @@ -73,7 +73,7 @@ class TopicDetail extends Component { axios.get(memoUrl,{ }) .then((response) => { - + if (response.data.status === -1) { setTimeout(() => { this.props.showNotification('帖子不存在!') @@ -81,7 +81,7 @@ class TopicDetail extends Component { // this.props.toListPage(response.data.data.course_id, bid) return; } else { - + this.setState({ memo: Object.assign({}, { ...response.data.data, @@ -93,7 +93,7 @@ class TopicDetail extends Component { // const { memo_replies, memo } = response.data; // 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; // memo_replies.forEach(item=>{ @@ -123,14 +123,14 @@ class TopicDetail extends Component { }) this.fetchReplies() - - $('body>#root').on('onMemoDelete', (event) => { + + $('body>#root').on('onMemoDelete', (event) => { // const val = $('body>#root').data('onMemoDelete') const val = window.onMemoDelete ; this.onMemoDelete( JSON.parse(decodeURIComponent(val)) ) }) - + } onPaginationChange = (pageCount) => { @@ -157,7 +157,7 @@ class TopicDetail extends Component { this.props.showNotification('删除成功'); const props = Object.assign({}, this.props, {}) this.props.toListPage( Object.assign({}, this.props.match.params, {'coursesId': this.state.memo.course_id} ) ) - + } else if (status === -1) { this.props.showNotification('帖子已被删除'); this.props.history.push(`/forums`) @@ -168,11 +168,11 @@ class TopicDetail extends Component { } 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) ) { if (this.state.memo && this.state.memo.content && prevState.memoLoading === true && this.state.memoLoading === false) { // md渲染content,等xhr执行完(即memoLoading变化),memo.content更新后初始化md - + setTimeout(()=>{ // var shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", { // htmlDecode: "style,script,iframe", // you can filter tags decode @@ -183,7 +183,7 @@ class TopicDetail extends Component { // }); }, 200) } - + } clickPraise(){ @@ -192,7 +192,7 @@ class TopicDetail extends Component { const url = memo.user_praise ? '/praise_tread/unlike.json' : `/praise_tread/like.json`; const _method = memo.user_praise ? axios.delete : axios.post let _data = { - object_id: memo.id, + object_id: memo.id, object_type: 'message', //Discuss } if (memo.user_praise) { @@ -204,10 +204,10 @@ class TopicDetail extends Component { ..._data }, { - + } ).then((response) => { - + const newMemo = Object.assign({}, this.state.memo) 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 @@ -248,10 +248,10 @@ class TopicDetail extends Component { className="mr12 color9B9B overflowHidden1" length="58" style={{maxWidth: '480px'}}> {fileName} - + {item.filesize} - + ) }) @@ -268,7 +268,7 @@ class TopicDetail extends Component { permission: true, // children: children, child_message_count: reply.total_count, - hidden: reply.is_hidden, + hidden: reply.is_hidden, id: reply.id, image_url: reply.author.image_url, reward: null, // @@ -289,7 +289,7 @@ class TopicDetail extends Component { }) .then((response) => { const { replies, liked, total_replies_count, total_count } = response.data.data - + const memo = Object.assign({}, this.state.memo) memo.user_praise = liked memo.total_replies_count = total_replies_count; @@ -322,15 +322,15 @@ class TopicDetail extends Component { return; } const url = `/messages/${id}/reply.json`; - + const { comments } = this.state; const user = this._getUser(); /* 移除末尾的空行 .replace(/(\n

\n\t
\n<\/p>)*$/g,''); - + */ - + commentContent = handleContentBeforeCreateSecondLevelComment(commentContent) if (!commentContent) { this.props.showNotification('不能为空') @@ -340,9 +340,9 @@ class TopicDetail extends Component { content: commentContent }, { - } + } ).then((response) => { - if (response.data.data.id) { + if (response.data.data.id) { let newId = response.data.data.id; const commentIndex = this._findById(id, comments); const parentComment = comments[commentIndex] @@ -361,7 +361,7 @@ class TopicDetail extends Component { memo: newMemo2 }) } - + }).catch((error) => { console.log(error) }) @@ -369,14 +369,14 @@ class TopicDetail extends Component { // 公共接口 --- 删除回复 deleteComment = (parrentComment, childCommentId) => { handleDeleteComment(this, parrentComment, childCommentId, 'message') - + } // 公共接口 --- 回复点赞 commentPraise = (discussId) => { handleCommentPraise(this, discussId, 'message', (old_user_praise) => { 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; this.setState({ memo: newMemo2 @@ -390,7 +390,7 @@ class TopicDetail extends Component { createNewComment = (commentContent, id, editor) => { let content = handleContentBeforeCreateNew(commentContent); const { memo } = this.props; - + const url = `/messages/${id}/reply.json`; // const url = `/api/v1/memos/${memo.id}/reply`; @@ -399,7 +399,7 @@ class TopicDetail extends Component { content: content }, { - } + } ).then((response) => { if (response.data.status === -1) { console.error('服务端异常') @@ -407,15 +407,15 @@ class TopicDetail extends Component { } // this.props.showNotification('帖子发表成功') - if (response.data) { + if (response.data) { const _id = response.data.data.id; // ke editor.html && editor.html(''); editor.afterBlur && editor.afterBlur() // md editor.setValue && editor.setValue('') - - + + const user = this._getUser(); this.setState({ 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.close(); - - + + } }).catch((error) => { console.log(error) @@ -444,7 +444,7 @@ class TopicDetail extends Component { }) .then((response) => { const { replies, liked, total_replies_count } = response.data.data - + // const memo = Object.assign({}, this.state.memo) // memo.total_replies_count = total_replies_count; this.setState({ @@ -460,19 +460,19 @@ class TopicDetail extends Component { // 置顶 setTop(memo) { // 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; // } - // if (this.state.p_forum_id) { + // if (this.state.p_forum_id) { // params.forum_id = this.state.p_forum_id; // } // let paramsUrl = urlStringify(params) const set_top_or_down_Url = `/messages/${memo.id}/sticky_top.json`; // 获取memo list axios.put(set_top_or_down_Url, { - + }) .then((response) => { const status = response.data.status @@ -487,7 +487,7 @@ class TopicDetail extends Component { console.log(error) }) } - + setRewardDialogVisible = (visible) => { this.setState({ goldRewardDialogOpen: visible @@ -512,7 +512,7 @@ class TopicDetail extends Component { } } - + render() { const { match, history } = this.props const { recommend_shixun, current_user,author_info } = this.props; @@ -567,7 +567,7 @@ class TopicDetail extends Component {

{memo.subject} - { !!memo.sticky && 置顶} { !!memo.reward && @@ -578,9 +578,9 @@ class TopicDetail extends Component {
} - +
-
+
@@ -625,7 +625,7 @@ class TopicDetail extends Component { {memo.visits || '1'} - { !!memo.total_replies_count && + { !!memo.total_replies_count && @@ -633,8 +633,8 @@ class TopicDetail extends Component { } - {!!memo.total_praises_count && - + {!!memo.total_praises_count && + { memo.total_praises_count } @@ -654,12 +654,12 @@ class TopicDetail extends Component {
- +
{/* */} - {memo.is_md == true ? - - : + {memo.is_md == true ? + + :
}
@@ -674,17 +674,17 @@ class TopicDetail extends Component {
- { memo.attachments && !!memo.attachments.length && + { memo.attachments && !!memo.attachments.length &&
{this.renderAttachment()}
}
- - {!isCourseEnd && } - {/* onClick={ this.createNewComment } + {/* onClick={ this.createNewComment } enableReplyTo={true} */}
- - - {/* { true ? : + + + {/* { true ? :
写评论
} */}
- - + +
- { total_count > REPLY_PAGE_COUNT && + { total_count > REPLY_PAGE_COUNT && } {!isCourseEnd &&
写评论
} -
- +
+ diff --git a/public/react/src/modules/courses/common/comments/CommonReply.js b/public/react/src/modules/courses/common/comments/CommonReply.js index 8b7817e85..42ec3d65a 100644 --- a/public/react/src/modules/courses/common/comments/CommonReply.js +++ b/public/react/src/modules/courses/common/comments/CommonReply.js @@ -18,7 +18,7 @@ import { generateComments, generateChildComments, _findById, handleContentBefore const REPLY_PAGE_COUNT = 10 const $ = window.$; -/* +/* 相比较GraduateTopicReply 改动的地方 列表接口名 /graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500 回复类型名 jour_type: this.props.jour_type, @@ -34,7 +34,7 @@ class CommonReply extends Component{ componentDidMount(){ this.fetchReplies() - + } _getUser() { const { current_user } = this.props; @@ -58,7 +58,7 @@ class CommonReply extends Component{ // m_parent_id reply_id: memo.user_id || this.state.homework_user_id } - } + } ).then((response) => { if (response.data.status === -1) { console.error('服务端异常') @@ -66,15 +66,15 @@ class CommonReply extends Component{ } // this.props.showNotification('帖子发表成功') - if (response.data && response.data.id) { + if (response.data && response.data.id) { const _id = response.data.id; // md editor.setValue && editor.setValue('') this.refs.editor.close && this.refs.editor.close() - + const user = this._getUser(); const isSuperAdmin = this.props.isSuperAdmin() - + this.setState({ comments: addNewComment(this.state.comments, _id, content, user, isSuperAdmin, this), total_count: this.state.total_count + 1 @@ -98,13 +98,13 @@ class CommonReply extends Component{ return; } const url = `/users/reply_message.json`; - + const { comments } = this.state; const user = this._getUser(); const graduation_topic_id = this.props.memo.id const commentIndex = this._findById(id, comments); let comment = comments[commentIndex]; - + commentContent = handleContentBeforeCreateSecondLevelComment(commentContent) axios.post(url, { journals_for_message: { @@ -117,9 +117,9 @@ class CommonReply extends Component{ } }, { - } + } ).then((response) => { - if (response.data.id) { + if (response.data.id) { let newId = response.data.id; const newMemo2 = Object.assign({}, this.props.memo); @@ -132,7 +132,7 @@ class CommonReply extends Component{ }) } - + }).catch((error) => { console.log(error) }) @@ -146,7 +146,7 @@ class CommonReply extends Component{ }) .then((response) => { const { comments } = response.data - + // const memo = Object.assign({}, this.state.memo) // memo.sum_replies_count = sum_replies_count; @@ -164,7 +164,7 @@ class CommonReply extends Component{ this.fetchReplies() }) } - + fetchReplies = () => { const graduation_topic_id = this.props.memo.id const course_id = this.props.course_id @@ -174,7 +174,7 @@ class CommonReply extends Component{ }) .then((response) => { const { comments, messages_count, homework_user_id, parent_messages_count } = response.data - + this.setState({ comments: generateComments(comments, this.transformReply), // : this.state.comments.concat(comments), @@ -185,7 +185,7 @@ class CommonReply extends Component{ console.log(error) }) } - + transformReply = (reply, children = []) => { const isAdmin = this.props.isAdmin() const isSuperAdmin = this.props.isSuperAdmin() @@ -194,7 +194,7 @@ class CommonReply extends Component{ isSuperAdmin: isSuperAdmin, permission: true, // children: children, - hidden: reply.hidden, + hidden: reply.hidden, id: reply.id, image_url: reply.author.image_url, reward: null, // @@ -249,7 +249,7 @@ class CommonReply extends Component{ padding-bottom: 30px; } `} - - - - {/* { true ? : + + + {/* { true ? :
写评论
} */} - - { total_count > REPLY_PAGE_COUNT && + + { total_count > REPLY_PAGE_COUNT &&
写评论
diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js index 4e318a0c1..df6152c04 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js @@ -28,7 +28,7 @@ class GraduateTopicReply extends Component{ componentDidMount(){ this.fetchReplies() - + } _getUser() { const { current_user } = this.props; @@ -52,7 +52,7 @@ class GraduateTopicReply extends Component{ // m_parent_id reply_id: memo.user_id } - } + } ).then((response) => { if (response.data.status === -1) { console.error('服务端异常') @@ -60,18 +60,18 @@ class GraduateTopicReply extends Component{ } // this.props.showNotification('帖子发表成功') - if (response.data && response.data.id) { + if (response.data && response.data.id) { const _id = response.data.id; // md editor.setValue && editor.setValue('') - + const user = this._getUser(); this.setState({ comments: addNewComment(this.state.comments, _id, content, user, this.props.isSuperAdmin(), this), total_count: this.state.total_count + 1 }) this.refs.editor.showEditor(); - + } }).catch((error) => { console.log(error) @@ -89,13 +89,13 @@ class GraduateTopicReply extends Component{ return; } const url = `/users/reply_message.json`; - + const { comments } = this.state; const user = this._getUser(); const graduation_topic_id = this.props.memo.id const commentIndex = this._findById(id, comments); let comment = comments[commentIndex]; - + commentContent = handleContentBeforeCreateSecondLevelComment(commentContent) axios.post(url, { journals_for_message: { @@ -107,9 +107,9 @@ class GraduateTopicReply extends Component{ } }, { - } + } ).then((response) => { - if (response.data.id) { + if (response.data.id) { let newId = response.data.id; this.setState({ @@ -122,7 +122,7 @@ class GraduateTopicReply extends Component{ memo: newMemo2 }) } - + }).catch((error) => { console.log(error) }) @@ -136,7 +136,7 @@ class GraduateTopicReply extends Component{ }) .then((response) => { const { comments } = response.data - + // const memo = Object.assign({}, this.state.memo) // memo.sum_replies_count = sum_replies_count; @@ -154,7 +154,7 @@ class GraduateTopicReply extends Component{ this.fetchReplies() }) } - + fetchReplies = () => { const graduation_topic_id = this.props.memo.id const course_id = this.props.course_id @@ -164,7 +164,7 @@ class GraduateTopicReply extends Component{ }) .then((response) => { const { comments, messages_count } = response.data - + this.setState({ comments: generateComments(comments, this.transformReply), // : this.state.comments.concat(comments), @@ -174,7 +174,7 @@ class GraduateTopicReply extends Component{ console.log(error) }) } - + transformReply = (reply, children = []) => { const isAdmin = this.props.isAdmin() const isSuperAdmin = this.props.isSuperAdmin() @@ -184,7 +184,7 @@ class GraduateTopicReply extends Component{ permission: true, // children: children, child_message_count: reply.child_message_count, - hidden: reply.hidden, + hidden: reply.hidden, id: reply.id, image_url: reply.author.image_url, reward: null, // @@ -226,7 +226,7 @@ class GraduateTopicReply extends Component{ return( -
- - - {/* { true ? : + + + {/* { true ? :
写评论
} */}
- - { total_count > REPLY_PAGE_COUNT && + + { total_count > REPLY_PAGE_COUNT &&
写评论
diff --git a/public/react/src/modules/forums/MemoDetail.js b/public/react/src/modules/forums/MemoDetail.js index b3e0e121e..813865724 100644 --- a/public/react/src/modules/forums/MemoDetail.js +++ b/public/react/src/modules/forums/MemoDetail.js @@ -58,7 +58,7 @@ class MemoDetail extends Component { // window.$("html,body").animate({"scrollTop":0}) const { match } = this.props - + const memoUrl = `/memos/${match.params.memoId}.json`; this.setState({ memoLoading: true @@ -79,7 +79,7 @@ class MemoDetail extends Component { const { memo_replies, memo } = response.data; let hasMoreComments = false; - if (memo_replies && memo_replies.length === 10 && memo.replies_count > 10) { + if (memo_replies && memo_replies.length === 10 && memo.replies_count > 10) { // 遍历一遍,计算下是否还有评论未加载 let totalCount = 10; memo_replies.forEach(item=>{ @@ -96,7 +96,7 @@ class MemoDetail extends Component { }) delete response.data.memo_replies; // reset - response.data.memo.praise_count = response.data.memo.memo_praise_count + 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; @@ -110,14 +110,14 @@ class MemoDetail extends Component { console.log(error) }) - $('body>#root').on('onMemoDelete', (event) => { + $('body>#root').on('onMemoDelete', (event) => { // const val = $('body>#root').data('onMemoDelete') const val = window.onMemoDelete ; this.onMemoDelete( JSON.parse(decodeURIComponent(val)) ) }) - + } componentWillUnmount() { $('body>#root').off('onMemoDelete') @@ -134,7 +134,7 @@ class MemoDetail extends Component { this.props.showNotification('删除成功'); this.props.history.push(`/forums`) - + } else if (status === -1) { this.props.showNotification('帖子已被删除'); this.props.history.push(`/forums`) @@ -145,7 +145,7 @@ class MemoDetail extends Component { } componentDidUpdate(prevProps, prevState, snapshot) { - // if (this.props.memo && this.props.memo.content + // if (this.props.memo && this.props.memo.content // && (!prevProps.memo || prevProps.memo.content != this.props.memo.content) ) { if (this.props.memo && this.props.memo.content && prevState.memoLoading === true && this.state.memoLoading === false) { // md渲染content,等xhr执行完(即memoLoading变化),memo.content更新后初始化md @@ -191,7 +191,7 @@ class MemoDetail extends Component { const ar = item.url.split('/') const fileName = item.title let filesize = item.filesize - + attachments.push( ) }) @@ -241,7 +241,7 @@ class MemoDetail extends Component { /* 移除末尾的空行 .replace(/(\n

\n\t
\n<\/p>)*$/g,''); - + */ if (commentContent) { commentContent = commentContent.replace(/(\n

\n\t
\n<\/p>)*$/g,''); @@ -254,10 +254,10 @@ class MemoDetail extends Component { }, { // withCredentials: true - } + } ).then((response) => { response.data.memo = response.data - if (response.data.memo) { + if (response.data.memo) { let newDiscuss = response.data.memo; var commentIndex = this._findById(id, comments); @@ -278,8 +278,8 @@ class MemoDetail extends Component { // "position": newDiscuss.position, "time": "1分钟前", "praise_count": 0, - - "user_id": newDiscuss.author_id, + + "user_id": newDiscuss.author_id, }) @@ -292,9 +292,9 @@ class MemoDetail extends Component { const $ = window.$ var view_selector = `.commentItemMDEditorView_${id}` $(view_selector).hide(); - } + } + - this.setState({ // runTesting: false, comments: comments @@ -320,15 +320,15 @@ class MemoDetail extends Component { deleteCommentId = childCommentId; } const url = `/memos/${deleteCommentId}.json` - let comments = this.state.comments; + let comments = this.state.comments; axios.delete(url, { // withCredentials: true - } + } ).then((response) => { // TODO 删除成功或失败 - if (response.data && response.data.status === 0) { + if (response.data && response.data.status === 0) { const commentIndex = this._findById(parrentComment.id, comments); // https://stackoverflow.com/questions/29527385/removing-element-from-array-in-component-state @@ -371,13 +371,13 @@ class MemoDetail extends Component { }, { // withCredentials: true - } + } ).then((response) => { - if (response.data.praise_count === 0 || response.data.praise_count) { - + if (response.data.praise_count === 0 || response.data.praise_count) { + comments[commentIndex].user_praise = !comments[commentIndex].user_praise; comments[commentIndex].praise_count = response.data.praise_count; - + this.setState({ comments }) @@ -406,9 +406,9 @@ class MemoDetail extends Component { }, { // withCredentials: true - } + } ).then((response) => { - if (response.data && response.data.code) { + if (response.data && response.data.code) { const commentIndex = this._findById(parrentComment.id, comments); if (childComment) { @@ -418,13 +418,13 @@ class MemoDetail extends Component { parrentComment.children[childCommentIndex] = newChildComment comments[commentIndex] = parrentComment; - + this.setState({ comments }) } else { comments[commentIndex].reward = response.data.code; - + this.setState({ comments }) @@ -449,14 +449,14 @@ class MemoDetail extends Component { }, { // withCredentials: true - } + } ).then((response) => { - if (response.data.status === -1) { + if (response.data.status === -1) { showNotification(response.data.message) return; } - if (response.data.status === 0) { - + if (response.data.status === 0) { + if (!childCommentId) { comment.hidden = !comment.hidden; this.setState({ @@ -468,7 +468,7 @@ class MemoDetail extends Component { childComment.hidden = !childComment.hidden; this.setState({ comments }) } - + } // {"message":"Couldn't find Discuss with id=911","status":-1} @@ -481,7 +481,7 @@ class MemoDetail extends Component { const { memo } = this.props; if(content != undefined){ content = content.replace(/(\n

\n\t
\n<\/p>)*$/g,''); - + var beforeImage = content.split(""); if(beforeImage[0] == "" && afterImage[1] == ""){ @@ -500,13 +500,13 @@ class MemoDetail extends Component { }, { // withCredentials: true - } + } ).then((response) => { if (response.data.status === -1) { console.error('服务端异常') return; } - if (response.data) { + if (response.data) { response.data.memo = response.data const newMemo = response.data.memo; // ke @@ -533,11 +533,11 @@ class MemoDetail extends Component { "user_praise": false, "time": "1分钟前", "praise_count": 0, - - "user_id": user.user_id, + + "user_id": user.user_id, }) - + this.setState({ comments }) @@ -558,11 +558,11 @@ class MemoDetail extends Component { const user = this._getUser(); const url = `/memos/${memo.id}/more_reply.json?page=${pageCount}`; axios.get(url, { - + }, { // withCredentials: true - } + } ).then((response) => { if (response.data.status === -1) { console.error('服务端异常') @@ -575,7 +575,7 @@ class MemoDetail extends Component { }) return; } - if (response.data.memos_count) { + if (response.data.memos_count) { const newComments = comments.concat(memo_replies); const hasMoreComments = memo_replies.length === 10 this.setState({ @@ -595,12 +595,12 @@ class MemoDetail extends Component { // 置顶 setTop(memo) { 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; } - if (this.state.p_forum_id) { + if (this.state.p_forum_id) { params.forum_id = this.state.p_forum_id; } let paramsUrl = urlStringify(params) @@ -628,7 +628,7 @@ class MemoDetail extends Component { const { memo, author_info } = this.props; const newMemo = Object.assign({}, memo); const _reward = parseInt(inputVal) - + const url = `/discusses/${memo.id}/reward_code.json` axios.post(url, { @@ -667,6 +667,8 @@ class MemoDetail extends Component { } // --------------------------------------------------------------------------------------------帖子獎勵 END showCommentInput = () => { + + debugger if (window.__useKindEditor === true) { this.refs.editor.showEditor(); } else { @@ -702,8 +704,8 @@ class MemoDetail extends Component { margin-top: 6px; } `} - - {/* overflowHidden1 */} {memo.subject} - { memo.sticky && 置顶} - { !!memo.reward && + { !!memo.reward && - @@ -749,8 +751,8 @@ class MemoDetail extends Component {

} - {/* 返回 @@ -773,7 +775,7 @@ class MemoDetail extends Component { {memo.viewed_count} - { !!memo.replies_count && + { !!memo.replies_count && {memo.replies_count} @@ -784,11 +786,11 @@ class MemoDetail extends Component {
- +
{ !memo.is_md ?
: - +
- 发送 diff --git a/public/react/src/modules/forums/MemoDetailMDEditor.js b/public/react/src/modules/forums/MemoDetailMDEditor.js index f00b4aeae..8076c5e6a 100644 --- a/public/react/src/modules/forums/MemoDetailMDEditor.js +++ b/public/react/src/modules/forums/MemoDetailMDEditor.js @@ -27,7 +27,7 @@ class MemoDetailMDEditor extends Component { componentDidUpdate(prevProps, prevState, snapshot) { if (this.props.memo && (!prevProps.memo || this.props.memo.id != prevProps.memo.id)) { // this.keEditor = window.sd_create_editor_from_data(this.props.memo.id, null, "100%", "Memo"); - // window._kk = this.keEditor + // window._kk = this.keEditor } } @@ -48,7 +48,7 @@ class MemoDetailMDEditor extends Component { console.log('create_editorMD_4comment') var commentMDEditor = window.create_editorMD_4comment("memo_comment_editorMd", '', this.props.height || 240, placeholder, imageUrl, () => { // commentMDEditor.focus() - + this.initDrag() commentMDEditor.cm.on("change", (_cm, changeObj) => { @@ -64,8 +64,8 @@ class MemoDetailMDEditor extends Component { }); this.commentMDEditor = commentMDEditor; window.commentMDEditor = commentMDEditor; - - }, window.__tt) + + }, window.__tt) } componentDidMount() { !this.props.usingMockInput && this.initMDEditor() @@ -75,8 +75,13 @@ class MemoDetailMDEditor extends Component { } onCommit = () => { + + if(this.props.checkIfProfileCompleted()===false){ + this.props.showhideAccountPhoneemailDialog() + return + } const content = this.commentMDEditor.getValue(); - // this.props.showError == + // this.props.showError == if (this.props.showError == true) { if (!content || content.trim() == "") { this.setState({ @@ -103,18 +108,18 @@ class MemoDetailMDEditor extends Component { window.$(document).trigger("onReply", { commentContent: content , id: this.props.memo.id, editor: this.commentMDEditor } ); } - + } showEditor() { - // $("html, body").animate({ scrollTop: $('.commentInput:visible').offset().top - 100 }, 1000, () => { - // if (this.commentMDEditor) { - // this.commentMDEditor.cm.focus() - // } else { - // this.onMockInputClick() - // } - // }); + $("html, body").animate({ scrollTop: $('.commentInput:visible').offset().top - 100 }, 1000, () => { + if (this.commentMDEditor) { + this.commentMDEditor.cm.focus() + } else { + this.onMockInputClick() + } + }); } close = () => { this.setState({isInited: false}) @@ -166,16 +171,16 @@ class MemoDetailMDEditor extends Component { width:100%!important; } `} -
- {this.props.buttonText || '发送'}
-
{errorMsg} }
- {this.props.buttonText || '发送'} diff --git a/public/react/src/modules/forums/MemoDetailMDEditortwo.js b/public/react/src/modules/forums/MemoDetailMDEditortwo.js index 257294452..eafc1451f 100644 --- a/public/react/src/modules/forums/MemoDetailMDEditortwo.js +++ b/public/react/src/modules/forums/MemoDetailMDEditortwo.js @@ -96,13 +96,13 @@ class MemoDetailMDEditortwo extends Component { } showEditor() { - // $("html, body").animate({ scrollTop: $('#commentInput').offset().top - 100 }, 1000, () => { - // if (this.commentMDEditor) { - // this.commentMDEditor.cm.focus() - // } else { - // $('#commentInput input')[0].click() - // } - // }); + $("html, body").animate({ scrollTop: $('#commentInput').offset().top - 100 }, 1000, () => { + if (this.commentMDEditor) { + this.commentMDEditor.cm.focus() + } else { + $('#commentInput input')[0].click() + } + }); } onMockInputClick = () => { this.setState({isInited: true}) diff --git a/public/react/src/modules/login/Trialapplication.js b/public/react/src/modules/login/Trialapplication.js index 094d683e0..be0b18edb 100644 --- a/public/react/src/modules/login/Trialapplication.js +++ b/public/react/src/modules/login/Trialapplication.js @@ -194,13 +194,13 @@ class Trialapplication extends Component { //短信验证 SMSverification = () => { + let logins=this.state.login; var url = `/accounts/get_verification_code.json`; - axios.get((url), { params: { login: this.state.login, type: 3, - smscode:setmiyah(this.state.logins) + smscode:setmiyah(logins) } }).then((result) => { //验证有问题{"status":1,"message":"success"} diff --git a/public/react/src/modules/login/Trialapplicationysl.js b/public/react/src/modules/login/Trialapplicationysl.js index ce6c28329..d685e1846 100644 --- a/public/react/src/modules/login/Trialapplicationysl.js +++ b/public/react/src/modules/login/Trialapplicationysl.js @@ -210,12 +210,13 @@ class Trialapplicationysl extends Component { //短信验证 SMSverification = () => { + let logins=this.state.login; var url = `/accounts/get_verification_code.json`; axios.get((url), { params: { login: this.state.login, type: 3, - smscode:setmiyah(this.state.logins) + smscode:setmiyah(logins) } }).then((result) => { //验证有问题{"status":1,"message":"success"} diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index aa88d7ea7..363acdba1 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -166,6 +166,27 @@ export function TPMIndexHOC(WrappedComponent) { document.title="翻转课堂"; } + // if(this.props.match.path==="/"){ + // document.title="EduCoder-IT实践教学平台_信息技术类精品课程网_大学生MOOC平台"; + // }else if(this.props.match.path==="/403"){ + // document.title="你没有权限访问"; + // }else if(this.props.match.path==="/nopage"){ + // document.title="没有找到该页面"; + // }else if(this.props.match.path==="/shixuns"){ + // document.title="EduCoder-IT实践教学平台_信息技术类精品课程网_大学生MOOC平台"; + // }else if(this.props.match.path==="/paths"){ + // document.title="实践课程_项目实战开发_web前端开发实训_web后端开发实战_人工智能技术-EduCoder"; + // }else if(this.props.match.path==="/courses"){ + // document.title="实训项目_php后端开发_app前端开发_java_python实训_C语言入门课程-EduCoder"; + // }else if(this.props.match.path==="/competitions"){ + // document.title="在线竞赛_计算机应用大赛_编程大赛_大学生设计大赛_全国高校绿色计算大赛-EduCoder"; + // }else if(this.props.match.path==="/moop_cases"){ + // document.title="教学案例-EduCoder"; + // }else if(this.props.match.path==="/forums"){ + // document.title="交流问答-EduCoder"; + // }else if(this.props.match.path==="/forums"){ + // document.title="交流问答-EduCoder"; + // } $.ajaxSetup({ cache: true diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index d9d7f1493..baf099909 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -157,12 +157,13 @@ class LoginRegisterComponent extends Component { } //短信验证 SMSverification = () => { + let logins=this.state.login; var url = `/accounts/get_verification_code.json`; axios.get((url), { params: { login: this.state.login, type: 2, - smscode:setmiyah(this.state.logins) + smscode:setmiyah(logins) } }).then((result) => { //验证有问题{"status":1,"message":"success"} diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 0bff604d0..d00d54371 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -608,12 +608,13 @@ class LoginRegisterComponent extends Component { }; //短信验证 SMSverification = () => { + let logins=this.state.login; var url = `/accounts/get_verification_code.json`; axios.get((url), { params: { login: this.state.logins, type: 1, - smscode:setmiyah(this.state.logins) + smscode:setmiyah(logins) } }).then((result) => { //验证有问题{"status":1,"message":"success"} diff --git a/public/react/src/search/searchc.css b/public/react/src/search/searchc.css index 73de87236..d9132a436 100644 --- a/public/react/src/search/searchc.css +++ b/public/react/src/search/searchc.css @@ -20,11 +20,14 @@ justify-content: center; } +.packinput .ant-input-group-addon{ + border: 1px solid #4cacff!important; +} .packinput .ant-input-group-addon .ant-btn{ width:137px !important; font-size: 18px; height: 53px; - background:rgba(76,172,255,1); + border-color: #4cacff !important; } .tabtitle{