Commit c4a7ed38 by FE

coupons to course detial midify

parent 70426bdf
......@@ -3,13 +3,15 @@ import './coupons.scss'
import RedeemBar from "./RedeemBar";
import Coupon from './Coupon'
import { http, api, getParam } from '@/utils'
import { http, getParam } from '@/utils'
import { WithFullSize } from '@/HOCs'
import { Toast } from 'antd-mobile'
import { isEmpty } from 'lodash'
import { HeaderBar } from "@/common";
import {connect} from 'react-redux';
import {getCourses} from './../detail/actions';
@connect()
class UseCoupon extends PureComponent {
state = {
......@@ -132,7 +134,7 @@ class UseCoupon extends PureComponent {
}
useCoupon = val => {
const {history} = this.props
const {history, dispatch} = this.props
const coupon = this.state.couponList.find(item => item.id === val)
if (val) {
......@@ -141,7 +143,10 @@ class UseCoupon extends PureComponent {
if (coupon['ctype'] === 1) {
history.push(`/classify`)
} else {
history.push(`/detail?id=${coupon['limit_course']}`)
dispatch(getCourses(coupon['limit_course'], () => {
history.push(`/detail?id=${coupon['limit_course']}`);
return false;
}));
}
} else {
......
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