"use strict";
var __reflect = (this && this.__reflect) || function (p, c, t) {
    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var __extends = this && this.__extends || function __extends(t, e) { 
 function r() { 
 this.constructor = t;
}
for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
r.prototype = e.prototype, t.prototype = new r();
};
Object.defineProperty(exports, "__esModule", { value: true });
var Panel_1 = require("../views/Panel");
var panelCtrl_1 = require("../ctrls/panelCtrl");
var MsgPanel = (function (_super) {
    __extends(MsgPanel, _super);
    function MsgPanel(data) {
        var _this = _super.call(this, data) || this;
        _this.mData = data;
        return _this;
    }
    Object.defineProperty(MsgPanel.prototype, "skinKey", {
        get: function () { return 'Msg'; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MsgPanel.prototype, "groupName", {
        get: function () { return 'msg_panel'; },
        enumerable: true,
        configurable: true
    });
    MsgPanel.prototype.onSkinComplete = function () {
        _super.prototype.onSkinComplete.call(this);
        this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
        if (this.stage) {
            this.onLoad();
        }
        this.showAct();
    };
    MsgPanel.prototype.start = function () {
        this.percentHeight = 100;
    };
    MsgPanel.prototype.initEvents = function () {
        _super.prototype.initEvents.call(this);
        this.okBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap, this);
    };
    MsgPanel.prototype.removeEvents = function () {
        _super.prototype.removeEvents.call(this);
        this.okBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap, this);
    };
    MsgPanel.prototype.onLoad = function () {
        this.okBtn['nameLb'].stroke = 5;
        this.okBtn['nameLb'].strokeColor = 0xf05a35;
        if (this.mData) {
            switch (this.mData.type) {
                case 0:
                    this.titleLb0.text = '未登录';
                    this.titleLb1.text = '您还没有登录哦！';
                    // if(this.mData.text){
                    this.okBtn['nameLb'].text = '去登录';
                    // }
                    break;
                case 1:
                    // this.titleLb0.text = DataManager.ins.customCfgData.unitName + '不足';
                    // this.titleLb1.text = '抱歉！您当前' + DataManager.ins.customCfgData.unitName + '不足';
                    // if(this.mData.text){
                    // this.okBtn['nameLb'].text = '赚' + DataManager.ins.customCfgData.unitName; 
                    // }
                    break;
            }
        }
    };
    MsgPanel.prototype.onTap = function () {
        panelCtrl_1.default.instance.btnDelay(this.okBtn);
        if (this.mData) {
            if (this.mData.type == 0) {
                // if(DataManager.ins.customCfgData.isNotLoginUser){
                //     window['requirelogin']();
                // }
                // window.location.href = DataManager.ins.customCfgData.login;
            }
            else if (this.mData.type == 1) {
                if (this.mData.isGoHome) {
                }
                // let url = DataManager.ins.customCfgData.getCreditsLink;
                // if(url != null && url != ''){
                //     window.location.href = url;
                // }
            }
        }
        this.hidePanel();
    };
    MsgPanel.prototype.onTouchTap = function () {
        _super.prototype.onTouchTap.call(this);
        if (this['closeBtn']) {
            panelCtrl_1.default.instance.btnDelay(this['closeBtn']);
        }
        this.onTap();
    };
    MsgPanel.prototype.getAjax = function () {
    };
    return MsgPanel;
}(Panel_1.default));
exports.default = MsgPanel;
__reflect(MsgPanel.prototype, "\"/Users/zuopeng/DBGitLab/db-game-template/egret/src/msgPanel/MsgPanel\".MsgPanel");
//# sourceMappingURL=MsgPanel.js.map