"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 DataManager_1 = require("./../../libs/tw/manager/DataManager");
var Panel_1 = require("../views/Panel");
var Waiting_1 = require("../waiting/Waiting");
var NetConst_1 = require("../NetConst");
var sceneCtrl_1 = require("../ctrls/sceneCtrl");
var sceneTypes_1 = require("../types/sceneTypes");
var GetCreditsPanel = (function (_super) {
    __extends(GetCreditsPanel, _super);
    function GetCreditsPanel() {
        var _this = _super.call(this) || this;
        _this.btnTip.text = "\u53BB\u8D5A" + (DataManager_1.DataManager.ins.customCfgData.unitName || '积分');
        _this.tips.text = (DataManager_1.DataManager.ins.customCfgData.unitName || '积分') + "\u4E0D\u591F\u5566";
        _this.littletip.text = "\u4ECA\u5929" + (DataManager_1.DataManager.ins.customCfgData.unitName || '积分') + "\u4E0D\u591F\u5566\uFF0C\u5FEB\u53BB\u8D5A" + (DataManager_1.DataManager.ins.customCfgData.unitName || '积分') + "\u5427";
        _this.btnTip.touchEnabled = false;
        return _this;
    }
    Object.defineProperty(GetCreditsPanel.prototype, "skinKey", {
        get: function () { return "GetCredits"; },
        enumerable: true,
        configurable: true
    });
    GetCreditsPanel.prototype.initEvents = function () {
        _super.prototype.initEvents.call(this);
        //this.onTap(this.earnBtn, this.onTap_earnBtn);
        this.onTap(this.getcreditsBtn, this.onTap_earnBtn);
        this.onTap(this.closeBtn, this.onTap_closeBtn);
    };
    GetCreditsPanel.prototype.onTap_earnBtn = function () {
        // 赚积分链接
        if (window["CFG"] && window["CFG"].getCreditsLink && window["CFG"].getCreditsLink !== "") {
            window.location.href = window["CFG"].getCreditsLink;
        }
        else {
            this.hidePanel();
        }
    };
    GetCreditsPanel.prototype.onTap_closeBtn = function (e) {
        var _this = this;
        Waiting_1.default.instance.show();
        NetConst_1.default.ajaxElement(function (s) {
            Waiting_1.default.instance.hide();
            _this.hidePanel();
            sceneCtrl_1.default.instance.change(sceneTypes_1.ModuleTypes.START_SCENE);
        });
    };
    GetCreditsPanel.prototype.removeEvents = function () {
        _super.prototype.removeEvents.call(this);
        this.clearTap(this.getcreditsBtn, this.onTap_earnBtn);
        this.clearTap(this.closeBtn, this.onTap_closeBtn);
    };
    return GetCreditsPanel;
}(Panel_1.default));
exports.default = GetCreditsPanel;
__reflect(GetCreditsPanel.prototype, "\"e:/zqty/egret/src/getCredits/GetCreditsPanel\".GetCreditsPanel");
//# sourceMappingURL=GetCreditsPanel.js.map