"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 NetManager_1 = require("../../libs/tw/manager/NetManager");
var DataManager_1 = require("../../libs/tw/manager/DataManager");
var sceneCtrl_1 = require("../ctrls/sceneCtrl");
var sceneTypes_1 = require("../types/sceneTypes");
/**
 * 领养界面
 */
var AdoptePanel = (function (_super) {
    __extends(AdoptePanel, _super);
    function AdoptePanel() {
        var _this = _super.call(this) || this;
        _this.init();
        return _this;
    }
    Object.defineProperty(AdoptePanel.prototype, "skinKey", {
        get: function () { return 'Adopte'; },
        enumerable: true,
        configurable: true
    });
    AdoptePanel.prototype.init = function () {
        this.updateData();
    };
    AdoptePanel.prototype.start = function () {
        this.percentHeight = 100;
    };
    AdoptePanel.prototype.updateData = function () {
    };
    /**
     * 领养（取名）
     */
    AdoptePanel.prototype.onClick_adopte = function () {
        NetManager_1.NetManager.ins.petAdopte(this.adopte_Back.bind(this), DataManager_1.DataManager.ins.petIndexData.activityId, this.nameTxt.text);
    };
    AdoptePanel.prototype.adopte_Back = function (success) {
        if (!success) {
            return;
        }
        this.hidePanel();
        NetManager_1.NetManager.ins.getPetInfo(function () {
            //进入游戏场景
            sceneCtrl_1.default.instance.change(sceneTypes_1.ModuleTypes.MAIN_SCENE);
        }, DataManager_1.DataManager.ins.petIndexData.activityId);
    };
    AdoptePanel.prototype.initEvents = function () {
        this.adopteBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClick_adopte, this);
    };
    AdoptePanel.prototype.removeEvents = function () {
        this.adopteBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onClick_adopte, this);
    };
    return AdoptePanel;
}(Panel_1.default));
exports.default = AdoptePanel;
__reflect(AdoptePanel.prototype, "\"/Users/chiwang/Desktop/\u5151\u5427\u5DE5\u4F5C/gameegret20181011/db-game-template/egret/src/adoptePanel/AdoptePanel\".AdoptePanel");
//# sourceMappingURL=AdoptePanel.js.map