Commit 8430b14d by xuzhenghua

push

parent 412ed223
......@@ -20,6 +20,7 @@ class ML extends Component {
super(props)
this.state = {
isPay: '',
buyTry: '',
userInfoList: [],
isAppUpdate: false,
backwardVersion: false, // 默认是新版本
......@@ -205,7 +206,8 @@ class ML extends Component {
} else {
this.setState({
backwardVersion: false,
isPay: data.course_info.is_pay
isPay: data.course_info.is_pay,
buyTry: data.course_info.buy_try
})
}
}
......@@ -213,7 +215,7 @@ class ML extends Component {
}
render() {
const {isPay, isAppUpdate, backwardVersion, isWxlogin} = this.state
const {isPay, buyTry, isAppUpdate, backwardVersion, isWxlogin} = this.state
// 旧版本 无论购买未购买 都跳转到 未购买的详情页; 如果是已购买就提示更新APP
return (
<div>
......@@ -225,11 +227,12 @@ class ML extends Component {
history={this.props.history}
isAppUpdate={isAppUpdate}
isPay={isPay}
buyTry={buyTry}
/>
)
}
{
(isPay === 1 && !getParam('version')) && <PythonStudy isAppUpdate={isAppUpdate} />
(isPay === 1 && !getParam('version')) && <PythonStudy isAppUpdate={isAppUpdate} buyTry={buyTry}/>
}
{
......
......@@ -186,7 +186,9 @@ class PythonDes extends Component {
}
getStatus = () => {
http.get(`${API['home']}/web/it_detail?course_id=${getParam('id')}`).then(res => {
const {buyTry} = this.props
http.get(`${API['home']}/web/it_detail?course_id=${getParam('id')}&buy_try=${buyTry}`).then(res => {
const {code, data, msg} = res.data
if (code == 200) {
this.setState({
......
......@@ -25,7 +25,9 @@ class PythonStudy extends Component {
}
fetchCourseDetail = () => {
http.get(`${API['home']}/web/it_detail?course_id=${getParam('id')}&is_pay=1`).then(res => {
const {buyTry} = this.props
http.get(`${API['home']}/web/it_detail?course_id=${getParam('id')}&is_pay=1&buy_try=${buyTry}`).then(res => {
const {data, code, msg} = res.data
if (code === 200) {
this.setState({
......
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