Commit d68ca51e by wangshuo

组件优化

parent e2ecada9
import React from 'react'
import './index.scss'
import React, {Component} from 'react'
import './index.scss';
const HeaderBar = (props) => {
return (
<div className="detail-header" style={{...props.style}}>
<i className={`iconfont ${props.arrow ? 'iconiconfront-68' : ''} return`} onClick={props.goBack}></i>
<span className='herder'>{props.title}</span>
<i className={`iconfont ${props.cart ? 'icongouwuche-xianxing' : ''} shopping-cart`} onClick={props.goShop}></i>
</div>
);
class HeaderBar extends Component {
constructor(props) {
super(props);
}
goBack = () => {
window.history.go(-1);
}
goShop = () => {
location.replace('/shopcart');
}
render() {
return (
<div className="detail-header" style={{...this.props.style}}>
<i className={`iconfont ${this.props.arrow ? 'iconiconfront-68' : ''} return`} onClick={this.goBack}></i>
<span className='herder'>{this.props.title}</span>
<i className={`iconfont ${this.props.cart ? 'icongouwuche-xianxing' : ''} shopping-cart`} onClick={this.goShop}></i>
</div>
);
}
};
export default HeaderBar;
......@@ -79,7 +79,7 @@ const MyForm = withFormik({
return;
}
Toast.info('保存成功!', undefined, undefined, false);
FormBag.props.history.push({
FormBag.props.history.replace({
pathname: '/order',
state: values
});
......
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