Commit c6432ef6 by Sweet Zhang

添加统计代码,解决冲突

parent f244c8fd
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
const queryString = hash.substring(queryIndex + 1); const queryString = hash.substring(queryIndex + 1);
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
const r = queryString.match(reg); const r = queryString.match(reg);
console.log('匹配结果', r); // console.log('匹配结果', r);
if (r != null) return decodeURIComponent(r[2]); if (r != null) return decodeURIComponent(r[2]);
return null; return null;
} }
const statusBarHeight = getQueryParam('statusBarHeight'); const statusBarHeight = getQueryParam('statusBarHeight');
console.log('状态栏高度', statusBarHeight); // console.log('状态栏高度', statusBarHeight);
if (statusBarHeight) { if (statusBarHeight) {
const height = parseInt(statusBarHeight, 10); const height = parseInt(statusBarHeight, 10);
if (!isNaN(height) && height > 0) { if (!isNaN(height) && height > 0) {
...@@ -56,9 +56,9 @@ ...@@ -56,9 +56,9 @@
var script = document.createElement('script'); var script = document.createElement('script');
script.src = 'https://res2.wx.qq.com/open/js/jweixin-1.6.0.js'; script.src = 'https://res2.wx.qq.com/open/js/jweixin-1.6.0.js';
document.head.appendChild(script); document.head.appendChild(script);
console.log('加载微信JS-SDK'); // console.log('加载微信JS-SDK');
} else { } else {
console.log('小程序Webview环境,不加载微信JS-SDK'); // console.log('小程序Webview环境,不加载微信JS-SDK');
} }
}); });
</script> </script>
......
// main.js
import App from './App'; import App from './App';
import { scrmUrl } from "./environments/environment";
import tracker from '@/util/tracker/tracker.js'
// // #ifndef VUE3 // 从 track-events.js 导入映射
// import Vue from 'vue' import {
// App.mpType = 'app' FUNCTION_EVENT_MAP,
// const app = new Vue({ FUNCTION_MODULE_MAP,
// ...App FUNCTION_NAMES,
// }) MODULE_NAMES
} from '@/util/tracker/track-events.js'
// ====== 导入 pages.json 自动生成模块映射 ======
import pagesJson from '@/pages.json'
// app.$mount() function buildModuleMap() {
// // #endif const map = {}
const keywordList = []
function processPages(pages, root = '') {
(pages || []).forEach((page) => {
const meta = (page.style && page.style.meta) || {}
if (meta.moduleCode) {
const fullPath = '/' + root + page.path
map[fullPath] = {
moduleType: meta.moduleCode,
moduleName: meta.moduleName || meta.moduleCode
}
keywordList.push({
keyword: meta.moduleCode,
moduleType: meta.moduleCode,
moduleName: meta.moduleName || meta.moduleCode
})
if (meta.moduleName && meta.moduleName !== meta.moduleCode) {
keywordList.push({
keyword: meta.moduleName,
moduleType: meta.moduleCode,
moduleName: meta.moduleName
})
}
}
})
}
processPages(pagesJson.pages)
;(pagesJson.subPackages || []).forEach((sub) => {
const root = sub.root || ''
processPages(sub.pages, root + '/')
})
return { exact: map, keyword: keywordList }
}
const moduleMapData = buildModuleMap()
// ====== 初始化 tracker ======
tracker.init({
reportUrl: `${scrmUrl}/scrm-api/log/client/batch/save`,
projectType: 'CFFP',
clientType: 'H5',
source: 'direct', // 访问来源,可从 URL 参数获取
// 注入功能映射
functionEventMap: FUNCTION_EVENT_MAP,
functionModuleMap: FUNCTION_MODULE_MAP,
functionNameMap: FUNCTION_NAMES,
// 模块映射
moduleMap: moduleMapData.exact,
keywordMap: moduleMapData.keyword,
debug: process.env.NODE_ENV === 'development',
dryRun: true // ✅ 开启模拟模式(只打印不上报)
})
// #ifdef VUE3 // #ifdef VUE3
import { createSSRApp } from 'vue' import { createSSRApp } from 'vue';
export function createApp() { export function createApp() {
const app = createSSRApp(App) const app = createSSRApp(App);
return {
app // 挂载到全局
} app.config.globalProperties.$tracker = tracker;
return {
app
};
} }
// #endif // #endif
//#ifdef H5 // #ifndef VUE3
window.sessionStorage.setItem('firstEntryUrl',window.location.href.split('#')[0]) import Vue from 'vue';
App.mpType = 'app';
const app = new Vue({
...App
});
app.$mount();
// #endif // #endif
// #ifdef H5
if (typeof window !== 'undefined' && window.sessionStorage) {
window.sessionStorage.setItem('firstEntryUrl', window.location.href.split('#')[0]);
}
// #endif
...@@ -834,7 +834,6 @@ ...@@ -834,7 +834,6 @@
} }
if(this.courseInfo.fileIntroduce){ if(this.courseInfo.fileIntroduce){
this.imagesList = this.extractImageUrls(this.courseInfo.fileIntroduce) this.imagesList = this.extractImageUrls(this.courseInfo.fileIntroduce)
console.log(' this.imagesList', this.imagesList);
} }
//this.courseInfo.serviceContent = res['data']['data']['filePathOss']; //this.courseInfo.serviceContent = res['data']['data']['filePathOss'];
this.lecturerId = res['data']['data']['fileLecturerId']; this.lecturerId = res['data']['data']['fileLecturerId'];
...@@ -1099,7 +1098,6 @@ ...@@ -1099,7 +1098,6 @@
// imgUrl: this.courseInfo.displayImage, //图片 // imgUrl: this.courseInfo.displayImage, //图片
imgUrl: this.courseInfo.shareImg, //图片 imgUrl: this.courseInfo.shareImg, //图片
} }
console.log('data', data);
//安卓机型获取当前页面路径 //安卓机型获取当前页面路径
let url = window.location.href.split('#')[0]; let url = window.location.href.split('#')[0];
...@@ -1220,7 +1218,7 @@ ...@@ -1220,7 +1218,7 @@
return return
} }
if(res.data.userIsActive&&res.data.userIsActive!=2){ if(res.data.userIsActive&&res.data.userIsActive!=2){
this.$refs.restrictedTip.close() this.$refs.restrictedTip?.close()
uni.removeStorageSync('userIsActive') uni.removeStorageSync('userIsActive')
} }
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo)) uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo))
......
...@@ -542,7 +542,6 @@ ...@@ -542,7 +542,6 @@
}); });
}, },
courseList() { courseList() {
console.log('执行了');
const param = { const param = {
queryName: this.queryName, queryName: this.queryName,
courseClassify: this.courseClassify courseClassify: this.courseClassify
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<view class="featureContent"> <view class="featureContent">
<!-- 顶部快捷菜单 --> <!-- 顶部快捷菜单 -->
<view class="nav_wrapper"> <view class="nav_wrapper">
<view class="nav_content" v-for="featureItem in featureLists" :key="featureItem.key" <view class="nav_content" v-for="featureItem in featureLists" :key="featureItem.key" :data-track="featureItem.trackCode"
@click="featureSelect(featureItem)"> @click="featureSelect(featureItem)">
<view class="imgbox"> <view class="imgbox">
<view class="iconfont iconSize" :class="`${featureItem.icon}`"></view> <view class="iconfont iconSize" :class="`${featureItem.icon}`"></view>
...@@ -222,7 +222,8 @@ ...@@ -222,7 +222,8 @@
icon: 'icon-hezuo', icon: 'icon-hezuo',
link: '/myPackageA/applyFranchise/applyFranchise', link: '/myPackageA/applyFranchise/applyFranchise',
isOpen: true, isOpen: true,
isApply:true isApply:true,
trackCode:"apply_join"
}, },
{ {
key: '07', key: '07',
...@@ -230,6 +231,7 @@ ...@@ -230,6 +231,7 @@
icon: 'icon-zhuanfa', icon: 'icon-zhuanfa',
link: '/pages/courselist/courselist', link: '/pages/courselist/courselist',
isOpen: true, isOpen: true,
trackCode:"share_product"
}, },
{ {
...@@ -238,7 +240,8 @@ ...@@ -238,7 +240,8 @@
icon: 'icon-yaoqing', icon: 'icon-yaoqing',
link: '/pages/inviteJoin/inviteJoin', link: '/pages/inviteJoin/inviteJoin',
isOpen: true, isOpen: true,
isJoin: true isJoin: true,
trackCode:"invite_join"
}, },
], ],
...@@ -314,7 +317,7 @@ ...@@ -314,7 +317,7 @@
}, },
onHide() { onHide() {
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$refs.courselist.$refs.sharePosterPop.closeDropdown() this.$refs.courselist?.$refs?.sharePosterPop?.closeDropdown?.()
}) })
}, },
onLoad(options) { onLoad(options) {
...@@ -393,10 +396,11 @@ ...@@ -393,10 +396,11 @@
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo)); uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo));
uni.setStorageSync('user_mobile', res.data.mobile) uni.setStorageSync('user_mobile', res.data.mobile)
if(cffp_userInfo.partnerType){ if(cffp_userInfo.partnerType){
this.featureLists = [{key: '00',name: '成交订单',icon:'icon-dingdan',link: '/pages/saleCourseLists/saleCourseLists',isOpen: true,enName:'order'}, this.featureLists =
{key: '01',name: '佣金',icon: 'icon-yongjin',link: '/pages/pointsExchange/pointsExchange',isOpen: true,isJoin: true}, [{key: '00',name: '成交订单',icon:'icon-dingdan',link: '/pages/saleCourseLists/saleCourseLists',isOpen: true,enName:'order',trackCode:"view_order_list" },
{key: '07',name: '分享产品',icon: 'icon-zhuanfa',link: '/pages/courselist/courselist',isOpen: true}, {key: '01',name: '佣金',icon: 'icon-yongjin',link: '/pages/pointsExchange/pointsExchange',isOpen: true,isJoin: true,trackCode:"view_commission" },
{key: '04',name: '邀请加盟',icon: 'icon-yaoqing',link: '/pages/inviteJoin/inviteJoin',isOpen: true,isJoin: true}]; {key: '07',name: '分享产品',icon: 'icon-zhuanfa',link: '/pages/courselist/courselist',isOpen: true,trackCode:"share_product" },
{key: '04',name: '邀请加盟',icon: 'icon-yaoqing',link: '/pages/inviteJoin/inviteJoin',isOpen: true,isJoin: true,trackCode:"invite_join" }];
}else { }else {
this.featureLists =[ this.featureLists =[
{ {
...@@ -405,7 +409,8 @@ ...@@ -405,7 +409,8 @@
icon: 'icon-hezuo', icon: 'icon-hezuo',
link: '/myPackageA/applyFranchise/applyFranchise', link: '/myPackageA/applyFranchise/applyFranchise',
isOpen: true, isOpen: true,
isApply:true isApply:true,
trackCode:"apply_join"
}, },
{ {
key: '07', key: '07',
...@@ -413,6 +418,7 @@ ...@@ -413,6 +418,7 @@
icon: 'icon-zhuanfa', icon: 'icon-zhuanfa',
link: '/pages/courselist/courselist', link: '/pages/courselist/courselist',
isOpen: true, isOpen: true,
trackCode:"share_product"
}, },
{ {
...@@ -421,7 +427,8 @@ ...@@ -421,7 +427,8 @@
icon: 'icon-yaoqing', icon: 'icon-yaoqing',
link: '/pages/inviteJoin/inviteJoin', link: '/pages/inviteJoin/inviteJoin',
isOpen: true, isOpen: true,
isJoin: true isJoin: true,
trackCode:"invite_join"
}, },
] ]
......
...@@ -279,7 +279,6 @@ ...@@ -279,7 +279,6 @@
isShow: true, isShow: true,
identity: true identity: true
}, },
// {title:'育成团队',icon:'icon-yuchengguanxi',link:'/pages/personalCenter/myTeamIncubate',isOpen:true,isShow:true,identity: true},
], ],
}, { }, {
id: '03', id: '03',
...@@ -371,7 +370,6 @@ ...@@ -371,7 +370,6 @@
minorMenuLists: [ minorMenuLists: [
// {title:'我的邀请码',icon:'shareEcode',link:'',isOpen:true,isShow:true}, // {title:'我的邀请码',icon:'shareEcode',link:'',isOpen:true,isShow:true},
{ title: '我的卡包', icon: 'card', link: '', isOpen: true, isShow: false }, { title: '我的卡包', icon: 'card', link: '', isOpen: true, isShow: false },
// {title:'我的认证',icon:'myCertify',link:'/pages/myCertify/myCertify',isOpen:true,isShow:true},
{ title: '申请修改公司周边', icon: 'setting', link: '', isOpen: true, isShow: false }, { title: '申请修改公司周边', icon: 'setting', link: '', isOpen: true, isShow: false },
{ {
title: '我的消息', title: '我的消息',
......
...@@ -344,11 +344,6 @@ ...@@ -344,11 +344,6 @@
}) })
} }
}, },
// toRecord(){
// uni.navigateTo({
// url:'/pages/exchangeRecord/exchangeRecord'
// })
// },
viewDropLists() { viewDropLists() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/dropLists/dropLists' url: '/pages/dropLists/dropLists'
......
...@@ -14,11 +14,12 @@ function isWechatBrowser(): boolean { ...@@ -14,11 +14,12 @@ function isWechatBrowser(): boolean {
function isMiniProgramWebView(): boolean { function isMiniProgramWebView(): boolean {
// 检查微信环境变量 // 检查微信环境变量
// @ts-ignore
if (typeof window.__wxjs_environment !== 'undefined' && window.__wxjs_environment === 'miniprogram') { if (typeof window.__wxjs_environment !== 'undefined' && window.__wxjs_environment === 'miniprogram') {
return true; return true;
} }
// 检查 URL 参数 // 检查 URL 参数
if (window.location.search.indexOf('from=miniprogram') > -1 || if (window.location.search.indexOf('from=miniprogram') > -1 ||
window.location.hash.indexOf('from=miniprogram') > -1) { window.location.hash.indexOf('from=miniprogram') > -1) {
return true; return true;
} }
...@@ -34,7 +35,7 @@ function ensureWechatSDK(): Promise<void> { ...@@ -34,7 +35,7 @@ function ensureWechatSDK(): Promise<void> {
resolve(); resolve();
return; return;
} }
// 如果已经有 wx(原生对象) // 如果已经有 wx(原生对象)
// @ts-ignore // @ts-ignore
if (typeof wx !== 'undefined' && wx.config) { if (typeof wx !== 'undefined' && wx.config) {
...@@ -43,7 +44,7 @@ function ensureWechatSDK(): Promise<void> { ...@@ -43,7 +44,7 @@ function ensureWechatSDK(): Promise<void> {
resolve(); resolve();
return; return;
} }
// 动态加载微信 SDK // 动态加载微信 SDK
const script = document.createElement('script'); const script = document.createElement('script');
script.src = 'https://res2.wx.qq.com/open/js/jweixin-1.6.0.js'; script.src = 'https://res2.wx.qq.com/open/js/jweixin-1.6.0.js';
...@@ -69,7 +70,7 @@ function ensureWechatSDK(): Promise<void> { ...@@ -69,7 +70,7 @@ function ensureWechatSDK(): Promise<void> {
export function initJssdkShare(callback: any, url: string) { export function initJssdkShare(callback: any, url: string) {
// 只在微信浏览器且非小程序环境中初始化 // 只在微信浏览器且非小程序环境中初始化
if (!isWechatBrowser() || isMiniProgramWebView()) { if (!isWechatBrowser() || isMiniProgramWebView()) {
console.log('当前环境不需要初始化微信 SDK:', console.log('当前环境不需要初始化微信 SDK:',
isWechatBrowser() ? '微信浏览器' : '非微信浏览器', isWechatBrowser() ? '微信浏览器' : '非微信浏览器',
isMiniProgramWebView() ? '小程序 WebView' : '普通环境' isMiniProgramWebView() ? '小程序 WebView' : '普通环境'
); );
...@@ -78,7 +79,7 @@ export function initJssdkShare(callback: any, url: string) { ...@@ -78,7 +79,7 @@ export function initJssdkShare(callback: any, url: string) {
} }
console.log('🔄 开始初始化微信 SDK...'); console.log('🔄 开始初始化微信 SDK...');
ensureWechatSDK().then(() => { ensureWechatSDK().then(() => {
// @ts-ignore // @ts-ignore
const wx = window.jWeixin || window.wx; const wx = window.jWeixin || window.wx;
...@@ -137,7 +138,7 @@ function getShareData(data?: any) { ...@@ -137,7 +138,7 @@ function getShareData(data?: any) {
// ===== 设置微信分享(主入口) ===== // ===== 设置微信分享(主入口) =====
export function setWechatShare(data: any) { export function setWechatShare(data: any) {
console.log('📤 setWechatShare 被调用', data); console.log('📤 setWechatShare 被调用', data);
// 在小程序环境中,不执行微信分享 // 在小程序环境中,不执行微信分享
if (isMiniProgramWebView()) { if (isMiniProgramWebView()) {
console.log('📱 小程序环境,跳过微信分享设置'); console.log('📱 小程序环境,跳过微信分享设置');
...@@ -147,7 +148,7 @@ export function setWechatShare(data: any) { ...@@ -147,7 +148,7 @@ export function setWechatShare(data: any) {
// 在微信浏览器中执行 // 在微信浏览器中执行
if (isWechatBrowser()) { if (isWechatBrowser()) {
const shareData = getShareData(data); const shareData = getShareData(data);
// 确保 SDK 已加载 // 确保 SDK 已加载
ensureWechatSDK().then(() => { ensureWechatSDK().then(() => {
// @ts-ignore // @ts-ignore
...@@ -166,7 +167,7 @@ export function setWechatShare(data: any) { ...@@ -166,7 +167,7 @@ export function setWechatShare(data: any) {
success: () => console.log('✅ 好友分享设置成功'), success: () => console.log('✅ 好友分享设置成功'),
fail: (err: any) => console.error('❌ 好友分享设置失败', err) fail: (err: any) => console.error('❌ 好友分享设置失败', err)
}); });
wx.updateTimelineShareData({ wx.updateTimelineShareData({
title: shareData.title, title: shareData.title,
link: shareData.link, link: shareData.link,
...@@ -174,7 +175,7 @@ export function setWechatShare(data: any) { ...@@ -174,7 +175,7 @@ export function setWechatShare(data: any) {
success: () => console.log('✅ 朋友圈分享设置成功'), success: () => console.log('✅ 朋友圈分享设置成功'),
fail: (err: any) => console.error('❌ 朋友圈分享设置失败', err) fail: (err: any) => console.error('❌ 朋友圈分享设置失败', err)
}); });
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
title: shareData.title, title: shareData.title,
desc: shareData.desc, desc: shareData.desc,
...@@ -194,7 +195,7 @@ export function setWechatShare(data: any) { ...@@ -194,7 +195,7 @@ export function setWechatShare(data: any) {
// ===== hshare 主入口 ===== // ===== hshare 主入口 =====
export function hshare(data: any, url: string) { export function hshare(data: any, url: string) {
console.log('📤 hshare 被调用', data, url); console.log('📤 hshare 被调用', data, url);
// 如果在非微信浏览器中,提示用户复制链接 // 如果在非微信浏览器中,提示用户复制链接
if (!isWechatBrowser() || isMiniProgramWebView()) { if (!isWechatBrowser() || isMiniProgramWebView()) {
const shareData = getShareData(data); const shareData = getShareData(data);
...@@ -202,7 +203,7 @@ export function hshare(data: any, url: string) { ...@@ -202,7 +203,7 @@ export function hshare(data: any, url: string) {
fallbackShare(shareData); fallbackShare(shareData);
return; return;
} }
// 微信浏览器中执行分享 // 微信浏览器中执行分享
initJssdkShare(() => { initJssdkShare(() => {
setWechatShare(data); setWechatShare(data);
......
...@@ -4,6 +4,7 @@ import { initJssdkShare, setWechatShare } from '@/util/fiveshare'; ...@@ -4,6 +4,7 @@ import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
import { shareURL } from "@/environments/environment"; import { shareURL } from "@/environments/environment";
import wx from 'weixin-js-sdk' import wx from 'weixin-js-sdk'
import { nanoid } from 'nanoid'; import { nanoid } from 'nanoid';
//只要是未登录状态,想要跳转到名单内的路径时,直接跳到登录页 //只要是未登录状态,想要跳转到名单内的路径时,直接跳到登录页
// 页面白名单,不受拦截 // 页面白名单,不受拦截
const whiteList = [ const whiteList = [
...@@ -26,13 +27,14 @@ let shareCustomPageList = [ ...@@ -26,13 +27,14 @@ let shareCustomPageList = [
'/pages/courselist/courselist', '/pages/courselist/courselist',
'/myPackageA/businessCard/businessCard', '/myPackageA/businessCard/businessCard',
] ]
export default function initApp() { export default function initApp() {
let date = Date.now() let date = Date.now()
uni.addInterceptor('navigateTo', { uni.addInterceptor('navigateTo', {
// 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转 // 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转
invoke(e) { invoke(e) {
let userInfo = {} let userInfo = {}
if (uni.getStorageSync('cffp_userInfo')) { if (uni.getStorageSync('cffp_userInfo')) {
userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo')) userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
...@@ -61,7 +63,7 @@ export default function initApp() { ...@@ -61,7 +63,7 @@ export default function initApp() {
return return
} }
} }
if (whiteList.indexOf(e.url) == -1 && !uni.getStorageSync('loginType')) { if (whiteList.indexOf(e.url) == -1 && !uni.getStorageSync('loginType')) {
uni.setStorageSync('loginType', 'visitor') uni.setStorageSync('loginType', 'visitor')
...@@ -69,6 +71,7 @@ export default function initApp() { ...@@ -69,6 +71,7 @@ export default function initApp() {
url: '/myPackageA/login/login' url: '/myPackageA/login/login'
}) })
} }
if (uni.getStorageSync('loginType') == 'codelogin') { if (uni.getStorageSync('loginType') == 'codelogin') {
api.queryInfo({}).then(res => { api.queryInfo({}).then(res => {
if (!res['success']) { if (!res['success']) {
...@@ -86,17 +89,16 @@ export default function initApp() { ...@@ -86,17 +89,16 @@ export default function initApp() {
} }
// 账号禁用用户 // 账号禁用用户
if(res.data.userIsActive&&res.data.userIsActive==2){ if(res.data.userIsActive&&res.data.userIsActive==2){
uni.setStorageSync('userIsActive',String(res.data.userIsActive)) uni.setStorageSync('userIsActive',String(res.data.userIsActive))
return return
} }
if(res.data.userIsActive&&res.data.userIsActive!=2){ if(res.data.userIsActive&&res.data.userIsActive!=2){
uni.removeStorageSync('userIsActive') uni.removeStorageSync('userIsActive')
} }
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo)) uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo))
} }
}) })
} }
...@@ -150,7 +152,8 @@ export default function initApp() { ...@@ -150,7 +152,8 @@ export default function initApp() {
} }
return true return true
}, },
success(e) {} success(e) {
}
}) })
uni.addInterceptor('switchTab', { uni.addInterceptor('switchTab', {
// tabbar页面跳转前进行拦截 // tabbar页面跳转前进行拦截
...@@ -194,7 +197,8 @@ export default function initApp() { ...@@ -194,7 +197,8 @@ export default function initApp() {
date = Date.now() date = Date.now()
return true return true
}, },
success(e) {} success(e) {
}
}) })
uni.addInterceptor('reLaunch', { uni.addInterceptor('reLaunch', {
//页面跳转前拦截 //页面跳转前拦截
...@@ -238,7 +242,9 @@ export default function initApp() { ...@@ -238,7 +242,9 @@ export default function initApp() {
return true return true
}, },
//页面跳转后缓存当前页路由 //页面跳转后缓存当前页路由
success(e) {} success(e) {
}
}) })
} }
......
// utils/tracker/types.js
/**
* 项目类型
*/
export const PROJECT_TYPES = {
SFP: 'SFP',
CFFP: 'CFFP',
}
/**
* 模块类型
*/
export const MODULE_TYPES = {
REPORT: 'report',
ORDER: 'order',
HOME: 'home',
PRODUCT: 'product',
USER: 'user',
SEARCH: 'search',
CART: 'cart',
PAYMENT: 'payment',
ACTIVITY: 'activity',
OTHER: 'other',
}
/**
* 客户端类型
*/
export const CLIENT_TYPES = {
MINI_PROGRAM: 'mini_program',
H5: 'H5',
APP: 'app',
}
/**
* 操作分类
*/
export const OPER_CATEGORY = {
GENERAL: '1', // 通用操作(系统自动采集)
PERSONALIZED: '2', // 个性化操作(定制化采集)
}
/**
* 事件类型(对应后端 eventType)
*/
export const EVENT_TYPES = {
PAGE_VIEW: 'page_view',
PAGE_LEAVE: 'page_leave',
CLICK: 'click',
LOGIN: 'login',
PURCHASE: 'purchase',
SHARE: 'share',
SEARCH: 'search',
DOWNLOAD: 'download',
SUBMIT: 'submit',
SCROLL: 'scroll',
CUSTOM: 'custom',
}
/**
* 目标类型
*/
export const TARGET_TYPES = {
BUTTON: 'button',
PRODUCT: 'product',
MODULE: 'module',
INPUT: 'input',
LINK: 'link',
IMAGE: 'image',
VIDEO: 'video',
REPORT: 'report',
OTHER: 'other',
}
\ No newline at end of file
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