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(() => {
const image = document.getElementById(this.props.imageId || '__image');
this.cropper = new window.Cropper(image, this.options);
}, 1000)
}, 1200)
}
renew = (image) => {

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

@ -265,9 +265,9 @@ class Testpapersettinghomepage extends Component{
<div className="educontent mb20" style={{width:"1200px"}}>
<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>
<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>
<WordsBtn className="fl">试卷详情</WordsBtn>
</p>

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

@ -22,179 +22,169 @@ import axios from 'axios'
const map={1:"未发布",2:"提交中",3:"已截止",4:"已结束"}
class PollDetailIndex extends Component{
constructor(props){
super(props);
this.state={
tab:["0"],
pollDetail:undefined,
user_permission:undefined,
DownloadType:false,
DownloadMessageval:undefined,
}
}
getPollInfo=()=>{
console.log(this.props);
let pollId=this.props.match.params.pollId;
let url=`/polls/${pollId}/common_header.json`
axios.get(url).then((result)=>{
if(result.status==200){
this.setState({
pollDetail:result.data,
user_permission:result.data.user_permission
})
}
}).catch((error)=>{
console.log(error);
})
}
componentDidMount(){
const query =this.props.location.search;
if(query.indexOf("?")!=-1){
const type = query.split('?');
let name = type[1].split("tab=");
name = String(name).split(",");
name = decodeURI(name[1]);
if(name!=undefined && name!="" && name!="undefined"){
this.setState({
tab:[name]
})
}
}
this.getPollInfo();
}
//切换tab
changeTab=(e)=>{
this.setState({
tab:e.key
})
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.message === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
}
Downloadcal=()=>{
this.setState({
DownloadType:false,
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);
constructor(props){
super(props);
this.state={
tab:["0"],
pollDetail:undefined,
user_permission:undefined,
DownloadType:false,
DownloadMessageval:undefined,
}
}
getPollInfo=()=>{
console.log(this.props);
let pollId=this.props.match.params.pollId;
let url=`/polls/${pollId}/common_header.json`
axios.get(url).then((result)=>{
if(result.status==200){
this.setState({
pollDetail:result.data,
user_permission:result.data.user_permission
})
}
}).catch((error)=>{
console.log(error);
})
}
componentDidMount(){
const query =this.props.location.search;
if(query.indexOf("?")!=-1){
const type = query.split('?');
let name = type[1].split("tab=");
name = String(name).split(",");
name = decodeURI(name[1]);
if(name!=undefined && name!="" && name!="undefined"){
this.setState({
tab:[name]
})
}
}
this.getPollInfo();
}
//切换tab
changeTab=(e)=>{
this.setState({
tab:e.key
})
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.message === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
}
Downloadcal=()=>{
this.setState({
DownloadType:false,
DownloadMessageval:undefined
})
}
render(){
let {tab,pollDetail,user_permission}=this.state;
const isAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent();
return(
<div className="newMain">
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
<div className="educontent mt10 mb50">
<p className="clearfix mb20">
<a style="grey" className="fl" onClick={()=>this.goback()}>{this.props.coursedata.name}</a>
<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>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>问卷详情</span>
</p>
<p className="clearfix mb20 lineh-25">
<span className="color-grey-3 font-24 fl task-hide break-word" style={{maxWidth:"900px",lineHeight:"25px"}} title={`${pollDetail && pollDetail.polls_name}`}>{pollDetail && pollDetail.polls_name}</span>
<span className="mt3 fl" style={{height:"25px"}}>
render(){
let {tab,pollDetail,user_permission}=this.state;
const isAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent();
return(
<div className="newMain">
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
<div className="educontent mt10 mb50">
<p className="clearfix mb20">
<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>
<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>问卷详情</span>
</p>
<p className="clearfix mb20 lineh-25">
<span className="color-grey-3 font-24 fl task-hide break-word" style={{maxWidth:"900px",lineHeight:"25px"}} title={`${pollDetail && pollDetail.polls_name}`}>{pollDetail && pollDetail.polls_name}</span>
<span className="mt3 fl" style={{height:"25px"}}>
<CoursesListType typelist={[`${map[pollDetail && pollDetail.polls_status]}`]} typesylename={""} />
</span>
<WordsBtn className="fr font-16 mt2" style="grey" onClick={()=>this.goback()}>返回</WordsBtn>
</p>
<div>
<div className="clearfix edu-back-white pl30 pr30 bor-bottom-greyE">
<div className="fl task_menu_ul">
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0">答题列表</Menu.Item>
{
(isAdmin || (isStudent && pollDetail && pollDetail.show_result == 1 && pollDetail.polls_status == 3 && user_permission && user_permission.current_status==1)) && <Menu.Item key="1">统计结果</Menu.Item>
}
{ isAdmin && <Menu.Item key="2">问卷预览</Menu.Item> }
<Menu.Item key="3">设置</Menu.Item>
</Menu>
</div>
{
isAdmin &&
<span className="fr mt22">
<WordsBtn className="fr font-16 mt2" style="grey" onClick={()=>this.props.history.goBack()}>返回</WordsBtn>
</p>
<div>
<div className="clearfix edu-back-white pl30 pr30 bor-bottom-greyE">
<div className="fl task_menu_ul">
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0">答题列表</Menu.Item>
{
(isAdmin || (isStudent && pollDetail && pollDetail.show_result == 1 && pollDetail.polls_status == 3 && user_permission && user_permission.current_status==1)) && <Menu.Item key="1">统计结果</Menu.Item>
}
{ isAdmin && <Menu.Item key="2">问卷预览</Menu.Item> }
<Menu.Item key="3">设置</Menu.Item>
</Menu>
</div>
{
isAdmin &&
<span className="fr mt22">
<WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/edit`} className="fl mr20 font-16">编辑问卷</WordsBtn>
{/* 立即发布 */}
{
user_permission && user_permission.poll_unpublish_count > 0 ?
<li className="fl mr20">
<ImmediatelyPublish
{...this.props}
{...this.state}
style="blue"
className={"font-16"}
checkBoxValues={[this.props.match.params.pollId]}
action={this.getPollInfo}
single={true}
></ImmediatelyPublish>
</li>
:""
}
{/* 立即截止、撤销发布 */}
{
user_permission && user_permission.poll_publish_count > 0 ?
<li className="fl mr20">
<ImmediatelyEnd
{...this.props}
{...this.state}
style="blue"
className={"font-16"}
checkBoxValues={[this.props.match.params.pollId]}
action={this.getPollInfo}
single={true}
></ImmediatelyEnd>
</li>
:""
}
{/* {
{/* 立即发布 */}
{
user_permission && user_permission.poll_unpublish_count > 0 ?
<li className="fl mr20">
<ImmediatelyPublish
{...this.props}
{...this.state}
style="blue"
className={"font-16"}
checkBoxValues={[this.props.match.params.pollId]}
action={this.getPollInfo}
single={true}
></ImmediatelyPublish>
</li>
:""
}
{/* 立即截止、撤销发布 */}
{
user_permission && user_permission.poll_publish_count > 0 ?
<li className="fl mr20">
<ImmediatelyEnd
{...this.props}
{...this.state}
style="blue"
className={"font-16"}
checkBoxValues={[this.props.match.params.pollId]}
action={this.getPollInfo}
single={true}
></ImmediatelyEnd>
</li>
:""
}
{/* {
user_permission && user_permission.poll_publish_count>0 ?
<li className="fl mr20">
<CancelPublish
@ -207,46 +197,46 @@ class PollDetailIndex extends Component{
</li>
:""
} */}
<a className="fl color-blue font-16" onClick={(url)=>this.confirmysl("/polls/"+this.props.match.params.pollId+"/commit_result.xlsx")} href="javascript:void(0);">导出统计</a>
<a className="fl color-blue font-16" onClick={(url)=>this.confirmysl("/polls/"+this.props.match.params.pollId+"/commit_result.xlsx")} href="javascript:void(0);">导出统计</a>
</span>
}
{
isStudent &&
<span className="fr mt22 font-16">
}
{
isStudent &&
<span className="fr mt22 font-16">
{
user_permission && user_permission.current_status!=3 ?
<WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/users/${this.props.current_user.login}`}>
{ user_permission && user_permission.current_status ==0 ? "继续答题" : user_permission.current_status == 1 ? "查看答题" : "开始答题" }
</WordsBtn>
:""
}
user_permission && user_permission.current_status!=3 ?
<WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/users/${this.props.current_user.login}`}>
{ user_permission && user_permission.current_status ==0 ? "继续答题" : user_permission.current_status == 1 ? "查看答题" : "开始答题" }
</WordsBtn>
:""
}
</span>
}
</div>
{
// 答题列表
parseInt(tab[0])==0 && <PollTabFirst {...this.props} {...this.state}></PollTabFirst>
}
{
// 统计结果
parseInt(tab[0])==1 && <PollTabSecond {...this.props} {...this.state}></PollTabSecond>
}
{
//问卷预览
parseInt(tab[0])==2 && <PollTabThird {...this.props} {...this.state}></PollTabThird>
}
{
//设置
parseInt(tab[0])==3 && <PollTabForth {...this.props} {...this.state} user_permission={user_permission} getPollInfo={this.getPollInfo}></PollTabForth>
}
</div>
</div>
</div>
)
}
}
</div>
{
// 答题列表
parseInt(tab[0])==0 && <PollTabFirst {...this.props} {...this.state}></PollTabFirst>
}
{
// 统计结果
parseInt(tab[0])==1 && <PollTabSecond {...this.props} {...this.state}></PollTabSecond>
}
{
//问卷预览
parseInt(tab[0])==2 && <PollTabThird {...this.props} {...this.state}></PollTabThird>
}
{
//设置
parseInt(tab[0])==3 && <PollTabForth {...this.props} {...this.state} user_permission={user_permission} getPollInfo={this.getPollInfo}></PollTabForth>
}
</div>
</div>
</div>
)
}
}
export default PollDetailIndex

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

@ -70,7 +70,14 @@ class CommitSummary extends Component{
const mdContnet = this.refs[`md${1}`].getValue().trim();
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=()=>{
this.setState({
contents:""
@ -123,20 +130,19 @@ class CommitSummary extends Component{
}} >
<div className="educontent mb30">
<p className="clearfix mb20 mt10 ml29">
<WordsBtn className="btn colorgrey fl hovercolorblue "
style="grey">{data === undefined ? "" :data.course_name===undefined?"": data.course_name}</WordsBtn>
<a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>{data === undefined ? "" :data.course_name===undefined?"": data.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey"
className="btn colorgrey fl hovercolorblue ">{data === undefined ? "" :data.category===undefined?"":data.category.category_name}</WordsBtn>
<a style="grey"
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>
<WordsBtn className="fl">作业详情</WordsBtn>
<a className="fl">作业详情</a>
</p>
</div>
</div>
<div>
<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>
{/*educontentbox*/}
<div className="stud-class-set pt40 pb40">

@ -132,11 +132,11 @@ class ShixunHomeworkPage extends Component {
<div className="educontent mb20">
<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>
<ActionBtn
<a
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>
<WordsBtn className="fl">作业详情</WordsBtn>
</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() {
let{data} =this.state;
let category_id=data===undefined?"":data.category===null?"":data.category.category_id;
@ -119,16 +127,15 @@ class ShixunWorkReport extends Component {
modalsType={this.state.DownloadType}
/>
<p className="clearfix mt20">
<WordsBtn to={"/courses/"+this.props.match.params.coursesId+"/students"} className="fl color-grey-9" style="btn colorgrey fl hovercolorblue">
<a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>
<span className={"color-grey-9"}> {data&&data.course_name}</span>
</WordsBtn>
</a>
<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>
</WordsBtn>
</a>
<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>
<WordsBtn className="fl">{data&&data.username}</WordsBtn>
</p>

@ -875,6 +875,14 @@ class ShixunHomework extends Component{
let data={id:parseInt(datas.category_id),name:name}
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(){
let {
modalname,

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

@ -402,7 +402,7 @@ class DetailCardsEditAndAdd extends Component{
<div className="df mb30">
<span className="mr30 color-orange pt10">*</span>
<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>
<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,10 +424,56 @@ class LoginRegisterComponent extends Component {
})
return
}
this.setState({
Phonenumberisnotcosytdhk:undefined,
})
this.Emailphonenumberverification(e.target.value)
console.log(e.target.value.length);
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: 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)
}
}

@ -46,7 +46,7 @@ class LoginRegisterComponent extends Component {
readAgreement: false,
getverificationcodes: true,
dragOk: false,
Agreetotheterms: false,
Agreetotheterms: true,
login: "",
password: "",
logins: "",
@ -81,7 +81,7 @@ class LoginRegisterComponent extends Component {
readAgreement: false,
getverificationcodes: true,
dragOk: false,
Agreetotheterms: false,
Agreetotheterms: true,
login: "",
password: "",
logins: "",
@ -402,6 +402,7 @@ class LoginRegisterComponent extends Component {
type: 1,
}
}).then((result) => {
debugger
//验证有问题{"status":1,"message":"success"}
// console.log(result);
// this.setState({dragOk: true})
@ -409,12 +410,12 @@ class LoginRegisterComponent extends Component {
if(result){
if(result.data.status===-2){
if (id === 1) {
console.log(value.length);
if(result.data.message==="该手机号码或邮箱已被注册"){
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
dragOk:true,
})
}else {
this.setState({
@ -436,7 +437,6 @@ class LoginRegisterComponent extends Component {
}
}else {
if (id === 1) {
console.log(value.length);
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
@ -585,13 +585,116 @@ class LoginRegisterComponent extends Component {
}
//失去焦点判断
inputOnBlur = (e, id) => {
this.isCorrectname(e.target.value, id);
// this.isCorrectname(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) => {
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);
return
}
this.Emailphonenumberverification(e.target.value, id);
}
}
//获取登入密码
passwordonChange = (e) => {
@ -944,7 +1047,7 @@ class LoginRegisterComponent extends Component {
}
<Checkbox onChange={this.onChange}
value={Agreetotheterms}
checked={Agreetotheterms}
><span className="font-14 " style={{
color: '#676767',
}}>我已阅读并同意

@ -105,11 +105,16 @@ class ChangeHeaderPicModal extends Component{
.then((response) => {
// {"status":0,"message":"success","avatar_url":"avatars/User/15739"}
if (response.data.status == 0) {
// this.props.getBasicInfo()
this.props.fetchUser()
// 头像更新后会触发AccountPage的DidUpdate然后会调用getBasicInfo
this.props.showNotification && this.props.showNotification("修改头像成功")
this.setVisible(false)
// this.props.getBasicInfo()
// https://www.trustie.net/issues/22461
if ( this.props.current_user.image_url.indexOf('avatars/User/b') != -1
|| this.props.current_user.image_url.indexOf('avatars/User/g') != -1 ) {
this.setTimeout(() => {
this.doAfterUpdated()
}, 1000)
} else {
this.doAfterUpdated();
}
}
})
.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(){
const { course_lists } = this.state

Loading…
Cancel
Save