From c6d491f0a36cb755125957b6a3d4dfcc71b049c7 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Mon, 5 Aug 2019 15:12:31 +0800
Subject: [PATCH 1/3] https://www.trustie.net/issues/22768
---
public/react/src/modules/paths/PathDetail/DetailTop.js | 2 +-
public/react/src/search/SearchPage.js | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js
index 09425df92..5bfb3c765 100644
--- a/public/react/src/modules/paths/PathDetail/DetailTop.js
+++ b/public/react/src/modules/paths/PathDetail/DetailTop.js
@@ -195,7 +195,7 @@ class DetailTop extends Component{
detailInfoList &&
{ detailInfoList.stages_count!=0 ? - 章节{detailInfoList.stages_count}
: ""}
- { detailInfoList.stage_shixuns_count!=0 ? - 实训{ detailInfoList.stage_shixuns_count}
: ""}
+ { detailInfoList.shixuns_count!=0 ? - 实训{ detailInfoList.shixuns_count}
: ""}
{ detailInfoList.challenge_choose_count!=0 ? - 选择题任务{detailInfoList.challenge_choose_count}
: ""}
{ detailInfoList.challenges_count!=0 ? - 实践任务{detailInfoList.challenges_count}
: ""}
{ detailInfoList.subject_score!=0 ? - 经验值{detailInfoList.subject_score}
: ""}
diff --git a/public/react/src/search/SearchPage.js b/public/react/src/search/SearchPage.js
index 68efca036..c455379af 100644
--- a/public/react/src/search/SearchPage.js
+++ b/public/react/src/search/SearchPage.js
@@ -286,10 +286,10 @@ class SearchPage extends Component{
}
- {!!item.stage_shixuns_count &&
+ {!!item.shixuns_count &&
{/* */}
实训数:
- {item.stage_shixuns_count}
+ {item.shixuns_count}
}
{type == 'subject' && !!item.visits_count &&
From d7e9e041b5222194d6f7a532d96e2329cabe84c8 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Mon, 5 Aug 2019 15:25:39 +0800
Subject: [PATCH 2/3] reward
---
public/react/src/modules/comment/Comments.js | 20 ++++++++++++++-----
.../react/src/modules/common/RewardDialog.js | 8 ++++++--
2 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/public/react/src/modules/comment/Comments.js b/public/react/src/modules/comment/Comments.js
index ce5cc8017..380b90bd9 100644
--- a/public/react/src/modules/comment/Comments.js
+++ b/public/react/src/modules/comment/Comments.js
@@ -23,6 +23,7 @@ import CommentItemMDEditor from './CommentItemMDEditor';
import './Comment.css'
import Modals from '../modals/Modals'
+import { InputNumber } from 'antd'
/*
-------------------------- 样式相关
@@ -470,7 +471,8 @@ class Comments extends Component {
onGoldRewardDialogOkBtnClick() {
console.log('onGoldRewardDialogOkBtnClick')
const { goldRewardInput } = this.state;
- if (!goldRewardInput || goldRewardInput === '0' || goldRewardInput.indexOf('-') !== -1) {
+ // || goldRewardInput.indexOf('-') !== -1
+ if (!goldRewardInput || goldRewardInput === '0' ) {
this.setState({ goldRewardInputError: true})
return;
} else {
@@ -478,8 +480,13 @@ class Comments extends Component {
this.props.rewardCode(this.comment, this.childComment, goldRewardInput)
}
}
- onGoldRewardInputChange(event) {
- this.setState({ goldRewardInput: event.target.value, goldRewardInputError: false });
+ onGoldRewardInputChange(value) {
+ // e.target.value
+ const number = parseInt(value || 0, 10);
+ if (Number.isNaN(number)) {
+ return;
+ }
+ this.setState({ goldRewardInput: number, goldRewardInputError: false });
}
render() {
const { deleteComment, onPaginationChange, comment_count_without_reply, currentPage, comments, usingAntdModal } = this.props;
@@ -538,11 +545,14 @@ class Comments extends Component {
{"奖励设置"}
-
+ this.onGoldRewardInputChange(e)} width={228} style={{ width: '228px'}} />
+
+ {/*
请输入奖励的金币数量
this.onGoldRewardInputChange(e)} />
{ goldRewardInputError ? 奖励金币不能为空或负数 : ''}
-
+ */}
{/* */}
diff --git a/public/react/src/modules/common/RewardDialog.js b/public/react/src/modules/common/RewardDialog.js
index d8a772e9f..93e0a8936 100644
--- a/public/react/src/modules/common/RewardDialog.js
+++ b/public/react/src/modules/common/RewardDialog.js
@@ -48,9 +48,13 @@ class RewardDialog extends Component {
this.props.rewardCode(goldRewardInput)
}
}
- onGoldRewardInputChange(event) {
+ onGoldRewardInputChange(value) {
// || event.target.value
- this.setState({ goldRewardInput: event , goldRewardInputError: false });
+ const number = parseInt(value || 0, 10);
+ if (Number.isNaN(number)) {
+ return;
+ }
+ this.setState({ goldRewardInput: number , goldRewardInputError: false });
}
render() {
From 099480951153abcfa92cd07baab7187e456449f4 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Mon, 5 Aug 2019 15:26:38 +0800
Subject: [PATCH 3/3] 1
---
public/react/src/modules/forums/shixun/MemoShixun.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/forums/shixun/MemoShixun.js b/public/react/src/modules/forums/shixun/MemoShixun.js
index 664b844ac..34288cbf0 100644
--- a/public/react/src/modules/forums/shixun/MemoShixun.js
+++ b/public/react/src/modules/forums/shixun/MemoShixun.js
@@ -68,7 +68,7 @@ class MemoShixun extends Component {
let currentPage = parseInt( arg_currentPage ? arg_currentPage : (parsed.page || 1) )
const paramsObject = {
- page: currentPage - 1
+ page: currentPage // - 1 从1开始
}
let searchValue = arg_searchValue != undefined ? arg_searchValue : this.props.searchValue