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

dev_hjm
daiao 6 years ago
commit 51a035961f

@ -43,7 +43,8 @@ module Searchable::Subject
author_school_name: user.school_name, author_school_name: user.school_name,
visits_count: visits, visits_count: visits,
stage_count: stages_count, stage_count: stages_count,
stage_shixuns_count: stage_shixuns_count stage_shixuns_count: stage_shixuns_count,
shixuns_count: shixuns_count
} }
end end

@ -1,4 +1,4 @@
json.(@subject, :id, :name, :description, :learning_notes, :stages_count, :stage_shixuns_count) json.(@subject, :id, :name, :description, :learning_notes, :stages_count, :stage_shixuns_count, :shixuns_count)
json.challenge_choose_count @subject.subject_challenge_choose_count json.challenge_choose_count @subject.subject_challenge_choose_count
json.challenges_count @subject.subject_challenge_count json.challenges_count @subject.subject_challenge_count

@ -41,7 +41,7 @@
} }
.stu_table table{ .stu_table table{
line-height: 1; line-height: 1.2;
} }
.stu_table .classesName{ .stu_table .classesName{
display: block; display: block;

@ -126,7 +126,7 @@ class AccountBasic extends Component {
// 输入昵称时change剩余的字数 // 输入昵称时change剩余的字数
changeNickName=(e)=>{ changeNickName=(e)=>{
let num= 10 - parseInt(e.target.value.length); let num= 20 - parseInt(e.target.value.length);
this.setState({ this.setState({
nameLength:num < 0 ? 0 : num nameLength:num < 0 ? 0 : num
}) })
@ -393,6 +393,13 @@ class AccountBasic extends Component {
this.props.showNotification("请先选择正确的单位或者学校!"); this.props.showNotification("请先选择正确的单位或者学校!");
} }
} }
checkNameLength = (rule, value, callback) => {
if (value && value.length <= 10) {
callback();
return;
}
callback('请输入您的姓名最大限制10个字符');
}
render() { render() {
let{ let{
@ -491,8 +498,8 @@ class AccountBasic extends Component {
message: '请输入您的昵称', message: '请输入您的昵称',
}], }],
})( })(
<Input placeholder="请输入您的昵称,10个字以内" onInput={this.changeNickName} maxLength="10" suffix ={ <Input placeholder="请输入您的昵称,最大限制20个字符" onInput={this.changeNickName} maxLength="20" suffix ={
<span className="color-grey-6 font-13">{String(nameLength)}/10</span> <span className="color-grey-6 font-13">{String(nameLength)}/20</span>
}></Input> }></Input>
)} )}
</Form.Item> </Form.Item>
@ -505,10 +512,11 @@ class AccountBasic extends Component {
rules: [{ rules: [{
// initialValue: this.state.cityDefaultValue, // initialValue: this.state.cityDefaultValue,
required: true, required: true,
message: '请输入您的姓名', message: '请输入您的姓名最大限制10个字符',
validator: this.checkNameLength
}], }],
})( })(
<Input placeholder="请输入您的姓名" disabled={!showRealName && this.state.forDisable == true } suffix={ <Input placeholder="请输入您的姓名最大限制10个字符" disabled={!showRealName && this.state.forDisable == true } suffix={
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"} <i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
onClick={()=>this.showOrHide(showRealName)}></i> onClick={()=>this.showOrHide(showRealName)}></i>
}></Input> }></Input>

Loading…
Cancel
Save