Commit 2c25c92c authored by wangwei's avatar wangwei

神策

parent 933cee7d
......@@ -30,6 +30,12 @@ export default {
},
methods: {
onPageReload: function () {
this.$sa.track('buttonClick',{
tabTitle:'授权',
moduleTitle:'授权',
buttonType:'重新授权',
buttonName:'重新授权'
});
window.location.reload()
}
}
......
......@@ -122,6 +122,8 @@
}
this.time=30;
this.timeO();
this.$sa.track('clickSendcode',{});
sendMobileCodeApi(json).then(res=>{
if(res === '操作成功'){
Toast('验证码已发送');
......@@ -143,6 +145,7 @@
}
},
bindMobile(){
this.$sa.track('clickSignUp',{});
if(this.flag){
this.flag = false;
if(this.msgCode===''||!this.msgCode) {
......
......@@ -388,6 +388,14 @@
});
}
this.$sa.track('viewCourseDetail',{
courseID:this.groupDetail.id,
courseCate:this.groupDetail.course_type === 1 ? '体验课' : '正式课',
lessonNumber:this.groupDetail.watch_num,
courseTitle:this.groupDetail.name,
coursePrice:this.groupDetail.original_price/100,
discountPrice:this.groupDetail.current_price/100
});
if(this.groupDetail.goods_type === 2){
if(localStorage.getItem('cc_token')){
getStatusWechatApi({goods_id:this.shopId}).then(res=>{
......
......@@ -3,7 +3,7 @@
<div class="banner-block">
<swiper :options="swiperOption" class="banner" ref="mySwiper">
<swiper-slide v-for="(data,index) in bannerList" :key="index">
<img class="banner" :src="data.url+'?imageslim'" @click="toBannerUrl(data.link)">
<img class="banner" :src="data.url+'?imageslim'" @click="toBannerUrl(data)">
</swiper-slide>
</swiper>
</div>
......@@ -116,16 +116,39 @@
},
methods:{
toOld(e){
this.$sa.track('buttonClick',{
tabTitle:'首页',
moduleTitle:'功能按钮',
buttonType:'板块按钮',
buttonName:'晚安电台'
});
// this.$sa.quick('trackHeatMap',e.srcElement)
window.location.href = 'https://appanqlfkth3717.h5.xiaoeknow.com/content_page/eyJ0eXBlIjozLCJyZXNvdXJjZV90eXBlIjoiIiwicmVzb3VyY2VfaWQiOiIiLCJwcm9kdWN0X2lkIjoicF81YjE0YjdjMjdjNDZiX2Rvd0xicDc1IiwiYXBwX2lkIjoiYXBwYU5RTGZrdEgzNzE3In0?state=2f12ab00cbc58f98cdc8193c8151437f_Sc7T3q'
},
toBannerUrl(data){
window.location.href = data
this.$sa.track('adClick',{
adTitle:data.title,
adID:data.link,
adPage:'首页'
});
window.location.href = data.link
},
toHear(){
this.$sa.track('buttonClick',{
tabTitle:'首页',
moduleTitle:'功能按钮',
buttonType:'板块按钮',
buttonName:'磨耳朵'
});
this.$router.push({name:'collection'})
},
toNewUrl(){
this.$sa.track('buttonClick',{
tabTitle:'首页',
moduleTitle:'课程',
buttonType:'没课banner',
buttonName:'没有更多课程'
});
window.location.href = this.newUrl
},
initPage(){
......@@ -160,6 +183,12 @@
})
},
toGoodsList(){
this.$sa.track('buttonClick',{
tabTitle:'首页',
moduleTitle:'课程',
buttonType:'板块按钮',
buttonName:'我的课程'
});
this.$router.push({name:'myGoodsList'})
},
dateParse(dateString){
......@@ -188,6 +217,12 @@
}
},
toMap(data) {
this.$sa.track('buttonClick',{
tabTitle:'首页',
moduleTitle:'课程',
buttonType:'课程',
buttonName:'进入课程'
});
if(this.dateCompare(new Date(),this.dateParse(data.start_at))<1){
this.$router.push({
name: 'map',
......
......@@ -317,6 +317,19 @@
},
// 切换主题
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:''
});
if(!flag){
this.parent_category_id = data.category_id;
this.$router.push({name:'map',query:{periods_id:this.periods_id,course_type:this.shopType,parent_category_id: this.parent_category_id}});
......
......@@ -46,6 +46,12 @@
})
},
clearBoth(){
this.$sa.track('buttonClick',{
tabTitle:'我的',
moduleTitle:'我的',
buttonType:'清楚缓存',
buttonName:'清楚缓存'
});
localStorage.clear();
Toast('清除成功')
......
......@@ -59,6 +59,12 @@
}
},
toMap(data){
this.$sa.track('buttonClick',{
tabTitle:'课程列表',
moduleTitle:'课程',
buttonType:'课程',
buttonName:'进入课程'
});
if(this.dateCompare(new Date(),this.dateParse(data.start_at))<1) {
this.$router.push({
name: 'map',
......
......@@ -80,6 +80,12 @@
})
},
shareOrder(data){
this.$sa.track('buttonClick',{
tabTitle:'订单',
moduleTitle:'订单',
buttonType:'分享',
buttonName:'团购分享'
});
this.showShare = true;
let shareData = JSON.parse(data.share_desc);
let that =this;
......
......@@ -6,20 +6,20 @@ import router from './router'
import store from './store'
import MintUI from 'mint-ui'
import VueClipboard from 'vue-clipboard2'
// import sa from'sa-sdk-javascript';
import sa from'sa-sdk-javascript';
import 'mint-ui/lib/style.css'
Vue.config.productionTip = false;
// Vue.prototype.$sa = sa;
// Vue.prototype.$sa.init({
// server_url: 'http://47.107.250.38:8106/sa?project=default', // 替换成自己的神策地址
// heatmap: {
// //是否开启点击图,默认 default 表示开启,自动采集 $WebClick 事件,可以设置 'not_collect' 表示关闭
// clickmap:'default',
// show_log: true, // 打印console,自己配置,可以看到自己是否踩点成功,以及
// //是否开启触达注意力图,默认 default 表示开启,自动采集 $WebStay 事件,可以设置 'not_collect' 表示关闭
// scroll_notice_map:'default',
// }
// });
Vue.prototype.$sa = sa;
Vue.prototype.$sa.init({
server_url: 'http://47.107.250.38:8106/sa?project=default', // 替换成自己的神策地址
heatmap: {
//是否开启点击图,默认 default 表示开启,自动采集 $WebClick 事件,可以设置 'not_collect' 表示关闭
clickmap:'default',
show_log: true, // 打印console,自己配置,可以看到自己是否踩点成功,以及
//是否开启触达注意力图,默认 default 表示开启,自动采集 $WebStay 事件,可以设置 'not_collect' 表示关闭
scroll_notice_map:'default',
}
});
Vue.use(MintUI);
Vue.use(VueClipboard);
/* eslint-disable no-new */
......
......@@ -5,6 +5,27 @@ import Router from 'vue-router'
import sa from'sa-sdk-javascript';
Vue.use(Router);
let browser = {
versions: function () {
let u = navigator.userAgent, app = navigator.appVersion;
return { //移动终端浏览器版本信息
trident: u.indexOf('Trident') > -1, //IE内核
presto: u.indexOf('Presto') > -1, //opera内核
webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') === -1, //火狐内核
mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
iPad: u.indexOf('iPad') > -1, //是否iPad
webApp: u.indexOf('Safari') == -1 //是否web应该程序,没有头部与底部
};
}(),
language: (navigator.browserLanguage || navigator.language).toLowerCase()
};
let ua = window.navigator.userAgent.toLowerCase();
const router =new Router({
routes: [
{
......@@ -162,47 +183,23 @@ const router =new Router({
});
router.beforeEach((to,from,next)=> {
// Vue.nextTick(() => {
// sa.quick("autoTrackSinglePage");
// });
let ua = window.navigator.userAgent.toLowerCase();
// 神策路由埋点
Vue.nextTick(() => {
sa.quick("autoTrackSinglePage");
});
// 判断是否是微信环境 排除本地
if(ua.match(/MicroMessenger/i) == 'micromessenger' || ua.match(/_SQ_/i) == '_sq_'){
if(to.name == 'noWechat'){
next({name:'index'});
}
}else{
if(to.name !== 'noWechat') {
if(to.name !== 'noWechat' && process.env.NODE_ENV === 'production') {
next({name:'noWechat'});
}
}
let browser = {
versions: function () {
let u = navigator.userAgent, app = navigator.appVersion;
return { //移动终端浏览器版本信息
trident: u.indexOf('Trident') > -1, //IE内核
presto: u.indexOf('Presto') > -1, //opera内核
webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') === -1, //火狐内核
mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
iPad: u.indexOf('iPad') > -1, //是否iPad
webApp: u.indexOf('Safari') == -1 //是否web应该程序,没有头部与底部
};
}(),
language: (navigator.browserLanguage || navigator.language).toLowerCase()
};
if (browser.versions.mobile) {//判断是否是移动设备打开。browser代码在下面
let ua = navigator.userAgent.toLowerCase();//获取判断用的对象
if (ua.match(/MicroMessenger/i) == "micromessenger") {
}else{
}
}
// 移动端判断
store.dispatch('isMobile',browser.versions.mobile);
// 默认title
document.title = '唱唱启蒙英语';
let goOn=function(){
if(localStorage.getItem('retUrl') && localStorage.getItem('retUrl') !== null && localStorage.getItem('retUrl') !== ''){
......
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