This commit is contained in:
qitmac000249 2017-07-25 21:12:35 +08:00
commit ef55513a6e
7 changed files with 49 additions and 26 deletions

View File

@ -11,7 +11,6 @@ import axios from 'axios';
const checkLoginState = () => { const checkLoginState = () => {
return(dispatch)=> { return(dispatch)=> {
axios.get('/user/status').then((res) => { axios.get('/user/status').then((res) => {
console.log(res);
dispatch({ dispatch({
type: GET_LOGIN_STATE, type: GET_LOGIN_STATE,
payload: res payload: res

View File

@ -31,7 +31,7 @@ export default class Srch extends Component{
} }
onSelect = (value) => { onSelect = (value) => {
if( value.split(":")[0] == "group" ){ if( value.split(":")[0] == "分组" ){
this.props.history.push('/group/'+value.split(":")[1].trim()); this.props.history.push('/group/'+value.split(":")[1].trim());
} else { } else {
this.props.history.push('/project/'+value.split("(")[1].slice(0,-1)); this.props.history.push('/project/'+value.split("(")[1].slice(0,-1));
@ -45,7 +45,7 @@ export default class Srch extends Component{
const dataSource = []; const dataSource = [];
for(let title in res.data.data){ for(let title in res.data.data){
res.data.data[title].map(item => { res.data.data[title].map(item => {
title == "group" ? dataSource.push( title+": "+item.groupName ): dataSource.push( title+": "+item.name+"("+item._id+")" ); title == "group" ? dataSource.push( "分组"+": "+item.groupName ): dataSource.push( "项目"+": "+item.name+"("+item._id+")" );
}) })
} }
this.setState({ this.setState({
@ -84,8 +84,13 @@ export default class Srch extends Component{
> >
<Input <Input
prefix={<Icon type="search" className="srch-icon" />} prefix={<Icon type="search" className="srch-icon" />}
size="large" style={{ width: 200 }} size="large"
placeholder="search group/project" style={{
// width: 200,
// borderColor:"#AAA",
// borderWidth:"1px",
}}
placeholder="搜索分组/项目"
className="search-input" className="search-input"
/> />
</AutoComplete> </AutoComplete>

View File

@ -2,10 +2,14 @@ $color-grey:#979DA7;
.search-wrapper{ .search-wrapper{
.search-input{ .search-input{
border:1px solid #AAA; border:1px solid $color-grey;
background-color: rgba(255,255,255,0.5); color: $color-grey;
width: 2rem;
transition: width 2s;
//background-color:rgba(0,0,0,0.5);
} }
.srch-icon{ .srch-icon{
color: $color-grey; color: $color-grey;
font-weight: bold;
} }
} }

View File

@ -40,7 +40,7 @@ const HomeGuest = (props) => (
<div className="feat-part"> <div className="feat-part">
<div className="container"> <div className="container">
<OverPack <OverPack
playScale="0.3" playScale={[0.3,0.1]}
> >
<TweenOne <TweenOne
key="feat-motion-one" key="feat-motion-one"
@ -52,13 +52,13 @@ const HomeGuest = (props) => (
<Row key="feat-motion-row"> <Row key="feat-motion-row">
<QueueAnim <QueueAnim
delay = {200} delay = {200}
interval ={100} interval ={200}
type = "bottom" leaveReverse={true}
ease = 'easeOutQuad' ease = 'easeOutQuad'
animConfig ={{ opacity:[1,0],y: '+=30' }} animConfig ={{ opacity:[1,0],y: '+=30' }}
key="feat-motion-queue" key="feat-motion-queue"
> >
<Col span={8} className="feat-wrapper" key="feat-wrapper-1"> <Col span={6} className="feat-wrapper" key="feat-wrapper-1">
<div className="feat-img"> <div className="feat-img">
<Icon type="api" /> <Icon type="api" />
</div> </div>
@ -66,7 +66,7 @@ const HomeGuest = (props) => (
接口管理 接口管理
</p> </p>
</Col> </Col>
<Col span={8} className="feat-wrapper" key="feat-wrapper-2"> <Col span={6} className="feat-wrapper" key="feat-wrapper-2">
<div className="feat-img"> <div className="feat-img">
<Icon type="link" /> <Icon type="link" />
</div> </div>
@ -74,7 +74,7 @@ const HomeGuest = (props) => (
支持Mock 支持Mock
</p> </p>
</Col> </Col>
<Col span={8} className="feat-wrapper" key="feat-wrapper-3"> <Col span={6} className="feat-wrapper" key="feat-wrapper-3">
<div className="feat-img"> <div className="feat-img">
<Icon type="team" /> <Icon type="team" />
</div> </div>
@ -82,6 +82,14 @@ const HomeGuest = (props) => (
团队协作 团队协作
</p> </p>
</Col> </Col>
<Col span={6} className="feat-wrapper" key="feat-wrapper-4">
<div className="feat-img">
<Icon type="desktop" />
</div>
<p className="feat-title">
可部署
</p>
</Col>
</QueueAnim> </QueueAnim>
</Row> </Row>
</OverPack> </OverPack>
@ -132,7 +140,7 @@ class Home extends Component {
<div className="user-home"> <div className="user-home">
<div className="user-des"> <div className="user-des">
<p className="title">YAPI</p> <p className="title">YAPI</p>
<p className="des">一个高效易用功能强大的api管理系统</p> <p className="des">一个高效易用可部署的Api管理系统</p>
<div className="btn"> <div className="btn">
<Button type="primary" size="large"> <Button type="primary" size="large">
<Link to="/group" onClick={this.toStart}>开始</Link> <Link to="/group" onClick={this.toStart}>开始</Link>

View File

@ -111,43 +111,48 @@ $color-black-lighter: #404040;
height:100%; height:100%;
position: relative; position: relative;
} }
.feat-wrapper{ .feat-wrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text-align: center; text-align: center;
.feat-img{ .feat-img {
height: 1.2rem; height: 1.2rem;
width: 1.2rem; width: 1.2rem;
border-radius: 100%; border-radius: 100%;
margin-bottom: .2rem; margin-bottom: .2rem;
color: $color-white; color: $color-white;
i{ i {
line-height: 1.2rem; line-height: 1.2rem;
font-size: .6rem; font-size: .6rem;
} }
} }
.feat-title{ .feat-title {
font-size: .16rem; font-size: .16rem;
line-height: .3rem; line-height: .3rem;
color: #333; color: #333;
} }
&:first-child{ &:first-child {
.feat-img{ .feat-img {
background-color: rgb(248, 88, 96); background-color: rgb(248, 88, 96);
} }
} }
&:nth-child(2){ &:nth-child(2) {
.feat-img{ .feat-img {
background-color: #f9bb13; background-color: #f9bb13;
} }
} }
&:nth-child(3){ &:nth-child(3) {
.feat-img{ .feat-img {
background-color: #20ab8e; background-color: #20ab8e;
} }
} }
&:nth-child(4) {
.feat-img {
background-color: rgb(66, 165, 245);
}
}
} }
} }

View File

@ -25,7 +25,8 @@ export default (state = initialState, action) => {
...state, ...state,
isLogin: (action.payload.data.errcode == 0), isLogin: (action.payload.data.errcode == 0),
loginState: (action.payload.data.errcode == 0)?MEMBER_STATUS:GUEST_STATUS, loginState: (action.payload.data.errcode == 0)?MEMBER_STATUS:GUEST_STATUS,
userName: action.payload.data.data ? action.payload.data.data.username : null userName: action.payload.data.data ? action.payload.data.data.username : null,
uid: action.payload.data.data ? action.payload.data.data._id : null
}; };
} }
case LOGIN: { case LOGIN: {

View File

@ -25,7 +25,8 @@ export default (state = initialState, action) => {
...state, ...state,
isLogin: (action.payload.data.errcode == 0), isLogin: (action.payload.data.errcode == 0),
loginState: (action.payload.data.errcode == 0)?MEMBER_STATUS:GUEST_STATUS, loginState: (action.payload.data.errcode == 0)?MEMBER_STATUS:GUEST_STATUS,
userName: action.payload.data.data ? action.payload.data.data.username : null userName: action.payload.data.data ? action.payload.data.data.username : null,
uid: action.payload.data.data ? action.payload.data.data._id : null
}; };
} }
case LOGIN: { case LOGIN: {