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-29 15:25:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3b6eb692c00643b2937d4840c99d286a9a1f207e
3b6eb692
1 parent
eedbf11f
准备好客户数据框架
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
43 deletions
src/pages/Customer/edit.js
src/pages/Customer/edit.js
View file @
3b6eb69
...
...
@@ -22,10 +22,15 @@ export default class Edit extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
customer_status
:
[],
customer_id
:
""
,
name
:
""
,
age
:
""
,
phone
:
""
,
sex
:
""
,
is_sign
:
""
,
recommend
:
""
,
is_married
:
""
,
modalVisible
:
false
,
recommend
:
""
has_children
:
""
,
};
}
componentWillMount
()
{}
...
...
@@ -35,37 +40,6 @@ export default class Edit extends Component {
getListData
()
{
post
(
"/test/insurance/article"
,
{},
res
=>
{},
err
=>
{});
}
setModalVisible
(
visible
)
{
this
.
setState
({
modalVisible
:
visible
});
}
_renderPicker
()
{
return
(
<
Modal
animationType
=
{
"slide"
}
transparent
=
{
false
}
visible
=
{
this
.
state
.
modalVisible
}
onRequestClose
=
{()
=>
{
alert
(
"Modal has been closed."
);
}}
>
<
Picker
selectedValue
=
{
this
.
state
.
is_married
}
onValueChange
=
{
status
=>
this
.
setState
({
is_married
:
status
})}
>
<
Picker
.
Item
label
=
"是"
value
=
"yes"
/>
<
Picker
.
Item
label
=
"否"
value
=
"no"
/>
<
/Picker
>
<
TouchableHighlight
onPress
=
{()
=>
{
this
.
setModalVisible
(
!
this
.
state
.
modalVisible
);
}}
>
<
Text
>
Hide
Modal
<
/Text
>
<
/TouchableHighlight
>
<
/Modal
>
);
}
Alert_select
(
title
,
tips
,
statusName
,
select1
,
select2
)
{
Alert
.
alert
(
title
,
...
...
@@ -81,17 +55,17 @@ export default class Edit extends Component {
text
:
select2
,
onPress
:
()
=>
{
this
.
setState
({
[
statusName
]:
select2
});
}
,
}
,
}
}
],
{
cancelable
:
false
}
);
}
AlertIOS_input
()
{
AlertIOS
.
prompt
(
"婚姻状态"
,
null
,
()
=>
{});
}
submit
()
{}
delete
()
{}
render
()
{
const
{
navigate
}
=
this
.
props
.
navigation
;
return
(
...
...
@@ -179,14 +153,16 @@ export default class Edit extends Component {
<
TouchableOpacity
style
=
{
styles
.
itemContainer
}
onPress
=
{()
=>
{
this
.
Alert_select
(
"婚姻状态"
,
"选一下嘛"
,
'is_married'
,
"已婚"
,
"未婚"
);
this
.
Alert_select
(
"婚姻状态"
,
"选一下嘛"
,
"is_married"
,
"已婚"
,
"未婚"
);
}}
>
<
View
style
=
{
styles
.
itemLeft
}
>
<
Text
style
=
{
styles
.
leftTitle
}
>
婚姻状态
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
itemRight
}
>
<
Text
style
=
{
styles
.
itemRightContent
}
>
{
this
.
state
.
is_married
}
<
/Text
>
<
Text
style
=
{
styles
.
itemRightContent
}
>
{
this
.
state
.
is_married
}
<
/Text
>
<
Image
style
=
{
styles
.
itemRightImg
}
source
=
{
require
(
"../../assets/Mine/rightArrow_gray.png"
)}
...
...
@@ -198,9 +174,7 @@ export default class Edit extends Component {
<
Text
style
=
{
styles
.
leftTitle
}
>
是否生育
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
itemRight
}
>
<
Text
style
=
{
styles
.
itemRightContent
}
>
否
<
/Text
>
<
Text
style
=
{
styles
.
itemRightContent
}
>
否
<
/Text
>
<
Image
style
=
{
styles
.
itemRightImg
}
source
=
{
require
(
"../../assets/Mine/rightArrow_gray.png"
)}
...
...
@@ -208,6 +182,26 @@ export default class Edit extends Component {
<
/View
>
<
/TouchableOpacity
>
<
/View
>
{
/* 按钮 */
}
<
View
style
=
{
styles
.
btnContainer
}
>
<
TouchableOpacity
onPress
=
{()
=>
{
this
.
submit
();
}}
style
=
{
styles
.
confirmBtn
}
>
<
Text
style
=
{
styles
.
confirmBtnText
}
>
确定
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
this
.
delete
();
}}
style
=
{
styles
.
deleteBtn
}
>
<
Text
style
=
{
styles
.
deleteText
}
>
删除
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
);
}
...
...
@@ -256,5 +250,28 @@ const styles = StyleSheet.create({
itemRightImg
:
{
width
:
14
,
height
:
14
},
confirmBtn
:
{
marginTop
:
20
,
marginHorizontal
:
40
,
justifyContent
:
"center"
,
alignItems
:
"center"
,
backgroundColor
:
"#1B9341"
,
height
:
45
,
borderRadius
:
5
},
confirmBtnText
:
{
fontSize
:
16
,
color
:
"white"
},
deleteBtn
:
{
marginHorizontal
:
40
,
justifyContent
:
"center"
,
alignItems
:
"center"
,
},
deleteText
:
{
fontSize
:
16
,
marginTop
:
24
,
color
:
"#1B9341"
}
});
...
...
Please
register
or
login
to post a comment