|
|
@ -49,7 +49,7 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
contact_phone:undefined,
|
|
|
|
contact_phone:undefined,
|
|
|
|
code:undefined,
|
|
|
|
code:undefined,
|
|
|
|
publish:false,
|
|
|
|
publish:false,
|
|
|
|
|
|
|
|
categories:[]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -79,6 +79,16 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let Url = `/api/v1/project_package_categories.json`;
|
|
|
|
|
|
|
|
axios.get(Url).then((response) => {
|
|
|
|
|
|
|
|
console.log(response)
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
categories:response.data.categories
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
console.log(error)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
// this.contentMdRef.current.setValue("测试赋值")
|
|
|
|
// this.contentMdRef.current.setValue("测试赋值")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获取验证码;
|
|
|
|
//获取验证码;
|
|
|
@ -155,11 +165,108 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onChangeTimePicker = (value, dateString) => {
|
|
|
|
onChangeTimePicker = (value, dateString) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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({
|
|
|
|
this.setState({
|
|
|
|
deadline_at: moment(handleDateString(dateString))
|
|
|
|
deadline_at: moment(handleDateString(dateString))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setcheckoutcontent=()=>{
|
|
|
|
|
|
|
|
const content = this.contentMdRef.current.getValue().trim();
|
|
|
|
|
|
|
|
if(content===undefined||content===null||content===""){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
contenttypes:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
contenttypes:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setcheckout=()=>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let {min_price,max_price}=this.state;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(min_price===undefined||max_price===undefined){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
min_pricetype:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
min_pricetype:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(parseInt(min_price)===undefined||parseInt(min_price)===null||parseInt(min_price)===""){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
min_pricetype:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
min_pricetype:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(parseInt(max_price)===undefined||parseInt(max_price)===null||parseInt(max_price)===""){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
min_pricetype:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
min_pricetype:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(parseInt(min_price)<=0||parseInt(max_price)<=0){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
smallstype:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
smallstype:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(parseInt(max_price)<parseInt(min_price)){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
minmaxtype:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
minmaxtype:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setPublication=(type)=>{
|
|
|
|
setPublication=(type)=>{
|
|
|
|
const content = this.contentMdRef.current.getValue().trim();
|
|
|
|
const content = this.contentMdRef.current.getValue().trim();
|
|
|
|
// console.log(content)
|
|
|
|
// console.log(content)
|
|
|
@ -210,6 +317,15 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(min_price===undefined||max_price===undefined){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
min_pricetype:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
min_pricetype:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(parseInt(min_price)===undefined||parseInt(min_price)===null||parseInt(min_price)===""){
|
|
|
|
if(parseInt(min_price)===undefined||parseInt(min_price)===null||parseInt(min_price)===""){
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -286,7 +402,7 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
const url = `/api/v1/project_packages.json`;
|
|
|
|
const url = `/api/v1/project_packages.json`;
|
|
|
|
|
|
|
|
|
|
|
|
axios.post(url, {
|
|
|
|
axios.post(url, {
|
|
|
|
category: category,
|
|
|
|
category_id: category,
|
|
|
|
title: title,
|
|
|
|
title: title,
|
|
|
|
content: content,
|
|
|
|
content: content,
|
|
|
|
attachment_ids: attachment_ids,
|
|
|
|
attachment_ids: attachment_ids,
|
|
|
@ -334,7 +450,7 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
const url = `/api/v1/project_packages/${this.props.match.params.id}.json`;
|
|
|
|
const url = `/api/v1/project_packages/${this.props.match.params.id}.json`;
|
|
|
|
|
|
|
|
|
|
|
|
axios.put(url, {
|
|
|
|
axios.put(url, {
|
|
|
|
category: category,
|
|
|
|
category_id: category,
|
|
|
|
title: title,
|
|
|
|
title: title,
|
|
|
|
content: content,
|
|
|
|
content: content,
|
|
|
|
attachment_ids: attachment_ids,
|
|
|
|
attachment_ids: attachment_ids,
|
|
|
@ -397,12 +513,32 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setcategory=(value)=>{
|
|
|
|
setcategory=(value)=>{
|
|
|
|
|
|
|
|
if(value===undefined||value===null||value===""){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
categorytypes:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
categorytypes:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
category:value
|
|
|
|
category:value
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
settitlefun=(e)=>{
|
|
|
|
settitlefun=(e)=>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(e.target.value===undefined||e.target.value===null||e.target.value===""){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
titletypes:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
titletypes:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
title:e.target.value
|
|
|
|
title:e.target.value
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -410,30 +546,77 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onChangemin_prices=(e)=>{
|
|
|
|
onChangemin_prices=(e)=>{
|
|
|
|
|
|
|
|
this.props.setcheckout()
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
min_price:e.target.value
|
|
|
|
min_price:e.target.value
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onChangemax_prices=(e)=>{
|
|
|
|
onChangemax_prices=(e)=>{
|
|
|
|
|
|
|
|
this.props.setcheckout()
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
max_price:e.target.value
|
|
|
|
max_price:e.target.value
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onChangeContact_name=(e)=>{
|
|
|
|
onChangeContact_name=(e)=>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(e.target.value===undefined||e.target.value===""||e.target.value===null){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
contact_nametype:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
contact_nametype:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
contact_name:e.target.value
|
|
|
|
contact_name:e.target.value
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onChangeContact_phone=(e)=>{
|
|
|
|
onChangeContact_phone=(e)=>{
|
|
|
|
|
|
|
|
let {modalCancel}=this.state;
|
|
|
|
|
|
|
|
if(modalCancel===true){
|
|
|
|
|
|
|
|
if(e.target.value===undefined||e.target.value===null||e.target.value===""){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
contact_phonetype:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
contact_phonetype:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(checkPhone(e.target.value)===false){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
contact_phonetypes:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
contact_phonetypes:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
contact_phone:e.target.value
|
|
|
|
contact_phone:e.target.value
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onChangeCode=(e)=>{
|
|
|
|
onChangeCode=(e)=>{
|
|
|
|
|
|
|
|
if(e.target.value===undefined||e.target.value===""||e.target.value===null){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
codeypes:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
codeypes:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
code:e.target.value
|
|
|
|
code:e.target.value
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -461,6 +644,8 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
{name:"人工智能",value:"ai"},
|
|
|
|
{name:"人工智能",value:"ai"},
|
|
|
|
{name:"其他",value:"other"},
|
|
|
|
{name:"其他",value:"other"},
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
|
|
|
|
|
|
|
|
<div className="mb20 touchSelect">
|
|
|
|
<div className="mb20 touchSelect">
|
|
|
@ -479,9 +664,10 @@ 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">
|
|
|
|
{categorylist.map((item,key)=>{
|
|
|
|
<li className={category===undefined?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} onClick={()=>this.setcategory(undefined)}>全部</li>
|
|
|
|
|
|
|
|
{this.state.categories.map((item,key)=>{
|
|
|
|
return(
|
|
|
|
return(
|
|
|
|
<li key={key} className={category===item.value?"shaiItem shixun_repertoire active borderccc":"shaiItem shixun_repertoire borderccc"} value={item.value} onClick={()=>this.setcategory(item.value)}>{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>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})}
|
|
|
|
})}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -496,7 +682,7 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
value={title} onInput={this.settitlefun}/>
|
|
|
|
value={title} onInput={this.settitlefun}/>
|
|
|
|
{this.state.titletypes===true?<div className={"color-red mt10"}>不能为空</div>:""}
|
|
|
|
{this.state.titletypes===true?<div className={"color-red mt10"}>不能为空</div>:""}
|
|
|
|
<MDEditors ref={this.contentMdRef} placeholder="请填写清晰完整的需求内容" mdID={'courseContentMD'} refreshTimeout={1500}
|
|
|
|
<MDEditors ref={this.contentMdRef} placeholder="请填写清晰完整的需求内容" mdID={'courseContentMD'} refreshTimeout={1500}
|
|
|
|
watch={false} className="courseMessageMD" initValue={this.state.content}></MDEditors>
|
|
|
|
watch={false} className="courseMessageMD" initValue={this.state.content} setcheckoutcontent={()=>this.setcheckoutcontent()}></MDEditors>
|
|
|
|
{/* 请求status 422 */}
|
|
|
|
{/* 请求status 422 */}
|
|
|
|
{this.state.contenttypes===true?<div className={"color-red"}>不能为空</div>:""}
|
|
|
|
{this.state.contenttypes===true?<div className={"color-red"}>不能为空</div>:""}
|
|
|
|
<div className="df uploadBtn">
|
|
|
|
<div className="df uploadBtn">
|
|
|
@ -611,7 +797,8 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
{this.state.contact_nametype===true?<div className={"color-red ml100"}>不能为空</div>:""}
|
|
|
|
{this.state.contact_nametype===true?<div className={"color-red ml100"}>不能为空</div>:""}
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
{modalCancel===false?<p className="clearfix mb20 shaiContent">
|
|
|
|
|
|
|
|
|
|
|
|
{modalCancel===false&&this.props.current_user.phone!=null?<p className="clearfix mb20 shaiContent">
|
|
|
|
<span className="shaiTitle fl mt5 ml25">手机号:</span>
|
|
|
|
<span className="shaiTitle fl mt5 ml25">手机号:</span>
|
|
|
|
<Input
|
|
|
|
<Input
|
|
|
|
className={"fafafas fl"}
|
|
|
|
className={"fafafas fl"}
|
|
|
@ -625,7 +812,7 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</p>:""}
|
|
|
|
</p>:""}
|
|
|
|
{this.state.current_userphonetype===true?<div className={"color-red ml100"}>不能为空</div>:""}
|
|
|
|
{this.state.current_userphonetype===true?<div className={"color-red ml100"}>不能为空</div>:""}
|
|
|
|
{modalCancel===true?<p className="clearfix mb20 shaiContent">
|
|
|
|
{modalCancel===true||this.props.current_user.phone===null?<p className="clearfix mb20 shaiContent">
|
|
|
|
<span className="shaiTitle mt5 fl">
|
|
|
|
<span className="shaiTitle mt5 fl">
|
|
|
|
<span className="shaiTitle fl mt5 ml25">
|
|
|
|
<span className="shaiTitle fl mt5 ml25">
|
|
|
|
{/*未注册才显示!*/}
|
|
|
|
{/*未注册才显示!*/}
|
|
|
|