Commit c4a7ed38 by FE

coupons to course detial midify

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