Files
fc/dev/project/library/imports/ae/ae30e51f-168f-4a21-853b-e4947882dd8f.js
T

62 lines
1.7 KiB
JavaScript
Raw Normal View History

2026-05-24 10:21:26 +08:00
"use strict";
cc._RF.push(module, 'ae30eUfFo9KIYU75JR4gt2P', 'cmp.trace.sh');
// Scripts/nx/mods/trace/cmps/cmp.trace.sh.js
"use strict";
/******************************************************************
* Copyright(C) 2019 - 2020 Nx Studio
*
* 埋点组件:界面开关
*
* 2018.05.18
******************************************************************/
var TDefine = require("trace.define");
var TTT = TDefine.TraceType;
cc.Class({
"extends": cc.Component,
properties: {
wndName: {
"default": "",
displayName: "窗体名"
},
showType: {
"default": TTT.openWindow,
type: TTT,
displayName: "打开埋点"
},
closeType: {
"default": TTT.closeWindow,
type: TTT,
displayName: "关闭埋点"
}
},
// 编辑器特性
editor: {
// 允许当前组件在编辑器模式下运行
executeInEditMode: false,
// requireComponent 参数用来指定当前组件的依赖组件
requireComponent: cc.Button,
// 当本组件添加到节点上后,禁止同类型(含子类)的组件再添加到同一个节点,防止逻辑发生冲突
disallowMultiple: true,
// menu 用来将当前组件添加到组件菜单中,方便用户查找
menu: "Nx/埋点|界面开关"
},
// 显示
onEnable: function onEnable() {
// 打开埋点
if (nx.mTrace && nx.dt.strNEmpty(this.wndName) && this.showType > 0) {
nx.mTrace.trace(this.showType, this.wndName);
}
},
// 隐藏
onDisable: function onDisable() {
// 关闭埋点
if (nx.mTrace && nx.dt.strNEmpty(this.wndName) && this.closeType > 0) {
nx.mTrace.trace(this.closeType, this.wndName);
}
}
});
cc._RF.pop();