Commit e4f4ec62 by wangshuo

Merge branch 'dev'

parents e37d3402 9f286b47
...@@ -96,7 +96,7 @@ class BtnStatus extends Component { ...@@ -96,7 +96,7 @@ class BtnStatus extends Component {
}else{ }else{
http.get(`${API['base-api']}/m/cart/addtopreorder/[${getParam('id')}]`).then((res) => { http.get(`${API['base-api']}/m/cart/addtopreorder/[${getParam('id')}]`).then((res) => {
if (res.data.errno === 0) { if (res.data.errno === 0) {
this.props.history.push(`/order?id=[${getParam('id')}]`, {simple: 1}) this.props.history.push(`/order?id=${getParam('id')}`, {simple: 1})
} else { } else {
Toast.info(res.data.msg, 2); Toast.info(res.data.msg, 2);
} }
...@@ -145,7 +145,7 @@ class BtnStatus extends Component { ...@@ -145,7 +145,7 @@ class BtnStatus extends Component {
}else{ }else{
http.get(`${API['base-api']}/m/cart/addtopreorder/[${getParam('id')}]`).then((res) => { http.get(`${API['base-api']}/m/cart/addtopreorder/[${getParam('id')}]`).then((res) => {
if (res.data.errno === 0) { if (res.data.errno === 0) {
this.props.history.push(`/order?id=[${getParam('id')}]`, {simple: 1}); this.props.history.push(`/order?id=[${getParam('id')}]`, {bargain: 1});
} else { } else {
Toast.info(res.data.msg, 2); Toast.info(res.data.msg, 2);
} }
...@@ -248,7 +248,6 @@ class BtnStatus extends Component { ...@@ -248,7 +248,6 @@ class BtnStatus extends Component {
<button className='btn btn-s bg-FCCD05' onClick={e => this.toCart(1)}>加入购物车</button> <button className='btn btn-s bg-FCCD05' onClick={e => this.toCart(1)}>加入购物车</button>
} }
{/*<Link to='/order' className='btn btn-s bg-FD7700'>立即报名</Link>*/}
<span className='btn btn-s bg-FD7700' onClick={e => this.simpleCourse()}>立即报名</span> <span className='btn btn-s bg-FD7700' onClick={e => this.simpleCourse()}>立即报名</span>
</div> </div>
} }
......
...@@ -40,7 +40,7 @@ function OrderList(props) { ...@@ -40,7 +40,7 @@ function OrderList(props) {
return ( return (
<OrderItem {...item} src={image_name} id={course_id} key={index} info={Info} isaist={props.isaist}> <OrderItem {...item} src={image_name} id={course_id} key={index} info={Info} isaist={props.isaist}>
{ {
is_coupon === 1 ? ( (props.locationState && (props.locationState.type || props.locationState.simple)) ? (
<div className="order-prefer"> <div className="order-prefer">
<List key={index}> <List key={index}>
<Item <Item
...@@ -227,7 +227,7 @@ class Order extends Component { ...@@ -227,7 +227,7 @@ class Order extends Component {
Toast.info(res.data.msg, 2); Toast.info(res.data.msg, 2);
} }
}) })
} else if (this.props.location.state && this.props.location.state.simple === 1) { } else if (this.props.location.state && (this.props.location.state.simple === 1 || this.props.location.state.bargain === 1)) {
// 普通课程立即报名 不带 type = 1 // 普通课程立即报名 不带 type = 1
http.get(`${API['base-api']}/m/order/preorder`).then(res => { http.get(`${API['base-api']}/m/order/preorder`).then(res => {
if(res.data.errno === 200) { if(res.data.errno === 200) {
...@@ -243,6 +243,20 @@ class Order extends Component { ...@@ -243,6 +243,20 @@ class Order extends Component {
console.log(resList); console.log(resList);
let courseInfo = resList[0], let courseInfo = resList[0],
orderInfo = resList[1]; orderInfo = resList[1];
console.log(courseInfo.data);
console.log(orderInfo.data);
if(courseInfo.data.errno === 200) {
}else{
Toast.info(courseInfo.data.msg, 2);
return;
}
if(orderInfo.data.code === 200) {
}else{
Toast.info(courseInfo.data.msg, 2);
return;
}
this.groupPrice = orderInfo.data.data.course_info.pdd_group_info.price; this.groupPrice = orderInfo.data.data.course_info.pdd_group_info.price;
this.publicGetData(courseInfo); this.publicGetData(courseInfo);
this.publicLocalStorage(); this.publicLocalStorage();
...@@ -312,7 +326,7 @@ class Order extends Component { ...@@ -312,7 +326,7 @@ class Order extends Component {
pathname: '/orderinfo', pathname: '/orderinfo',
state: { state: {
...this.state.perfect, ...this.state.perfect,
type: this.props.location.state ? this.props.location.state.type : null, ...this.props.location.state,
id: getParam('id') id: getParam('id')
} }
} }
......
...@@ -95,6 +95,7 @@ const MyForm = withFormik({ ...@@ -95,6 +95,7 @@ const MyForm = withFormik({
if(FormBag.props.userInfo.id) { if(FormBag.props.userInfo.id) {
pathName = pathName + '?id=' + FormBag.props.userInfo.id; pathName = pathName + '?id=' + FormBag.props.userInfo.id;
} }
console.log(values);
if(same === 3) { if(same === 3) {
FormBag.props.history.replace( FormBag.props.history.replace(
pathName, pathName,
...@@ -113,7 +114,9 @@ const MyForm = withFormik({ ...@@ -113,7 +114,9 @@ const MyForm = withFormik({
Toast.info('保存成功!', undefined, undefined, false); Toast.info('保存成功!', undefined, undefined, false);
FormBag.props.history.replace( FormBag.props.history.replace(
pathName, pathName,
values {
...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