From 6265247c80b2921abdad2886ae3657b8f0020a39 Mon Sep 17 00:00:00 2001 From: huanghaipeng Date: Fri, 14 Nov 2025 15:40:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E6=95=B0=E6=95=B0=E6=89=93=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Scene/HomeScene.fire | 18 ++--- assets/Script/JiaZai.ts | 136 ++++++++++++++++++++++++++++++++-- assets/Script/SceneManager.ts | 41 +++++++++- assets/Script/ranking.ts | 19 ++++- 4 files changed, 195 insertions(+), 19 deletions(-) diff --git a/assets/Scene/HomeScene.fire b/assets/Scene/HomeScene.fire index 5e697a5..5409d35 100644 --- a/assets/Scene/HomeScene.fire +++ b/assets/Scene/HomeScene.fire @@ -3129,7 +3129,7 @@ "component": "", "_componentId": "1dc93b4fehOrpGgTkihBH4g", "handler": "openHeath", - "customEventData": "" + "customEventData": "healthBtn" }, { "__type__": "cc.Node", @@ -3634,7 +3634,7 @@ "component": "", "_componentId": "1dc93b4fehOrpGgTkihBH4g", "handler": "openShop", - "customEventData": "" + "customEventData": "coinBtn" }, { "__type__": "cc.Node", @@ -4181,7 +4181,7 @@ "component": "", "_componentId": "1dc93b4fehOrpGgTkihBH4g", "handler": "openMonthCard", - "customEventData": "" + "customEventData": "yiconBtn" }, { "__type__": "cc.Node", @@ -4560,7 +4560,7 @@ "component": "", "_componentId": "1dc93b4fehOrpGgTkihBH4g", "handler": "openStarter_pack", - "customEventData": "" + "customEventData": "xinshouBtn" }, { "__type__": "cc.Node", @@ -4784,7 +4784,7 @@ "component": "", "_componentId": "83533ha7L1Hn4Ep+rvR3z5k", "handler": "init", - "customEventData": "" + "customEventData": "btnRank" }, { "__type__": "cc.Node", @@ -10585,7 +10585,7 @@ "component": "", "_componentId": "1dc93b4fehOrpGgTkihBH4g", "handler": "openShop", - "customEventData": "" + "customEventData": "shopBtn" }, { "__type__": "cc.Node", @@ -10864,7 +10864,7 @@ "component": "", "_componentId": "1dc93b4fehOrpGgTkihBH4g", "handler": "openDailyQuests", - "customEventData": "" + "customEventData": "dayBtn" }, { "__type__": "cc.Node", @@ -11045,7 +11045,7 @@ "component": "", "_componentId": "1dc93b4fehOrpGgTkihBH4g", "handler": "openWinStreak", - "customEventData": "" + "customEventData": "hammerBtn" }, { "__type__": "cc.Node", @@ -11226,7 +11226,7 @@ "component": "", "_componentId": "1dc93b4fehOrpGgTkihBH4g", "handler": "openPassCheck", - "customEventData": "" + "customEventData": "passBtn" }, { "__type__": "cc.Node", diff --git a/assets/Script/JiaZai.ts b/assets/Script/JiaZai.ts index b6453b5..0441963 100644 --- a/assets/Script/JiaZai.ts +++ b/assets/Script/JiaZai.ts @@ -598,7 +598,24 @@ export default class JiaZai extends cc.Component { } // 打开heath弹窗,创建预制体并启动自己的倒计时 - openHeath() { + openHeath(event?: cc.Event, customEventData?: string) { // EventTouch EventCustom + let eventName = ""; + let btnName = "" + if (customEventData !== undefined) { + btnName = customEventData; + eventName = "click" + } else { + btnName = "healthBtn"; + eventName = "auto"; + } + let dataInfo = { + interface_id: "heathnum", // 界面名称 + reason: eventName, // 事件名称 + is_first_exposure: false, // 是否首次曝光 + entry_point: btnName, // 按钮名称 + } + cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); + let health = cc.instantiate(this.health); this.node.addChild(health); let heathPop = health.getComponent("heathnum").heatht; @@ -927,12 +944,30 @@ export default class JiaZai extends cc.Component { } //打开商店 - openShop() { + openShop(event?: cc.Event, customEventData?: string) { if (!JiaZai.cachedShopPrefab) { cc.error('Shop prefab is not loaded yet.'); return; } + let eventName = ""; + let btnName = "" + if (customEventData !== undefined) { + btnName = customEventData; + eventName = "click" + } else { + btnName = "shopBtn"; + eventName = "auto"; + } + let dataInfo = { + interface_id: "shop", // 界面名称 + reason: eventName, // 事件名称 + is_first_exposure: false, // 是否首次曝光 + entry_point: btnName, // 按钮名称 + } + cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); + console.log("统计功能", dataInfo); + if (!this.shopNode) { // 第一次使用,创建节点 this.shopNode = cc.instantiate(JiaZai.cachedShopPrefab); @@ -975,11 +1010,30 @@ export default class JiaZai extends cc.Component { this.updatePower(); } //打开月卡 - openMonthlyCard() { + openMonthlyCard(event?: cc.Event, customEventData?: string) { if (!JiaZai.cachedMonthlyCardPrefab) { cc.error('MonthlyCard prefab is not loaded yet.'); return; } + + let eventName = ""; + let btnName = "" + if (customEventData !== undefined) { + btnName = customEventData; + eventName = "click" + } else { + btnName = "yiconBtn"; + eventName = "auto"; + } + let dataInfo = { + interface_id: "monthlyCard", // 界面名称 + reason: eventName, // 事件名称 + is_first_exposure: false, // 是否首次曝光 + entry_point: btnName, // 按钮名称 + } + cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); + console.log("统计功能", dataInfo); + if (!this.monthlyCardNode) { // 第一次使用,创建节点 this.monthlyCardNode = cc.instantiate(JiaZai.cachedMonthlyCardPrefab); @@ -1005,7 +1059,24 @@ export default class JiaZai extends cc.Component { } - openDailyQuests() { + openDailyQuests(event?: cc.Event, customEventData?: string) { + let eventName = ""; + let btnName = "" + if (customEventData !== undefined) { + btnName = customEventData; + eventName = "click" + } else { + btnName = "dayBtn"; + eventName = "auto"; + } + let dataInfo = { + interface_id: "DailyQuests", // 界面名称 + reason: eventName, // 事件名称 + is_first_exposure: false, // 是否首次曝光 + entry_point: btnName, // 按钮名称 + } + cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); + this.dailyQuestsNode = null; this.openLoad2(); this.dailyQuestsShow = true; @@ -1328,8 +1399,25 @@ export default class JiaZai extends cc.Component { // }) } - openStarter_pack() { + openStarter_pack(event?: cc.Event, customEventData?: string) { if (!JiaZai.cachedActionPrefab) { + let eventName = ""; + let btnName = "" + if (customEventData !== undefined) { + btnName = customEventData; + eventName = "click" + } else { + btnName = "xinshouBtn"; + eventName = "auto"; + } + let dataInfo = { + interface_id: "NewbieGift", // 界面名称 + reason: eventName, // 事件名称 + is_first_exposure: false, // 是否首次曝光 + entry_point: btnName, // 按钮名称 + } + cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); + // cc.error('Action prefab is not loaded yet.'); cc.assetManager.loadBundle('action_bundle', (err: Error, bundle: cc.AssetManager.Bundle) => { if (err) { @@ -1809,7 +1897,24 @@ export default class JiaZai extends cc.Component { this.openWinStreak(); } //打开连胜活动 - openWinStreak() { + openWinStreak(event?: cc.Event, customEventData?: string) { + let eventName = ""; + let btnName = "" + if (customEventData !== undefined) { + btnName = customEventData; + eventName = "click"; + } else { + btnName = "hammerBtn"; + eventName = "auto"; + } + let dataInfo = { + interface_id: "WinStreak", // 界面名称 + reason: eventName, // 事件名称 + is_first_exposure: false, // 是否首次曝光 + entry_point: btnName, // 按钮名称 + } + cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); + if (!JiaZai.cachedWinStreakPrefab) { // cc.error('Action prefab is not loaded yet.'); cc.assetManager.loadBundle('action_bundle', (err: Error, bundle: cc.AssetManager.Bundle) => { @@ -1901,12 +2006,29 @@ export default class JiaZai extends cc.Component { } - openPassCheck() { + openPassCheck(event?: cc.Event, customEventData?: string) { if (!JiaZai.cachedPassCheckPrefab) { console.error('PassCheck prefab is not loaded yet.') return; } + let eventName = ""; + let btnName = "" + if (customEventData !== undefined) { + btnName = customEventData; + eventName = "click"; + } else { + btnName = "passBtn"; + eventName = "auto"; + } + let dataInfo = { + interface_id: "passCheck", // 界面名称 + reason: eventName, // 事件名称 + is_first_exposure: false, // 是否首次曝光 + entry_point: btnName, // 按钮名称 + } + cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); + var passCheck = null; Utils.getPassCheckInfo((data) => { passCheck = data.data.passCheck; diff --git a/assets/Script/SceneManager.ts b/assets/Script/SceneManager.ts index 577de29..e644757 100644 --- a/assets/Script/SceneManager.ts +++ b/assets/Script/SceneManager.ts @@ -411,12 +411,31 @@ export default class SceneManager extends cc.Component { //打开商店 - openShop() { + openShop(customEventData?: string) { console.log("进入sceneManager openShop"); if (!SceneManager.cachedShopPrefab) { cc.error('Shop prefab is not loaded yet.'); return; } + + let eventName = ""; + let btnName = "" + if (customEventData !== undefined) { + btnName = customEventData; + eventName = "click" + } else { + btnName = "shop_level"; + eventName = "auto"; + } + let dataInfo = { + interface_id: "shop", // 界面名称 + reason: eventName, // 事件名称 + is_first_exposure: false, // 是否首次曝光 + entry_point: btnName, // 按钮名称 + } + cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); + + MapConroler._instance.pause = true; MapConroler._instance.stopBoom(); if (!this.shopNode) { @@ -432,11 +451,29 @@ export default class SceneManager extends cc.Component { // console.log("shopNode parent:", this.shopNode.parent); } //打开月卡 - openMonthlyCard() { + openMonthlyCard(customEventData?: string) { if (!SceneManager.cachedMonthlyCardPrefab) { cc.error('MonthlyCard prefab is not loaded yet.'); return; } + + let eventName = ""; + let btnName = "" + if (customEventData !== undefined) { + btnName = customEventData; + eventName = "click" + } else { + btnName = "yicon_level"; + eventName = "auto"; + } + let dataInfo = { + interface_id: "monthlyCard", // 界面名称 + reason: eventName, // 事件名称 + is_first_exposure: false, // 是否首次曝光 + entry_point: btnName, // 按钮名称 + } + cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); + if (!this.monthlyCardNode) { // 第一次使用,创建节点 this.monthlyCardNode = cc.instantiate(SceneManager.cachedMonthlyCardPrefab); diff --git a/assets/Script/ranking.ts b/assets/Script/ranking.ts index b15386c..82a9e76 100644 --- a/assets/Script/ranking.ts +++ b/assets/Script/ranking.ts @@ -40,7 +40,24 @@ export default class ranking extends cc.Component { start() { } - init() { + init(event?: cc.Event, customEventData?: string) { + let eventName = ""; + let btnName = "" + if (customEventData !== undefined) { + btnName = customEventData; + eventName = "click" + } else { + btnName = "btnRank"; + eventName = "auto"; + } + let dataInfo = { + interface_id: "ranking", // 界面名称 + reason: eventName, // 事件名称 + is_first_exposure: false, // 是否首次曝光 + entry_point: btnName, // 按钮名称 + } + cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); + this.openLoad(); this.btnRanks.active = true; let user_Info = cc.fx.StorageMessage.getStorage("user_Info");