import Panel from "../views/Panel";
export default class UpLevelPanel extends Panel{
    protected get skinKey(){  return 'UpLevel' }

    public closeBtn:eui.Button;
    public upshowBtn:eui.Button;
    public uptext:eui.Label;
    public leveltext:eui.Label;
    public rewardtype:eui.Image;
    public rewardnum:eui.Label;


    constructor(data){
        super();
        this.initUI(data);
    }

    initUI(data){
        this.uptext.text = "恭喜店长，\n店铺成功升级到L"+data.level+"啦~"
        this.leveltext.text = "L"+data.level;
        if(data.level<10){
            this.leveltext.x = 450;
        }else{
            this.leveltext.x = 440;
        }

    }

    initEvents(){
        super.initEvents();
        this.onTap(this.closeBtn,this.onTap_closeBtn);
        this.onTap(this.upshowBtn,this.onTap_show);
    }

    onTap_closeBtn(){
        this.hidePanel();
        //主页面增加钻石数
    }
    onTap_show(){
        //分享弹窗
    }

    removeEvents(){
        super.removeEvents();
        this.clearTap(this.closeBtn,this.onTap_closeBtn);
        this.clearTap(this.upshowBtn,this.onTap_show);
    }
}