Commit d7ae3181 by zhanghaozhe

领取页

parent b7a878ef
......@@ -53,7 +53,6 @@
.barrage-list {
height: px2rem(30);
overflow: hidden;
li {
height: px2rem(30);
......@@ -205,7 +204,6 @@
.person-left {
display: flex;
align-items: center;
width: px2rem(200);
overflow: hidden;
.avatar {
......@@ -225,7 +223,6 @@
}
.person-right {
margin-right: 58px;
.time {
@include px2px(font-size, 22);
......
......@@ -19,6 +19,7 @@ class GiveCourseAssistance extends Component {
scrollContainer = null
cloned = false
animationId = 0
swiper = null
state = {
allCourse: [],
......@@ -57,6 +58,7 @@ class GiveCourseAssistance extends Component {
componentWillUnmount() {
window.cancelAnimationFrame(this.animationId)
this.swiper && this.swiper.destroy()
}
......@@ -95,7 +97,8 @@ class GiveCourseAssistance extends Component {
})
}
inviteFriends = () => {
getCourse = () => {
_czc && _czc.push(["_trackEvent", '中间页免费领取课程', '中间页免费领取课程'])
const {history, user} = this.props
if (browser.isWeixin) {
if (user.hasError) {
......@@ -126,7 +129,8 @@ class GiveCourseAssistance extends Component {
}
toGetDetail = courseId => {
_czc && _czc.push(["_trackEvent", `课程id=${courseId}`, '中间页查看课程详情'])
window.location.href = this.state.activeUrl
}
displayScrollArea = () => {
......@@ -169,12 +173,13 @@ class GiveCourseAssistance extends Component {
}
setupHeadItemsSwiper = () => {
new Swiper('.barrage-wrapper', {
this.swiper = new Swiper('.barrage-wrapper', {
autoplay: {
reverseDirection: true
delay: 5000
},
direction: 'vertical',
loop: true
loop: true,
allowTouchMove: false
})
}
......@@ -223,6 +228,7 @@ class GiveCourseAssistance extends Component {
<div className="bg-image" style={{backgroundImage: `url(${courseImg})`}}>
{
isAwards == 1 && <button className="ranklist-btn" type="button" onClick={() => {
_czc && _czc.push(["_trackEvent", '中间页大奖排行榜', '中间页面大奖排行榜'])
history.push(`/active/givecourse?activename=${activeName}`)
}}>大奖排行榜>></button>
}
......@@ -241,11 +247,16 @@ class GiveCourseAssistance extends Component {
{
getBtnStatus === 1
?
<button type="button" className="btn-get" disabled={disabled} click="btnGet">
<button type="button" className="btn-get" disabled={disabled} onClick={this.getCourse}>
免费领取
</button>
:
<button type="button" className="btn-get" onClick={this.inviteFriends}>
<button type="button" className="btn-get" onClick={() => {
_czc && _czc.push(["_trackEvent", '中间页继续邀请好友', '中间页继续邀请好友'])
this.setState({
friendStatus: true
})
}}>
继续邀请好友
</button>
}
......@@ -289,6 +300,7 @@ class GiveCourseAssistance extends Component {
<div className="btn-morewap">
<button type="button" className="btn-more" onClick={() => {
_czc && _czc.push(["_trackEvent", '中间页参与活动领更多课时', '中间页参与活动领更多课时'])
this.setState({activeStatus: true})
}}>参与活动领更多课时
</button>
......
......@@ -139,6 +139,8 @@ class GiveCourses extends Component {
<li className='course-teacher'><span className='tag'>讲师</span>{course["teachers"]}</li>
<li className='course-time'><span className='tag'>开课时间</span>{course["start_time"]}</li>
<li className='toreceive' onClick={() => {
_czc && _czc.push(["_trackEvent", `课程id=${course.course_id}`, '免费领取课程'])
console.log(course.course_id)
this.setState({isShow: true})
}}>免费领取课程
</li>
......
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