|
4 | 4 |
|
5 | 5 | import React, { Component } from 'react'; |
6 | 6 | import { createStore, applyMiddleware, compose } from 'redux'; |
7 | | -import { Provider,connect } from 'react-redux'; |
8 | | -import { Router, Scene } from 'react-native-router-flux'; |
| 7 | +import { Provider, connect } from 'react-redux'; |
| 8 | +import { Router, Scene, Modal } from 'react-native-router-flux'; |
9 | 9 | import login from './../../containers/android/Login'; |
10 | | -import ListView from './../../containers/android/ListView'; |
11 | | -import login2 from './../../components/android/Login2'; |
12 | | -import login3 from './../../components/android/Login3'; |
| 10 | +import main from './../../components/android/Main'; |
13 | 11 | import routeReducerCreator from './../../reducers/routeReducerCreator'; |
14 | 12 | import helper from './../../utils/helper' |
15 | | -import { api, callApi } from './../../apis/api' |
16 | | -import Button from "react-native-button"; |
17 | 13 | import store from './../../store/store'; |
| 14 | + |
18 | 15 | class App extends React.Component { |
19 | 16 | constructor(props) { |
20 | 17 | super(props); |
21 | 18 | helper.bindMethod(this); |
22 | 19 | } |
23 | 20 |
|
24 | | - testApi(){ |
25 | | - const parameter ={userNickName:"mayunfei",userPassword:"test"}; |
26 | | - callApi( |
27 | | - api.test(parameter), |
28 | | - (data)=>console.log(data), |
29 | | - (err)=>console.log(err) |
30 | | - ); |
31 | | - } |
32 | | - |
33 | | - render () { |
| 21 | + render() { |
34 | 22 | return ( |
35 | 23 | <Provider store={store}> |
36 | 24 | <Router createReducer={routeReducerCreator}> |
37 | | - <Scene key="login" direction="vertical" initial={true}> |
38 | | - <Scene key="loginModal" direction="vertical" component={login} title="Login" hideNavBar/> |
39 | | - <Scene |
40 | | - key="loginModal2" |
41 | | - hideNavBar |
42 | | - component={login2} |
43 | | - title="Login2" |
44 | | - panHandlers={null} |
45 | | - duration={1} |
46 | | - /> |
47 | | - <Scene |
48 | | - key="loginModal3" |
49 | | - hideNavBar |
50 | | - component={login3} |
51 | | - title="Login3" |
52 | | - panHandlers={null} |
53 | | - duration={1} |
54 | | - /> |
| 25 | + <Scene key="modal" component={Modal}> |
| 26 | + <Scene key="root" hideNavBar hideTabBar> |
| 27 | + <Scene key="loginModule" direction="vertical" initial={true}> |
| 28 | + <Scene key="login" component={login} title="Login" |
| 29 | + hideNavBar/> |
| 30 | + </Scene> |
| 31 | + <Scene key="main" direction="vertical" component={main} title="Main" |
| 32 | + hideNavBar/> |
| 33 | + </Scene> |
| 34 | + <Scene key="error" component={Error}/> |
55 | 35 | </Scene> |
56 | 36 | </Router> |
57 | 37 | </Provider> |
58 | 38 | ); |
59 | | - // |
60 | | - //return( |
61 | | - // <Button onPress={this.testApi}>测试服务</Button> |
62 | | - //); |
63 | 39 | } |
64 | 40 | } |
65 | 41 |
|
|
0 commit comments