/*
 * @Author: mojunshou 1637302775@qq.com
 * @Date: 2025-03-21 11:45:43
 * @LastEditors: mojunshou 1637302775@qq.com
 * @LastEditTime: 2025-04-11 16:00:25
 * @Description: 提现必返
 */
import { _decorator, Label } 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 { UIID } from '../common/config/GameUIConfig';
import { CocosHandler } from '../common/manager/CocosHandler';
import { ADHandler } from '../common/manager/ADHandler';
import { smc } from '../common/SingletonModuleComp';
import { GameEvent } from '../common/config/GameEvent';


const { ccclass, property } = _decorator;

/** 显示对象控制 */
@ccclass('CashRebateView')
export class CashRebateView extends GameComponent {
    @property(Label)
    lab_num: Label = null!;
    protected start() {
        this.setButton();
        this.setData();
    }


    setData() {
        if (this.lab_num) {
            this.lab_num.string = smc.game.GameModel.cashNum + "";
        }
    }
    private btn_ok() {
        //看广告
        if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
            ADHandler.inst.showAd("105");
            oops.gui.remove(UIID.CashRebate);
            oops.message.dispatchEvent(GameEvent.showCoinAnimation);

        } else {
            oops.gui.remove(UIID.CashRebate);
        }
    }
}