Commit d6c6d172 authored by wangwei's avatar wangwei

神策埋点

parent 6390d9fc
......@@ -118,7 +118,6 @@
import {getwechatParam,getGoodsDetailApi,getGroupDetailApi,getStatusWechatApi,getUserDetailApi} from "../../service/api";
import refBg from '../../assets/refBg.png'
import moreUrl from '../../assets/moreIcon.png'
import refIcon from '../../assets/refIcon.png'
import weChatIcon from '../../assets/wechatIcon.png'
import weChatQrUrl from '../../assets/weChatCode.png'
import closeUrl from '../../assets/closemy.png'
......@@ -383,14 +382,18 @@
_this.groupDetail.share_desc.refImg[0].url = avatarUrl;
});
}
let invite = this.$route.query.invite_code;
this.$sa.track('viewCourseDetail',{
goodsID:this.groupDetail.id,
courseCate:this.groupDetail.course_type === 1 ? '体验课' : '正式课',
lessonNumber:this.groupDetail.watch_num,
goodsName:this.groupDetail.name,
coursePrice:this.groupDetail.original_price/100,
discountPrice:this.groupDetail.current_price/100
discountPrice:this.groupDetail.current_price/100,
courseID:this.groupDetail.course_id,
courseName:'',
salesType:invite?invite.split('-')[1]:'null',
salesID:invite?invite.split('-')[2]:0
});
if(this.groupDetail.goods_type === 2){
if(localStorage.getItem('cc_token')){
......
......@@ -174,6 +174,9 @@
return {
shopType:this.$route.query.course_type,
diaBGI:diaBGI,
course_id:'',
push_time:'',
course_name:'',
nextUnitUrl:nextUnitUrl,
periods_id:this.$route.query.periods_id,
parent_category_id:this.$route.query.parent_category_id,
......@@ -193,7 +196,6 @@
slideChangeTransitionStart: function(){
if(this.activeIndex >= that.swiper.slides.length - 4 && that.more){
that.swiper.slidePrev();
}
},
resize: function () {
......@@ -293,6 +295,13 @@
},
// 进入课程
goDetail(){
// 神策埋点 选择课时
this.$sa.track('StartCourse',{
elementID:this.thisLesson.id.toString(),
is_view_today:''
});
if(this.thisLesson.content.tips){
let query = {
periods_id:this.periods_id,
......@@ -312,23 +321,16 @@
course_type:this.$route.query.course_type,
type:'1'
};
this.$router.push({name:'lesson',query:query})
// this.$router.push({name:'lesson',query:query})
}
},
// 切换主题
changeCateGory(data,flag){
// 神策埋点
// 神策埋点 选择主题
this.$sa.track('selectCategory',{
themeID:data.category_id,
themeName:data.category_name,
courseID:'',
courseCate:this.$route.query.course_type == 0 ? '正式课' : '体验课',
lessonNumber:'',
courseTitle:'',
periodID:'',
periodName:'',
teacherID:'',
teacherName:''
themeID:data.category_id.toString(),
themeName:data.category_name.toString(),
courseID:this.course_id.toString(),
});
if(!flag){
this.parent_category_id = data.category_id;
......@@ -342,10 +344,18 @@
getLessonDetailApi(this.periods_id,data.id,data.ele_id).then(res=>{
res.content = JSON.parse(res.content);
this.thisLesson = res;
this.thisLesson.id = data.id;
this.thisLesson.id = data.ele_id.toString();
this.thisLesson.domTitle = data.name;
this.thisLesson.day = i;
this.popupVisible=true;
this.push_time = data.push_time;
// 神策埋点 选择课时
this.$sa.track('selectElement',{
elementID:data.ele_id.toString(),
elementName:data.name.toString(),
themeID:this.parent_category_id.toString(),
courseID:this.course_id.toString()
});
})
}else{
Toast('课程还未开始哦')
......@@ -358,6 +368,7 @@
this.getUnitList()
}
},
// 获取列表
getUnitList(){
getCourseListApi(this.periods_id).then(res=>{
this.unitList = [];
......@@ -391,15 +402,20 @@
})
})
},
// 获取课程
getLessonList(data){
getLessonListApi(this.periods_id+'/v2',{category_id:this.parent_category_id}).then(res=>{
if(this.course_id !== res.periods_info.course_id){
this.course_id = res.periods_info.course_id;
this.course_name = res.periods_info.title;
// 神策埋点 进入课程
this.$sa.track('EnterCourse',{
courseID:this.course_id
});
}
this.lessonList=[];
this.hpLessonList = [];
if(res.list.length<1){
this.noLesson = true
}else{
this.noLesson = false
}
this.noLesson = !!res.list.length<1;
let list = [];
let x = 0;
for(let i = 0; i < res.list.length; i ++ ){
......
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