Commit d6c6d172 authored by wangwei's avatar wangwei

神策埋点

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