/*
 * @Author: mojunshou 1637302775@qq.com
 * @Date: 2025-03-19 18:02:51
 * @LastEditors: mojunshou 1637302775@qq.com
 * @LastEditTime: 2025-03-20 11:27:04
 * @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';
const { ccclass, property } = _decorator;

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

    private btn_agree() {
        console.log("同意");
        // 同意后，将同意状态存储到本地
        sys.localStorage.setItem("agree", "true");
        // 是客户端就发送信息给安卓
        if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
            // 发送信息给安卓
            // sys.sendNativeEvent("agree");
        }
        // 关闭当前UI
        oops.message.dispatchEvent(AndroidEvent.AgreePrivacy);
    }

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


