/*
 * @Author: mojunshou 1637302775@qq.com
 * @Date: 2025-03-19 18:02:51
 * @LastEditors: mojunshou 1637302775@qq.com
 * @LastEditTime: 2025-04-08 17:12:37
 * @Description: 温馨提示弹窗
 */
import { _decorator, Component, Node } from 'cc';
import { oops } from 'db://oops-framework/core/Oops';
import { GameComponent } from 'db://oops-framework/module/common/GameComponent';
import { UIID } from '../config/GameUIConfig';
import { sys } from 'cc';
import { DeviceUtil } from 'db://oops-framework/core/utils/DeviceUtil';
import { AndroidEvent } from '../config/AndroidEvent';
import { CocosHandler } from '../manager/CocosHandler';
const { ccclass, property } = _decorator;

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

    private async btn_agree() {
        console.log("同意");

        if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
            let result = await CocosHandler.inst.savePrivacyStatus(true);
            console.log("返回状态>>>>>>>>>>>>>>>>>", result)
            if (result.code == 0) {
                CocosHandler.inst.ad_interstitial_start();
                oops.gui.remove(UIID.KindTips);
            } else {
                oops.gui.toast("保存失败")
            }
        }
    }

    private btn_disagree() {
        oops.gui.open(UIID.Retention);
    }
}


