import Panel from "../views/Panel";
import PanelCtrl from "../ctrls/panelCtrl";
export default class ResultPanel extends Panel {

    private mdata:any;

    private img:any;
    public get skinKey() { return 'ResultPanel' }
    // public get groupName() { return 'tips_panel'}
    
    constructor(data){
        super(data);

        this.mdata = data;

        this.img = document.getElementById('shareImg');
    }

    onSkinComplete():void{
        super.onSkinComplete();

        this.once(egret.Event.ADDED_TO_STAGE,this.onLoad,this);
		if(this.stage){
			this.onLoad();
        }
        

        this.showAct();

        this.img.style.display = 'block';
    }

    start():void{
        this.percentHeight = 100;
    }

    initEvents():void{
        super.initEvents();
    }

    removeEvents():void{
        super.removeEvents();
    }

    private onLoad():void{

        
    }

    onTouchTap():any{
        super.onTouchTap();
        if(this['closeBtn']){
            PanelCtrl.instance.btnDelay(this['closeBtn']);
        }

        this.img.style.display = 'none';

        if(this.mdata){
            this.mdata();
        }
    }
}