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 14:58:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eedbf11f859ddd79262f8b716e95e2c624a27966
eedbf11f
1 parent
df2d47cb
Alert
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
7 deletions
src/pages/Customer/edit.js
src/pages/Customer/edit.js
View file @
eedbf11
...
...
@@ -8,7 +8,12 @@ import {
TouchableOpacity
,
ScrollView
,
ListView
,
Dimensions
Dimensions
,
Picker
,
Modal
,
Alert
,
AlertIOS
,
TouchableHighlight
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
import
post
from
"../../utils/fetch"
;
...
...
@@ -16,7 +21,12 @@ import post from "../../utils/fetch";
export
default
class
Edit
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{};
this
.
state
=
{
customer_status
:
[],
is_married
:
""
,
modalVisible
:
false
,
recommend
:
""
};
}
componentWillMount
()
{}
...
...
@@ -26,6 +36,62 @@ export default class Edit extends Component {
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
,
tips
,
[
{
text
:
select1
,
onPress
:
()
=>
{
this
.
setState
({
[
statusName
]:
select1
});
}
},
{
text
:
select2
,
onPress
:
()
=>
{
this
.
setState
({
[
statusName
]:
select2
});
},
},
],
{
cancelable
:
false
}
);
}
AlertIOS_input
()
{
AlertIOS
.
prompt
(
"婚姻状态"
,
null
,
()
=>
{});
}
render
()
{
const
{
navigate
}
=
this
.
props
.
navigation
;
return
(
...
...
@@ -91,24 +157,36 @@ export default class Edit extends Component {
/
>
<
/View
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{
styles
.
itemContainer
}
onPress
=
{()
=>
{}}
>
<
TouchableOpacity
style
=
{
styles
.
itemContainer
}
onPress
=
{()
=>
{
this
.
AlertIOS_input
();
}}
>
<
View
style
=
{
styles
.
itemLeft
}
>
<
Text
style
=
{
styles
.
leftTitle
}
>
客户来源
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
itemRight
}
>
<
Text
style
=
{
styles
.
itemRightContent
}
>
芒果钱包
<
/Text
>
<
Text
style
=
{
styles
.
itemRightContent
}
>
{
this
.
state
.
recommend
}
<
/Text
>
<
Image
style
=
{
styles
.
itemRightImg
}
source
=
{
require
(
"../../assets/Mine/rightArrow_gray.png"
)}
/
>
<
/View
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{
styles
.
itemContainer
}
onPress
=
{()
=>
{}}
>
<
TouchableOpacity
style
=
{
styles
.
itemContainer
}
onPress
=
{()
=>
{
this
.
Alert_select
(
"婚姻状态"
,
"选一下嘛"
,
'is_married'
,
"已婚"
,
"未婚"
);
}}
>
<
View
style
=
{
styles
.
itemLeft
}
>
<
Text
style
=
{
styles
.
leftTitle
}
>
婚姻状态
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
itemRight
}
>
<
Text
style
=
{
styles
.
itemRightContent
}
>
未婚
<
/Text
>
<
Text
style
=
{
styles
.
itemRightContent
}
>
{
this
.
state
.
is_married
}
<
/Text
>
<
Image
style
=
{
styles
.
itemRightImg
}
source
=
{
require
(
"../../assets/Mine/rightArrow_gray.png"
)}
...
...
@@ -120,7 +198,9 @@ 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"
)}
...
...
Please
register
or
login
to post a comment