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 = () => {
return(dispatch)=> {
axios.get('/user/status').then((res) => {
console.log(res);
dispatch({
type: GET_LOGIN_STATE,
payload: res

View File

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

View File

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

View File

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

View File

@ -148,6 +148,11 @@ $color-black-lighter: #404040;
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,
isLogin: (action.payload.data.errcode == 0),
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: {

View File

@ -25,7 +25,8 @@ export default (state = initialState, action) => {
...state,
isLogin: (action.payload.data.errcode == 0),
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: {