众包首页和新建编辑页面

project_pack
杨树明 5 years ago
parent 05bd1ca0c8
commit 84a99dc3f5

@ -64,8 +64,8 @@ gem 'elasticsearch-rails'
gem 'oauth2'
# xlsx
gem 'axlsx', '3.0.0.pre'
gem 'axlsx_rails', '0.3.0'
# gem 'axlsx', '3.0.0.pre'
# gem 'axlsx_rails', '0.3.0'
# state machine
gem 'aasm'

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -73,6 +73,10 @@ const ForumsIndexComponent = Loadable({
loading: Loading,
})
const ProjectPackages=Loadable({
loader: () => import('./modules/projectPackages/ProjectPackageIndex'),
loading: Loading,
})
const ECIndexComponent = Loadable({
loader: () => import('./modules/ec'),
@ -220,6 +224,8 @@ class App extends Component {
</Route>
<Route path="/fork_list" component={TPMshixunfork_listIndexComponent}>
</Route> */}
{/*众包*/}
<Route path={"/project_packages"} component={ProjectPackages}/>
<Route path="/forums" component={ForumsIndexComponent}>
</Route>

@ -39,11 +39,9 @@ window.__useKindEditor = false;
// TODO 读取到package.json中的配置
var proxy = "http://localhost:3000"
// proxy = "http://testbdweb.trustie.net"
proxy = "http://testbdweb.educoder.net"
// proxy = "http://testbdweb.educoder.net"
// proxy = 'http://192.168.0.195:3000'
proxy ='https://testbdweb.educoder.net'
proxy ='http://testbdweb.educoder.net'
// proxy='https://www.educoder.net'
// proxy='https://www.educoder.net'
const requestMap={};
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制

@ -0,0 +1,25 @@
import React, {Component} from 'react';
import {Link} from "react-router-dom";
class PackageBanner extends Component {
constructor(props) {
super(props)
this.state = {
}
}
componentDidMount() {
}
render() {
return (
<div className="courseHead" style={{height: '300px'}}></div>
)
}
}
export default PackageBanner;

@ -0,0 +1,154 @@
import React, {Component} from 'react';
import {Link} from "react-router-dom";
import axios from 'axios';
import { Input ,Icon,Button,Pagination} from 'antd';
import '../packageconcnet.css';
const { Search } = Input;
class PackageConcent extends Component {
constructor(props) {
super(props)
this.state = {
}
}
componentDidMount() {
}
render() {
return (
<div className="educontent clearfix" style={{flex: "1 0 auto"}}>
<div className="stud-class-set">
<div className="news">
<div className="edu-class-inner container clearfix">
<div className="member for-content-0 for-content">
<div className="people clearfix mb25">
{/*concent*/}
<div className="mb30">
<div className="clearfix">
<p className="clearfix" >
<p style={{height: '50px'}}>
<Search placeholder="输入标题名称进行检索"
style={{ width: 749}}
className="packinput"
enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>}
onSearch={value => console.log(value)} />
<Button type="primary" className="setissues fr" size={"large"}>
发布需求
</Button>
</p>
</p>
</div>
</div>
<div className="edu-back-white mb20">
<p className="clearfix padding30">
<p className="clearfix mb30 shaiContent">
<span className="shaiTitle fl mt3">类型</span>
<div className="fl pr shaiAllItem pagetype">
<li className="shaiItem shixun_repertoire active" value="a">全部</li>
<li className="shaiItem shixun_repertoire " value="a">前端开发</li>
<li className="shaiItem shixun_repertoire " value="a">后端开发</li>
<li className="shaiItem shixun_repertoire " value="a">移动开发</li>
<li className="shaiItem shixun_repertoire " value="a">数据库</li>
<li className="shaiItem shixun_repertoire " value="a">云计算和大数据</li>
<li className="shaiItem shixun_repertoire " value="a">运维与测试</li>
<li className="shaiItem shixun_repertoire " value="a">人工智能</li>
<li className="shaiItem shixun_repertoire " value="a">其他</li>
</div>
</p>
<p className="clearfix shaiContent">
<span className="shaiTitle fl mt3">排序</span>
<div className="fl pr shaiAllItem pagetype">
<li className="shaiItem shixun_repertoire active" value="a">最新</li>
<li className="shaiItem shixun_repertoire " value="a">价格</li>
</div>
</p>
</p>
</div>
<div className="educontent project-packages-list">
<div className="project-package-item">
<div className="item-image">
<img />
</div>
<div className=" item-body">
<div className=" item-head mbf10">
<div className=" item-head-title">
<a className={"fl mt3 font-20 font-bd color-dark maxwidth580 "}>xxxxxx</a>
</div>
<div className=" item-head-blank"></div>
<div className=" item-head-price">
<span></span>~<span></span>
</div>
</div>
<div className=" item-category">
<div className=" item-category-item">人工智能</div>
</div>
<div className=" item-other">
<div className=" item-group item-other-visit">
<span className=" item-group-icon"><i className="fa fa-eye"></i></span>
<span className=" item-group-text">人浏览</span>
</div>
<div className=" item-group item-other-deadline">
<span className=" item-group-icon"><i className="fa fa-clock-o"></i></span>
<span className=" item-group-text">内竞标截止</span>
</div>
<div className=" item-group item-other-bidding">
<span className=" item-group-icon"><i className="fa fa-user" ></i></span>
<span className=" item-group-text">人竞标</span>
</div>
<div className=" item-other-blank"></div>
<div className=" item-group item-other-publish-at">
<span className=" item-group-text">发布于 </span>
</div>
</div>
</div>
</div>
</div>
<div className={"mt40"}>
<Pagination className="edu-txt-center" defaultCurrent={1} total={50} />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
)
}
}
export default PackageConcent;

@ -0,0 +1,30 @@
import React, { Component } from 'react';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
//业务组件
import PackageBanner from "./PackageBanner";
import PackageConcent from "./PackageConcent";
class PackageIndex extends Component{
constructor(props) {
super(props)
}
componentDidMount(){
}
render() {
return (
<div>
<div className="clearfix">
{/*头部banner*/}
<PackageBanner {...this.props}></PackageBanner>
{/*内容banner*/}
<PackageConcent {...this.props}></PackageConcent>
</div>
</div>
)
}
}
export default PackageIndex;

@ -0,0 +1,42 @@
import React, {Component} from 'react';
import {Link} from "react-router-dom";
import { Steps, Divider } from 'antd';
import 'antd/dist/antd.css';
const { Step } = Steps;
class PackageIndexNEIBanner extends Component {
constructor(props) {
super(props)
this.state = {
current:0
}
}
componentDidMount() {
}
onChange=(current)=>{
debugger
console.log('onChange:', current);
this.setState({ current });
};
render() {
const { current } = this.state;
return (
<div className="edu-back-white mb20 PackageIndexNEIBanner">
<p className="clearfix padding110">
<Steps current={current} >
<Step title="发布需求"onClick={()=>this.onChange(0)}/>
<Step title="筛选合适的接包方" onClick={()=>this.onChange(1)}/>
<Step title="线下交易,完成实施"onClick={()=>this.onChange(2)}/>
</Steps>
</p>
</div>
)
}
}
export default PackageIndexNEIBanner;

@ -0,0 +1,66 @@
import React, {Component} from 'react';
import {Link} from "react-router-dom";
import axios from 'axios';
import { Input ,Icon,Button,Pagination} from 'antd';
import '../packageconcnet.css';
const { Search } = Input;
class PackageIndexNEIBannerConcent extends Component {
constructor(props) {
super(props)
this.state = {
}
}
componentDidMount() {
}
render() {
return (
<div className="edu-back-white mb20">
<p className="clearfix ">
<div className={"stud-class-set padding30 coursenavbox edu-back-white"}>
<div className={"ant-row ant-form-item contentbox mdInForm "}>
<div className="ant-form-item-label mb10">
<label htmlFor="coursesNew_description" className="ant-form-item-required font-16">请选择需求类型</label>
</div>
<p className="clearfix mb20 shaiContent">
<div className="fl pr shaiAllItem pagetype">
<li className="shaiItem shixun_repertoire active borderccc" value="a">前端开发</li>
<li className="shaiItem shixun_repertoire borderccc" value="a">后端开发</li>
<li className="shaiItem shixun_repertoire borderccc" value="a">移动开发</li>
<li className="shaiItem shixun_repertoire borderccc" value="a">数据库</li>
<li className="shaiItem shixun_repertoire borderccc" value="a">云计算和大数据</li>
<li className="shaiItem shixun_repertoire borderccc" value="a">运维与测试</li>
<li className="shaiItem shixun_repertoire borderccc" value="a">人工智能</li>
<li className="shaiItem shixun_repertoire borderccc" value="a">其他</li>
</div>
</p>
<div className="ant-form-item-label mb10">
<label htmlFor="coursesNew_description" className="ant-form-item-required font-16">需求标题和详情</label>
</div>
<Input placeholder="请输入需求标题示例美食类APP开发最大限制60个字符" maxLength="60" className="input-100-40s mt5 fafafas" />
</div>
</div>
<div className={"stud-class-set padding30 coursenavbox edu-back-white"} style={{borderTop: '1px solid #EAEAEA'}}>
</div>
</p>
</div>
)
}
}
export default PackageIndexNEIBannerConcent;

@ -0,0 +1,39 @@
import React, { Component } from 'react';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
//业务组件
import PackageIndexNEIBanner from "./PackageIndexNEIBanner";
//业务组件
import PackageIndexNEIBannerConcent from "./PackageIndexNEIBannerConcent"
import '../packageconcnet.css';
class PackageIndexNewandEditIndex extends Component{
constructor(props) {
super(props)
}
componentDidMount(){
console.log(this.props)
}
render() {
return (
<div>
<div className="clearfix">
<div className={"educontent mt20 mb50"}>
<p className="clearfix mt20 mb20">
<span className="fl font-24 color-grey-3">新建</span>
</p>
<PackageIndexNEIBanner/>
<PackageIndexNEIBannerConcent/>
</div>
</div>
</div>
)
}
}
export default PackageIndexNewandEditIndex;

@ -0,0 +1,45 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import Loading from '../../Loading'
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'
import { SnackbarHOC } from 'educoder'
const PackageIndex = Loadable({
loader: () => import('./PackageIndex/PackageIndex'),
loading: Loading,
})
const PackageIndexNewandEdit = Loadable({
loader: () => import('./PackageIndexNewandEdit/PackageIndexNewandEditIndex'),
loading: Loading,
})
class ProjectPackageIndex extends Component {
constructor(props) {
super(props)
}
render() {
return (
<div className="newMain clearfix">
<Switch>
{/*众包首页*/}
<Route path="/project_packages/:id/edit" {...this.props} component={PackageIndexNewandEdit}></Route>
<Route path="/project_packages/new" {...this.props} component={PackageIndexNewandEdit}></Route>
<Route path="/project_packages" {...this.props} component={PackageIndex}></Route>
</Switch>
</div>
);
}
}
export default SnackbarHOC() (TPMIndexHOC (ProjectPackageIndex)) ;

@ -0,0 +1,71 @@
.width1240{
width:1240px;
}
.packinput .ant-input{
height: 50px;
width:749px;
border-color: #E1EDF8 !important;
}
.packinput .ant-input-group-addon .ant-btn{
width:140px !important;
font-size: 18px;
height: 50px;
background:rgba(76,172,255,1);
margin-right:18px;
}
.setissues{
width:280px;
height:50px;
background:rgba(76,172,255,1);
border-radius:4px;
margin-left: 15px;
}
.pagetype li{
color:#8F8F8F !important;
}
.maxwidth580{
max-width: 580px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mbf10{
margin-bottom:-10px;
}
.PackageIndexNEIBanner{
width:1200px;
height:110px;
background:rgba(255,255,255,1);
box-shadow:0px 2px 6px 0px rgba(125,125,125,0.26);
border-radius:8px;
}
.padding110{
padding: 39px 110px 0px;
box-sizing: border-box;
}
.borderccc{
border: 1px solid #ccc;
}
.input-100-40s{
width: 100%;
height: 40px;
padding: 5px;
box-sizing: border-box;
}
.fafafas{
background-color: #fafafa!important;
}
.fafafas:focus{
background-color: #fff!important;
}

@ -133,6 +133,7 @@ class NewHeader extends Component {
},
ImageUrl:"",
ecUrl:null,
project_packages_url:null,
ImageUrlType:false
}
}
@ -198,7 +199,8 @@ class NewHeader extends Component {
}
).then((response) => {
this.setState({
ecUrl:response.data.ec_url
ecUrl:response.data.ec_url,
project_packages_url:response.data.project_packages_url
})
}).catch((error) => {
console.log(error)
@ -232,7 +234,7 @@ class NewHeader extends Component {
}
render() {
let {careerslist,isLogin,current_user,ImageUrl,ecUrl,ImageUrlType} = this.state;
let {careerslist,isLogin,current_user,ImageUrl,ecUrl,ImageUrlType,project_packages_url} = this.state;
// const isLogin = isLogintype; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。
const { user, match } = this.props;
/*
@ -243,6 +245,7 @@ class NewHeader extends Component {
let activeShixuns = false;
let activeCareers = false;
let activeCourses = false;
let competitions = false;
if (match.path === '/forums') {
activeForums = true;
} else if (match.path.startsWith('/shixuns')) {
@ -253,7 +256,9 @@ class NewHeader extends Component {
activeCourses=true;
}else if(match.path.startsWith('/ec_major_schools')){
activeCourses=true;
}else{
}else if(match.path.startsWith('/competitions')){
competitions=true;
}else{
activeIndex = true;
}
@ -295,7 +300,13 @@ class NewHeader extends Component {
</div>
</li>
{/* <li><a href="/libraries">教学案例</a></li> */}
<li><a href="/competitions">在线竞赛</a></li>
<li className={`${competitions === true ? 'active' : ''}`} ><a href="/competitions">在线竞赛</a></li>
<li className={`${competitions === true ? 'active' : ''}`} style={{display:project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'none':'block'}} >
<a href="/project_packages">
{project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'':'众包'}
</a>
</li>
<li className={`${activeForums === true ? 'active' : ''}`}><a href="/forums">交流问答</a></li>
<li className={`${activeCourses === true ? 'active' : ''}`} style={{display:ecUrl===null||ecUrl===undefined||ecUrl===""?'none':'block'}}><a href={ecUrl}>{ecUrl===null||ecUrl===undefined||ecUrl===""?'':'工程认证'}</a></li>
</ul>

@ -980,11 +980,11 @@ html>body #ajax-indicator { position: fixed; }
margin-bottom: 20px;
padding: 20px;
background: white;
box-shadow:1px 3px 3px 1px rgba(156,156,156,0.16);
/*box-shadow:1px 3px 3px 1px rgba(156,156,156,0.16);*/
}
.project-packages-list .project-package-item:hover{
box-shadow:2px 6px 6px 3px rgba(156,156,156,0.16);
box-shadow: 1px 6px 16px rgba(156,156,156,0.16);
opacity: 1;
border-radius: 2px;
}

Loading…
Cancel
Save