index.js 1.55 KB
import React, { Component } from 'react'
import { connect } from 'dva'
import shareHide from "../../utils/shareHide";
import {urlGetParams} from "../../utils/dataFilter";

import styles from './Welcome.css'
// import ReactCSSTransitionGroup from "react-addons-css-transition-group";
class Welcome extends Component {
  constructor(){
    super()
    this.state={
      phoneNum:urlGetParams(window.location.href).phoneNum ? false : true
    }
  }

  go = ()=> {
    let url = window.location.href;
    let location = "";
    //后台重定向到欢迎页面时,2秒后跳转home页面,并将参数带过去。
    if(this.props.location.query){//登录页面过来,携带了phoneNum参数
      location = window.location.origin+'/index.html#/home?' + url.split('?')[1] + "&phoneNum="+this.props.location.query.phoneNum;
    }else {
      location = window.location.origin+'/index.html#/home?' + url.split('?')[1];
    }
    window.location.href = location;
  }
  componentDidMount() {
    document.title = '华夏O2O智慧工作平台';
    shareHide();
    setTimeout(this.go,2000)
  }


  render() {
    let animate = {
      textAlign:'center',
      position:'absolute',
      top:'70%',
      fontSize: '.2rem',
      width: '100%',
    }
    return (
      <div className={styles.welcome}>
        {this.state.phoneNum && <div className={styles.FadeInFrame}  style={animate}>
           恭喜您成功注册智慧工作平台<br/>
            开启智慧工作之旅
        </div>}
      </div>
    )
  }
}

Welcome.propsTypes = {}

export default connect()(Welcome)