Commit 8430b14d by xuzhenghua

push

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