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 16:44:57 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
48dfd115b28525d568721928a8c8c8bcee4b9230
48dfd115
1 parent
0406fecd
可修改了
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
10 deletions
src/pages/Customer/edit.js
src/pages/Customer/index.js
src/pages/Customer/edit.js
View file @
48dfd11
...
...
@@ -23,23 +23,88 @@ export default class Edit extends Component {
super
(
props
);
this
.
state
=
{
USER_ID
:
""
,
customer_id
:
""
,
customer_id
:
this
.
props
.
navigation
.
state
.
params
.
item
.
id
,
name
:
""
,
age
:
""
,
phone
:
""
,
sex
:
""
,
is_sign
:
""
,
recommend
:
""
,
is_marri
e
d
:
""
,
is_marrid
:
""
,
has_children
:
""
};
}
componentWillMount
()
{}
componentWillMount
()
{
console
.
log
(
"customer_id"
,
this
.
state
.
customer_id
);
this
.
getItemInfo
();
}
componentDidMount
()
{}
getListData
()
{
post
(
"/test/insurance/article"
,
{},
res
=>
{},
err
=>
{});
getItemInfo
()
{
const
that
=
this
;
const
{
customer_id
}
=
this
.
state
;
post
(
`/test/insurance/contact/get/detail/
${
customer_id
}
`
,
{},
res
=>
{
console
.
log
(
"客户个人信息"
,
res
);
that
.
setState
({
name
:
res
.
data
.
name
,
age
:
res
.
data
.
age
,
phone
:
res
.
data
.
phone
,
sex
:
res
.
data
.
sex
,
is_sign
:
res
.
data
.
is_sign
,
recommend
:
res
.
data
.
recommend
,
is_marrid
:
res
.
data
.
is_marrid
,
has_children
:
res
.
data
.
has_children
});
},
err
=>
{
console
.
log
(
err
);
}
);
}
submit
()
{
const
that
=
this
;
const
{
customer_id
}
=
this
.
state
;
const
{
goBack
}
=
this
.
props
.
navigation
;
post
(
`/test/insurance/contact/update/
${
customer_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
;
post
(
`/test/insurance/contact/del/
${
customer_id
}
`
,
{},
res
=>
{
console
.
log
(
"修改客户个人信息"
,
res
);
Alert
.
alert
(
"删除成功"
,
null
,
()
=>
goBack
());
},
err
=>
{
Alert
.
alert
(
err
);
}
);
}
Alert_select
(
title
,
tips
,
statusName
,
select1
,
select2
)
{
...
...
@@ -70,8 +135,7 @@ export default class Edit extends Component {
});
});
}
submit
()
{}
delete
()
{}
render
()
{
const
{
navigate
}
=
this
.
props
.
navigation
;
return
(
...
...
@@ -186,7 +250,7 @@ export default class Edit extends Component {
<
TouchableOpacity
style
=
{
styles
.
itemContainer
}
onPress
=
{()
=>
{
this
.
Alert_select
(
"婚姻状态"
,
""
,
"is_marri
e
d"
,
"已婚"
,
"未婚"
);
this
.
Alert_select
(
"婚姻状态"
,
""
,
"is_marrid"
,
"已婚"
,
"未婚"
);
}}
>
<
View
style
=
{
styles
.
itemLeft
}
>
...
...
@@ -194,7 +258,7 @@ export default class Edit extends Component {
<
/View
>
<
View
style
=
{
styles
.
itemRight
}
>
<
Text
style
=
{
styles
.
itemRightContent
}
>
{
this
.
state
.
is_marri
e
d
}
{
this
.
state
.
is_marrid
}
<
/Text
>
<
Image
style
=
{
styles
.
itemRightImg
}
...
...
src/pages/Customer/index.js
View file @
48dfd11
...
...
@@ -160,7 +160,7 @@ export default class Customer extends Component {
<
TouchableOpacity
key
=
{
index
}
style
=
{
styles
.
mainCustomerItem
}
onPress
=
{()
=>
navigate
(
"CustomerEdit"
)}
onPress
=
{()
=>
navigate
(
"CustomerEdit"
,{
item
:
item
}
)}
>
<
Text
style
=
{
styles
.
mainCustomerItemText
}
>
{
item
.
name
}
<
/Text
>
<
Image
...
...
Please
register
or
login
to post a comment