ClickEventHandler.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * @Author: mojunshou 1637302775@qq.com
  3. * @Date: 2025-03-19 17:46:09
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-04-10 15:31:35
  6. * @Description: 用户协议和隐私协议点击事件
  7. */
  8. import { sys } from 'cc';
  9. import { _decorator, EventTouch } from 'cc';
  10. import { oops } from 'db://oops-framework/core/Oops';
  11. import { GameComponent } from "db://oops-framework/module/common/GameComponent";
  12. import { CocosHandler } from '../manager/CocosHandler';
  13. import { smc } from '../SingletonModuleComp';
  14. import { LoginHandler } from '../manager/LoginHandler';
  15. const { ccclass, property } = _decorator;
  16. /** 显示对象控制 */
  17. @ccclass('ClickEventHandler')
  18. export class ClickEventHandler extends GameComponent {
  19. onClicked(eventTouch: EventTouch, param: string) {
  20. console.log("onClicked", param);
  21. switch (param) {
  22. case "User Agreement":
  23. // 在游戏内打开用户协议
  24. // sys.openURL("https://store.cocos.com/app/detail/3814");
  25. smc.game.GameModel.protocolType = 2;
  26. break;
  27. case "Privacy Policy":
  28. // 在游戏内打开隐私协议
  29. smc.game.GameModel.protocolType = 1;
  30. // sys.openURL("https://store.cocos.com/app/detail/3814");
  31. break;
  32. }
  33. LoginHandler.inst.openAgreement();
  34. }
  35. }