-
{showRealName ? this.props.basicInfo.name : this.getHiddenName(this.props.basicInfo.name)}
+
{showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)}
this.showOrHide(showRealName)}>
{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }
From 95037fa4cb22505f7a4604c01c2710dd462adbd7 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Fri, 19 Jul 2019 16:03:16 +0800
Subject: [PATCH 07/11] load
---
.../src/modules/user/account/AccountNav.js | 52 +++++++++++++++++++
.../src/modules/user/account/AccountSecure.js | 23 ++++----
.../react/src/modules/user/account/common.css | 50 +-----------------
3 files changed, 65 insertions(+), 60 deletions(-)
diff --git a/public/react/src/modules/user/account/AccountNav.js b/public/react/src/modules/user/account/AccountNav.js
index 1ebbf3355..b0038e43b 100644
--- a/public/react/src/modules/user/account/AccountNav.js
+++ b/public/react/src/modules/user/account/AccountNav.js
@@ -21,6 +21,58 @@ class AccountNav extends Component {
const isSecure = path.indexOf('secure') != -1
return (
+
{
basicInfo && basicInfo.id &&
diff --git a/public/react/src/modules/user/account/AccountSecure.js b/public/react/src/modules/user/account/AccountSecure.js
index 6cff4d901..29abf22e4 100644
--- a/public/react/src/modules/user/account/AccountSecure.js
+++ b/public/react/src/modules/user/account/AccountSecure.js
@@ -35,6 +35,9 @@ class AccountSecure extends Component {
// 获取验证码倒计时
remainTime=()=>{
+ this.setState({
+ seconds: 60
+ })
this.timer = setInterval(() => {
let { seconds } =this.state;
let s = parseInt(seconds)-1;
@@ -53,7 +56,7 @@ class AccountSecure extends Component {
// 获取验证码
getCode=(index)=>{
- let url=`/account/get_verification_code.json`
+ let url=`/accounts/get_verification_code.json`
let login = '';
let values=this.props.form.getFieldsValue();
if(index == 3){
@@ -199,9 +202,11 @@ class AccountSecure extends Component {
InputNewPassword=(rule,value,callback)=>{
const { form } = this.props;
- if (value.length<8 || value.length>12) {
- callback("请输入8-12个字符的新密码,区分大小写!");
- }else {
+ if (!value) {
+ callback("请输入8-16位字符的新密码,区分大小写!");
+ } else if (value.length<8 || value.length>16) {
+ callback("请输入8-16位字符的新密码,区分大小写!");
+ } else {
callback();
}
}
@@ -283,7 +288,7 @@ class AccountSecure extends Component {
:
未绑定
}
- 绑定手机号码,将获得500金币的奖励哟~,手机号码仅自己可见~
+ {basicInfo.phone ? '仅自己可见,可用手机号码登录EduCoder' : '绑定手机号码,将获得500金币的奖励哟~,手机号码仅自己可见~'}
{
updating != PHONE &&
@@ -305,10 +310,10 @@ class AccountSecure extends Component {
rules: [{
// initialValue: this.state.cityDefaultValue,
required: true,
- message: '请输入要绑定的手机号码',
+ message: `请输入要${basicInfo.phone ? '更换' : '绑定'}的手机号码`,
}],
})(
-
+
)}
@@ -442,10 +447,6 @@ class AccountSecure extends Component {
>
{getFieldDecorator('p_new', {
rules: [{
- // initialValue: this.state.cityDefaultValue,
- required: true,
- message: '请输入8~16位的新密码,区分大小写',
- },{
validator:this.InputNewPassword
}],
})(
diff --git a/public/react/src/modules/user/account/common.css b/public/react/src/modules/user/account/common.css
index 6d1207325..113b39e07 100644
--- a/public/react/src/modules/user/account/common.css
+++ b/public/react/src/modules/user/account/common.css
@@ -18,9 +18,7 @@
.flexRow {
display: flex;
}
-.color-green-light{
- color: #45E660!important;
-}
+
.mb15{margin-bottom: 15px!important;}
/* BUTTOn */
.ant-btn {
@@ -53,49 +51,3 @@ button.ant-btn.ant-btn-primary.grayBtn {
.basicForm .ant-form-item-label label {
color: #979797
} */
- .accountInfo {
- text-align: center;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .accountInfo .name {
- color: #05101A;
- font-size: 24px;
- height: 36px;
- }
- .accountInfo .role {
- color: #666666;
- font-size: 14px;
- }
- .accountManagement .title {
- color: #05101A;
- font-size: 18px;
- font-weight: 400;
- padding: 10px 28px;
- margin-top: 6px;
- }
- .accountManagement .navItem {
- font-size: 16px;
- padding: 6px 0px;
- padding-left: 30px;
- border-left: 2px solid #fff;
- cursor: pointer;
- color:#4D4D4D;
- }
- .accountManagement .navItem i{
- margin-top: -4px;
- display: inline-block;
- margin-right: 7px;
- }
- .accountManagement .navItem i.status{
- margin-top: 1px;
- margin-right: 24px;
- }
- .accountManagement .navItem.active {
- border-left: 2px solid #4CACFF;
- background: #E6F3FF;
- }
- .accountManagement .navItem.active i:first-child{
- color:#4CACFF!important;
- }
\ No newline at end of file
From 26f443203d660f16588db37458e5df0e85df66f0 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Fri, 19 Jul 2019 16:35:32 +0800
Subject: [PATCH 08/11] ts_mem
---
public/react/src/modules/page/main/CodeEvaluateView.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/page/main/CodeEvaluateView.js b/public/react/src/modules/page/main/CodeEvaluateView.js
index 48bb0b245..8be0b8765 100644
--- a/public/react/src/modules/page/main/CodeEvaluateView.js
+++ b/public/react/src/modules/page/main/CodeEvaluateView.js
@@ -184,8 +184,8 @@ class CodeEvaluateView extends Component {
{ headIconClass &&
}
{ _headLockIconClass &&
}
- { item.ts_memo &&
消耗内存{item.ts_memo}MB }
- { item.ts_memo && item.ts_time &&
}
+ { item.ts_mem &&
消耗内存{item.ts_mem}MB }
+ { item.ts_mem && item.ts_time &&
}
{ item.ts_time &&
代码执行时长:{item.ts_time}秒 }
From 25baaa300757f2e6e1830c262958a3a6b6459863 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Fri, 19 Jul 2019 17:14:41 +0800
Subject: [PATCH 09/11] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/coursesPublic/PathModal.js | 99 +++++++-
.../courses/coursesPublic/ShixunModal.js | 107 +++++++--
.../courses/shixunHomework/shixunHomework.js | 222 +++++++-----------
3 files changed, 256 insertions(+), 172 deletions(-)
diff --git a/public/react/src/modules/courses/coursesPublic/PathModal.js b/public/react/src/modules/courses/coursesPublic/PathModal.js
index fc6747e08..824c50c78 100644
--- a/public/react/src/modules/courses/coursesPublic/PathModal.js
+++ b/public/react/src/modules/courses/coursesPublic/PathModal.js
@@ -11,7 +11,10 @@ class PathModal extends Component{
Searchvalue:undefined,
type:'all',
page:1,
- patheditarry:undefined
+ patheditarry:undefined,
+ newshixunmodallist:undefined,
+ hometypepvisible: false,
+ shixunmodallist:undefined,
}
}
@@ -19,14 +22,78 @@ class PathModal extends Component{
this.props.hidecouseShixunModal()
}
+ componentDidMount(){
+ this.setState({
+ hometypepvisible: true,
+ patheditarry: [],
+ checkBoxValues: [],
+
+ })
+
+ let coursesId = this.props.match.params.coursesId;
+ let url = "/courses/" + coursesId + "/homework_commons/subjects.json";
+
+ axios.get(url).then((result) => {
+ if (result.status === 200) {
+ this.setState({
+ shixunpath: true,
+ shixunmodallist: result.data,
+ hometypepvisible: false,
+ newshixunmodallist: result.data.subject_list,
+ })
+ }
+ }).catch((error) => {
+ console.log(error);
+ })
+ }
+ funshixunpathlist=(search,type,loading,page)=>{
+ let{newshixunmodallist}=this.state;
+ let newshixunmodallists=[]
+ if(page>1){
+ newshixunmodallists=newshixunmodallist;
+ }
+ this.setState({
+ hometypepvisible:loading
+ })
+ let coursesId=this.props.match.params.coursesId;
+ let url ="/courses/"+coursesId+"/homework_commons/subjects.json";
+
+ axios.get(url, {
+ params: {
+ search: search,
+ type:type,
+ page:page
+ }
+ }).then((result)=>{
+ if(result.status===200){
+
+ let shixun_list=result.data.subject_list;
+
+ for(var i=0; i
{
+ console.log(error);
+ })
+ }
+
//tag
changeTag=(types)=>{
let {Searchvalue}=this.state;
this.setState({
type:types,
page:1,
+ newshixunmodallist:undefined
})
- this.props.funshixunpathlist(Searchvalue,types,true,1)
+ this.funshixunpathlist(Searchvalue,types,true,1)
}
//搜索
@@ -40,7 +107,7 @@ class PathModal extends Component{
this.setState({
page:1,
})
- this.props.funshixunpathlist(value,type,true,1)
+ this.funshixunpathlist(value,type,true,1)
}
@@ -59,7 +126,7 @@ class PathModal extends Component{
let {Searchvalue,type,page,shixunpathlist}=this.state;
let newpage=page+1
- this.props.funshixunpathlist(Searchvalue,type,true,newpage)
+ this.funshixunpathlist(Searchvalue,type,true,newpage)
this.setState({
page:newpage
})
@@ -69,19 +136,24 @@ class PathModal extends Component{
}
//提交
savecouseShixunModal=()=>{
+ this.setState({
+ hometypepvisible:true
+ })
let {patheditarry}=this.state;
- let {coursesId,Coursename,page,order,category_id,datas}=this.props;
+ let {coursesId}=this.props;
let url="/courses/"+coursesId+"/homework_commons/create_subject_homework.json";
if(patheditarry===undefined){
this.setState({
patheditarrytype:true,
- patheditarryvalue:"请先选择实践课程"
+ patheditarryvalue:"请先选择实践课程",
+ hometypepvisible:false
})
return
}else if(patheditarry.length===0){
this.setState({
patheditarrytype:true,
- patheditarryvalue:"请先选择实践课程"
+ patheditarryvalue:"请先选择实践课程",
+ hometypepvisible:false
})
return
}
@@ -114,14 +186,16 @@ class PathModal extends Component{
// this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
// }
-
+ this.setState({
+ hometypepvisible:false
+ })
}).catch((error) => {
console.log(error)
})
}
render(){
- let {Searchvalue,type,Modalstype}=this.state;
- let {visible,shixunmodallist,hometypepvisible,newshixunmodallist}=this.props;
+ let {Searchvalue,type,Modalstype,newshixunmodallist,hometypepvisible,shixunmodallist}=this.state;
+ let {visible}=this.props;
const antIcon = ;
return(
@@ -164,7 +238,7 @@ class PathModal extends Component{
共
{shixunmodallist === undefined ? "":shixunmodallist.subjects_count}
- 个实训
+ 个实践课程
{
+
newshixunmodallist&&newshixunmodallist.map((item,key)=>{
return(
@@ -236,4 +311,4 @@ class PathModal extends Component{
)
}
}
-export default PathModal;
\ No newline at end of file
+export default PathModal;
diff --git a/public/react/src/modules/courses/coursesPublic/ShixunModal.js b/public/react/src/modules/courses/coursesPublic/ShixunModal.js
index 2d43439c4..4046a58a4 100644
--- a/public/react/src/modules/courses/coursesPublic/ShixunModal.js
+++ b/public/react/src/modules/courses/coursesPublic/ShixunModal.js
@@ -6,6 +6,7 @@ import axios from'axios';
const Option = Select.Option;
const Search = Input.Search;
+
class ShixunModal extends Component{
constructor(props){
super(props);
@@ -13,13 +14,69 @@ class ShixunModal extends Component{
Searchvalue:undefined,
type:'all',
category_id:0,
- page:1
+ page:1,
+ shixunmodallist:undefined,
+ hometypepvisible:false,
+ newshixunmodallist:undefined,
}
}
componentDidMount() {
-
-
+ this.setState({
+ hometypepvisible:true,
+ })
+ let coursesId=this.props.match.params.coursesId;
+ let url ="/courses/"+coursesId+"/homework_commons/shixuns.json";
+
+ axios.get(url).then((result)=>{
+ if(result.status===200){
+ this.setState({
+ shixunmodallist:result.data,
+ hometypepvisible:false,
+ newshixunmodallist:result.data.shixun_list,
+ })
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
}
+ setupdatalist=(search,type,loading,page)=>{
+ let{newshixunmodallist}=this.state;
+ let newshixunmodallists=[]
+ if(page>1){
+ newshixunmodallists=newshixunmodallist;
+ }
+ this.setState({
+ hometypepvisible:loading
+ })
+ let coursesId=this.props.match.params.coursesId;
+ let url ="/courses/"+coursesId+"/homework_commons/shixuns.json";
+
+ axios.get(url, {
+ params: {
+ search: search,
+ type:type,
+ page:page
+ }
+ }).then((result)=>{
+ if(result.status===200){
+
+ let shixun_list=result.data.shixun_list;
+ for(var i=0; i
{
+ console.log(error);
+ })
+ }
//勾选实训
shixunhomeworkedit=(list)=>{
@@ -43,16 +100,13 @@ class ShixunModal extends Component{
contentViewScrolledit=(e)=>{
//滑动到底判断
-
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
-
- let {Searchvalue,type,page}=this.state;
- let newpage=page+1
- this.props.funshixunmodallist(Searchvalue,type,true,newpage)
- this.setState({
- page:newpage
- })
-
+ let {Searchvalue,type,page}=this.state;
+ let newpage=page+1
+ this.setupdatalist(Searchvalue,type,true,newpage)
+ this.setState({
+ page:newpage
+ })
}
}
@@ -69,7 +123,7 @@ class ShixunModal extends Component{
page:1,
})
- this.props.funshixunmodallist(value,type,true,1)
+ this.setupdatalist(value,type,true,1)
this.props.funpatheditarry([])
}
@@ -79,9 +133,10 @@ class ShixunModal extends Component{
this.setState({
type:types,
page:1,
+ newshixunmodallist:undefined
})
- this.props.funshixunmodallist(Searchvalue,types,true,1)
+ this.setupdatalist(Searchvalue,types,true,1)
this.props.funpatheditarry([])
}
@@ -91,17 +146,24 @@ class ShixunModal extends Component{
}
savecouseShixunModal=()=>{
+ this.setState({
+ hometypepvisible:true
+ })
let {coursesId,patheditarry,datas}=this.props;
let{category_id}=this.state;
if (this.props.chooseShixun) {
this.props.chooseShixun(patheditarry)
+ this.setState({
+ hometypepvisible:false
+ })
return;
}
if(patheditarry.length===0){
this.setState({
shixunmodelchke:true,
- chekicmessage:"请先选择实训"
+ chekicmessage:"请先选择实训",
+ hometypepvisible:false
})
return
@@ -119,7 +181,9 @@ class ShixunModal extends Component{
this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
this.props.hidecouseShixunModal()
}
-
+ this.setState({
+ hometypepvisible:false
+ })
// category_id: 3
// homework_ids: (5) [9171, 9172, 9173, 9174, 9175]
}).catch((error) => {
@@ -133,8 +197,8 @@ class ShixunModal extends Component{
})
}
render(){
- let {Searchvalue,type,category_id}=this.state;
- let {visible,shixunmodallist,hometypepvisible,newshixunmodallist,patheditarry}=this.props;
+ let {Searchvalue,type,hometypepvisible,shixunmodallist,newshixunmodallist,}=this.state;
+ let {visible,patheditarry}=this.props;
const antIcon = ;
// console.log(patheditarry)
return(
@@ -205,7 +269,7 @@ class ShixunModal extends Component{
`
}
-
+
this.changeTag("all")} className={ type==="all" ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部
@@ -277,6 +341,9 @@ class ShixunModal extends Component{
width: 11%;
box-sizing: border-box;
}
+ .pl12{
+ padding-left: 12px;
+ }
`
}
@@ -298,7 +365,7 @@ class ShixunModal extends Component{
{item.school}
{item.myshixuns_count}
-
{item.level}
+
{item.level}
详情
diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
index 42f5fbf6a..1913b0d2d 100644
--- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js
+++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
@@ -454,20 +454,6 @@ class ShixunHomework extends Component{
checkBoxValues:[]
})
- let coursesId=this.props.match.params.coursesId;
- let url ="/courses/"+coursesId+"/homework_commons/shixuns.json";
-
- axios.get(url).then((result)=>{
- if(result.status===200){
- this.setState({
- shixunmodallist:result.data,
- hometypepvisible:false,
- newshixunmodallist:result.data.shixun_list,
- })
- }
- }).catch((error)=>{
- console.log(error);
- })
}
@@ -477,24 +463,10 @@ class ShixunHomework extends Component{
this.setState({
hometypepvisible:true,
patheditarry:[],
- checkBoxValues:[]
+ checkBoxValues:[],
+ shixunpath: true,
})
- let coursesId=this.props.match.params.coursesId;
- let url ="/courses/"+coursesId+"/homework_commons/subjects.json";
-
- axios.get(url).then((result)=>{
- if(result.status===200){
- this.setState({
- shixunpath:true,
- shixunpathlist:result.data,
- hometypepvisible:false,
- newshixunpathlist:result.data.subject_list,
- })
- }
- }).catch((error)=>{
- console.log(error);
- })
}
@@ -508,116 +480,80 @@ class ShixunHomework extends Component{
})
}
- funshixunmodallist=(search,type,loading,page)=>{
- let{newshixunmodallist}=this.state;
- let newshixunmodallists=[]
- if(page>1){
- newshixunmodallists=newshixunmodallist;
- }
- this.setState({
- hometypepvisible:loading
- })
- let coursesId=this.props.match.params.coursesId;
- let url ="/courses/"+coursesId+"/homework_commons/shixuns.json";
-
- axios.get(url, {
- params: {
- search: search,
- type:type,
- page:page
- }
- }).then((result)=>{
- if(result.status===200){
-
- let shixun_list=result.data.shixun_list;
- for(var i=0; i
{
- console.log(error);
- })
- }
-
- funshixunpathlist=(search,type,loading,page)=>{
- let{newshixunpathlist}=this.state;
- let newshixunmodallists=[]
- if(page>1){
- newshixunmodallists=newshixunpathlist;
- }
- this.setState({
- hometypepvisible:loading
- })
- let coursesId=this.props.match.params.coursesId;
- let url ="/courses/"+coursesId+"/homework_commons/subjects.json";
-
- axios.get(url, {
- params: {
- search: search,
- type:type,
- page:page
- }
- }).then((result)=>{
- if(result.status===200){
-
- let shixun_list=result.data.subject_list;
- for(var i=0; i{
- console.log(error);
- })
- }
-
- funshixunpathlist=(search,type,loading,page)=>{
- let{newshixunpathlist}=this.state;
- let newshixunmodallists=[]
- if(page>1){
- newshixunmodallists=newshixunpathlist;
- }
- this.setState({
- hometypepvisible:loading
- })
- let coursesId=this.props.match.params.coursesId;
- let url ="/courses/"+coursesId+"/homework_commons/subjects.json";
+ // funshixunmodallist=(search,type,loading,page)=>{
+ // let{newshixunmodallist}=this.state;
+ // let newshixunmodallists=[]
+ // if(page>1){
+ // newshixunmodallists=newshixunmodallist;
+ // }
+ // this.setState({
+ // hometypepvisible:loading
+ // })
+ // let coursesId=this.props.match.params.coursesId;
+ // let url ="/courses/"+coursesId+"/homework_commons/shixuns.json";
+ //
+ // axios.get(url, {
+ // params: {
+ // search: search,
+ // type:type,
+ // page:page
+ // }
+ // }).then((result)=>{
+ // if(result.status===200){
+ //
+ // let shixun_list=result.data.shixun_list;
+ // for(var i=0; i{
+ // console.log(error);
+ // })
+ // }
- axios.get(url, {
- params: {
- search: search,
- type:type,
- page:page
- }
- }).then((result)=>{
- if(result.status===200){
- let shixun_list=result.data.subject_list;
- for(var i=0; i{
- console.log(error);
- })
- }
+ // funshixunpathlist=(search,type,loading,page)=>{
+ // let{newshixunpathlist}=this.state;
+ // let newshixunmodallists=[]
+ // if(page>1){
+ // newshixunmodallists=newshixunpathlist;
+ // }
+ // this.setState({
+ // hometypepvisible:loading
+ // })
+ // let coursesId=this.props.match.params.coursesId;
+ // let url ="/courses/"+coursesId+"/homework_commons/subjects.json";
+ //
+ // axios.get(url, {
+ // params: {
+ // search: search,
+ // type:type,
+ // page:page
+ // }
+ // }).then((result)=>{
+ // if(result.status===200){
+ //
+ // let shixun_list=result.data.subject_list;
+ // for(var i=0; i{
+ // console.log(error);
+ // })
+ // }
PaginationCourse=(pageNumber)=>{
let {Coursename,order}=this.state;
@@ -1012,13 +948,16 @@ class ShixunHomework extends Component{
course_groups={course_groups}
getcourse_groupslist={(id)=>this.getcourse_groupslist(id)}
/>:""}
+
{/*选择实训*/}
{shixunmodal===true?this.funshixunmodallist(search,type,loading,page)}
+ // funshixunmodallist={(search,type,loading,page)=>this.funshixunmodallist(search,type,loading,page)}
hometypepvisible={hometypepvisible}
hidecouseShixunModal={this.hidecouseShixunModal}
newshixunmodallist={newshixunmodallist}
@@ -1027,6 +966,7 @@ class ShixunHomework extends Component{
funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}
patheditarry={patheditarry}
/>:""}
+
{shixunmodal===true||shixunpath===true?:""}
{/*选择实训路径*/}
{shixunpath===true? this.funshixunpathlist(search,type,loading,page)}
+ // funshixunpathlist={(search,type,loading,page)=>this.funshixunpathlist(search,type,loading,page)}
hometypepvisible={hometypepvisible}
hidecouseShixunModal={this.hidecouseShixunModal}
coursesId={this.props.match.params.coursesId}
From 49d3cc2c48b8bf98cc580d21289e007b0d66a48d Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Fri, 19 Jul 2019 17:25:52 +0800
Subject: [PATCH 10/11] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=A4=A7=E5=9B=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/common/educoder.js | 1 +
.../react/src/common/hooks/ImageLayerHook.js | 47 +++++++++++++++++++
.../members/modal/CourseGroupChooserModal.js | 4 +-
.../modules/page/main/CodeEvaluateView.css | 1 +
.../user/modal/RealNameCertificationModal.js | 14 ++++--
5 files changed, 61 insertions(+), 6 deletions(-)
create mode 100644 public/react/src/common/hooks/ImageLayerHook.js
diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js
index 263e08808..749d2a1e5 100644
--- a/public/react/src/common/educoder.js
+++ b/public/react/src/common/educoder.js
@@ -50,3 +50,4 @@ export { default as DMDEditor } from './components/markdown/DMDEditor'
+export { default as ImageLayerHook } from './hooks/ImageLayerHook'
\ No newline at end of file
diff --git a/public/react/src/common/hooks/ImageLayerHook.js b/public/react/src/common/hooks/ImageLayerHook.js
new file mode 100644
index 000000000..c9f0a14a4
--- /dev/null
+++ b/public/react/src/common/hooks/ImageLayerHook.js
@@ -0,0 +1,47 @@
+import React, { useState, useEffect, memo } from 'react'
+import ImageLayer from '../../modules/page/layers/ImageLayer'
+import { isImageExtension } from 'educoder'
+function ImageLayerHook(props) {
+ const [showImage, setShowImage] = useState(false)
+ const [imageSrc, setImageSrc] = useState('')
+
+ const { parentSel, childSel, watchPropsArray } = props
+
+ const onImageLayerClose = () => {
+ setShowImage(false)
+ setImageSrc('')
+ }
+ const onDelegateClick = (event) => {
+ const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href')
+ // 判断imageSrc是否是图片
+ const fileName = event.target.innerHTML.trim()
+ if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName) || event.target.tagName == 'IMG' || imageSrc.indexOf('base64,') != -1) {
+ // 非回复里的头像图片; 非emoticons
+ if (imageSrc.indexOf('/images/avatars/User') === -1 &&
+ imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {
+ setShowImage(true)
+ setImageSrc(imageSrc)
+ }
+ event.stopPropagation()
+ event.preventDefault && event.preventDefault()
+ event.originalEvent.preventDefault()
+ // event.originalEvent.stopPropagation()
+ // event.originalEvent.cancelBubble = true
+ return false;
+ }
+ }
+ useEffect(() => {
+ $(parentSel)
+ .delegate(childSel, "click", onDelegateClick);
+
+ return () => {
+ $(parentSel).undelegate(childSel, "click", onDelegateClick )
+ }
+ })
+
+ return (
+
+ )
+}
+
+export default memo(ImageLayerHook)
\ No newline at end of file
diff --git a/public/react/src/modules/courses/members/modal/CourseGroupChooserModal.js b/public/react/src/modules/courses/members/modal/CourseGroupChooserModal.js
index dc3044cc0..3f4f1a0ca 100644
--- a/public/react/src/modules/courses/members/modal/CourseGroupChooserModal.js
+++ b/public/react/src/modules/courses/members/modal/CourseGroupChooserModal.js
@@ -1,4 +1,4 @@
-import React, { useState, useEffect, useRef, memo } from 'react'
+import React, { useState, useEffect, useRef, useMemo } from 'react'
import { trigger } from 'educoder'
import { Input, Checkbox } from "antd";
import CourseGroupChooser from '../CourseGroupChooser'
@@ -105,4 +105,4 @@ function CourseGroupChooserModal({ course_groups = [], isAdminOrCreator, item, i
)
}
-export default memo(CourseGroupChooserModal)
\ No newline at end of file
+export default useMemo(CourseGroupChooserModal)
\ No newline at end of file
diff --git a/public/react/src/modules/page/main/CodeEvaluateView.css b/public/react/src/modules/page/main/CodeEvaluateView.css
index bd0427d7b..137174d95 100644
--- a/public/react/src/modules/page/main/CodeEvaluateView.css
+++ b/public/react/src/modules/page/main/CodeEvaluateView.css
@@ -126,4 +126,5 @@
display: inline-block;
height: 10px;
margin: 5px 0;
+ float: right;
}
\ No newline at end of file
diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js
index ccb301a32..6c92423cd 100644
--- a/public/react/src/modules/user/modal/RealNameCertificationModal.js
+++ b/public/react/src/modules/user/modal/RealNameCertificationModal.js
@@ -2,7 +2,7 @@ import React, { Component } from "react";
import { message, Icon, Input, Form, Upload} from "antd";
import axios from 'axios'
import ModalWrapper from "../../courses/common/ModalWrapper"
-import { City, getUploadActionUrl,getImageUrl } from 'educoder'
+import { City, getUploadActionUrl, getImageUrl, ImageLayerHook } from 'educoder'
import '../account/common.css'
import authImg from '../../../images/account/auth.png'
@@ -201,7 +201,11 @@ class RealNameCertificationModal extends Component{
}
.applyForModal .ant-form-item-label label {
color: #979797
+ }
+ .applyForModal .ant-upload.ant-upload-drag .ant-upload {
+ padding: 0px;
}
+
.certificationModal .ant-modal-body{
padding:20px;
}
@@ -295,9 +299,9 @@ class RealNameCertificationModal extends Component{
{imageUrl2 ?
-
+ //
- :
+ :
@@ -311,7 +315,9 @@ class RealNameCertificationModal extends Component{
From b89832fe8476840874fe5e639edfe63c88e0538a Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Fri, 19 Jul 2019 17:44:52 +0800
Subject: [PATCH 11/11] users
---
public/react/src/context/TPIContextProvider.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js
index 10e9c07e2..449f79a7a 100644
--- a/public/react/src/context/TPIContextProvider.js
+++ b/public/react/src/context/TPIContextProvider.js
@@ -424,7 +424,7 @@ pop_box_new(htmlvalue, 480, 182);
*/
let user = resData.user;
user.username = resData.user.name;
- user.user_url = `/user/${resData.user.login}`;
+ user.user_url = `/users/${resData.user.login}`;
// user.image_url = resData.image_url;
user.is_teacher = resData.is_teacher;
resData.user = user;