dev_admin
杨树明 6 years ago
parent aed1dad82c
commit 4662edde1a

@ -4,6 +4,9 @@ import axios from 'axios';
import { Input ,Icon,Button,Pagination} from 'antd';
import moment from 'moment';
import '../packageconcnet.css';
import AccountProfile from"../../user/AccountProfile";
import LoginDialog from '../../login/LoginDialog';
const { Search } = Input;
let categorylist=[
@ -45,7 +48,9 @@ class PackageConcent extends Component {
sort_direction:"desc",
page:1,
per_page:20,
categories:[]
categories:[],
isRender:false,
AccountProfiletype:false
}
}
//desc, desc, asc
@ -134,12 +139,66 @@ class PackageConcent extends Component {
this.setdatas(category,keyword,value,sort_directionvalue,page)
}
onReleaseRequirements=(url)=>{
let{current_user} =this.props;
if(current_user===undefined){
this.setState({
isRender:true
})
return
}
if(current_user&&current_user.login===""){
this.setState({
isRender:true
})
return;
}
if(current_user&&current_user.profile_completed===false){
this.setState({
AccountProfiletype:true
})
return;
}
if(url !== undefined || url!==""){
window.location.href = url;
}
}
// 登录
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
}
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render() {
let {data,page,category,sort_by,sort_direction,project_packages}=this.state;
let {data,page,category,sort_by,sort_direction,project_packages,
isRender,AccountProfiletype
}=this.state;
return (
<div className="educontent clearfix mtf10" style={{flex: "1 0 auto"}}>
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.state}
{...this.props}
/>:""}
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
<div className="stud-class-set">
<div className="news">
<div className="edu-class-inner container clearfix">
@ -158,7 +217,7 @@ class PackageConcent extends Component {
enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>}
onSearch={ (value)=>this.setdatafuns(value)} />
<Button type="primary" className="setissues fr" size={"large"}>
<a href="/crowdsourcing/new" >发布需求</a>
<a onClick={()=>this.onReleaseRequirements("/crowdsourcing/new")}>发布需求</a>
</Button>
</p>
</p>
@ -224,7 +283,7 @@ class PackageConcent extends Component {
<div className=" item-head-title">
<a className={"fl mt3 font-20 font-bd color-dark maxwidth700 "}
href={"/crowdsourcing/"+item.id}
onClick={()=>this.onReleaseRequirements("/crowdsourcing/"+item.id)}
title={item.title}
>{item.title}</a>
</div>

Loading…
Cancel
Save