From 9e2b61c859cf8fb66b0832fba276025bb20a42db Mon Sep 17 00:00:00 2001 From: xu_yanfeng Date: Fri, 7 Feb 2025 20:50:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0popup=E7=9A=84=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ga/type.ts | 1 + src/views/popup/index.vue | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/ga/type.ts b/src/ga/type.ts index 18c0d1a..23ce07b 100644 --- a/src/ga/type.ts +++ b/src/ga/type.ts @@ -79,6 +79,7 @@ export enum GA_EventName { Inspector = "Inspector", EngineVersion = "engine_version", AppVersion = "app_version", + Popup = "popup", GameUrl = "game_url", GamePlayer = "game_player", GamePause = "game_pause", diff --git a/src/views/popup/index.vue b/src/views/popup/index.vue index ecc1408..6a7a0a7 100644 --- a/src/views/popup/index.vue +++ b/src/views/popup/index.vue @@ -6,7 +6,7 @@
  1. CocosStore打赏该插件
  2. -
  3. 支持作者其他插件
  4. +
  5. 支持作者其他插件
  6. 请我喝杯咖啡 @@ -29,7 +29,7 @@
    1. - {{ item.name }} + {{ item.name }}
    @@ -48,6 +48,7 @@ import { ChromeConst } from "cc-plugin/src/chrome/const"; import { defineComponent, onMounted, ref } from "vue"; import { Page } from "../../core/types"; import { ga } from "../../ga"; +import { GA_EventName } from "../../ga/type"; import Ad from "../../scripts/inject-view/ad.vue"; import { getAdData } from "../../scripts/inject-view/loader"; const { CCInput, CCButton, CCButtonGroup, CCInputNumber, CCSelect, CCCheckBox, CCColor } = ccui.components; @@ -103,36 +104,48 @@ export default defineComponent({ { text: "在线工具", icon: "icon_fly", - click: () => { + click: (event: MouseEvent | null, item: ButtonGroupItem) => { viewType.value = ViewType.OnlineTools; + ga.fireEventWithParam(GA_EventName.Popup, item.text); }, }, { text: "支持我", icon: "icon_cocos", - click: () => { + click: (event: MouseEvent | null, item: ButtonGroupItem) => { viewType.value = ViewType.Support; + ga.fireEventWithParam(GA_EventName.Popup, item.text); }, }, { text: "加我为好友", icon: "icon_wechat", - click: () => { + click: (event: MouseEvent | null, item: ButtonGroupItem) => { viewType.value = ViewType.Friends; + ga.fireEventWithParam(GA_EventName.Popup, item.text); }, }, { text: "推荐", icon: "icon_good", - click: () => { + click: (event: MouseEvent | null, item: ButtonGroupItem) => { viewType.value = ViewType.Recommend; + ga.fireEventWithParam(GA_EventName.Popup, item.text); }, }, ]); const viewType = ref(ViewType.Friends); const onlineTools = ref([]); const chooseItem = ref(items.value[0]); + const myPlugins = ref("https://store.cocos.com/app/search?name=xu_yanfeng"); return { + myPlugins, + onClickBuyPlugins() { + ga.fireEventWithParam(GA_EventName.Popup, myPlugins.value); + }, + onClickTry(event: MouseEvent, url: string) { + ga.fireEventWithParam(GA_EventName.Popup, url); + }, onlineTools, isViewSupport() { return viewType.value === ViewType.Support;