Commit 93e8a451 by wangshuo

单集购买

parent f6e72bf0
......@@ -99,11 +99,6 @@ class Detail extends Component {
})
}
}
showSingleBox = () => {
this.setState({
singleBox: true
})
}
// componentWillReceiveProps(nextProps) {
// let _this = this;
......@@ -309,7 +304,6 @@ class Detail extends Component {
{/*单集购买弹窗*/}
<Single
singleBox={this.state.singleBox}
showSingleBox={this.showSingleBox}
boxHide={this.boxHide}
data={this.state.singMess}
vcourseId={course_info.v_course_id}
......
......@@ -37,7 +37,7 @@ class Single extends Component {
componentWillReceiveProps(nextProps, nextContext) {
this.setState({
singleBox: nextProps.singleBox,
singleBox: nextProps.singleBox
})
}
......@@ -118,30 +118,32 @@ class Single extends Component {
clearInterval(_this.intervalPayStatus);
_this.intervalPayStatus = null;
// 获取课程类型
this.props.showSingleBox();
http.get(`${API['base-api']}/class_order_status/${getParam('oid')}`).then((res) => {
Toast.info(Number(res.data.data.errno));
if (Number(res.data.data.errno) === 200) {
// 正常购买单集成功
this.setState({
status: 6
status: 6,
showSingleBox: true,
})
} else if (Number(res.data.data.errno) === 201) {
// 0元参团
this.setState({
status: 4
status: 4,
showSingleBox: true,
})
} else if (Number(res.data.data.errno) === 202) {
// 0元购
this.setState({
status: 3
status: 3,
showSingleBox: true,
})
} else if (Number(res.data.data.errno) === 203) {
// 三天内特价
this.setState({
nowPrice: res.data.data.data.now_price,
laterPrice: res.data.data.data.three_day_later_price,
status: 2
status: 2,
showSingleBox: true,
})
} else {
Toast.info(res.data.data.msg, 2)
......@@ -184,29 +186,32 @@ class Single extends Component {
clearInterval(_this.intervalPayStatus);
_this.intervalPayStatus = null;
// 获取课程类型
this.props.showSingleBox();
http.get(`${API['base-api']}/class_order_status/${getParam('oid')}`).then((res) => {
if (Number(res.data.data.errno) === 200) {
// 正常购买单集成功
this.setState({
status: 6
status: 6,
showSingleBox: true,
})
} else if (Number(res.data.data.errno) === 201) {
// 0元参团
this.setState({
status: 4
status: 4,
showSingleBox: true,
})
} else if (Number(res.data.data.errno) === 202) {
// 0元购
this.setState({
status: 3
status: 3,
showSingleBox: true,
})
} else if (Number(res.data.data.errno) === 203) {
// 三天内特价
this.setState({
nowPrice: res.data.data.data.now_price,
laterPrice: res.data.data.data.three_day_later_price,
status: 2
status: 2,
showSingleBox: true,
})
} else {
Toast.info(res.data.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