"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 Buried_1 = require("../../libs/tw/util/Buried");
var NetManager_1 = require("../../libs/tw/manager/NetManager");
var ExChangeItem = (function (_super) {
    __extends(ExChangeItem, _super);
    function ExChangeItem(callBack) {
        if (callBack === void 0) { callBack = null; }
        var _this = _super.call(this) || this;
        _this.skinName = 'resource/skins/ui/ExChangeItemSkin.exml';
        _this.addEventListener(egret.Event.COMPLETE, _this.onSkinComplete, _this);
        _this.exchangeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, _this.onTap_exchangeBtn, _this);
        if (_this.skin) {
            _this.onSkinComplete();
        }
        _this.callBack = callBack;
        return _this;
    }
    ExChangeItem.prototype.onSkinComplete = function () {
        this.removeEventListener(egret.Event.COMPLETE, this.onSkinComplete, this);
    };
    ExChangeItem.prototype.onTap_exchangeBtn = function () {
        if (this.callBack) {
            this.callBack(this.pData, this);
        }
        if (this.pData.blackBoxFlag) {
            var startDpmOut = Buried_1.Buried.connectDpm(110, 4, 4); // 点击埋点   
            var startDcmOut = Buried_1.Buried.connectDcm(202, 0, 0); // 曝光埋点
            var exposure = Buried_1.Buried.createExposure(startDpmOut, startDcmOut);
            NetManager_1.NetManager.ins.clickLog(exposure);
        }
        else {
            console.log('this.pData.prizeId', this.pData.prizeId);
            if (this.pData.prizeId == 'sss_1') {
                var startDpmOut = Buried_1.Buried.connectDpm(110, 4, 1); // 点击埋点   
                var startDcmOut = Buried_1.Buried.connectDcm(202, 0, 0); // 曝光埋点
                var exposure = Buried_1.Buried.createExposure(startDpmOut, startDcmOut);
                NetManager_1.NetManager.ins.clickLog(exposure);
            }
            else if (this.pData.prizeId == 'sss_2') {
                var startDpmOut = Buried_1.Buried.connectDpm(110, 4, 2); // 点击埋点   
                var startDcmOut = Buried_1.Buried.connectDcm(202, 0, 0); // 曝光埋点
                var exposure = Buried_1.Buried.createExposure(startDpmOut, startDcmOut);
                NetManager_1.NetManager.ins.clickLog(exposure);
            }
            else if (this.pData.prizeId == 'sss_3') {
                var startDpmOut = Buried_1.Buried.connectDpm(110, 4, 3); // 点击埋点   
                var startDcmOut = Buried_1.Buried.connectDcm(202, 0, 0); // 曝光埋点
                var exposure = Buried_1.Buried.createExposure(startDpmOut, startDcmOut);
                NetManager_1.NetManager.ins.clickLog(exposure);
            }
        }
    };
    return ExChangeItem;
}(eui.Component));
exports.ExChangeItem = ExChangeItem;
__reflect(ExChangeItem.prototype, "\"/Users/zuopeng/DBGitLab/db-game-template/egret/src/ui/ExChangeItem\".ExChangeItem");
//# sourceMappingURL=ExChangeItem.js.map