众包完善

dev_admin
杨树明 6 years ago
parent 58bf4afde2
commit 872fc5bb6c

@ -222,7 +222,7 @@ export default class MDEditors extends Component {
const _placeholder = placeholder || ""; const _placeholder = placeholder || "";
// amp; // amp;
// 编辑时要传memoId // 编辑时要传memoId
const imageUrl = `/upload_with_markdown?container_id=&container_type=Memo`; const imageUrl = `/api/attachments.json`;
// 创建editorMd // 创建editorMd
let react_id = `react_${_id}`; let react_id = `react_${_id}`;

@ -43,6 +43,12 @@ function disabledDateTime() {
disabledMinutes: () => range(1, 30).concat(range(31, 60)), disabledMinutes: () => range(1, 30).concat(range(31, 60)),
}; };
} }
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
class PackageIndexNEIBannerConcent extends Component { class PackageIndexNEIBannerConcent extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
@ -50,7 +56,7 @@ class PackageIndexNEIBannerConcent extends Component {
this.state = { this.state = {
modalCancel:false, modalCancel:false,
getverificationcodes:true, getverificationcodes:true,
seconds:35, seconds:60,
springtype:false, springtype:false,
category:undefined, category:undefined,
title:undefined, title:undefined,
@ -83,7 +89,7 @@ class PackageIndexNEIBannerConcent extends Component {
deadline_at:moment(data.deadline_at), deadline_at:moment(data.deadline_at),
min_price:data.min_price, min_price:data.min_price,
max_price:data.max_price, max_price:data.max_price,
contact_name:data.contact_name==null||data.contact_name==undefined?this.props.current_user.username:data.contact_name, contact_name:data.contact_name==null||data.contact_name==undefined?this.props.current_user.real_name:data.contact_name,
phones:data.contact_phone, phones:data.contact_phone,
attachments:data.attachments, attachments:data.attachments,
@ -93,7 +99,7 @@ class PackageIndexNEIBannerConcent extends Component {
}) })
}else{ }else{
console.log(this.props.current_user&&this.props.current_user.username) console.log(this.props.current_user&&this.props.current_user.real_name)
} }
let Url = `/project_package_categories.json`; let Url = `/project_package_categories.json`;
@ -112,7 +118,7 @@ class PackageIndexNEIBannerConcent extends Component {
}) })
this.setState({ this.setState({
contact_name:this.props.current_user&&this.props.current_user.username contact_name:this.props.current_user&&this.props.current_user.real_name
}) })
// this.contentMdRef.current.setValue("测试赋值") // this.contentMdRef.current.setValue("测试赋值")
@ -123,7 +129,7 @@ class PackageIndexNEIBannerConcent extends Component {
if(prevProps.current_user!=this.props.current_user){ if(prevProps.current_user!=this.props.current_user){
if(this.props.current_user!=undefined){ if(this.props.current_user!=undefined){
this.setState({ this.setState({
contact_name:this.props.current_user.username contact_name:this.props.current_user.real_name
}) })
} }
} }
@ -151,7 +157,7 @@ class PackageIndexNEIBannerConcent extends Component {
clearInterval(timer); clearInterval(timer);
this.setState({ this.setState({
getverificationcodes: false, getverificationcodes: false,
seconds: 35, seconds: 60,
}) })
} }
}); });
@ -170,7 +176,7 @@ class PackageIndexNEIBannerConcent extends Component {
clearInterval(timer); clearInterval(timer);
this.setState({ this.setState({
getverificationcodes: false, getverificationcodes: false,
seconds: 35, seconds: 60,
}) })
} }
@ -187,7 +193,7 @@ class PackageIndexNEIBannerConcent extends Component {
axios.get((url), { axios.get((url), {
params: { params: {
value: contact_phone, value: contact_phone,
type: 9, type: 5,
} }
}).then((result) => { }).then((result) => {
//验证有问题{"status":1,"message":"success"} //验证有问题{"status":1,"message":"success"}
@ -452,7 +458,7 @@ class PackageIndexNEIBannerConcent extends Component {
deadline_at:deadline_at._i, deadline_at:deadline_at._i,
min_price:parseInt(min_price), min_price:parseInt(min_price),
max_price:parseInt(max_price), max_price:parseInt(max_price),
contact_name: contact_name===null||contact_name===undefined?this.props.current_user.username:contact_name, contact_name: contact_name===null||contact_name===undefined?this.props.current_user.real_name:contact_name,
contact_phone: contact_phone===undefined?this.props.current_user&&this.props.current_user.phone:contact_phone, contact_phone: contact_phone===undefined?this.props.current_user&&this.props.current_user.phone:contact_phone,
code:code, code:code,
publish:types publish:types
@ -500,7 +506,7 @@ class PackageIndexNEIBannerConcent extends Component {
deadline_at:deadline_at._i, deadline_at:deadline_at._i,
min_price:parseInt(min_price), min_price:parseInt(min_price),
max_price:parseInt(max_price), max_price:parseInt(max_price),
contact_name: contact_name===null||contact_name===undefined?this.props.current_user.username:contact_name, contact_name: contact_name===null||contact_name===undefined?this.props.current_user.real_name:contact_name,
contact_phone: contact_phone===undefined?this.props.current_user&&this.props.current_user.phone:contact_phone, contact_phone: contact_phone===undefined?this.props.current_user&&this.props.current_user.phone:contact_phone,
code:code, code:code,
publish:types publish:types
@ -805,6 +811,8 @@ class PackageIndexNEIBannerConcent extends Component {
placeholder="请选择任务的竞标截止日期" placeholder="请选择任务的竞标截止日期"
className={"fafas"} className={"fafas"}
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
disabledDate={disabledDate}
dropdownClassName="hideDisable"
value={this.state.deadline_at} value={this.state.deadline_at}
onChange={this.onChangeTimePicker} onChange={this.onChangeTimePicker}
/> />
@ -848,7 +856,7 @@ class PackageIndexNEIBannerConcent extends Component {
<Input <Input
className={"fafafas"} className={"fafafas"}
style={{"width": "260px"}} style={{"width": "260px"}}
value={this.state.contact_name===null||this.state.contact_name===undefined?this.props.current_user&&this.props.current_user.username:this.state.contact_name} value={this.state.contact_name===null||this.state.contact_name===undefined?this.props.current_user&&this.props.current_user.real_name:this.state.contact_name}
placeholder="请输入姓名" placeholder="请输入姓名"
onInput={(e)=>this.onChangeContact_name(e)} onInput={(e)=>this.onChangeContact_name(e)}
/> />

@ -617,8 +617,10 @@ submittojoinclass=(value)=>{
let activeShixuns = false; let activeShixuns = false;
let activePaths = false; let activePaths = false;
let coursestype=false; let coursestype=false;
let activePackages=false;
if (match.path === '/forums') {
if (match.path === '/forums') {
activeForums = true; activeForums = true;
} else if (match.path.startsWith('/shixuns')) { } else if (match.path.startsWith('/shixuns')) {
activeShixuns = true; activeShixuns = true;
@ -626,14 +628,12 @@ submittojoinclass=(value)=>{
activePaths = true; activePaths = true;
} else if (match.path.startsWith('/courses')) { } else if (match.path.startsWith('/courses')) {
coursestype = true; coursestype = true;
}else { }else if (match.path.startsWith('/crowdsourcing')) {
activePackages = true;
}else {
activeIndex = true; activeIndex = true;
} }
// join_course_url: "https://www.educoder.net/courses/join_course_multi_role"
// join_project_url: "https://www.educoder.net/applied_project/applied_project_info"
// rolearr:["",""],
// console.log("618");
// console.log(user_phone_binded);
return ( return (
<div className="newHeader" id="nHeader" > <div className="newHeader" id="nHeader" >
@ -716,10 +716,9 @@ submittojoinclass=(value)=>{
/> />
</li> </li>
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.moop_cases_url}>教学案例</a></li> <li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.moop_cases_url}>教学案例</a></li>
<li className=""><a <li className={`${activePackages === true ? 'pr active' : 'pr'}`}>
// href={this.props.Headertop===undefined?"":this.props.Headertop.crowdsourcing_url} <a href={'/crowdsourcing'}>众包创新</a>
href={'/crowdsourcing'} </li>
>众包创新</a></li>
<li className={`${activeForums === true ? 'active' : ''}`}><a href={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</a></li> <li className={`${activeForums === true ? 'active' : ''}`}><a href={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</a></li>
<li <li
style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}} style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}}

Loading…
Cancel
Save