Commit a0446621 by 姜雷

Merge branch 'develop' into test

parents 53654687 cdbe76a1
......@@ -50,6 +50,14 @@ class PublicCarApply extends Component {
showAllCategory: !showAllCategory,
}));
};
onChangeBeginDate = date => {
const { endDate } = this.state;
if (endDate && endDate.getTime() < date.getTime()) {
this.setState({ beginDate: date, endDate: date });
} else {
this.setState({ beginDate: date });
}
};
validateForm = () => {
if (!this.state.categoryId) {
Toast.fail('请选择用车类型');
......@@ -103,8 +111,10 @@ class PublicCarApply extends Component {
applyPublicCar(entity)
.then(res => {
console.log('res: ' + res);
Toast.success(res.msg);
const { history } = this.props;
this.resetForm();
Toast.success(res.msg);
history.replace('/publicCar/PublicCarList');
})
.catch(err => {
console.log('err: ' + err);
......@@ -191,11 +201,12 @@ class PublicCarApply extends Component {
<div className={styles.itemValue}>
<input
className={styles.itemInput}
type="text"
type="tel"
maxLength="5"
value={this.state.userCount}
onChange={e =>
this.setState({
userCount: e.target.value,
userCount: e.target.value.replace(/\D/g, ''),
})
}
/>
......@@ -206,7 +217,8 @@ class PublicCarApply extends Component {
<div className={styles.itemSelect}>
<DatePicker
value={this.state.beginDate}
onChange={date => this.setState({ beginDate: date })}
onChange={this.onChangeBeginDate}
minDate={new Date()}
>
<CustomChildren className={styles.DateInnerWrap} />
</DatePicker>
......@@ -216,9 +228,9 @@ class PublicCarApply extends Component {
<div className={styles.itemLabel}>用车结束时间</div>
<div className={styles.itemSelect}>
<DatePicker
className={styles.DateWrap}
value={this.state.endDate}
onChange={date => this.setState({ endDate: date })}
minDate={this.state.beginDate}
>
<CustomChildren className={styles.DateInnerWrap} />
</DatePicker>
......
......@@ -22,6 +22,7 @@ class PublicCar extends Component {
<NavLink
className={styles['footer-item']}
to="/publicCar/PublicCarApply"
replace
>
约车服务
</NavLink>
......@@ -29,6 +30,7 @@ class PublicCar extends Component {
<NavLink
className={styles['footer-item']}
to="/publicCar/PublicCarList"
replace
>
约车记录
</NavLink>
......
......@@ -185,10 +185,12 @@ class ReprtRepair extends Component {
.then(res => {
console.log(res);
const { data } = res;
const { history } = this.props;
console.log('resetForm');
this.resetApplyForm();
Toast.hide();
Toast.success(data.msg);
history.replace('/repair/RepairList');
})
.catch(err => {
console.log(err);
......
......@@ -27,11 +27,19 @@ class index extends Component {
</Switch>
</div>
<div className={styles.footer}>
<NavLink className={styles['footer-item']} to="/repair/ReprtRepair">
<NavLink
className={styles['footer-item']}
to="/repair/ReprtRepair"
replace
>
报修服务
</NavLink>
<span className={styles.line} />
<NavLink className={styles['footer-item']} to="/repair/RepairList">
<NavLink
className={styles['footer-item']}
to="/repair/RepairList"
replace
>
报修记录
</NavLink>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment