/*
 * @Author: mojunshou 1637302775@qq.com
 * @Date: 2025-03-19 18:02:51
 * @LastEditors: mojunshou 1637302775@qq.com
 * @LastEditTime: 2025-04-11 11:23:56
 * @Description: 隐私挽留弹窗
 */
import { _decorator, game } from 'cc';
import { oops } from 'db://oops-framework/core/Oops';
import { DeviceUtil } from 'db://oops-framework/core/utils/DeviceUtil';
import { GameComponent } from 'db://oops-framework/module/common/GameComponent';
import { AD_TYPE } from '../config/GameDefine';
import { UIID } from '../config/GameUIConfig';
import { CocosHandler } from '../manager/CocosHandler';
import { ADHandler } from '../manager/ADHandler';
import { LoginHandler } from '../manager/LoginHandler';
const { ccclass, property } = _decorator;

@ccclass('RetentionView')
export class RetentionView extends GameComponent {
    start() {
        this.setButton();
    }

    private async btn_agree() {
        console.log("同意");
        //调用安卓给权限
        if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
            // CocosHandler.inst.ad_interstitial_start();
            LoginHandler.inst.savePrivacyStatus(true);
            ADHandler.inst.showAd(AD_TYPE.Start);
            oops.gui.remove(UIID.Retention);
        }
    }

    private btn_disagree() {
        console.log("不同意");
        game.end();
    }
}


