From fc9bb34eec4a128df6181e4397573558d03280eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 11:40:00 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Testpapersettinghomepage.js | 4 ++-- .../react/src/modules/courses/poll/PollNew.js | 20 ++++++++++++------- .../courses/shixunHomework/CommitSummary.js | 20 ++++++++++++------- .../shixunHomework/ShixunHomeworkPage.js | 6 +++--- .../shixunHomework/ShixunWorkReport.js | 19 ++++++++++++------ .../courses/shixunHomework/shixunHomework.js | 8 ++++++++ .../modules/user/LoginRegisterComponent.js | 6 +++--- 7 files changed, 55 insertions(+), 28 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index 4868171a1..845caacbc 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -247,9 +247,9 @@ class Testpapersettinghomepage extends Component{

- this.gotohome()}>{this.props.coursedata.name} + this.gotohome()}>{this.props.coursedata.name} > - 试卷 + 试卷 > 试卷详情

diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index cf415aa28..0c4109ceb 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -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 { /> : ""}

- {this.props.coursedata.name} + this.gotohome()}>{this.props.coursedata.name} > - 问卷 + 问卷 > {this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}

{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}

- 返回 + this.gotohome()} + className=" fr font-16">返回
{/*
*/} diff --git a/public/react/src/modules/courses/shixunHomework/CommitSummary.js b/public/react/src/modules/courses/shixunHomework/CommitSummary.js index af8bda0dc..b40cb3536 100644 --- a/public/react/src/modules/courses/shixunHomework/CommitSummary.js +++ b/public/react/src/modules/courses/shixunHomework/CommitSummary.js @@ -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{ }} >

- {data === undefined ? "" :data.course_name===undefined?"": data.course_name} + this.gotohome()}>{data === undefined ? "" :data.course_name===undefined?"": data.course_name} > - {data === undefined ? "" :data.category===undefined?"":data.category.category_name} + {data === undefined ? "" :data.category===undefined?"":data.category.category_name} > - 作业详情 + 作业详情

修改总结

- 返回 + this.gotohome()} className="color-grey-6 fr font-16 ml30 mt10">返回
{/*educontentbox*/}
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index 9b053f03b..e2285a7a6 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -132,11 +132,11 @@ class ShixunHomeworkPage extends Component {

- this.gotohome()}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name} + this.gotohome()}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name} > - {jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name} + 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} > 作业详情

diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 3c2367942..91f6f3001 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -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} />

- - + this.gotohome()}> {data&&data.course_name} - + > - + {data===undefined?"":data.category===null?"":data.category.category_name} - + > - 作业详情 + 作业详情 > {data&&data.username}

diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 504dd9c57..61133acd2 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -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, diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index ff3eba33d..b27fe8cec 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -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: "", @@ -944,7 +944,7 @@ class LoginRegisterComponent extends Component { } 我已阅读并同意 From 23f61a9c950f677d0794cf8c73657754c3137f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 25 Jul 2019 11:45:22 +0800 Subject: [PATCH 2/7] Merge branches 'dev_aliyun' and 'master' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun # Conflicts: # public/react/src/modules/courses/exercise/Testpapersettinghomepage.js --- .../src/modules/courses/new/CoursesNew.js | 6 +- .../modules/courses/poll/PollDetailIndex.js | 400 +++++++++--------- .../paths/PathDetail/DetailCardsEditAndAdd.js | 2 +- 3 files changed, 198 insertions(+), 210 deletions(-) diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index fce6cd732..c8b090b8b 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -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) diff --git a/public/react/src/modules/courses/poll/PollDetailIndex.js b/public/react/src/modules/courses/poll/PollDetailIndex.js index cbcdd1533..8e3f78d5c 100644 --- a/public/react/src/modules/courses/poll/PollDetailIndex.js +++ b/public/react/src/modules/courses/poll/PollDetailIndex.js @@ -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( -
- -
-

- this.goback()}>{this.props.coursedata.name} - > - 问卷 - > - 问卷详情 -

-

