Commit f3808f1e by xuzhenghua

直播见

parent 05868f1d
......@@ -47,6 +47,28 @@ export default class PayOrder extends Component {
categoryList: [],
}
}
// 支付成功后,判断并重定向
redirectAfterPay = () => {
// status:0成功,1失败
const status = getParam('status');
const type = getParam('type');
const oid = getParam('oid');
const { history } = this.props;
if(status || type) {
if(parseInt(status, 10) === 0) {
// type订单类型 0普通订单 1团购 2小团 3砍价 4单集购买 5定金课定金 6定金课尾款
if(parseInt(type, 10) === 2) {
history.push(`/togroup?id=${oid}`);
}else {
history.push('/purchased');
}
}else {
Toast.info('支付异常', 2);
}
}
}
onChange = (value) => {
this.setState({
payType: value,
......@@ -178,6 +200,7 @@ export default class PayOrder extends Component {
}
componentDidMount() {
this.redirectAfterPay()
http.post(`${API['base-api']}/m/order/detail`, { order_id: this.state.orderId }).then((res) => {
console.log(res);
if (res.data.errno !== 200) {
......
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