Commit 31d8686f by zhanghaozhe

搜索结果免费课程

parent d81aeb2a
...@@ -6,7 +6,14 @@ const VList = (props) => { ...@@ -6,7 +6,14 @@ const VList = (props) => {
<li <li
className="v-list-item" className="v-list-item"
onClick={() => { onClick={() => {
typeof props.toDetail === "function" && props.toDetail(props.id) if (typeof props.toDetail !== "function") {
return
}
if (props.needCourseInfo) {
props.toDetail(props.course)
} else {
props.toDetail(props.id)
}
}} }}
> >
<div className="content"> <div className="content">
......
...@@ -73,9 +73,13 @@ class SearchResult extends PureComponent { ...@@ -73,9 +73,13 @@ class SearchResult extends PureComponent {
this.setState({ value }) this.setState({ value })
} }
toCourseDetail = (id) => { toCourseDetail = ({ course_id, v_course_id }) => {
const { history } = this.props const { history } = this.props
history.push(`/detail?id=${id}`) history.push(
course_id === 0
? `/play/video?id=${v_course_id}`
: `/detail?id=${course_id}`
)
} }
handleScroll = throttle(() => { handleScroll = throttle(() => {
...@@ -186,7 +190,9 @@ class SearchResult extends PureComponent { ...@@ -186,7 +190,9 @@ class SearchResult extends PureComponent {
key={index} key={index}
info={Info} info={Info}
id={item["course_id"]} id={item["course_id"]}
course={item}
status={status} status={status}
needCourseInfo
/> />
) )
})} })}
......
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