| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- /**
- * 开屏页面
- * @邠心vbe on 2021/03/22
- */
- import React from 'react'
- import { Image, StyleSheet, Text, View } from 'react-native'
- import {InitSomething} from '../components/Dialog';
- import { PageList } from './Router';
- class Launch extends React.Component {
-
- constructor(props) {
- super(props);
- this.state = {
- isShow: true
- };
- }
- componentDidMount() {
- InitSomething();
- if (isIOS) {
- this.goHome(100);
- } else {
- this.goHome(3000);
- }
- }
- goHome(time) {
- setTimeout(() => {
- this.setState({
- isShow: false
- });
- startPage(PageList.home);
- }, time);
- }
-
- render() {
- return (
- this.state.isShow
- ? isIOS
- ? <View style={styles.iosContent}></View>
- : <View style={styles.container}>
- <View style={styles.content}>
- <Image
- style={styles.logo}
- source={require('../images/tool-logo.png')}/>
- <Text style={styles.slogan}>Feel The Green Energy</Text>
- </View>
- </View>
- : <View style={styles.loaded}></View>
- );
- }
- }
- export default Launch
- const styles = StyleSheet.create({
- container: {
- alignItems: 'center',
- backgroundColor: colorPrimary,
- ...StyleSheet.absoluteFillObject
- },
- iosContent: {
- flex: 1,
- backgroundColor: colorPrimary
- },
- loaded: {
- flex: 1,
- backgroundColor: '#eee'
- },
- content: {
- alignItems: 'center',
- paddingTop: $vh(30)
- },
- logo: {
- width:165.09,
- height: 51.94,
- marginLeft: 10,
- //top: $vh(25),
- //bottom: $vh(25),
- //position: 'absolute'
- },
- slogan: {
- color: '#333',
- fontSize: 14,
- fontStyle: 'italic',
- fontWeight: 'bold'
- }
- });
|