-
Notifications
You must be signed in to change notification settings - Fork 249
/
index.ios.js
129 lines (115 loc) · 2.99 KB
/
index.ios.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var Login = require('./app/page/login');
var Home = require('./app/page/home');
var Market = require('./app/page/market');
var ShoppingCart = require('./app/page/shoppingcart');
var Me = require('./app/page/me');
var {
AppRegistry,
StyleSheet,
Text,
View,
TabBarIOS,
NavigatorIOS,
} = React;
// StatusBarIOS.setStyle('light-content');
var bqseller = React.createClass({
getInitialState: function() {
return{
selectedTab:'home',
logined:false,
showIndex: {
height:0,
opacity:0
},
};
},
_selectTab: function(tabName){
this.setState({
selectedTab:tabName,
});
},
_addNavigator: function(component, title){
var data = null;
return <NavigatorIOS
style={{flex:1}}
barTintColor='#6bb967'
titleTextColor="#fff"
tintColor="#fff"
translucent={false}
initialRoute={{
component: component,
title: title,
passProps:{
data: data
}
}} />;
},
_renderLogin:function(){
return (
<Login/>
);
},
render: function() {
return (
<TabBarIOS >
<TabBarIOS.Item
title="首页"
icon={require("image!icon_bottomtag_home_n")}
selected={this.state.selectedTab ==='home'}
onPress={this._selectTab.bind(this,'home')}
>
{this._addNavigator(Home,'首页')}
</TabBarIOS.Item>
<TabBarIOS.Item
title="闪送超市"
icon={require("image!icon_bottomtag_market_n")}
selected={this.state.selectedTab ==='market'}
onPress={this._selectTab.bind(this,'market')}
>
{this._addNavigator(Market,'闪送超市')}
</TabBarIOS.Item>
<TabBarIOS.Item
title="购物车"
icon={require("image!icon_bottomtag_cart_n")}
selected={this.state.selectedTab ==='shoppingcart'}
onPress={this._selectTab.bind(this,'shoppingcart')}
>
{this._addNavigator(ShoppingCart,'购物车')}
</TabBarIOS.Item>
<TabBarIOS.Item
title="个人中心"
icon={require("image!icon_bottomtag_me_n")}
selected={this.state.selectedTab ==='me'}
onPress={this._selectTab.bind(this,'me')}
>
{this._addNavigator(Me,'个人中心')}
</TabBarIOS.Item>
</TabBarIOS>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#EE7700',
},
row:{
flexDirection:'row',
},
title:{
color: '#ffffff',
},
actionBar: {
height:49,
alignItems:'center',
justifyContent: 'center',
backgroundColor: '#6bb967',
}
});
AppRegistry.registerComponent('bqseller', () => bqseller);