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 17:25:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fa148e9d9ad2b69cc5dbb0dc6532834675a300f8
fa148e9d
1 parent
d2eb86bc
add
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletions
src/pages/Customer/edit.js
src/pages/Customer/index.js
src/pages/Customer/edit.js
View file @
fa148e9
...
...
@@ -26,6 +26,7 @@ export default class Edit extends Component {
USER_ID
:
""
,
IS_LOGIN
:
""
,
customer_id
:
this
.
props
.
navigation
.
state
.
params
.
item
.
id
,
todo
:
this
.
props
.
navigation
.
state
.
params
.
todo
,
name
:
""
,
age
:
""
,
phone
:
""
,
...
...
@@ -109,6 +110,31 @@ export default class Edit extends Component {
}
);
}
add
()
{
const
that
=
this
;
const
{
USER_ID
}
=
this
.
state
;
const
{
goBack
,
state
}
=
this
.
props
.
navigation
;
post
(
`/test/insurance/contact/update/
${
USER_ID
}
`
,
{
name
:
this
.
state
.
name
,
age
:
this
.
state
.
age
,
phone
:
this
.
state
.
phone
,
sex
:
this
.
state
.
sex
,
is_sign
:
this
.
state
.
is_sign
,
recommend
:
this
.
state
.
recommend
,
is_marrid
:
this
.
state
.
is_marrid
,
has_children
:
this
.
state
.
has_children
},
res
=>
{
// console.log("修改客户个人信息", res);
Alert
.
alert
(
"提交成功"
,
null
,
()
=>
goBack
());
},
err
=>
{
Alert
.
alert
(
err
);
}
);
}
delete
()
{
const
that
=
this
;
const
{
customer_id
}
=
this
.
state
;
...
...
@@ -312,7 +338,11 @@ export default class Edit extends Component {
<
View
style
=
{
styles
.
btnContainer
}
>
<
TouchableOpacity
onPress
=
{()
=>
{
if
(
this
.
state
.
todo
==
'edit'
)
{
this
.
submit
();
}
else
{
this
.
add
();
}
}}
style
=
{
styles
.
confirmBtn
}
>
...
...
src/pages/Customer/index.js
View file @
fa148e9
...
...
@@ -136,7 +136,7 @@ export default class Customer extends Component {
<
TouchableOpacity
style
=
{
styles
.
mainBtnContaierLeft
}
onPress
=
{()
=>
{
navigate
(
"CustomerEdit"
);
navigate
(
"CustomerEdit"
,{
todo
:
'add'
}
);
}}
>
<
Image
...
...
@@ -162,6 +162,7 @@ export default class Customer extends Component {
onPress
=
{()
=>
navigate
(
"CustomerEdit"
,
{
item
:
item
,
todo
:
'edit'
,
refreshCallback
:
this
.
getAsyncStorage
})}
>
...
...
Please
register
or
login
to post a comment