2017-07-10 11:50:56 +08:00
|
|
|
|
import './Home.scss'
|
2017-07-06 17:01:48 +08:00
|
|
|
|
import React, { Component } from 'react'
|
2017-07-19 14:08:24 +08:00
|
|
|
|
import { connect } from 'react-redux'
|
2017-07-19 17:53:39 +08:00
|
|
|
|
import { Link } from 'react-router-dom'
|
2017-07-25 15:35:23 +08:00
|
|
|
|
import { Row, Col, Button, Icon } from 'antd'
|
2017-07-17 21:11:58 +08:00
|
|
|
|
import PropTypes from "prop-types"
|
2017-07-20 10:51:31 +08:00
|
|
|
|
import Login from '../Login/LoginWrap'
|
2017-07-17 21:11:58 +08:00
|
|
|
|
import Intro from '../../components/Intro/Intro'
|
2017-07-20 21:30:35 +08:00
|
|
|
|
import { changeMenuItem } from '../../actions/menu'
|
2017-07-25 15:35:23 +08:00
|
|
|
|
import { OverPack } from 'rc-scroll-anim'
|
|
|
|
|
import TweenOne from 'rc-tween-one'
|
2017-07-25 17:56:04 +08:00
|
|
|
|
import QueueAnim from 'rc-queue-anim';
|
2017-07-14 19:20:52 +08:00
|
|
|
|
|
2017-07-25 15:35:23 +08:00
|
|
|
|
|
|
|
|
|
const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };
|
2017-07-26 16:45:21 +08:00
|
|
|
|
const imgAnim = { y: '+=50', opacity: 0, type: 'from', ease: 'easeOutQuad', duration: '1500'};
|
2017-07-26 16:06:54 +08:00
|
|
|
|
const style = {
|
|
|
|
|
'height':'100%',
|
|
|
|
|
'width':'100%',
|
2017-07-26 21:24:02 +08:00
|
|
|
|
'background': 'url(./image/bg-img.jpg) no-repeat',
|
|
|
|
|
'backgroundSize':'100% 100%'
|
2017-07-26 16:06:54 +08:00
|
|
|
|
}
|
2017-07-19 14:08:24 +08:00
|
|
|
|
const HomeGuest = (props) => (
|
|
|
|
|
<div>
|
2017-07-26 16:06:54 +08:00
|
|
|
|
<div className="main-one" style = {style}>
|
2017-07-26 21:24:02 +08:00
|
|
|
|
<div style={{ background: "linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.2))"}}>
|
2017-07-26 16:06:54 +08:00
|
|
|
|
<div className="container">
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<div className="home-des">
|
|
|
|
|
<p className="title">YAPI</p>
|
2017-07-26 21:24:02 +08:00
|
|
|
|
<div className="detail">高效、易用、可部署的API管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务</div>
|
2017-07-26 16:06:54 +08:00
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={8} className="main-one-left">
|
|
|
|
|
<Login/>
|
|
|
|
|
</Col>
|
2017-07-26 16:45:21 +08:00
|
|
|
|
<OverPack>
|
|
|
|
|
<TweenOne
|
|
|
|
|
key="feat-motion-one"
|
|
|
|
|
animation={imgAnim}
|
|
|
|
|
>
|
|
|
|
|
<Col span={16} className="main-one-right">
|
|
|
|
|
|
|
|
|
|
<div className="img-container">
|
|
|
|
|
<img src="./image/demo-img.png"/>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
</TweenOne>
|
|
|
|
|
</OverPack>
|
2017-07-26 16:06:54 +08:00
|
|
|
|
</Row>
|
|
|
|
|
</div>
|
2017-07-19 14:08:24 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2017-07-25 15:35:23 +08:00
|
|
|
|
<div className="feat-part">
|
|
|
|
|
<div className="container">
|
|
|
|
|
<OverPack
|
2017-07-26 16:06:54 +08:00
|
|
|
|
playScale={[0.2,0.1]}
|
2017-07-25 15:35:23 +08:00
|
|
|
|
>
|
|
|
|
|
<TweenOne
|
2017-07-25 17:56:04 +08:00
|
|
|
|
key="feat-motion-one"
|
2017-07-25 15:35:23 +08:00
|
|
|
|
animation={oneAnim}
|
2017-07-26 21:24:02 +08:00
|
|
|
|
component="p"
|
2017-07-25 15:35:23 +08:00
|
|
|
|
>
|
|
|
|
|
<span>特性</span>
|
|
|
|
|
</TweenOne>
|
2017-07-25 17:56:04 +08:00
|
|
|
|
<Row key="feat-motion-row">
|
|
|
|
|
<QueueAnim
|
|
|
|
|
delay = {200}
|
2017-07-25 21:04:11 +08:00
|
|
|
|
interval ={200}
|
|
|
|
|
leaveReverse={true}
|
2017-07-25 17:56:04 +08:00
|
|
|
|
ease = 'easeOutQuad'
|
|
|
|
|
animConfig ={{ opacity:[1,0],y: '+=30' }}
|
|
|
|
|
key="feat-motion-queue"
|
|
|
|
|
>
|
2017-07-25 21:04:11 +08:00
|
|
|
|
<Col span={6} className="feat-wrapper" key="feat-wrapper-1">
|
2017-07-25 15:35:23 +08:00
|
|
|
|
<div className="feat-img">
|
|
|
|
|
<Icon type="api" />
|
|
|
|
|
</div>
|
|
|
|
|
<p className="feat-title">
|
|
|
|
|
接口管理
|
|
|
|
|
</p>
|
|
|
|
|
</Col>
|
2017-07-25 21:04:11 +08:00
|
|
|
|
<Col span={6} className="feat-wrapper" key="feat-wrapper-2">
|
2017-07-25 15:35:23 +08:00
|
|
|
|
<div className="feat-img">
|
|
|
|
|
<Icon type="link" />
|
|
|
|
|
</div>
|
|
|
|
|
<p className="feat-title">
|
|
|
|
|
支持Mock
|
|
|
|
|
</p>
|
|
|
|
|
</Col>
|
2017-07-25 21:04:11 +08:00
|
|
|
|
<Col span={6} className="feat-wrapper" key="feat-wrapper-3">
|
2017-07-25 15:35:23 +08:00
|
|
|
|
<div className="feat-img">
|
|
|
|
|
<Icon type="team" />
|
|
|
|
|
</div>
|
|
|
|
|
<p className="feat-title">
|
|
|
|
|
团队协作
|
|
|
|
|
</p>
|
|
|
|
|
</Col>
|
2017-07-25 21:04:11 +08:00
|
|
|
|
<Col span={6} className="feat-wrapper" key="feat-wrapper-4">
|
|
|
|
|
<div className="feat-img">
|
|
|
|
|
<Icon type="desktop" />
|
|
|
|
|
</div>
|
|
|
|
|
<p className="feat-title">
|
|
|
|
|
可部署
|
|
|
|
|
</p>
|
|
|
|
|
</Col>
|
2017-07-25 17:56:04 +08:00
|
|
|
|
</QueueAnim>
|
|
|
|
|
</Row>
|
2017-07-25 15:35:23 +08:00
|
|
|
|
</OverPack>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2017-07-19 14:08:24 +08:00
|
|
|
|
{ props.introList.map(function(intro,i){
|
|
|
|
|
return (
|
2017-07-25 15:35:23 +08:00
|
|
|
|
<div className="main-part" key={i} id={`main-part-${i}`}>
|
2017-07-19 14:08:24 +08:00
|
|
|
|
<div className="container">
|
|
|
|
|
<Intro intro={intro}/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
HomeGuest.propTypes ={
|
|
|
|
|
introList: PropTypes.array
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@connect(
|
|
|
|
|
state => ({
|
|
|
|
|
login: state.login.isLogin
|
2017-07-20 21:30:35 +08:00
|
|
|
|
}),
|
|
|
|
|
{
|
|
|
|
|
changeMenuItem
|
|
|
|
|
}
|
2017-07-19 14:08:24 +08:00
|
|
|
|
)
|
2017-07-05 14:10:06 +08:00
|
|
|
|
|
2017-07-06 17:01:48 +08:00
|
|
|
|
class Home extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
|
}
|
2017-07-17 21:11:58 +08:00
|
|
|
|
static propTypes = {
|
2017-07-19 14:08:24 +08:00
|
|
|
|
introList: PropTypes.array,
|
2017-07-20 21:30:35 +08:00
|
|
|
|
login : PropTypes.bool,
|
|
|
|
|
changeMenuItem : PropTypes.func
|
|
|
|
|
}
|
|
|
|
|
toStart = () =>{
|
2017-07-25 17:56:04 +08:00
|
|
|
|
this.props.changeMenuItem('/group');
|
2017-07-17 21:11:58 +08:00
|
|
|
|
}
|
2017-07-06 17:01:48 +08:00
|
|
|
|
render () {
|
2017-07-19 14:08:24 +08:00
|
|
|
|
const { login } = this.props;
|
2017-07-06 17:01:48 +08:00
|
|
|
|
return (
|
2017-07-14 19:20:52 +08:00
|
|
|
|
<div className="home-main">
|
2017-07-19 14:08:24 +08:00
|
|
|
|
{login?
|
|
|
|
|
(
|
2017-07-19 17:53:39 +08:00
|
|
|
|
<div className="user-home">
|
|
|
|
|
<div className="user-des">
|
|
|
|
|
<p className="title">YAPI</p>
|
2017-07-25 21:04:11 +08:00
|
|
|
|
<p className="des">一个高效,易用,可部署的Api管理系统</p>
|
2017-07-19 17:53:39 +08:00
|
|
|
|
<div className="btn">
|
|
|
|
|
<Button type="primary" size="large">
|
2017-07-25 17:56:04 +08:00
|
|
|
|
<Link to="/group" onClick={this.toStart}>开始</Link>
|
2017-07-19 17:53:39 +08:00
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
2017-07-17 21:11:58 +08:00
|
|
|
|
</div>
|
2017-07-19 17:53:39 +08:00
|
|
|
|
</div>
|
|
|
|
|
)
|
2017-07-19 14:08:24 +08:00
|
|
|
|
: <HomeGuest introList={this.props.introList}/>}
|
2017-07-14 19:20:52 +08:00
|
|
|
|
</div>
|
2017-07-06 17:01:48 +08:00
|
|
|
|
)
|
|
|
|
|
}
|
2017-07-05 21:08:51 +08:00
|
|
|
|
}
|
2017-07-06 17:01:48 +08:00
|
|
|
|
|
2017-07-17 21:11:58 +08:00
|
|
|
|
Home.defaultProps={
|
|
|
|
|
introList:[{
|
|
|
|
|
title:"接口管理",
|
|
|
|
|
des:"yapi将满足你的所有接口管理需求。不再需要 为每个项目搭建独立的接口管理平台和编写离线的接口文档",
|
|
|
|
|
detail:[
|
2017-07-25 17:56:04 +08:00
|
|
|
|
{title:"接口管理",des:"强大的接口文档",iconType:"smile-o"},
|
|
|
|
|
{title:"接口管理",des:"强大的接口文档",iconType:"smile-o"},
|
|
|
|
|
{title:"接口管理",des:"强大的接口文档",iconType:"smile-o"}
|
2017-07-17 21:11:58 +08:00
|
|
|
|
],
|
2017-07-18 18:25:53 +08:00
|
|
|
|
img:"./image/demo-img.png"
|
2017-07-17 21:11:58 +08:00
|
|
|
|
},{
|
|
|
|
|
title:"接口管理",
|
|
|
|
|
des:"yapi将满足你的所有接口管理需求。不再需要 为每个项目搭建独立的接口管理平台和编写离线的接口文档",
|
|
|
|
|
detail:[
|
2017-07-25 17:56:04 +08:00
|
|
|
|
{title:"接口管理",des:"强大的接口文档",iconType:"smile-o"},
|
|
|
|
|
{title:"接口管理",des:"强大的接口文档",iconType:"smile-o"}
|
2017-07-17 21:11:58 +08:00
|
|
|
|
],
|
2017-07-18 18:25:53 +08:00
|
|
|
|
img:"./image/demo-img.png"
|
2017-07-17 21:11:58 +08:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
2017-07-10 21:29:03 +08:00
|
|
|
|
export default Home
|