// import { HtmlTextParser } from './../ctrls/HtmlTextParser';
import Panel from "../views/Panel";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager";
export default class NewPetPanel extends Panel {
    public image: eui.Image;
    public noprize: eui.Group;
    public image0: eui.Image;
    public closeBtn1: eui.Button;
    public prize: eui.Group;
    public image1: eui.Image;
    public closeBtn2: eui.Button;
    public prizeImg: eui.Image;
    public dog_lv_1: eui.Image;
    public dog_lv_2: eui.Image;
    public dog_lv_3: eui.Image;
    public dog_lv_4: eui.Image;
    public dog_lv_5: eui.Image;
    public dog_lv_6: eui.Image;
    public dog_lv_7: eui.Image;
    public dog_lv_8: eui.Image;
    public dog_lv_9: eui.Image;
    public dog_lv_10: eui.Image;
    public closeBtn: eui.Button;


    public get skinKey() { return 'NewPetPanel' }
    public get groupName() { return 'newpet_panel' }

    NewPetData

    constructor(data: any) {
        super(data);
        this.NewPetData = data;
    }

    onSkinComplete(): void {
        super.onSkinComplete();
        this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
        if (this.stage) {
            this.onLoad();
        }
    }
    onTouchTap() {
        super.onTouchTap()
        if (this.NewPetData.callBack) {
            this.NewPetData.callBack(false);
        }
    }

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

    initEvents(): void {
        super.initEvents();
        this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
        this.closeBtn1.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
        this.closeBtn2.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
    }

    removeEvents(): void {
        super.removeEvents();
        this.closeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
        this.closeBtn1.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
        this.closeBtn2.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
    }

    private onLoad(): void {
        this.noprize.visible=false;
        this.prize.visible=false;
        if(this.NewPetData.prize){
            this.prize.visible=true;
        }else{
            this.noprize.visible=true;
        }
       // this.jlText.text = this.NewPetData.text;
    }


}