-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ios.js
54 lines (44 loc) · 971 Bytes
/
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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var Login = require('./app/page/login');
var Index = require('./app/page/index');
var store = require('react-native-simple-store');
var {
AppRegistry,
} = React;
// StatusBarIOS.setStyle('light-content');
var app = React.createClass({
getInitialState: function() {
return{
logined:false,
};
},
_renderLogin:function(){
return (
<Login loginResult={(userData)=>this._loginSucc(userData)}/>
);
},
_loginSucc:function(userData){
store.save('user', userData);
this.setState({
logined:true,
});
},
_renderIndex:function(){
return (
<Index/>
);
},
render: function() {
if(this.state.logined){
return this._renderIndex();
}else{
return this._renderLogin();
}
},
});
AppRegistry.registerComponent('bqseller', () => app);