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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
20 deletions
+23
-20
src/components/passport/studentRoot/index.js
+23
-20
No files found.
src/components/passport/studentRoot/index.js
View file @
7be1662e
...
...
@@ -32,7 +32,7 @@ class StudentRoot extends PureComponent {
isCollege
:
false
,
list
:
[],
schoolList
:
[],
collegeList
:
[]
,
schoolName
:
''
,
};
}
...
...
@@ -100,18 +100,24 @@ class StudentRoot extends PureComponent {
}
changeToCollege
=
(
school
=
''
)
=>
{
const
{
list
}
=
this
.
state
;
const
data
=
list
.
filter
(
item
=>
item
[
'school'
]
===
school
);
if
(
data
.
length
>
0
)
{
this
.
setState
({
collegeList
:
data
[
0
][
'colleges'
]
schoolName
:
school
});
}
fetchCollegeInfo
=
()
=>
{
const
{
list
,
schoolName
}
=
this
.
state
;
const
data
=
list
.
filter
(
item
=>
item
[
'school'
]
===
schoolName
);
if
(
data
.
length
>
0
)
{
return
data
[
0
][
'colleges'
]
}
return
[];
}
render
()
{
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
(
<>
<
HeaderBar
title
=
{
'助学计划'
}
arrow
=
{
true
}
/
>
...
...
@@ -202,9 +208,7 @@ class StudentRoot extends PureComponent {
<
VeriCodeInput
{...
field
}
className
=
{
'student-form__code'
}
icon
=
{
<
i
className
=
{
'iconfont iconduanxin'
}
style
=
{{
fontSize
:
'20px'
,
left
:
'12px'
}}
/>
}
icon
=
{
<
i
className
=
{
'iconfont iconduanxin'
}
style
=
{{
fontSize
:
'20px'
,
left
:
'12px'
}}
/>
}
tel
=
{
props
.
values
.
tel
}
challenge
=
{
validate
}
errors
=
{
props
.
errors
}
...
...
@@ -220,6 +224,7 @@ class StudentRoot extends PureComponent {
<
StudentSelect
name
=
"school"
value
=
{
props
.
values
.
school
}
schoolName
=
{
schoolName
}
data
=
{{
key
:
'isSchool'
,
val
:
isSchool
...
...
@@ -227,7 +232,9 @@ class StudentRoot extends PureComponent {
options
=
{
schoolList
}
placeholder
=
"请选择"
onChange
=
{
props
.
setFieldValue
}
clearToCollege
=
{()
=>
props
.
setFieldValue
(
'college'
,
''
)}
clearToCollege
=
{()
=>
{
props
.
setFieldValue
(
'college'
,
''
)
}}
selectSwitch
=
{
this
.
selectSwitch
}
changeToCollege
=
{
this
.
changeToCollege
}
/
>
...
...
@@ -246,7 +253,6 @@ class StudentRoot extends PureComponent {
placeholder
=
"请先选择学校"
onChange
=
{
props
.
setFieldValue
}
selectSwitch
=
{
this
.
selectSwitch
}
changeToCollege
=
{
this
.
changeToCollege
}
/
>
<
/div
>
<
div
className
=
"student-form__item"
>
...
...
@@ -277,6 +283,7 @@ const StudentSelect = (props) => {
const
{
options
=
[],
data
:
{
key
=
''
,
val
=
false
},
schoolName
,
isClick
=
true
,
name
,
value
,
...
...
@@ -302,25 +309,21 @@ const StudentSelect = (props) => {
val
&&
<
ul
className
=
"student-select__list"
>
{
options
.
length
>
0
?
(
<>
{
options
.
map
((
item
,
index
)
=>
(
options
.
length
>
0
&&
options
.
map
((
item
,
index
)
=>
(
<
li
className
=
"student-select__option"
key
=
{
index
}
onClick
=
{()
=>
{
selectSwitch
(
key
,
false
);
onChange
(
name
,
item
);
typeof
clearToCollege
===
'function'
&&
clearToCollege
();
changeToCollege
(
item
);
if
(
schoolName
!==
item
&&
typeof
clearToCollege
===
'function'
)
{
clearToCollege
();
}
typeof
changeToCollege
===
'function'
&&
changeToCollege
(
item
);
}}
>
{
item
}
<
/li
>
))
}
<
/>
)
:
<
li
className
=
"student-select__option"
>
暂无数据
<
/li
>
}
<
/ul
>
}
<
/div
>
...
...
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