Skip to content

Commit

Permalink
添加启动页
Browse files Browse the repository at this point in the history
  • Loading branch information
EleTeam committed Sep 10, 2016
1 parent 0a16cb7 commit b076e0e
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 5 deletions.
15 changes: 11 additions & 4 deletions app/containers/app.js → app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,25 @@ import React, { Component } from 'react';
import {
Navigator,
View,
StatusBar,
Platform
} from 'react-native';

import StatusBarIOS from '../components/StatusBarIOS';
import TabBarView from '../containers/TabBarView';
import Splash from './pages/Splash';

export const STATUS_BAR_HEIGHT = (Platform.OS === 'ios' ? 20 : 25)

class App extends Component {
render() {
return (
<View style={{flex: 1}}>
<StatusBarIOS barStyle="light-content"/>
<StatusBar
barStyle='light-content'
backgroundColor='transparent'
style={{height: STATUS_BAR_HEIGHT}}
/>
<Navigator
initialRoute={{name: 'TabBarView', component: TabBarView}}
initialRoute={{name: 'Splash', component: Splash}}
configureScene={()=>{
return Navigator.SceneConfigs.PushFromRight;
}}
Expand Down
Binary file added app/images/ic_welcome.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/tab/ic_tab_cart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/tab/ic_tab_cart_press.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/tab/ic_tab_center.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/tab/ic_tab_center_press.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/tab/ic_tab_home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/tab/ic_tab_home_press.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/tab/ic_tab_order.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/tab/ic_tab_order_press.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions app/pages/Splash.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* ShopReactNative
*
* @author Tony Wong
* @date 2016-08-13
* @email 908601756@qq.com
* @copyright Copyright © 2016 EleTeam
* @license The MIT License (MIT)
*/

'use strict';

import React from 'react';
import {
Dimensions,
Image,
InteractionManager,
View
} from 'react-native';

import TabBarView from '../containers/TabBarView';

var {height, width} = Dimensions.get('window');

class Splash extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
const {navigator} = this.props;
this.timer=setTimeout(() => {
InteractionManager.runAfterInteractions(() => {
navigator.resetTo({
component: TabBarView,
name: 'TabBarView'
});
});
}, 2500);
}
componentWillUnmount() {
this.timer && clearTimeout(this.timer);
}

render() {
return (
<View style={{flex:1}}>
<Image
style={{flex:1,width:width,height:height}}
source={require('../images/ic_welcome.jpg')}
/>
</View>
);
}
}

export default Splash;
2 changes: 1 addition & 1 deletion app/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import React, { Component } from 'react';
import { Provider } from 'react-redux';
import store from './store/store';

import App from './containers/app';
import App from './app';

export default class Root extends Component {
render() {
Expand Down

0 comments on commit b076e0e

Please sign in to comment.