- {pollDetail && pollDetail.polls_name} - + render(){ + let {tab,pollDetail,user_permission}=this.state; + + const isAdmin =this.props.isAdmin(); + const isStudent = this.props.isStudent(); + return( +

+ +
+

+ {this.props.coursedata.name} + > + 问卷 + > + 问卷详情 +

+

+ {pollDetail && pollDetail.polls_name} + - this.goback()}>返回 -

-
-
-
- - 答题列表 - { - (isAdmin || (isStudent && pollDetail && pollDetail.show_result == 1 && pollDetail.polls_status == 3 && user_permission && user_permission.current_status==1)) && 统计结果 - } - { isAdmin && 问卷预览 } - 设置 - -
- { - isAdmin && - + this.props.history.goBack()}>返回 +

+
+
+
+ + 答题列表 + { + (isAdmin || (isStudent && pollDetail && pollDetail.show_result == 1 && pollDetail.polls_status == 3 && user_permission && user_permission.current_status==1)) && 统计结果 + } + { isAdmin && 问卷预览 } + 设置 + +
+ { + isAdmin && + 编辑问卷 - {/* 立即发布 */} - { - user_permission && user_permission.poll_unpublish_count > 0 ? -
  • - -
  • - :"" - } - {/* 立即截止、撤销发布 */} - { - user_permission && user_permission.poll_publish_count > 0 ? -
  • - -
  • - :"" - } - {/* { + {/* 立即发布 */} + { + user_permission && user_permission.poll_unpublish_count > 0 ? +
  • + +
  • + :"" + } + {/* 立即截止、撤销发布 */} + { + user_permission && user_permission.poll_publish_count > 0 ? +
  • + +
  • + :"" + } + {/* { user_permission && user_permission.poll_publish_count>0 ?
  • :"" } */} - this.confirmysl("/polls/"+this.props.match.params.pollId+"/commit_result.xlsx")} href="javascript:void(0);">导出统计 + this.confirmysl("/polls/"+this.props.match.params.pollId+"/commit_result.xlsx")} href="javascript:void(0);">导出统计 - } - { - isStudent && - + } + { + isStudent && + { - user_permission && user_permission.current_status!=3 ? - - { user_permission && user_permission.current_status ==0 ? "继续答题" : user_permission.current_status == 1 ? "查看答题" : "开始答题" } - - :"" - } + user_permission && user_permission.current_status!=3 ? + + { user_permission && user_permission.current_status ==0 ? "继续答题" : user_permission.current_status == 1 ? "查看答题" : "开始答题" } + + :"" + } - } - -
  • - - { - // 答题列表 - parseInt(tab[0])==0 && - } - { - // 统计结果 - parseInt(tab[0])==1 && - } - - { - //问卷预览 - parseInt(tab[0])==2 && - } - { - //设置 - parseInt(tab[0])==3 && - } - -
    -
    -
    - ) - } + } + +
    + + { + // 答题列表 + parseInt(tab[0])==0 && + } + { + // 统计结果 + parseInt(tab[0])==1 && + } + + { + //问卷预览 + parseInt(tab[0])==2 && + } + { + //设置 + parseInt(tab[0])==3 && + } + +
    +
    +
    + ) + } } export default PollDetailIndex \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index 5534dd415..1c6ee09e6 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -402,7 +402,7 @@ class DetailCardsEditAndAdd extends Component{
    *
    - +
    名称不能为空
    必填项
    From bbad22274c447e5e8d992656216f6a0a8f222364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 25 Jul 2019 11:45:47 +0800 Subject: [PATCH 3/7] Merge branches 'dev_aliyun' and 'master' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun # Conflicts: # public/react/src/modules/courses/exercise/Testpapersettinghomepage.js --- .../react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index 1c6ee09e6..340505655 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -402,7 +402,7 @@ class DetailCardsEditAndAdd extends Component{
    *
    - +
    名称不能为空
    必填项
    From 1aec807d6b368fe701b694f2cd8f0447e7d63530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 11:47:41 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/exercise/Testpapersettinghomepage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index a54f5a6e2..31f127af1 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -265,9 +265,9 @@ class Testpapersettinghomepage extends Component{

    - {this.props.coursedata.name} + {this.props.coursedata.name} > - 试卷 + 试卷 > 试卷详情

    From 4992ea6d61bc120d8f25872e4654dd7ad2df0158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 13:08:27 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/FindPasswordComponent.js | 54 ++++++++- .../modules/user/LoginRegisterComponent.js | 113 +++++++++++++++++- 2 files changed, 158 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index 19b5a7388..22fcd97de 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -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) } } diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index b27fe8cec..dcbaf4730 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -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) => { From a4910c2f8f61a051c06ae220f4034fc89a56d4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 13:40:12 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/EducoderLogin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/login/EducoderLogin.js b/public/react/src/modules/login/EducoderLogin.js index 713593100..eed3a9add 100644 --- a/public/react/src/modules/login/EducoderLogin.js +++ b/public/react/src/modules/login/EducoderLogin.js @@ -148,7 +148,7 @@ class EducoderLogin extends Component { "align-items": "center", "width": "100%" }}> -
    +
    this.gohome()} src={educodernet}/>
    From a107be221c2a8f3135e60060ebff32ee693f1d1e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 25 Jul 2019 14:02:02 +0800 Subject: [PATCH 7/7] delay 1 --- public/react/src/common/components/Cropper.js | 2 +- .../src/modules/courses/busyWork/UseBank.js | 2 +- .../user/account/ChangeHeaderPicModal.js | 21 ++++++++++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/public/react/src/common/components/Cropper.js b/public/react/src/common/components/Cropper.js index 632950434..3ce30a8b5 100644 --- a/public/react/src/common/components/Cropper.js +++ b/public/react/src/common/components/Cropper.js @@ -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) => { diff --git a/public/react/src/modules/courses/busyWork/UseBank.js b/public/react/src/modules/courses/busyWork/UseBank.js index 671a09fff..ca65e74be 100644 --- a/public/react/src/modules/courses/busyWork/UseBank.js +++ b/public/react/src/modules/courses/busyWork/UseBank.js @@ -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; diff --git a/public/react/src/modules/user/account/ChangeHeaderPicModal.js b/public/react/src/modules/user/account/ChangeHeaderPicModal.js index abb3d0e12..cef643094 100644 --- a/public/react/src/modules/user/account/ChangeHeaderPicModal.js +++ b/public/react/src/modules/user/account/ChangeHeaderPicModal.js @@ -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