Commit 4d2d1822 authored by Damon's avatar Damon

refactor: 去除埋点

parent 4842f56a
<script> <script>
import "./../.env.js"; import "./../.env.js";
import { AnalysysAgent } from "@/utils/analysys_paas.js"; import { AnalysysAgent } from "@/utils/analysys_paas.js";
import util from "@/utils/util.js";
import login from "@/utils/login.js"; import login from "@/utils/login.js";
import upload from '@/components/upload/task.js' import upload from '@/components/upload/task.js'
import { ERROR } from "@/common/log.js"
export default { export default {
globalData: { globalData: {
...@@ -70,7 +68,7 @@ export default { ...@@ -70,7 +68,7 @@ export default {
}, },
onLaunch: async function () { onLaunch: async function () {
// 应用初始化(全局只触发一次) // 应用初始化(全局只触发一次)
AnalysysAgent.registerSuperProperty("platform", "self-support"); // AnalysysAgent.registerSuperProperty("platform", "self-support");
// 版本更新 // 版本更新
await this.updateApp(); await this.updateApp();
this.getSystemInfo(); this.getSystemInfo();
...@@ -85,9 +83,6 @@ export default { ...@@ -85,9 +83,6 @@ export default {
}, },
onHide: function () { onHide: function () {
// 应用从前台进入后台 // 应用从前台进入后台
// if (this.uploadTask.length > 0) {
// ERROR('onUnload', {task: this.uploadTask.length, mobile: this.vuex_user.mobile})
// }
}, },
watch: { watch: {
uploadTask: function(newValue, oldValue) { uploadTask: function(newValue, oldValue) {
...@@ -217,59 +212,59 @@ export default { ...@@ -217,59 +212,59 @@ export default {
track(event, properties) { track(event, properties) {
if (AnalysysAgent) { if (AnalysysAgent) {
// 易观添加事件 // 易观添加事件
let AnalysysAgent = wx.AnalysysAgent; // let AnalysysAgent = wx.AnalysysAgent;
AnalysysAgent.track("self_support_" + event, properties); // AnalysysAgent.track("self_support_" + event, properties);
} }
}, },
profileSet(vm) { profileSet(vm) {
// 设备身份标识 // 设备身份标识
if (AnalysysAgent) { if (AnalysysAgent) {
let user = vm.$u.deepClone(vm.vuex_user); // let user = vm.$u.deepClone(vm.vuex_user);
let profile = vm.$u.deepClone(vm.vuex_auth_user); // let profile = vm.$u.deepClone(vm.vuex_auth_user);
profile.openid = user.wxopenid || profile.openid // profile.openid = user.wxopenid || profile.openid
profile.unionid = user.unionid || profile.unionid || null // profile.unionid = user.unionid || profile.unionid || null
AnalysysAgent.profileSet(profile); // AnalysysAgent.profileSet(profile);
} }
}, },
profileAppend(vm) { profileAppend(vm) {
if (AnalysysAgent) { if (AnalysysAgent) {
let user = vm.$u.deepClone(vm.vuex_user); // let user = vm.$u.deepClone(vm.vuex_user);
// 用户id设置 // // 用户id设置
AnalysysAgent.alias(user.id + ""); // AnalysysAgent.alias(user.id + "");
// 用户附加属性 // // 用户附加属性
let profile = { // let profile = {
userfrom: "自营平台", // userfrom: "自营平台",
id: user.id, // id: user.id,
mobile: user.mobile, // mobile: user.mobile,
loginName: user.loginName, // loginName: user.loginName,
source: user.score, // source: user.score,
}; // };
Object.keys(profile).map((key) => { // Object.keys(profile).map((key) => {
if (key && profile[key]) { // if (key && profile[key]) {
AnalysysAgent.profileAppend(key, profile[key]); // AnalysysAgent.profileAppend(key, profile[key]);
} // }
}); // });
} }
}, },
share(toShareProperties, trackProperties) { share(toShareProperties, trackProperties) {
if (AnalysysAgent) { if (AnalysysAgent) {
AnalysysAgent.share(toShareProperties, trackProperties); // AnalysysAgent.share(toShareProperties, trackProperties);
} }
}, },
trackPage(pageName, properties) { trackPage(pageName, properties) {
if (AnalysysAgent) { if (AnalysysAgent) {
AnalysysAgent.pageView(pageName, properties); // AnalysysAgent.pageView(pageName, properties);
} }
}, },
initShare(option) { initShare(option) {
option = option || {}; // option = option || {};
if (AnalysysAgent && option.user_id) { // if (AnalysysAgent && option.user_id) {
let shareUserInfo = { // let shareUserInfo = {
share_from_id: option.user_id || "", // share_from_id: option.user_id || "",
share_from_nickname: option.user_name || "", // share_from_nickname: option.user_name || "",
}; // };
AnalysysAgent.registerSuperProperties(shareUserInfo); // AnalysysAgent.registerSuperProperties(shareUserInfo);
} // }
}, },
/* ------------------------- 数据埋点end ------------------------------ */ /* ------------------------- 数据埋点end ------------------------------ */
}, },
......
...@@ -3,16 +3,16 @@ import { ...@@ -3,16 +3,16 @@ import {
} from '@/config'; } from '@/config';
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
import AnalysysAgent from '@/include/libs/analysys_paas/mp-weixin/AnalysysAgent_WX_SDK.custom.es6.min.js' import AnalysysAgent from '@/include/libs/analysys_paas/mp-weixin/AnalysysAgent_WX_SDK.custom.es6.min.js'
if (AnalysysAgent) { // if (AnalysysAgent) {
AnalysysAgent.identify(AnalysysAgent.getDistinctId()); // AnalysysAgent.identify(AnalysysAgent.getDistinctId());
AnalysysAgent.appkey = argo.appkey //设置您的APPKEY // AnalysysAgent.appkey = argo.appkey //设置您的APPKEY
AnalysysAgent.debugMode = argo.debugMode // AnalysysAgent.debugMode = argo.debugMode
AnalysysAgent.uploadURL = argo.uploadURL; // AnalysysAgent.uploadURL = argo.uploadURL;
// AnalysysAgent.autoShare = true // // AnalysysAgent.autoShare = true
AnalysysAgent.allowTimeCheck = true // AnalysysAgent.allowTimeCheck = true
AnalysysAgent.autoTrack = true // AnalysysAgent.autoTrack = true
AnalysysAgent.registerSuperProperty("platform","self-support"); // AnalysysAgent.registerSuperProperty("platform","self-support");
} // }
// #endif // #endif
export { export {
AnalysysAgent, AnalysysAgent,
......
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