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

dev_forum
cxt 6 years ago
commit 6745763149

@ -102,7 +102,7 @@ class Cropper extends Component {
setTimeout(() => { setTimeout(() => {
const image = document.getElementById(this.props.imageId || '__image'); const image = document.getElementById(this.props.imageId || '__image');
this.cropper = new window.Cropper(image, this.options); this.cropper = new window.Cropper(image, this.options);
}, 1000) }, 1200)
} }
renew = (image) => { renew = (image) => {

@ -194,7 +194,7 @@ class UseBank extends Component{
display: -webkit-flex; display: -webkit-flex;
} }
.setImgW .edu-nodata-img{ .setImgW .edu-nodata-img{
width:218px !important; width: 170px !important;
} }
.bankwidth{ .bankwidth{
width:24% !important; width:24% !important;

@ -265,9 +265,9 @@ class Testpapersettinghomepage extends Component{
<div className="educontent mb20" style={{width:"1200px"}}> <div className="educontent mb20" style={{width:"1200px"}}>
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue " onClick={this.goback} >{this.props.coursedata.name}</ActionBtn> <a className=" btn colorgrey fl hovercolorblue " onClick={this.goback} >{this.props.coursedata.name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn className=" btn colorgrey fl hovercolorblue " to={`/courses/${this.props.match.params.coursesId}/exercises/${Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.left_banner_id}`} >试卷</ActionBtn> <a className=" btn colorgrey fl hovercolorblue " to={`/courses/${this.props.match.params.coursesId}/exercises/${Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.left_banner_id}`} >试卷</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">试卷详情</WordsBtn> <WordsBtn className="fl">试卷详情</WordsBtn>
</p> </p>

@ -192,7 +192,7 @@ class CoursesNew extends Component {
).then((response) => { ).then((response) => {
// debugger // debugger
if (response.data.status === 0) { if (response.data.status === 0) {
this.goback this.goback()
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -235,9 +235,7 @@ class CoursesNew extends Component {
} }
).then((response) => { ).then((response) => {
if (response.status === 200) { if (response.status === 200) {
if (response.data.course_id != undefined) { this.goback()
window.location.href = "/courses/" + response.data.course_id+"/students";
}
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)

@ -107,16 +107,6 @@ class PollDetailIndex extends Component{
DownloadType:false, DownloadType:false,
DownloadMessageval:undefined DownloadMessageval:undefined
}) })
}
goback=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
} }
render(){ render(){
let {tab,pollDetail,user_permission}=this.state; let {tab,pollDetail,user_permission}=this.state;
@ -133,7 +123,7 @@ class PollDetailIndex extends Component{
/> />
<div className="educontent mt10 mb50"> <div className="educontent mt10 mb50">
<p className="clearfix mb20"> <p className="clearfix mb20">
<a style="grey" className="fl" onClick={()=>this.goback()}>{this.props.coursedata.name}</a> <WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/students`}>{this.props.coursedata.name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/polls/${user_permission && user_permission.left_banner_id}`}>问卷</WordsBtn> <WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/polls/${user_permission && user_permission.left_banner_id}`}>问卷</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -144,7 +134,7 @@ class PollDetailIndex extends Component{
<span className="mt3 fl" style={{height:"25px"}}> <span className="mt3 fl" style={{height:"25px"}}>
<CoursesListType typelist={[`${map[pollDetail && pollDetail.polls_status]}`]} typesylename={""} /> <CoursesListType typelist={[`${map[pollDetail && pollDetail.polls_status]}`]} typesylename={""} />
</span> </span>
<WordsBtn className="fr font-16 mt2" style="grey" onClick={()=>this.goback()}>返回</WordsBtn> <WordsBtn className="fr font-16 mt2" style="grey" onClick={()=>this.props.history.goBack()}>返回</WordsBtn>
</p> </p>
<div> <div>
<div className="clearfix edu-back-white pl30 pr30 bor-bottom-greyE"> <div className="clearfix edu-back-white pl30 pr30 bor-bottom-greyE">

@ -2319,7 +2319,14 @@ class PollNew extends Component {
} }
} }
gotohome=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
//试图 //试图
render() { render() {
let { let {
@ -2373,19 +2380,18 @@ class PollNew extends Component {
/> : ""} /> : ""}
<div className="educontent mb50"> <div className="educontent mb50">
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue" <a className=" btn colorgrey fl hovercolorblue" onClick={()=>this.gotohome()}>{this.props.coursedata.name}</a>
to={`/courses/${this.props.match.params.coursesId}`}>{this.props.coursedata.name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn className=" btn colorgrey fl hovercolorblue" <a className=" btn colorgrey fl hovercolorblue"
to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</ActionBtn> to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>{this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}</span> <span>{this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}</span>
</p> </p>
<div className="clearfix mb30"> <div className="clearfix mb30">
<p <p
className="fl color-black summaryname mt5">{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}</p> className="fl color-black summaryname mt5">{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}</p>
<ActionBtn to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`} <a onClick={()=>this.gotohome()}
className=" fr font-16">返回</ActionBtn> className=" fr font-16">返回</a>
</div> </div>
{/*<Form {...formItemLayout} onSubmit={this.handleSubmit}>*/} {/*<Form {...formItemLayout} onSubmit={this.handleSubmit}>*/}

@ -70,7 +70,14 @@ class CommitSummary extends Component{
const mdContnet = this.refs[`md${1}`].getValue().trim(); const mdContnet = this.refs[`md${1}`].getValue().trim();
console.log(mdContnet) console.log(mdContnet)
} }
gotohome=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
asdasdsad=()=>{ asdasdsad=()=>{
this.setState({ this.setState({
contents:"" contents:""
@ -123,20 +130,19 @@ class CommitSummary extends Component{
}} > }} >
<div className="educontent mb30"> <div className="educontent mb30">
<p className="clearfix mb20 mt10 ml29"> <p className="clearfix mb20 mt10 ml29">
<WordsBtn className="btn colorgrey fl hovercolorblue " <a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>{data === undefined ? "" :data.course_name===undefined?"": data.course_name}</a>
style="grey">{data === undefined ? "" :data.course_name===undefined?"": data.course_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" <a style="grey"
className="btn colorgrey fl hovercolorblue ">{data === undefined ? "" :data.category===undefined?"":data.category.category_name}</WordsBtn> className="btn colorgrey fl hovercolorblue ">{data === undefined ? "" :data.category===undefined?"":data.category.category_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn> <a className="fl">作业详情</a>
</p> </p>
</div> </div>
</div> </div>
<div> <div>
<p className="ml29 fl color-black mt10 summaryname" onClick={this.asdasdsad}>修改总结</p> <p className="ml29 fl color-black mt10 summaryname" onClick={this.asdasdsad}>修改总结</p>
<a href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/openlist?tab=0`} className="color-grey-6 fr font-16 ml30 mt10">返回</a> <a onClick={()=>this.gotohome()} className="color-grey-6 fr font-16 ml30 mt10">返回</a>
</div> </div>
{/*educontentbox*/} {/*educontentbox*/}
<div className="stud-class-set pt40 pb40"> <div className="stud-class-set pt40 pb40">

@ -132,11 +132,11 @@ class ShixunHomeworkPage extends Component {
<div className="educontent mb20"> <div className="educontent mb20">
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}</ActionBtn> <a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn <a
className=" btn colorgrey fl hovercolorblue " className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name}</ActionBtn> href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn> <WordsBtn className="fl">作业详情</WordsBtn>
</p> </p>

@ -101,6 +101,14 @@ class ShixunWorkReport extends Component {
} }
} }
} }
gotohome=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
render() { render() {
let{data} =this.state; let{data} =this.state;
let category_id=data===undefined?"":data.category===null?"":data.category.category_id; let category_id=data===undefined?"":data.category===null?"":data.category.category_id;
@ -119,16 +127,15 @@ class ShixunWorkReport extends Component {
modalsType={this.state.DownloadType} modalsType={this.state.DownloadType}
/> />
<p className="clearfix mt20"> <p className="clearfix mt20">
<a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>
<WordsBtn to={"/courses/"+this.props.match.params.coursesId+"/students"} className="fl color-grey-9" style="btn colorgrey fl hovercolorblue">
<span className={"color-grey-9"}> {data&&data.course_name}</span> <span className={"color-grey-9"}> {data&&data.course_name}</span>
</WordsBtn> </a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+category_id} style="grey" className="btn colorgrey fl hovercolorblue "> <a className="btn colorgrey fl hovercolorblue " to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+category_id}>
<span className={"color-grey-9"}>{data===undefined?"":data.category===null?"":data.category.category_name}</span> <span className={"color-grey-9"}>{data===undefined?"":data.category===null?"":data.category.category_name}</span>
</WordsBtn> </a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+homework_common_id+"/list?tab=0"} className="fl color-grey-9">作业详情</WordsBtn> <a to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+homework_common_id+"/list?tab=0"} className="fl color-grey-9">作业详情</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">{data&&data.username}</WordsBtn> <WordsBtn className="fl">{data&&data.username}</WordsBtn>
</p> </p>

@ -875,6 +875,14 @@ class ShixunHomework extends Component{
let data={id:parseInt(datas.category_id),name:name} let data={id:parseInt(datas.category_id),name:name}
trigger('editshixunname', data) trigger('editshixunname', data)
} }
gotohome=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
render(){ render(){
let { let {
modalname, modalname,

@ -148,7 +148,7 @@ class EducoderLogin extends Component {
"align-items": "center", "align-items": "center",
"width": "100%" "width": "100%"
}}> }}>
<div > <div style={{cursor:"pointer"}}>
<img style={{cursor:"pointer"}} onClick={()=>this.gohome()} src={educodernet}/> <img style={{cursor:"pointer"}} onClick={()=>this.gohome()} src={educodernet}/>
</div> </div>

@ -402,7 +402,7 @@ class DetailCardsEditAndAdd extends Component{
<div className="df mb30"> <div className="df mb30">
<span className="mr30 color-orange pt10">*</span> <span className="mr30 color-orange pt10">*</span>
<div className="flex1 mr20"> <div className="flex1 mr20">
<input type="text" style={{width:'670px'}} className={stage_nametype===false?"input-100-45 greyInput":"input-100-45 greyInput bor-red"} name="stage_name" value={stage_names} onInput={this.updatastage_names} placeholder={"请输入第"+this.props.sum+"阶段名称"}/> <input maxLength="60" type="text" style={{width:'670px'}} className={stage_nametype===false?"input-100-45 greyInput":"input-100-45 greyInput bor-red"} name="stage_name" value={stage_names} onInput={this.updatastage_names} placeholder={"请输入第"+this.props.sum+"阶段名称"}/>
<div className={stage_nametype===true?"red":'none'}>名称不能为空</div> <div className={stage_nametype===true?"red":'none'}>名称不能为空</div>
</div> </div>
<div style={{"width":"60px"}}><span className="color-orange fl mt8 none" id="stage_name_notice"><i className="iconfont icon-tishi font-14 mr3"></i></span></div> <div style={{"width":"60px"}}><span className="color-orange fl mt8 none" id="stage_name_notice"><i className="iconfont icon-tishi font-14 mr3"></i></span></div>

@ -424,9 +424,55 @@ class LoginRegisterComponent extends Component {
}) })
return return
} }
console.log(e.target.value.length);
if (e.target.value.length === 0) {
this.setState({ this.setState({
Phonenumberisnotcosytdhk:undefined, Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
})
return;
}
// var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
var stringdata = undefined;
if (!regph.test(e.target.value)) {
stringdata = "手机号格式不正确";
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false,
})
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true,
}) })
return
}
if (!regemail.test(e.target.value)) {
if ((e.target.value.indexOf("@") != -1) === true) {
stringdata = "邮箱格式不正确";
} else {
stringdata = "手机号格式不正确";
}
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false,
})
return
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true,
})
this.Emailphonenumberverification(e.target.value)
return
}
this.Emailphonenumberverification(e.target.value) this.Emailphonenumberverification(e.target.value)
} }

@ -46,7 +46,7 @@ class LoginRegisterComponent extends Component {
readAgreement: false, readAgreement: false,
getverificationcodes: true, getverificationcodes: true,
dragOk: false, dragOk: false,
Agreetotheterms: false, Agreetotheterms: true,
login: "", login: "",
password: "", password: "",
logins: "", logins: "",
@ -81,7 +81,7 @@ class LoginRegisterComponent extends Component {
readAgreement: false, readAgreement: false,
getverificationcodes: true, getverificationcodes: true,
dragOk: false, dragOk: false,
Agreetotheterms: false, Agreetotheterms: true,
login: "", login: "",
password: "", password: "",
logins: "", logins: "",
@ -402,6 +402,7 @@ class LoginRegisterComponent extends Component {
type: 1, type: 1,
} }
}).then((result) => { }).then((result) => {
debugger
//验证有问题{"status":1,"message":"success"} //验证有问题{"status":1,"message":"success"}
// console.log(result); // console.log(result);
// this.setState({dragOk: true}) // this.setState({dragOk: true})
@ -409,12 +410,12 @@ class LoginRegisterComponent extends Component {
if(result){ if(result){
if(result.data.status===-2){ if(result.data.status===-2){
if (id === 1) { if (id === 1) {
console.log(value.length);
if(result.data.message==="该手机号码或邮箱已被注册"){ if(result.data.message==="该手机号码或邮箱已被注册"){
this.setState({ this.setState({
Phonenumberisnotco: undefined, Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
dragOk:true, dragOk:true,
}) })
}else { }else {
this.setState({ this.setState({
@ -436,7 +437,6 @@ class LoginRegisterComponent extends Component {
} }
}else { }else {
if (id === 1) { if (id === 1) {
console.log(value.length);
this.setState({ this.setState({
Phonenumberisnotco: undefined, Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
@ -585,13 +585,116 @@ class LoginRegisterComponent extends Component {
} }
//失去焦点判断 //失去焦点判断
inputOnBlur = (e, id) => { inputOnBlur = (e, id) => {
this.isCorrectname(e.target.value, id); // this.isCorrectname(e.target.value, id);
// this.Emailphonenumberverification(e.target.value, id); // this.Emailphonenumberverification(e.target.value, id);
if (e.target.value.length === 0) {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
})
return;
}
// var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
var stringdata = undefined;
if (!regph.test(e.target.value)) {
stringdata = "手机号格式不正确";
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: true,
dragOk:false,
Whethertoverify:this.state.Whethertoverify===true?false:true,
})
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
})
return
}
if (!regemail.test(e.target.value)) {
if ((e.target.value.indexOf("@") != -1) === true) {
stringdata = "邮箱格式不正确";
} else {
stringdata = "手机号格式不正确";
}
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: true,
dragOk:false,
Whethertoverify:this.state.Whethertoverify===true?false:true,
})
return
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
})
this.Emailphonenumberverification(e.target.value, 1);
return
}
this.Emailphonenumberverification(e.target.value, 1);
} }
inputOnBlurzhuche = (e, id) => { inputOnBlurzhuche = (e, id) => {
if(this.state.pciphone===false) { if (e.target.value.length === 0) {
this.setState({
Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: false,
})
return;
}
// var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
var stringdata = undefined;
if (!regph.test(e.target.value)) {
stringdata = "手机号格式不正确";
this.setState({
Phonenumberisnotcos: stringdata,
Phonenumberisnotcobool: true,
dragOk:false,
Whethertoverify:this.state.Whethertoverify===true?false:true,
})
} else {
this.setState({
Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: false,
})
return
}
if (!regemail.test(e.target.value)) {
if ((e.target.value.indexOf("@") != -1) === true) {
stringdata = "邮箱格式不正确";
} else {
stringdata = "手机号格式不正确";
}
this.setState({
Phonenumberisnotcos: stringdata,
Phonenumberisnotcobool: true,
dragOk:false,
Whethertoverify:this.state.Whethertoverify===true?false:true,
})
return
} else {
this.setState({
Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: false,
})
this.Emailphonenumberverification(e.target.value, id); this.Emailphonenumberverification(e.target.value, id);
return
} }
this.Emailphonenumberverification(e.target.value, id);
} }
//获取登入密码 //获取登入密码
passwordonChange = (e) => { passwordonChange = (e) => {
@ -944,7 +1047,7 @@ class LoginRegisterComponent extends Component {
} }
<Checkbox onChange={this.onChange} <Checkbox onChange={this.onChange}
value={Agreetotheterms} checked={Agreetotheterms}
><span className="font-14 " style={{ ><span className="font-14 " style={{
color: '#676767', color: '#676767',
}}>我已阅读并同意 }}>我已阅读并同意

@ -106,10 +106,15 @@ class ChangeHeaderPicModal extends Component{
// {"status":0,"message":"success","avatar_url":"avatars/User/15739"} // {"status":0,"message":"success","avatar_url":"avatars/User/15739"}
if (response.data.status == 0) { if (response.data.status == 0) {
// this.props.getBasicInfo() // this.props.getBasicInfo()
this.props.fetchUser() // https://www.trustie.net/issues/22461
// 头像更新后会触发AccountPage的DidUpdate然后会调用getBasicInfo if ( this.props.current_user.image_url.indexOf('avatars/User/b') != -1
this.props.showNotification && this.props.showNotification("修改头像成功") || this.props.current_user.image_url.indexOf('avatars/User/g') != -1 ) {
this.setVisible(false) this.setTimeout(() => {
this.doAfterUpdated()
}, 1000)
} else {
this.doAfterUpdated();
}
} }
}) })
.catch(function (error) { .catch(function (error) {
@ -117,6 +122,12 @@ class ChangeHeaderPicModal extends Component{
}); });
}); });
} }
doAfterUpdated = () => {
this.props.fetchUser()
// 头像更新后会触发AccountPage的DidUpdate然后会调用getBasicInfo
this.props.showNotification && this.props.showNotification("修改头像成功")
this.setVisible(false)
}
render(){ render(){
const { course_lists } = this.state const { course_lists } = this.state

Loading…
Cancel
Save