Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hjm
cxt 6 years ago
commit ba60ffd293

@ -54,5 +54,8 @@ html, body {
/* md多空格 */ /* md多空格 */
.markdown-body p { .markdown-body p {
white-space: pre-wrap; white-space: pre-wrap;
margin-bottom: 0px !important; }
/* resize */
.editormd .CodeMirror {
border-right: none !important;
} }

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

@ -155,6 +155,9 @@ class Exercisetablesmubus extends Component {
.Exermubu .ant-table-tbody > tr:nth-last-child(1) > td{ .Exermubu .ant-table-tbody > tr:nth-last-child(1) > td{
border:1px solid transparent; border:1px solid transparent;
} }
.Exermubu .editormd-html-preview, .Exermubu .editormd-preview-container {
background: transparent;
}
`} `}
</style> </style>
{datas===undefined?"":<Table {datas===undefined?"":<Table

@ -105,7 +105,7 @@ class ForumsIndex extends Component {
componentDidMount() { componentDidMount() {
window.document.title = '讨论区' window.document.title = '交流问答'
} }

@ -685,6 +685,7 @@ class MemoDetail extends Component {
<RewardDialog goldRewardDialogOpen={goldRewardDialogOpen} <RewardDialog goldRewardDialogOpen={goldRewardDialogOpen}
setRewardDialogVisible={this.setRewardDialogVisible} setRewardDialogVisible={this.setRewardDialogVisible}
rewardCode={this.rewardCodeMemo} rewardCode={this.rewardCodeMemo}
{...this.props}
></RewardDialog> ></RewardDialog>
<div className="clearfix"> <div className="clearfix">
<div id="forum_list" className="forum_table mh650"> <div id="forum_list" className="forum_table mh650">
@ -694,7 +695,8 @@ class MemoDetail extends Component {
{ memo.sticky && <span className="btn-cir btn-cir-red ml10 " style={{ height: '20px' }}>置顶</span>} { memo.sticky && <span className="btn-cir btn-cir-red ml10 " style={{ height: '20px' }}>置顶</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}`} >
<i className="iconfont icon-gift mr5"></i>{memo.reward} <i className="iconfont icon-gift mr5"></i>
<span style={{ 'vertical-align': 'sub' }}>{memo.reward}</span>
</span> } </span> }
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>

@ -323,7 +323,7 @@ class Challenges extends Component {
</Tooltip> </Tooltip>
</p> </p>
<div className="justify break_full_word new_li markdown-body" <div className="justify break_full_word new_li "
id="challenge_editorMd_description"> id="challenge_editorMd_description">
<p id="ReactMarkdown" style={{overflow:'hidden'}}> <p id="ReactMarkdown" style={{overflow:'hidden'}}>
{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"": {ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":

@ -13,7 +13,7 @@ class AccountNav extends Component {
this.props.history.push(`/account/secure`) this.props.history.push(`/account/secure`)
} }
render() { render() {
let { basicInfo } = this.props let { basicInfo, current_user } = this.props
// console.log(this.props); // console.log(this.props);
const path = window.location.pathname const path = window.location.pathname
const isBasic = path.indexOf('profile') != -1 || path == "/account" const isBasic = path.indexOf('profile') != -1 || path == "/account"
@ -78,7 +78,7 @@ class AccountNav extends Component {
<React.Fragment> <React.Fragment>
<div className="accountInfo"> <div className="accountInfo">
<AccountImg src={basicInfo.avatar_url} {...this.props}></AccountImg> <AccountImg src={basicInfo.avatar_url} {...this.props}></AccountImg>
<span className="name">{basicInfo.name}</span> <span className="name">{basicInfo.name || (current_user ? current_user.login : '')}</span>
<span className="role">{basicInfo.technical_title}</span> <span className="role">{basicInfo.technical_title}</span>
</div> </div>

Loading…
Cancel
Save