|
|
|
@ -9,6 +9,7 @@ import Dialog, {
|
|
|
|
|
import Button from 'material-ui/Button';
|
|
|
|
|
import { FormControl, FormHelperText } from 'material-ui/Form';
|
|
|
|
|
import Input, { InputLabel } from 'material-ui/Input';
|
|
|
|
|
import { InputNumber } from 'antd'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -38,8 +39,9 @@ class RewardDialog extends Component {
|
|
|
|
|
onGoldRewardDialogOkBtnClick() {
|
|
|
|
|
console.log('onGoldRewardDialogOkBtnClick')
|
|
|
|
|
const { goldRewardInput } = this.state;
|
|
|
|
|
if (!goldRewardInput || goldRewardInput === '0' || goldRewardInput.indexOf('-') !== -1) {
|
|
|
|
|
this.setState({ goldRewardInputError: true})
|
|
|
|
|
if (!goldRewardInput || goldRewardInput === '0' || goldRewardInput < 0) {
|
|
|
|
|
this.props.showNotification('奖励金币不能为空或负数')
|
|
|
|
|
// this.setState({ goldRewardInputError: true})
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
this.props.setRewardDialogVisible( false )
|
|
|
|
@ -47,7 +49,8 @@ class RewardDialog extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
onGoldRewardInputChange(event) {
|
|
|
|
|
this.setState({ goldRewardInput: event.target.value, goldRewardInputError: false });
|
|
|
|
|
// || event.target.value
|
|
|
|
|
this.setState({ goldRewardInput: event , goldRewardInputError: false });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
@ -58,17 +61,26 @@ class RewardDialog extends Component {
|
|
|
|
|
return (
|
|
|
|
|
<Dialog
|
|
|
|
|
open={goldRewardDialogOpen}
|
|
|
|
|
disableEscapeKeyDown={true}
|
|
|
|
|
disableEscapeKeyDown={true}
|
|
|
|
|
onClose={this.handleGoldRewardDialogClose}
|
|
|
|
|
className={'rewardDialog'}
|
|
|
|
|
>
|
|
|
|
|
<style>{`
|
|
|
|
|
.rewardDialog>div:last-child {
|
|
|
|
|
width: 280px;
|
|
|
|
|
}
|
|
|
|
|
`}</style>
|
|
|
|
|
<DialogTitle id="alert-dialog-title">{"奖励设置"}</DialogTitle>
|
|
|
|
|
<DialogContent>
|
|
|
|
|
|
|
|
|
|
<FormControl { ...goldRewardInputErrorObj } aria-describedby="name-error-text">
|
|
|
|
|
<InputLabel htmlFor="goldReward">请输入奖励的金币数量</InputLabel>
|
|
|
|
|
{/* <FormControl { ...goldRewardInputErrorObj } aria-describedby="name-error-text"> */}
|
|
|
|
|
{/* <InputLabel htmlFor="goldReward">请输入奖励的金币数量</InputLabel>
|
|
|
|
|
<Input id="goldReward" type="number" value={this.state.goldRewardInput} onChange={(e) => this.onGoldRewardInputChange(e)} />
|
|
|
|
|
{ goldRewardInputError ? <FormHelperText id="name-error-text">奖励金币不能为空或负数</FormHelperText> : ''}
|
|
|
|
|
</FormControl>
|
|
|
|
|
{ goldRewardInputError ? <FormHelperText id="name-error-text">奖励金币不能为空或负数</FormHelperText> : ''} */}
|
|
|
|
|
|
|
|
|
|
<InputNumber placeholder="请输入奖励的金币数量" id="goldReward" type="number" value={this.state.goldRewardInput}
|
|
|
|
|
onChange={(e) => this.onGoldRewardInputChange(e)} width={228} style={{ width: '228px'}} />
|
|
|
|
|
{/* </FormControl> */}
|
|
|
|
|
|
|
|
|
|
{/*<DialogContentText id="alert-dialog-description" style={{textAlign: 'center'}}> </DialogContentText>*/}
|
|
|
|
|
</DialogContent>
|
|
|
|
|