dev_aliyun
杨树明 6 years ago
parent 1087006484
commit 961f828f68

@ -229,8 +229,8 @@ class PackageIndexNEITaskDetails extends Component {
render() { render() {
let {overtype,data}=this.state; let {overtype,data}=this.state;
console.log(data&&data.creator.login) // console.log(data&&data.creator.login)
console.log(this.props.current_user.login) // console.log(this.props.current_user.login)
return ( return (
<div> <div>
<div className="clearfix"> <div className="clearfix">
@ -370,7 +370,7 @@ class PackageIndexNEITaskDetails extends Component {
{/*发布者和竞选者状态show*/} {/*发布者和竞选者状态show*/}
{this.state.setbiddingmantype===false?<div className={"stud-class-set coursenavbox edu-back-white mt20"}> {this.state.setbiddingmantype===false&&data&&data.published_at!=null?<div className={"stud-class-set coursenavbox edu-back-white mt20"}>
{/*下面是头像*/} {/*下面是头像*/}
<div className={"stud-class-set pd30a0 coursenavbox edu-back-white"}> <div className={"stud-class-set pd30a0 coursenavbox edu-back-white"}>
<div className={"relativef"}> <div className={"relativef"}>

@ -29,6 +29,20 @@ function checkPhone(phone){
return false; return false;
} }
} }
function range(start, end) {
const result = [];
for (let i = start; i < end; i++) {
result.push(i);
}
return result;
}
function disabledDateTime() {
return {
disabledMinutes: () => range(1, 30).concat(range(31, 60)),
};
}
class PackageIndexNEIBannerConcent extends Component { class PackageIndexNEIBannerConcent extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
@ -170,7 +184,11 @@ class PackageIndexNEIBannerConcent extends Component {
onChangeTimePicker = (value, dateString) => { onChangeTimePicker = (value, dateString) => {
if(value===null){
this.setState({
deadline_at:""
})
}else{
if(moment(handleDateString(dateString))===undefined||moment(handleDateString(dateString))===null||moment(handleDateString(dateString))===""){ if(moment(handleDateString(dateString))===undefined||moment(handleDateString(dateString))===null||moment(handleDateString(dateString))===""){
this.setState({ this.setState({
deadline_attypes:true deadline_attypes:true
@ -193,6 +211,8 @@ class PackageIndexNEIBannerConcent extends Component {
this.setState({ this.setState({
deadline_at: moment(handleDateString(dateString)) deadline_at: moment(handleDateString(dateString))
}) })
}
} }
@ -210,10 +230,7 @@ class PackageIndexNEIBannerConcent extends Component {
} }
setcheckout=()=>{ setcheckout=(min_price,max_price)=>{
let {min_price,max_price}=this.state;
// if(min_price===undefined){ // if(min_price===undefined){
// this.setState({ // this.setState({
// min_pricetype:true // min_pricetype:true
@ -259,6 +276,7 @@ class PackageIndexNEIBannerConcent extends Component {
} }
if(parseInt(max_price)<parseInt(min_price)){ if(parseInt(max_price)<parseInt(min_price)){
this.setState({ this.setState({
minmaxtype:true minmaxtype:true
}) })
@ -377,7 +395,7 @@ class PackageIndexNEIBannerConcent extends Component {
} }
if(modalCancel===true){ if(modalCancel===true||this.props.current_user.phone===null){
if(contact_phone===undefined||contact_phone===null||contact_phone===""){ if(contact_phone===undefined||contact_phone===null||contact_phone===""){
this.setState({ this.setState({
contact_phonetype:true contact_phonetype:true
@ -414,7 +432,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, contact_name: contact_name===null?this.props.current_user.username:contact_name,
contact_phone: contact_phone===undefined?this.props.current_user.phone:contact_phone, contact_phone: contact_phone===undefined?this.props.current_user.phone:contact_phone,
code:code, code:code,
publish:types publish:types
@ -462,7 +480,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, contact_name: contact_name===null?this.props.current_user.username:contact_name,
contact_phone: contact_phone===undefined?this.props.current_user.phone:contact_phone, contact_phone: contact_phone===undefined?this.props.current_user.phone:contact_phone,
code:code, code:code,
publish:types publish:types
@ -551,18 +569,20 @@ class PackageIndexNEIBannerConcent extends Component {
onChangemin_prices=(e)=>{ onChangemin_prices=(e)=>{
let{max_price}=this.state;
this.setState({ this.setState({
min_price:e.target.value min_price:e.target.value
}) })
this.setcheckout() this.setcheckout(e.target.value,max_price)
} }
onChangemax_prices=(e)=>{ onChangemax_prices=(e)=>{
let{min_price}=this.state;
this.setState({ this.setState({
max_price:e.target.value max_price:e.target.value
}) })
this.setcheckout() this.setcheckout(min_price,e.target.value)
} }
@ -597,7 +617,7 @@ class PackageIndexNEIBannerConcent extends Component {
}) })
} }
} }
if(modalCancel===true){ if(modalCancel===true||this.props.current_user.phone===null){
if(e.target.value===undefined||e.target.value===null||e.target.value===""){ if(e.target.value===undefined||e.target.value===null||e.target.value===""){
this.setState({ this.setState({
contact_phonetype:true contact_phonetype:true
@ -682,7 +702,6 @@ class PackageIndexNEIBannerConcent extends Component {
<p className="clearfix mb20 shaiContent" > <p className="clearfix mb20 shaiContent" >
<div className="fl pr shaiAllItem pagetype"> <div className="fl pr shaiAllItem pagetype">
<li className={category===undefined?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} onClick={()=>this.setcategory(undefined)}>全部</li>
{this.state.categories.map((item,key)=>{ {this.state.categories.map((item,key)=>{
return( return(
<li key={key} className={category===item.id?"shaiItem shixun_repertoire active borderccc":"shaiItem shixun_repertoire borderccc"} value={item.id} onClick={()=>this.setcategory(item.id)}>{item.name}</li> <li key={key} className={category===item.id?"shaiItem shixun_repertoire active borderccc":"shaiItem shixun_repertoire borderccc"} value={item.id} onClick={()=>this.setcategory(item.id)}>{item.name}</li>
@ -765,6 +784,7 @@ class PackageIndexNEIBannerConcent extends Component {
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
placeholder="请选择任务的竞标截止日期" placeholder="请选择任务的竞标截止日期"
className={"fafas"} className={"fafas"}
disabledTime={disabledDateTime}
value={this.state.deadline_at} value={this.state.deadline_at}
onChange={this.onChangeTimePicker} onChange={this.onChangeTimePicker}
/> />
@ -780,7 +800,7 @@ class PackageIndexNEIBannerConcent extends Component {
style={{"width": "260px"}} style={{"width": "260px"}}
value={this.state.min_price} value={this.state.min_price}
placeholder="支付多少费用(最低)" placeholder="支付多少费用(最低)"
onInput={this.onChangemin_prices} onInput={(e)=>this.onChangemin_prices(e)}
suffix={ suffix={
<span >¥</span> <span >¥</span>
} }
@ -791,8 +811,7 @@ class PackageIndexNEIBannerConcent extends Component {
style={{"width": "260px"}} style={{"width": "260px"}}
value={this.state.max_price} value={this.state.max_price}
placeholder="支付多少费用(最高)" placeholder="支付多少费用(最高)"
onInput={this.onChangemax_prices} onInput={(e)=>this.onChangemax_prices(e)}
suffix={ suffix={
<span>¥</span> <span>¥</span>
} }
@ -809,9 +828,9 @@ class PackageIndexNEIBannerConcent extends Component {
<Input <Input
className={"fafafas"} className={"fafafas"}
style={{"width": "260px"}} style={{"width": "260px"}}
value={this.state.contact_name} value={this.state.contact_name===null?this.props.current_user.username:this.state.contact_name}
placeholder="请输入姓名" placeholder="请输入姓名"
onInput={this.onChangeContact_name} onInput={(e)=>this.onChangeContact_name(e)}
/> />
{this.state.contact_nametype===true?<div className={"color-red ml100"}>不能为空</div>:""} {this.state.contact_nametype===true?<div className={"color-red ml100"}>不能为空</div>:""}
</p> </p>
@ -841,7 +860,7 @@ class PackageIndexNEIBannerConcent extends Component {
style={{"width": "260px"}} style={{"width": "260px"}}
value={this.state.contact_phone} value={this.state.contact_phone}
placeholder="请输入手机号码" placeholder="请输入手机号码"
onInput={this.onChangeContact_phone} onInput={(e)=>this.onChangeContact_phone(e)}
/> />
{this.state.contact_phonetype===true?<div className={"color-red ml100"}>不能为空</div>:""} {this.state.contact_phonetype===true?<div className={"color-red ml100"}>不能为空</div>:""}
{this.state.contact_phonetypes===true?<div className={"color-red ml100"}>请输入正确的手机号</div>:""} {this.state.contact_phonetypes===true?<div className={"color-red ml100"}>请输入正确的手机号</div>:""}
@ -857,7 +876,7 @@ class PackageIndexNEIBannerConcent extends Component {
enterButton={ enterButton={
getverificationcodes === undefined ? <span>重新发送 ({seconds}s)</span>: getverificationcodes === true ?<span ></span> :<span ></span>} getverificationcodes === undefined ? <span>重新发送 ({seconds}s)</span>: getverificationcodes === true ?<span ></span> :<span ></span>}
onSearch={()=>this.getverificationcode()} onSearch={()=>this.getverificationcode()}
onInput={this.onChangeCode} onInput={(e)=>this.onChangeCode(e)}
/> />
{this.state.codeypes===true?<div className={"color-red"}>验证码不能为空</div>:""} {this.state.codeypes===true?<div className={"color-red"}>验证码不能为空</div>:""}
{this.state.codeypesno===true?<div className={"color-red"}>验证码不正确</div>:""} {this.state.codeypesno===true?<div className={"color-red"}>验证码不正确</div>:""}

Loading…
Cancel
Save