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

@ -229,8 +229,8 @@ class PackageIndexNEITaskDetails extends Component {
render() {
let {overtype,data}=this.state;
console.log(data&&data.creator.login)
console.log(this.props.current_user.login)
// console.log(data&&data.creator.login)
// console.log(this.props.current_user.login)
return (
<div>
<div className="clearfix">
@ -370,7 +370,7 @@ class PackageIndexNEITaskDetails extends Component {
{/*发布者和竞选者状态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={"relativef"}>

@ -29,6 +29,20 @@ function checkPhone(phone){
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 {
constructor(props) {
super(props)
@ -170,29 +184,35 @@ class PackageIndexNEIBannerConcent extends Component {
onChangeTimePicker = (value, dateString) => {
if(moment(handleDateString(dateString))===undefined||moment(handleDateString(dateString))===null||moment(handleDateString(dateString))===""){
if(value===null){
this.setState({
deadline_attypes:true
})
}else{
this.setState({
deadline_attypes:false
})
}
if(moment(handleDateString(dateString))<moment(new Date())){
this.setState({
deadline_attypexy:true
deadline_at:""
})
}else{
if(moment(handleDateString(dateString))===undefined||moment(handleDateString(dateString))===null||moment(handleDateString(dateString))===""){
this.setState({
deadline_attypes:true
})
}else{
this.setState({
deadline_attypes:false
})
}
if(moment(handleDateString(dateString))<moment(new Date())){
this.setState({
deadline_attypexy:true
})
}else{
this.setState({
deadline_attypexy:false
})
}
this.setState({
deadline_attypexy:false
deadline_at: moment(handleDateString(dateString))
})
}
this.setState({
deadline_at: moment(handleDateString(dateString))
})
}
@ -210,10 +230,7 @@ class PackageIndexNEIBannerConcent extends Component {
}
setcheckout=()=>{
let {min_price,max_price}=this.state;
setcheckout=(min_price,max_price)=>{
// if(min_price===undefined){
// this.setState({
// min_pricetype:true
@ -259,6 +276,7 @@ class PackageIndexNEIBannerConcent extends Component {
}
if(parseInt(max_price)<parseInt(min_price)){
this.setState({
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===""){
this.setState({
contact_phonetype:true
@ -414,7 +432,7 @@ class PackageIndexNEIBannerConcent extends Component {
deadline_at:deadline_at._i,
min_price:parseInt(min_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,
code:code,
publish:types
@ -462,7 +480,7 @@ class PackageIndexNEIBannerConcent extends Component {
deadline_at:deadline_at._i,
min_price:parseInt(min_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,
code:code,
publish:types
@ -551,18 +569,20 @@ class PackageIndexNEIBannerConcent extends Component {
onChangemin_prices=(e)=>{
let{max_price}=this.state;
this.setState({
min_price:e.target.value
})
this.setcheckout()
this.setcheckout(e.target.value,max_price)
}
onChangemax_prices=(e)=>{
let{min_price}=this.state;
this.setState({
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===""){
this.setState({
contact_phonetype:true
@ -682,7 +702,6 @@ class PackageIndexNEIBannerConcent extends Component {
<p className="clearfix mb20 shaiContent" >
<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)=>{
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>
@ -765,6 +784,7 @@ class PackageIndexNEIBannerConcent extends Component {
format="YYYY-MM-DD HH:mm"
placeholder="请选择任务的竞标截止日期"
className={"fafas"}
disabledTime={disabledDateTime}
value={this.state.deadline_at}
onChange={this.onChangeTimePicker}
/>
@ -780,7 +800,7 @@ class PackageIndexNEIBannerConcent extends Component {
style={{"width": "260px"}}
value={this.state.min_price}
placeholder="支付多少费用(最低)"
onInput={this.onChangemin_prices}
onInput={(e)=>this.onChangemin_prices(e)}
suffix={
<span >¥</span>
}
@ -791,8 +811,7 @@ class PackageIndexNEIBannerConcent extends Component {
style={{"width": "260px"}}
value={this.state.max_price}
placeholder="支付多少费用(最高)"
onInput={this.onChangemax_prices}
onInput={(e)=>this.onChangemax_prices(e)}
suffix={
<span>¥</span>
}
@ -809,9 +828,9 @@ class PackageIndexNEIBannerConcent extends Component {
<Input
className={"fafafas"}
style={{"width": "260px"}}
value={this.state.contact_name}
value={this.state.contact_name===null?this.props.current_user.username:this.state.contact_name}
placeholder="请输入姓名"
onInput={this.onChangeContact_name}
onInput={(e)=>this.onChangeContact_name(e)}
/>
{this.state.contact_nametype===true?<div className={"color-red ml100"}>不能为空</div>:""}
</p>
@ -841,7 +860,7 @@ class PackageIndexNEIBannerConcent extends Component {
style={{"width": "260px"}}
value={this.state.contact_phone}
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_phonetypes===true?<div className={"color-red ml100"}>请输入正确的手机号</div>:""}
@ -857,7 +876,7 @@ class PackageIndexNEIBannerConcent extends Component {
enterButton={
getverificationcodes === undefined ? <span>重新发送 ({seconds}s)</span>: getverificationcodes === true ?<span ></span> :<span ></span>}
onSearch={()=>this.getverificationcode()}
onInput={this.onChangeCode}
onInput={(e)=>this.onChangeCode(e)}
/>
{this.state.codeypes===true?<div className={"color-red"}>验证码不能为空</div>:""}
{this.state.codeypesno===true?<div className={"color-red"}>验证码不正确</div>:""}

Loading…
Cancel
Save