Commit d335e805 by zhanghaozhe

Merge branch 'ml-statistics'

parents 314ab93a 87673eb6
...@@ -20,7 +20,7 @@ export default class Experience extends Component { ...@@ -20,7 +20,7 @@ export default class Experience extends Component {
</div> </div>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/r%402x.png" alt=""/> <img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/r%402x.png" alt=""/>
</div> </div>
<div className={'btn'} onClick={tryLearn}>立即体验</div> <div className={'btn'} onClick={() => {tryLearn(1)}}>立即体验</div>
</> </>
) )
: ( : (
......
...@@ -12,7 +12,7 @@ import ShareRank from "@components/detail/shareRank" ...@@ -12,7 +12,7 @@ import ShareRank from "@components/detail/shareRank"
import { http, getParam, SendMessageToApp, } from '@/utils' import { http, getParam, SendMessageToApp, } from '@/utils'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { Toast } from "antd-mobile" import { Toast } from "antd-mobile"
import {CallApp} from "@common/index" import { CallApp } from "@common/index"
@connect(state => ({ @connect(state => ({
user: state.user user: state.user
...@@ -35,6 +35,7 @@ class PythonDes extends Component { ...@@ -35,6 +35,7 @@ class PythonDes extends Component {
// 立即报名 // 立即报名
signUp = () => { signUp = () => {
this.statistics(3)
// 已登录 // 已登录
if (!this.props.user.hasError) { if (!this.props.user.hasError) {
this.toDetail() this.toDetail()
...@@ -44,7 +45,8 @@ class PythonDes extends Component { ...@@ -44,7 +45,8 @@ class PythonDes extends Component {
} }
// 立即体验、免费试学 // 立即体验、免费试学
tryLearn = () => { tryLearn = type => {
this.statistics(type)
// 已登录 // 已登录
if (!this.props.user.hasError) { if (!this.props.user.hasError) {
this.toLearn() this.toLearn()
...@@ -169,6 +171,11 @@ class PythonDes extends Component { ...@@ -169,6 +171,11 @@ class PythonDes extends Component {
} }
} }
// 统计
statistics = type => {
http.post(`${API.home}/web/it_click_num/${getParam('id')}`, {type})
}
shouldComponentUpdate(nextProps, nextState, nextContext) { shouldComponentUpdate(nextProps, nextState, nextContext) {
if (this.props.isAppUpdate !== nextProps.isAppUpdate) { if (this.props.isAppUpdate !== nextProps.isAppUpdate) {
...@@ -207,7 +214,10 @@ class PythonDes extends Component { ...@@ -207,7 +214,10 @@ class PythonDes extends Component {
</div> </div>
<div className={'btn__group'}> <div className={'btn__group'}>
<div className={'try__study'} onClick={this.tryLearn}>免费试学</div> <div className={'try__study'} onClick={() => {
this.tryLearn(2)
}}>免费试学
</div>
<div className={'sign__now'} onClick={this.signUp}>立即报名</div> <div className={'sign__now'} onClick={this.signUp}>立即报名</div>
</div> </div>
</div> </div>
......
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