import Panel from "../../libs/new_wx/components/Panel";
import { DataManager } from "../../libs/tw/manager/DataManager";

export default class Prize3Panel extends Panel {
    start() {
        super.start();

        const data1 = DataManager.ins.getData('getPlugOrderStatus1');
        this['nametxt1'].text = data1.lottery.title;

        const data2 = DataManager.ins.getData('getPlugOrderStatus2');
        this['nametxt2'].text = data2.lottery.title;
        this['img'].source = data2.lottery.imgurl
    }

    initEvents() {
        super.initEvents();
        this.useBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_useBtn, this);

    }

    onTap_useBtn() {
        const data = DataManager.ins.getData('getPlugOrderStatus2');
        location.href=data.lottery.link
    }

    get skinKey(): string { return 'Prize3' }
    useBtn: eui.Button;
}