Commit a6bef5d7 by xuzhenghua

shiting

parent d7258b48
...@@ -18,6 +18,7 @@ import {bindActionCreators} from "redux"; ...@@ -18,6 +18,7 @@ import {bindActionCreators} from "redux";
import {delCountryNum} from './../country/countryRedux'; import {delCountryNum} from './../country/countryRedux';
import RedPacket from './redPacket'; import RedPacket from './redPacket';
import {Link} from "react-router-dom";
class Detail extends Component { class Detail extends Component {
...@@ -318,15 +319,26 @@ class Detail extends Component { ...@@ -318,15 +319,26 @@ class Detail extends Component {
} }
// 点击子组件试听按钮 // 点击子组件试听按钮
toAudition = () => { toAudition = (vCourseId,videoId) => {
const {user} = this.props const {user} = this.props
const uid = user && user.data && user.data.uid const uid = user && user.data && user.data.uid
if (!uid) { if (!uid) {
this.props.history.push('/passport/login') this.props.history.push('/passport/login')
} else { } else {
this.setState({ console.log(vCourseId,videoId)
auditionBox: true, if(videoId == '' || videoId == 0 || videoId == undefined){
return false;
}
http.post(`${API['base-api']}/sys/get_class_audition?video_id=${videoId}`).then((res) => {
if (res.data.errno == 200) {
this.props.history.push(`/play/video?id=${vCourseId + '&video_id=' + videoId}`)
}else {
Toast.info(res.data.msg, 2);
}
}) })
// this.setState({
// auditionBox: true,
// })
} }
} }
// 点击子组件单集购买按钮 // 点击子组件单集购买按钮
......
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