|
|
|
@ -6,9 +6,11 @@ import { handleDateString} from 'educoder';
|
|
|
|
|
import locale from 'antd/lib/date-picker/locale/zh_CN';
|
|
|
|
|
import MDEditors from '../MDEditors';
|
|
|
|
|
import PhoneModel from './PhoneModel';
|
|
|
|
|
import moment from 'moment'
|
|
|
|
|
import '../packageconcnet.css';
|
|
|
|
|
const { Search } = Input;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
@ -17,12 +19,25 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
modalCancel:false,
|
|
|
|
|
getverificationcodes:true,
|
|
|
|
|
seconds:35,
|
|
|
|
|
|
|
|
|
|
category:undefined,
|
|
|
|
|
title:undefined,
|
|
|
|
|
content:undefined,
|
|
|
|
|
attachment_ids:undefined,
|
|
|
|
|
deadline_at:undefined,
|
|
|
|
|
min_price:undefined,
|
|
|
|
|
max_price:undefined,
|
|
|
|
|
contact_name:undefined,
|
|
|
|
|
contact_phone:undefined,
|
|
|
|
|
code:undefined,
|
|
|
|
|
publish:false,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.contentMdRef.current.setValue("测试赋值")
|
|
|
|
|
}
|
|
|
|
|
//获取验证码;
|
|
|
|
|
getverificationcode =()=>{
|
|
|
|
@ -77,41 +92,72 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
}
|
|
|
|
|
//短信验证
|
|
|
|
|
SMSverification = () => {
|
|
|
|
|
// var url = `/accounts/get_verification_code.json`;
|
|
|
|
|
// axios.get((url), {
|
|
|
|
|
// params: {
|
|
|
|
|
// login: this.state.logins,
|
|
|
|
|
// type: 1,
|
|
|
|
|
// }
|
|
|
|
|
// }).then((result) => {
|
|
|
|
|
// //验证有问题{"status":1,"message":"success"}
|
|
|
|
|
// // console.log(result);
|
|
|
|
|
// this.openNotification("验证码已发送,请注意查收!",2);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// }).catch((error) => {
|
|
|
|
|
// console.log(error);
|
|
|
|
|
//
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
setclick=()=>{
|
|
|
|
|
const mdContnet = this.contentMdRef.current.getValue().trim();
|
|
|
|
|
console.log(mdContnet)
|
|
|
|
|
let {contact_phone,code}=this.state;
|
|
|
|
|
var url = `/account/get_verification_code.json`;
|
|
|
|
|
axios.get((url), {
|
|
|
|
|
params: {
|
|
|
|
|
login: contact_phone,
|
|
|
|
|
type: code,
|
|
|
|
|
}
|
|
|
|
|
}).then((result) => {
|
|
|
|
|
//验证有问题{"status":1,"message":"success"}
|
|
|
|
|
// console.log(result);
|
|
|
|
|
this.openNotification("验证码已发送,请注意查收!",2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onChangeTimePicker = (value, dateString) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
TimePickervalue: dateString
|
|
|
|
|
deadline_at: moment(handleDateString(dateString))
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setPublication=()=>{
|
|
|
|
|
setPublication=(type)=>{
|
|
|
|
|
const content = this.contentMdRef.current.getValue().trim();
|
|
|
|
|
// console.log(content)
|
|
|
|
|
// console.log(this.state.deadline_at._i)
|
|
|
|
|
this.setState({
|
|
|
|
|
publish:type
|
|
|
|
|
})
|
|
|
|
|
let types=type;
|
|
|
|
|
let {category,title,attachment_ids,deadline_at,min_price,max_price,contact_name,contact_phone,code}=this.state;
|
|
|
|
|
const url = `/api/v1/project_packages.json`;
|
|
|
|
|
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
category: category,
|
|
|
|
|
title: title,
|
|
|
|
|
content: content,
|
|
|
|
|
attachment_ids: attachment_ids,
|
|
|
|
|
deadline_at:deadline_at._i,
|
|
|
|
|
min_price:parseInt(min_price).toFixed(2),
|
|
|
|
|
max_price:parseInt(max_price).toFixed(2),
|
|
|
|
|
contact_name: contact_name,
|
|
|
|
|
contact_phone: contact_phone,
|
|
|
|
|
code:code,
|
|
|
|
|
publish:types
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
debugger
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.props.setPublicationfun()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
modalCancel=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
modalCancel:false
|
|
|
|
|
modalCancel:false,
|
|
|
|
|
contact_phone:undefined,
|
|
|
|
|
code:undefined,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -122,14 +168,67 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setcategory=(value)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
category:value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
settitlefun=(e)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
title:e.target.value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onChangemin_prices=(e)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
min_price:e.target.value
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
onChangemax_prices=(e)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
max_price:e.target.value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onChangeContact_name=(e)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
contact_name:e.target.value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onChangeContact_phone=(e)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
contact_phone:e.target.value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onChangeCode=(e)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
code:e.target.value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {modalCancel,seconds,getverificationcodes}=this.state;
|
|
|
|
|
let {modalCancel,seconds,getverificationcodes,
|
|
|
|
|
category,title}=this.state;
|
|
|
|
|
let categorylist=[
|
|
|
|
|
{name:"前端开发",value:"front"},
|
|
|
|
|
{name:"后端开发",value:"backend"},
|
|
|
|
|
{name:"移动开发",value:"mobile"},
|
|
|
|
|
{name:"数据库",value:"database"},
|
|
|
|
|
{name:"云计算和大数据",value:"cloud_compute_and_big_data"},
|
|
|
|
|
{name:"人工智能",value:"ai"},
|
|
|
|
|
{name:"其他",value:"other"},
|
|
|
|
|
]
|
|
|
|
|
return (
|
|
|
|
|
<div className="mb20">
|
|
|
|
|
<PhoneModel
|
|
|
|
|
modalsType={modalCancel}
|
|
|
|
|
modalCancel={this.modalCancel}
|
|
|
|
|
/>
|
|
|
|
|
{/*<PhoneModel*/}
|
|
|
|
|
{/*modalsType={modalCancel}*/}
|
|
|
|
|
{/*modalCancel={this.modalCancel}*/}
|
|
|
|
|
{/*/>*/}
|
|
|
|
|
<p className="clearfix ">
|
|
|
|
|
|
|
|
|
|
<div className={"stud-class-set pd30a0 coursenavbox edu-back-white"}>
|
|
|
|
@ -140,14 +239,11 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
{categorylist.map((item,key)=>{
|
|
|
|
|
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>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
@ -156,10 +252,11 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
<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 mb20" />
|
|
|
|
|
<Input placeholder="请输入需求标题,示例:美食类APP开发,最大限制60个字符" maxLength="60" className="input-100-40s mt5 fafafas mb20"
|
|
|
|
|
value={title} onInput={this.settitlefun}/>
|
|
|
|
|
|
|
|
|
|
<MDEditors ref={this.contentMdRef} placeholder="请填写清晰完整的需求内容" mdID={'courseContentMD'} refreshTimeout={5000}
|
|
|
|
|
watch={false} className="courseMessageMD" initValue={this.state.description}></MDEditors>
|
|
|
|
|
<MDEditors ref={this.contentMdRef} placeholder="请填写清晰完整的需求内容" mdID={'courseContentMD'} refreshTimeout={1500}
|
|
|
|
|
watch={false} className="courseMessageMD" initValue={this.state.content}></MDEditors>
|
|
|
|
|
{/* 请求status 422 */}
|
|
|
|
|
<div className="df uploadBtn">
|
|
|
|
|
<a href="javascript:void(0);" className="fl" onClick={() => window.$('#_file').click()}
|
|
|
|
@ -213,6 +310,7 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
placeholder="请选择任务的竞标截止日期"
|
|
|
|
|
className={"fafas"}
|
|
|
|
|
value={this.state.deadline_at}
|
|
|
|
|
onChange={this.onChangeTimePicker}
|
|
|
|
|
/>
|
|
|
|
|
</p>
|
|
|
|
@ -221,9 +319,9 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
<Input
|
|
|
|
|
className={"fafas"}
|
|
|
|
|
style={{"width": "260px"}}
|
|
|
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
value={this.state.min_price}
|
|
|
|
|
placeholder="支付多少费用(最低)"
|
|
|
|
|
onChange={this.onChangeTimePicker}
|
|
|
|
|
onInput={this.onChangemin_prices}
|
|
|
|
|
suffix={
|
|
|
|
|
<span >¥</span>
|
|
|
|
|
}
|
|
|
|
@ -232,9 +330,9 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
<Input
|
|
|
|
|
className={"fafas"}
|
|
|
|
|
style={{"width": "260px"}}
|
|
|
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
value={this.state.max_price}
|
|
|
|
|
placeholder="支付多少费用(最高)"
|
|
|
|
|
onChange={this.onChangeTimePicker}
|
|
|
|
|
onInput={this.onChangemax_prices}
|
|
|
|
|
|
|
|
|
|
suffix={
|
|
|
|
|
<span>¥</span>
|
|
|
|
@ -249,9 +347,9 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
<Input
|
|
|
|
|
className={"fafafas"}
|
|
|
|
|
style={{"width": "260px"}}
|
|
|
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
value={this.state.contact_name}
|
|
|
|
|
placeholder="请输入姓名"
|
|
|
|
|
onChange={this.onChangeTimePicker}
|
|
|
|
|
onInput={this.onChangeContact_name}
|
|
|
|
|
/>
|
|
|
|
|
</p>
|
|
|
|
|
<p className="clearfix mb20 shaiContent">
|
|
|
|
@ -259,18 +357,16 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
<Input
|
|
|
|
|
className={"fafafas fl"}
|
|
|
|
|
style={{"width": "260px"}}
|
|
|
|
|
format="YYYY-MM-DD HH:mm"
|
|
|
|
|
showTime={{ format: 'HH:mm' }}
|
|
|
|
|
value={this.state.contact_phone}
|
|
|
|
|
placeholder="请输入手机号"
|
|
|
|
|
disabled={true}
|
|
|
|
|
onChange={this.onChangeTimePicker}
|
|
|
|
|
/>
|
|
|
|
|
<a className="fl ml20">
|
|
|
|
|
<i className="iconfont icon-bianjidaibeijing font-26 color-blue" onClick={()=>this.editmodels()}></i>
|
|
|
|
|
</a>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p className="clearfix mb20 shaiContent">
|
|
|
|
|
{modalCancel===true?<p className="clearfix mb20 shaiContent">
|
|
|
|
|
<span className="shaiTitle mt5 fl">
|
|
|
|
|
<span className="shaiTitle fl mt5 ml25">
|
|
|
|
|
{/*未注册才显示!*/}
|
|
|
|
@ -279,10 +375,9 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
<Input
|
|
|
|
|
className={"fafafas fl"}
|
|
|
|
|
style={{"width": "260px"}}
|
|
|
|
|
format="YYYY-MM-DD HH:mm"
|
|
|
|
|
showTime={{ format: 'HH:mm' }}
|
|
|
|
|
value={this.state.contact_phone}
|
|
|
|
|
placeholder="请输入手机号码"
|
|
|
|
|
onChange={this.onChangeTimePicker}
|
|
|
|
|
onInput={this.onChangeContact_phone}
|
|
|
|
|
/>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
@ -290,28 +385,32 @@ class PackageIndexNEIBannerConcent extends Component {
|
|
|
|
|
<span>
|
|
|
|
|
<Search
|
|
|
|
|
style={{ width: 300 }}
|
|
|
|
|
value={this.state.code}
|
|
|
|
|
className="fafas"
|
|
|
|
|
placeholder="请输入验证码"
|
|
|
|
|
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()}
|
|
|
|
|
onInput={this.onChangeCode}
|
|
|
|
|
/>
|
|
|
|
|
</span>
|
|
|
|
|
<span>
|
|
|
|
|
|
|
|
|
|
{/*<Button type="primary" className="defalutSubmitbtn ml10 defalutSubmitbtnmodels">重新发送()</Button>*/}
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
<a className="fl mt13">
|
|
|
|
|
<span className="font-18 color-blue" onClick={()=>this.modalCancel()}>X</span>
|
|
|
|
|
</a>
|
|
|
|
|
</p>:""}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<div className="clearfix mt30 mb30">
|
|
|
|
|
<Button type="primary" className="defalutSubmitbtn fl mr20 defalutSubmitbtns" onClick={this.setPublication}>申请发布</Button>
|
|
|
|
|
<a className="defalutCancelbtns fl">保存</ a>
|
|
|
|
|
<Button type="primary" className="defalutSubmitbtn fl mr20 defalutSubmitbtns" onClick={()=>this.setPublication(true)}>申请发布</Button>
|
|
|
|
|
<a className="defalutCancelbtns fl" onClick={()=>this.setPublication(false)}>保存</ a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|