Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
7be1662e
Commit
7be1662e
authored
Feb 14, 2020
by
FE
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'student-register' into dev
parents
f157cd93
40fe659e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
31 deletions
+34
-31
src/components/passport/studentRoot/index.js
+34
-31
No files found.
src/components/passport/studentRoot/index.js
View file @
7be1662e
...
@@ -32,7 +32,7 @@ class StudentRoot extends PureComponent {
...
@@ -32,7 +32,7 @@ class StudentRoot extends PureComponent {
isCollege
:
false
,
isCollege
:
false
,
list
:
[],
list
:
[],
schoolList
:
[],
schoolList
:
[],
collegeList
:
[]
,
schoolName
:
''
,
};
};
}
}
...
@@ -100,18 +100,24 @@ class StudentRoot extends PureComponent {
...
@@ -100,18 +100,24 @@ class StudentRoot extends PureComponent {
}
}
changeToCollege
=
(
school
=
''
)
=>
{
changeToCollege
=
(
school
=
''
)
=>
{
const
{
list
}
=
this
.
state
;
this
.
setState
({
const
data
=
list
.
filter
(
item
=>
item
[
'school'
]
===
school
);
schoolName
:
school
});
}
fetchCollegeInfo
=
()
=>
{
const
{
list
,
schoolName
}
=
this
.
state
;
const
data
=
list
.
filter
(
item
=>
item
[
'school'
]
===
schoolName
);
if
(
data
.
length
>
0
)
{
if
(
data
.
length
>
0
)
{
this
.
setState
({
return
data
[
0
][
'colleges'
]
collegeList
:
data
[
0
][
'colleges'
]
});
}
}
return
[];
}
}
render
()
{
render
()
{
const
{
country
}
=
this
.
props
;
const
{
country
}
=
this
.
props
;
const
{
validate
,
captchaInstance
,
isSchool
,
isCollege
,
schoolList
,
collegeList
}
=
this
.
state
;
const
{
validate
,
captchaInstance
,
isSchool
,
isCollege
,
schoolList
,
schoolName
}
=
this
.
state
;
const
collegeList
=
this
.
fetchCollegeInfo
();
return
(
return
(
<>
<>
<
HeaderBar
title
=
{
'助学计划'
}
arrow
=
{
true
}
/
>
<
HeaderBar
title
=
{
'助学计划'
}
arrow
=
{
true
}
/
>
...
@@ -202,9 +208,7 @@ class StudentRoot extends PureComponent {
...
@@ -202,9 +208,7 @@ class StudentRoot extends PureComponent {
<
VeriCodeInput
<
VeriCodeInput
{...
field
}
{...
field
}
className
=
{
'student-form__code'
}
className
=
{
'student-form__code'
}
icon
=
{
<
i
className
=
{
'iconfont iconduanxin'
}
icon
=
{
<
i
className
=
{
'iconfont iconduanxin'
}
style
=
{{
fontSize
:
'20px'
,
left
:
'12px'
}}
/>
}
style
=
{{
fontSize
:
'20px'
,
left
:
'12px'
}}
/>
}
tel
=
{
props
.
values
.
tel
}
tel
=
{
props
.
values
.
tel
}
challenge
=
{
validate
}
challenge
=
{
validate
}
errors
=
{
props
.
errors
}
errors
=
{
props
.
errors
}
...
@@ -220,6 +224,7 @@ class StudentRoot extends PureComponent {
...
@@ -220,6 +224,7 @@ class StudentRoot extends PureComponent {
<
StudentSelect
<
StudentSelect
name
=
"school"
name
=
"school"
value
=
{
props
.
values
.
school
}
value
=
{
props
.
values
.
school
}
schoolName
=
{
schoolName
}
data
=
{{
data
=
{{
key
:
'isSchool'
,
key
:
'isSchool'
,
val
:
isSchool
val
:
isSchool
...
@@ -227,7 +232,9 @@ class StudentRoot extends PureComponent {
...
@@ -227,7 +232,9 @@ class StudentRoot extends PureComponent {
options
=
{
schoolList
}
options
=
{
schoolList
}
placeholder
=
"请选择"
placeholder
=
"请选择"
onChange
=
{
props
.
setFieldValue
}
onChange
=
{
props
.
setFieldValue
}
clearToCollege
=
{()
=>
props
.
setFieldValue
(
'college'
,
''
)}
clearToCollege
=
{()
=>
{
props
.
setFieldValue
(
'college'
,
''
)
}}
selectSwitch
=
{
this
.
selectSwitch
}
selectSwitch
=
{
this
.
selectSwitch
}
changeToCollege
=
{
this
.
changeToCollege
}
changeToCollege
=
{
this
.
changeToCollege
}
/
>
/
>
...
@@ -246,7 +253,6 @@ class StudentRoot extends PureComponent {
...
@@ -246,7 +253,6 @@ class StudentRoot extends PureComponent {
placeholder
=
"请先选择学校"
placeholder
=
"请先选择学校"
onChange
=
{
props
.
setFieldValue
}
onChange
=
{
props
.
setFieldValue
}
selectSwitch
=
{
this
.
selectSwitch
}
selectSwitch
=
{
this
.
selectSwitch
}
changeToCollege
=
{
this
.
changeToCollege
}
/
>
/
>
<
/div
>
<
/div
>
<
div
className
=
"student-form__item"
>
<
div
className
=
"student-form__item"
>
...
@@ -277,6 +283,7 @@ const StudentSelect = (props) => {
...
@@ -277,6 +283,7 @@ const StudentSelect = (props) => {
const
{
const
{
options
=
[],
options
=
[],
data
:
{
key
=
''
,
val
=
false
},
data
:
{
key
=
''
,
val
=
false
},
schoolName
,
isClick
=
true
,
isClick
=
true
,
name
,
name
,
value
,
value
,
...
@@ -299,27 +306,23 @@ const StudentSelect = (props) => {
...
@@ -299,27 +306,23 @@ const StudentSelect = (props) => {
}}
}}
/
>
/
>
{
{
val
&&
val
&&
<
ul
className
=
"student-select__list"
>
<
ul
className
=
"student-select__list"
>
{
{
options
.
length
>
0
options
.
length
>
0
&&
options
.
map
((
item
,
index
)
=>
(
?
(
<>
<
li
{
className
=
"student-select__option"
options
.
map
((
item
,
index
)
=>
(
key
=
{
index
}
<
li
onClick
=
{()
=>
{
className
=
"student-select__option"
selectSwitch
(
key
,
false
);
key
=
{
index
}
onChange
(
name
,
item
);
onClick
=
{()
=>
{
if
(
schoolName
!==
item
&&
typeof
clearToCollege
===
'function'
)
{
selectSwitch
(
key
,
false
);
clearToCollege
();
onChange
(
name
,
item
);
}
typeof
clearToCollege
===
'function'
&&
clearToCollege
();
typeof
changeToCollege
===
'function'
&&
changeToCollege
(
item
);
changeToCollege
(
item
);
}}
}}
>
{
item
}
<
/li
>
>
{
item
}
<
/li
>
))
))
}
<
/>
)
:
<
li
className
=
"student-select__option"
>
暂无数据
<
/li
>
}
}
<
/ul
>
<
/ul
>
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment