/*
 * @Author: mojunshou 1637302775@qq.com
 * @Date: 2025-03-19 18:02:51
 * @LastEditors: mojunshou 1637302775@qq.com
 * @LastEditTime: 2025-04-27 16:51:29
 * @Description: 温馨提示弹窗
 */
import { _decorator } 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 { ADHandler } from '../manager/ADHandler';
import { LoginHandler } from '../manager/LoginHandler';
import { DCHandler } from '../manager/DCHandler';
import { ServerHandler } from '../manager/ServerHandler';
const { ccclass, property } = _decorator;

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

    private async btn_agree() {
        DCHandler.inst.reportData(3000000)
        if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
            LoginHandler.inst.savePrivacyStatus(true);
            this.scheduleOnce(() => {
                ADHandler.inst.showAd(AD_TYPE.Start);
                //先关闭，同意直接进游戏
                // ServerHandler.inst.getAccountInfo();
                oops.gui.remove(UIID.KindTips);
            }, 0.2)
        }


    }

    private btn_disagree() {
        DCHandler.inst.reportData(3000001)
        oops.gui.open(UIID.Retention);
        oops.gui.remove(UIID.KindTips);
    }
}


