RetentionView.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * @Author: mojunshou 1637302775@qq.com
  3. * @Date: 2025-03-19 18:02:51
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-04-10 10:51:35
  6. * @Description: 隐私挽留弹窗
  7. */
  8. import { _decorator, game } from 'cc';
  9. import { oops } from 'db://oops-framework/core/Oops';
  10. import { DeviceUtil } from 'db://oops-framework/core/utils/DeviceUtil';
  11. import { GameComponent } from 'db://oops-framework/module/common/GameComponent';
  12. import { AD_TYPE } from '../config/GameDefine';
  13. import { UIID } from '../config/GameUIConfig';
  14. import { CocosHandler } from '../manager/CocosHandler';
  15. const { ccclass, property } = _decorator;
  16. @ccclass('RetentionView')
  17. export class RetentionView extends GameComponent {
  18. start() {
  19. this.setButton();
  20. }
  21. private async btn_agree() {
  22. console.log("同意");
  23. //调用安卓给权限
  24. if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
  25. // CocosHandler.inst.ad_interstitial_start();
  26. CocosHandler.inst.show_ad(AD_TYPE.Start);
  27. oops.gui.remove(UIID.Retention);
  28. }
  29. }
  30. private btn_disagree() {
  31. console.log("不同意");
  32. game.end();
  33. }
  34. }