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-06 23:04:37 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ec9ba1897fe5ff3b56d6474e9869787616ccb01e
ec9ba189
1 parent
28c0e690
判断登录状态
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
202 additions
and
74 deletions
index.ios.js
src/pages/Login.js
src/pages/Mine/Login.js
src/pages/main.js
index.ios.js
View file @
ec9ba18
...
...
@@ -16,7 +16,9 @@ import Main from './src/pages/main';
export
default
class
ProtectGod
extends
Component
{
render
()
{
return
(
<
Main
/>
<
Main
loginSuccess
=
{
false
}
/
>
);
}
}
...
...
src/pages/Login.js
0 → 100644
View file @
ec9ba18
import
React
,
{
Component
}
from
"react"
;
import
{
AppRegistry
,
StyleSheet
,
Text
,
View
,
Image
,
TouchableOpacity
,
ScrollView
,
}
from
"react-native"
;
export
default
class
Login
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{};
}
componentDidMount
()
{
console
.
log
(
"thisprops"
,
this
.
props
);
}
render
()
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
Text
>
我是登录页面
<
/Text
>
<
/View
>
);
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
paddingTop
:
64
,
justifyContent
:
"flex-start"
,
alignItems
:
"stretch"
,
backgroundColor
:
"white"
,
paddingLeft
:
38
,
paddingRight
:
38
,
},
});
...
...
src/pages/Mine/Login.js
deleted
100644 → 0
View file @
28c0e69
File mode changed
src/pages/main.js
View file @
ec9ba18
...
...
@@ -13,7 +13,7 @@ import Home from "./Home/index";
import
InsuranceCircle
from
"./InsuranceCircle/index"
;
import
InsuranceChurch
from
"./InsuranceChurch/index"
;
import
Mine
from
"./Mine/index"
;
import
Login
from
"./Login"
;
var
scale
=
Dimensions
.
get
(
'window'
).
scale
;
...
...
@@ -21,87 +21,174 @@ export default class Main extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
selectedItem
:
"home"
selectedItem
:
"home"
,
}
}
componentWillMount
()
{
console
.
log
(
"loginSuccess"
,
this
.
props
);
}
render
()
{
// {this.state.loginSuccess ? {} : {}}
const
{
loginSuccess
}
=
this
.
props
;
return
(
<
TabBarIOS
tintColor
=
"#08CC6A"
barTintColor
=
"white"
>
<
TabBarIOS
.
Item
title
=
"首页"
icon
=
{
require
(
"../assets/tabbar/ic_home_n.png"
)}
selected
=
{
this
.
state
.
selectedItem
==
"home"
}
onPress
=
{()
=>
{
this
.
setState
({
selectedItem
:
"home"
});
}}
>
<
NavigatorIOS
style
=
{{
flex
:
1
}}
initialRoute
=
{{
component
:
Home
,
title
:
"保护神"
loginSuccess
?
(
<
TabBarIOS
tintColor
=
"#08CC6A"
barTintColor
=
"white"
>
<
TabBarIOS
.
Item
title
=
"首页"
icon
=
{
require
(
"../assets/tabbar/ic_home_n.png"
)}
selected
=
{
this
.
state
.
selectedItem
==
"home"
}
onPress
=
{()
=>
{
this
.
setState
({
selectedItem
:
"home"
});
}}
/
>
<
/TabBarIOS.Item
>
<
TabBarIOS
.
Item
title
=
"保圈"
icon
=
{
require
(
"../assets/tabbar/ic_circle_n.png"
)}
selected
=
{
this
.
state
.
selectedItem
==
"insuranceCircle"
}
onPress
=
{()
=>
{
this
.
setState
({
selectedItem
:
"insuranceCircle"
});
}}
>
<
NavigatorIOS
style
=
{{
flex
:
1
}}
initialRoute
=
{
{
component
:
InsuranceCircle
,
title
:
"保护神"
,
>
<
NavigatorIOS
style
=
{{
flex
:
1
}}
initialRoute
=
{{
component
:
Home
,
title
:
"保护神"
}
}
/
>
<
/TabBarIOS.Item
>
<
TabBarIOS
.
Item
title
=
"保圈"
icon
=
{
require
(
"../assets/tabbar/ic_circle_n.png"
)}
selected
=
{
this
.
state
.
selectedItem
==
"insuranceCircle"
}
onPress
=
{()
=>
{
this
.
setState
(
{
selectedItem
:
"insuranceCircle"
});
}}
/
>
<
/TabBarIOS.Item
>
<
TabBarIOS
.
Item
title
=
"保堂"
icon
=
{
require
(
"../assets/tabbar/ic_umbrella_n.png"
)}
selected
=
{
this
.
state
.
selectedItem
==
"insuranceChurch"
}
onPress
=
{()
=>
{
this
.
setState
({
selectedItem
:
"insuranceChurch"
});
}}
>
<
NavigatorIOS
style
=
{{
flex
:
1
}}
initialRoute
=
{
{
component
:
InsuranceChurch
,
title
:
"保护神"
>
<
NavigatorIOS
style
=
{{
flex
:
1
}}
initialRoute
=
{{
component
:
InsuranceCircle
,
title
:
"保护神"
,
}}
/
>
<
/TabBarIOS.Item
>
<
TabBarIOS
.
Item
title
=
"保堂"
icon
=
{
require
(
"../assets/tabbar/ic_umbrella_n.png"
)}
selected
=
{
this
.
state
.
selectedItem
==
"insuranceChurch"
}
onPress
=
{()
=>
{
this
.
setState
(
{
selectedItem
:
"insuranceChurch"
});
}}
/
>
<
/TabBarIOS.Item
>
<
TabBarIOS
.
Item
title
=
"我的"
icon
=
{
require
(
"../assets/tabbar/ic_mine_n.png"
)}
selected
=
{
this
.
state
.
selectedItem
==
"mine"
}
onPress
=
{()
=>
{
this
.
setState
({
selectedItem
:
"mine"
});
}}
>
<
NavigatorIOS
style
=
{{
flex
:
1
}}
initialRoute
=
{
{
component
:
Mine
,
title
:
"保护神"
>
<
NavigatorIOS
style
=
{{
flex
:
1
}}
initialRoute
=
{{
component
:
InsuranceChurch
,
title
:
"保护神"
}}
/
>
<
/TabBarIOS.Item
>
<
TabBarIOS
.
Item
title
=
"我的"
icon
=
{
require
(
"../assets/tabbar/ic_mine_n.png"
)}
selected
=
{
this
.
state
.
selectedItem
==
"mine"
}
onPress
=
{()
=>
{
this
.
setState
(
{
selectedItem
:
"mine"
});
}}
/
>
<
/TabBarIOS.Item
>
<
/TabBarIOS
>
>
<
NavigatorIOS
style
=
{{
flex
:
1
}}
initialRoute
=
{{
component
:
Mine
,
title
:
"保护神"
}}
/
>
<
/TabBarIOS.Item
>
<
/TabBarIOS
>
)
:
(
<
Login
/>
)
// <TabBarIOS tintColor="#08CC6A" barTintColor="white">
// <TabBarIOS.Item
// title="首页"
// icon={require("../assets/tabbar/ic_home_n.png")}
// selected={this.state.selectedItem == "home"}
// onPress={() => {
// this.setState({
// selectedItem: "home"
// });
// }}
// >
// <NavigatorIOS
// style={{ flex: 1 }}
// initialRoute={{
// component: Home,
// title: "保护神"
// }}
// />
// </TabBarIOS.Item>
// <TabBarIOS.Item
// title="保圈"
// icon={require("../assets/tabbar/ic_circle_n.png")}
// selected={this.state.selectedItem == "insuranceCircle"}
// onPress={() => {
// this.setState({
// selectedItem: "insuranceCircle"
// });
// }}
// >
// <NavigatorIOS
// style={{ flex: 1 }}
// initialRoute={{
// component: InsuranceCircle,
// title: "保护神",
// }}
// />
// </TabBarIOS.Item>
// <TabBarIOS.Item
// title="保堂"
// icon={require("../assets/tabbar/ic_umbrella_n.png")}
// selected={this.state.selectedItem == "insuranceChurch"}
// onPress={() => {
// this.setState({
// selectedItem: "insuranceChurch"
// });
// }}
// >
// <NavigatorIOS
// style={{ flex: 1 }}
// initialRoute={{
// component: InsuranceChurch,
// title: "保护神"
// }}
// />
// </TabBarIOS.Item>
// <TabBarIOS.Item
// title="我的"
// icon={require("../assets/tabbar/ic_mine_n.png")}
// selected={this.state.selectedItem == "mine"}
// onPress={() => {
// this.setState({
// selectedItem: "mine"
// });
// }}
// >
// <NavigatorIOS
// style={{ flex: 1 }}
// initialRoute={{
// component: Mine,
// title: "保护神"
// }}
// />
// </TabBarIOS.Item>
// </TabBarIOS>
);
}
}
...
...
Please
register
or
login
to post a comment