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 17:16:51 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7304fe0f8221a8074330d25750f6b36f2a3c927d
7304fe0f
1 parent
7e55ff1c
准备接入通信录接口
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
14 deletions
src/pages/Customer/index.js
src/pages/Customer/index.js
View file @
7304fe0
...
...
@@ -9,7 +9,8 @@ import {
ScrollView
,
ListView
,
Dimensions
,
AsyncStorage
AsyncStorage
,
Alert
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
import
post
from
"../../utils/fetch"
;
...
...
@@ -22,11 +23,26 @@ export default class Customer extends Component {
USER_ID
:
""
,
NICKNAME
:
""
,
PROFESSION
:
""
,
hasCustomer
:
true
,
customersList
:
[
"张某某"
,
"周某某"
,
"林某某"
,
"李某某"
]
hasCustomer
:
false
,
customersList
:
[
"张某某"
,
"周某某"
,
"林某某"
,
"李某某"
],
customersList2
:
[{
name
:
"Tina"
,
id
:
""
,
phone
:
""
,
},{
name
:
"aaaa"
,
id
:
""
,
phone
:
""
,
},{
name
:
"dddd"
,
id
:
""
,
phone
:
""
,
}]
};
}
componentWillMount
()
{}
componentWillMount
()
{
this
.
getAsyncStorage
();
}
componentDidMount
()
{}
...
...
@@ -84,10 +100,28 @@ export default class Customer extends Component {
style
=
{
styles
.
beginPic
}
/
>
<
View
style
=
{
styles
.
beginBtnContaier
}
>
<
TouchableOpacity
style
=
{
styles
.
beginBtnLeft
}
onPress
=
{()
=>
{
navigate
(
"CustomerEdit"
)}}
>
<
Text
style
=
{
styles
.
beginBtnLeftText
}
>
手动选择
<
/Text
>
<
TouchableOpacity
style
=
{
styles
.
beginBtnLeft
}
onPress
=
{()
=>
{
if
(
this
.
state
.
IS_LOGIN
!=
"yes"
)
{
Alert
.
alert
(
"请先登录账号"
);
}
else
{
navigate
(
"CustomerEdit"
);
}
}}
>
<
Text
style
=
{
styles
.
beginBtnLeftText
}
>
手动添加
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{
styles
.
beginBtnRight
}
>
<
TouchableOpacity
style
=
{
styles
.
beginBtnRight
}
onPress
=
{()
=>
{
if
(
this
.
state
.
IS_LOGIN
!=
"yes"
)
{
Alert
.
alert
(
"请先登录账号"
);
}
else
{
{
/* navigate("CustomerEdit"); */
}
}
}}
>
<
Text
style
=
{
styles
.
beginBtnRightText
}
>
通信录导入
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
...
...
@@ -100,7 +134,12 @@ export default class Customer extends Component {
return
(
<
View
style
=
{
styles
.
mainContaier
}
>
<
View
style
=
{
styles
.
mainBtnContaier
}
>
<
TouchableOpacity
style
=
{
styles
.
mainBtnContaierLeft
}
onPress
=
{()
=>
{
navigate
(
"CustomerEdit"
)}}
>
<
TouchableOpacity
style
=
{
styles
.
mainBtnContaierLeft
}
onPress
=
{()
=>
{
navigate
(
"CustomerEdit"
);
}}
>
<
Image
style
=
{
styles
.
mainBtnLeftImg
}
source
=
{
require
(
"../../assets/customer/ic_add.png"
)}
...
...
@@ -138,14 +177,10 @@ export default class Customer extends Component {
render
()
{
const
{
navigate
}
=
this
.
props
.
navigation
;
const
{
IS_LOGIN
,
hasCustomer
,
customers
}
=
this
.
state
;
const
{
IS_LOGIN
,
hasCustomer
,
customers
}
=
this
.
state
;
return
(
<
View
style
=
{
styles
.
container
}
>
{
hasCustomer
?
(
this
.
_renderMain
()
)
:
(
this
.
_renderBegin
()
)}
{
hasCustomer
?
this
.
_renderMain
()
:
this
.
_renderBegin
()}
<
/View
>
);
}
...
...
Please
register
or
login
to post a comment