Commit effae382 by wangshuo

我的课程 练习题跳转

parent 441f6a64
......@@ -168,13 +168,21 @@ class OutLine extends Component {
}
{
introduce.is_aist && item.practice.title !== "" && item.is_open && introduce.is_baoming === 1 && !item.practice.is_tested &&
<Link to={`/campTest?keshi_id=${item.video_id}&qid=${item.practice.qid}`} className='camp camp_test' key={index}>
<Link to={{
pathname: `/campTest`,
search: `?keshi_id=${item.video_id}&qid=${item.practice.qid}`,
state: {from: `/detail${window.location.search}`}
}} className='camp camp_test' key={index}>
<span>课后练习:{item.practice.title}</span>
</Link>
}
{
introduce.is_aist && item.practice.title !== "" && item.is_open && introduce.is_baoming === 1 && item.practice.is_tested &&
<Link to={`/campResolve?keshi_id=${item.video_id}&qid=${item.practice.qid}`} className='camp camp_test' key={index}>
<Link to={{
pathname: `/campResolve`,
search: `?keshi_id=${item.video_id}&qid=${item.practice.qid}`,
state: {from: `/detail${window.location.search}`}
}} className='camp camp_test' key={index}>
<span>课后练习:{item.practice.title}</span>
<i className='exam exam_open' />
</Link>
......
import React, { PureComponent } from "react"
import React, { Component } from "react"
import VList from '@/common/v-list-base'
import './my-courses.scss'
import { isToday, format } from "date-fns"
......@@ -68,7 +68,7 @@ const Bottom = React.memo(({item}) => {
)
})
class MyCourses extends PureComponent {
class MyCourses extends Component {
list
......
......@@ -35,7 +35,7 @@ class CampResolve extends Component {
this.body = document.getElementsByTagName('body')[0];
this.body.style.position = 'static';
} else {
this.props.history.push(`/detail?id=${this.course_id}`,{href: '/purchased'})
this.props.history.push(`${this.props.location.state.from}`,{href: '/purchased'})
}
};
componentDidMount() {
......
......@@ -71,7 +71,7 @@ class CampTest extends Component {
this.body = document.getElementsByTagName('body')[0];
this.body.style.position = 'static';
} else {
this.props.history.push(`/detail?id=${this.course_id}`,{href: '/classify'})
this.props.history.push(`${this.props.location.state.from}`,{href: '/classify'})
}
};
// 选择答案
......
......@@ -37,7 +37,8 @@ class VideoCatalog extends Component {
(item.practice && item.practice.qid)
? <Link to={{
pathname: item.practice.is_tested ? '/campResolve' : '/campTest',
search: `?keshi_id=${item.id}&qid=${item.practice.qid}`
search: `?keshi_id=${item.id}&qid=${item.practice.qid}`,
state: {from: `/play/video${window.location.search}`}
}}>
<div className="exercise">
课后练习:{item.practice.title}
......
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