12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- import React, {Component} from 'react'
- import {StyleSheet, View, Text, Image} from 'react-native'
- import SyncStorage from 'sync-storage';
- import {connect} from 'react-redux'
- import {NavigationActions, StackActions, ScreenUtil} from '../utils'
- import {ComponentsStyles} from '../components'
- @connect(auth => ({...auth}))
- class Welcome extends Component {
- constructor(props) {
- super(props);
- }
- componentDidMount() {
- const {navigation} = this.props;
- const resetAction = NavigationActions.navigate({
- routeName: "DesktopHome",
- actions: [NavigationActions.navigate({routeName: 'DesktopHome'})],
- })
- this.timer = setTimeout(
- () => {
- navigation.dispatch(resetAction);
- },
- 2000
- );
- }
- componentWillUnmount() {
- this.timer && clearTimeout(this.timer);
- }
- render() {
- return (
- <View style={ComponentsStyles.container}>
- <View style={styles.up}>
- <Image source={require('../../assets/images/logo.png')} style={styles.logo}/>
- <Text style={styles.title}>电金睛</Text>
- </View>
- <View style={styles.down}>
- <Text style={styles.rights}>©2021 郑州市凯贝特互感器有限公司 All rights reserved.</Text>
- </View>
- </View>
- )
- }
- }
- const styles = StyleSheet.create({
- up: {
- flex: 4,
- paddingTop: ScreenUtil.scaleSize(80),
- textAlign: 'center',
- alignItems: 'center',
- },
- logo: {
- width: ScreenUtil.scaleSize(80),
- height: ScreenUtil.scaleSize(80),
- },
- title: {
- paddingTop: 20,
- fontSize: ScreenUtil.scaleSize(24),
- color: '#5394e4',
- textAlign: 'center',
- },
- down: {
- flex: 1,
- textAlign: 'center',
- justifyContent: 'flex-end'
- },
- rights: {
- height: 50,
- fontSize: ScreenUtil.scaleSize(12),
- color: '#aaaaaa',
- textAlign: 'center',
- }
- })
- export default Welcome
|