Commit 2898ac2b by FE

to buy in video

parent a1b3a3a3
......@@ -135,9 +135,11 @@ class Video extends Component {
// 直接购买
tobuy = () => {
http.get(`${API['base-api']}/m/cart/addtopreorder/[${getParam('id')}]`).then((res) => {
// 详情页单集购买到该页面,url中的id不是课程id
const { course={} } = this.state;
http.get(`${API['base-api']}/m/cart/addtopreorder/[${course.course_id}]`).then((res) => {
if (res.data.errno === 0) {
this.props.history.push(`/order?id=${getParam('id')}`, {simple: 1})
this.props.history.push(`/order?id=${course.course_id}`, {simple: 1})
} else {
Toast.info(res.data.msg, 2);
}
......
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