index.js
1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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)