Toggle navigation
Toggle navigation
This project
Loading...
Sign in
罗广聪
/
ProtectGod
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
罗广聪
2017-09-30 12:04:03 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
64a7ff9af8cd4e9b20626027586b13e158abb286
64a7ff9a
1 parent
0c0225ae
select
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
src/pages/Customer/Import.js
src/pages/Customer/Import.js
View file @
64a7ff9
...
...
@@ -19,7 +19,7 @@ export default class Import extends Component {
this
.
state
=
{
customersList
:
this
.
props
.
navigation
.
state
.
params
.
customersList
,
selected_all
:
false
,
selected_len
:
5
selected_len
:
0
};
}
componentWillMount
()
{}
...
...
@@ -32,6 +32,27 @@ export default class Import extends Component {
post
(
"/test/insurance/article"
,
{},
res
=>
{},
err
=>
{});
}
selectItem
(
index
)
{
const
{
customersList
,
selected_all
,
selected_len
}
=
this
.
state
;
let
Temp
=
customersList
;
console
.
log
(
index
);
Temp
.
splice
(
index
,
1
,
{
...
customersList
[
index
],
selected
:
!
customersList
[
index
].
selected
});
this
.
setState
({
customersList
:
Temp
});
}
selectAll
()
{
const
{
customersList
,
selected_all
,
selected_len
}
=
this
.
state
;
let
LEN
=
customersList
.
length
;
this
.
setState
({
selected_all
:
!
this
.
state
.
selected_all
});
}
render
()
{
const
{
navigate
}
=
this
.
props
.
navigation
;
const
{
customersList
,
selected_all
,
selected_len
}
=
this
.
state
;
...
...
@@ -52,15 +73,7 @@ export default class Import extends Component {
key
=
{
index
}
style
=
{
styles
.
CustomerItemContaier
}
onPress
=
{()
=>
{
let
Temp
=
customersList
;
console
.
log
(
index
);
Temp
.
splice
(
index
,
1
,
{
...
customersList
[
index
],
selected
:
!
customersList
[
index
].
selected
});
this
.
setState
({
customersList
:
Temp
});
this
.
selectItem
(
index
)
}}
>
<
View
style
=
{
styles
.
itemSelectIconContainer
}
>
...
...
@@ -86,9 +99,7 @@ export default class Import extends Component {
<
TouchableOpacity
style
=
{
styles
.
selectAllContainer
}
onPress
=
{()
=>
{
this
.
setState
({
selected_all
:
!
this
.
state
.
selected_all
});
this
.
selectAll
();
}}
>
<
View
style
=
{
styles
.
selectAllIcon
}
>
...
...
Please
register
or
login
to post a comment