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:50:12 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
46d59e7318415ef8cebb0d6062ae057f6cad03bc
46d59e73
1 parent
fa148e9d
添加和修改都OK 回调没处理
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
11 deletions
src/pages/Customer/edit.js
src/pages/Customer/index.js
src/pages/Customer/edit.js
View file @
46d59e7
...
...
@@ -25,7 +25,9 @@ export default class Edit extends Component {
this
.
state
=
{
USER_ID
:
""
,
IS_LOGIN
:
""
,
customer_id
:
this
.
props
.
navigation
.
state
.
params
.
item
.
id
,
customer_id
:
this
.
props
.
navigation
.
state
.
params
.
item
?
this
.
props
.
navigation
.
state
.
params
.
item
.
id
:
null
,
todo
:
this
.
props
.
navigation
.
state
.
params
.
todo
,
name
:
""
,
age
:
""
,
...
...
@@ -138,7 +140,7 @@ export default class Edit extends Component {
delete
()
{
const
that
=
this
;
const
{
customer_id
}
=
this
.
state
;
const
{
state
,
goBack
}
=
this
.
props
.
navigation
;
const
{
state
,
goBack
}
=
this
.
props
.
navigation
;
post
(
`/test/insurance/contact/del/
${
customer_id
}
`
,
{},
...
...
@@ -338,7 +340,7 @@ export default class Edit extends Component {
<
View
style
=
{
styles
.
btnContainer
}
>
<
TouchableOpacity
onPress
=
{()
=>
{
if
(
this
.
state
.
todo
==
'edit'
)
{
if
(
this
.
state
.
todo
==
"edit"
)
{
this
.
submit
();
}
else
{
this
.
add
();
...
...
src/pages/Customer/index.js
View file @
46d59e7
...
...
@@ -24,7 +24,7 @@ export default class Customer extends Component {
USER_ID
:
""
,
NICKNAME
:
""
,
PROFESSION
:
""
,
hasCustomer
:
tru
e
,
hasCustomer
:
fals
e
,
customersList
:
[]
};
this
.
getAllPhone
=
this
.
getAllPhone
.
bind
(
this
);
...
...
@@ -73,10 +73,12 @@ export default class Customer extends Component {
`/test/insurance/contact/get/
${
that
.
state
.
USER_ID
}
`
,
{},
res
=>
{
that
.
setState
({
hasCustomer
:
true
,
customersList
:
res
.
data
.
contacts
});
if
(
res
.
data
.
contacts
)
{
that
.
setState
({
hasCustomer
:
true
,
customersList
:
res
.
data
.
contacts
});
}
},
err
=>
{
console
.
log
(
"通信录err"
,
err
);
...
...
@@ -136,7 +138,7 @@ export default class Customer extends Component {
<
TouchableOpacity
style
=
{
styles
.
mainBtnContaierLeft
}
onPress
=
{()
=>
{
navigate
(
"CustomerEdit"
,
{
todo
:
'add'
});
navigate
(
"CustomerEdit"
,
{
todo
:
"add"
});
}}
>
<
Image
...
...
@@ -145,7 +147,12 @@ export default class Customer extends Component {
/
>
<
Text
style
=
{
styles
.
mainBtnLeftText
}
>
手动添加
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{
styles
.
mainBtnContaierRight
}
>
<
TouchableOpacity
style
=
{
styles
.
mainBtnContaierRight
}
onPress
=
{()
=>
{
this
.
getAllPhone
();
}}
>
<
Image
style
=
{
styles
.
mainBtnRightImg
}
source
=
{
require
(
"../../assets/customer/ic_message.png"
)}
...
...
@@ -162,7 +169,7 @@ export default class Customer extends Component {
onPress
=
{()
=>
navigate
(
"CustomerEdit"
,
{
item
:
item
,
todo
:
'edit'
,
todo
:
"edit"
,
refreshCallback
:
this
.
getAsyncStorage
})}
>
...
...
Please
register
or
login
to post a comment