local BaseLayer = require("luaScript.ModuleEapSdk.BaseLayers.BaseLayer") local LayerTeam = class("LayerTeam", BaseLayer) function LayerTeam.createWithData(__node, __zorder) local layer = LayerTeam.new() layer.m_parent = __node __node:addChild(layer, __zorder) return layer end function LayerTeam:myShow() -- self:addListener(true) self:initData() self:initUI() end function LayerTeam:myClose() end function LayerTeam:initData() self.m_lblCnts = {} end function LayerTeam:initUI() self.imgPath = { "res/ModuleEapSdk/eapsdk_public_back_bg1.png", "res/ModuleEapSdk/eapsdk_public_back_bg2.png", "res/ModuleEapSdk/eapsdk_public_back_bg3.png", "res/ModuleEapSdk/eapsdk_bg_bj_sp1.png", "res/ModuleEapSdk/eapsdk_wj_icon_question.png", "res/ModuleEapSdk/eapsdk_wj_btn_rank.png", "res/ModuleEapSdk/eapsdk_btn_teamDetail.png", } local fix_x = display.width local fix_y = display.cy local imgBack2 = G_EapAbbreviation.createImageView(self.imgPath[2], self, cc.p(fix_x-10, fix_y-106), true, 2, 8101, cc.p(1, 0.5)) imgBack2:setSize(cc.size(530, 204)) local imgBack3 = G_EapAbbreviation.createImageView(self.imgPath[4], imgBack2, cc.p(265, 140), true, 2, 8102, cc.p(0.5, 1)) imgBack3:setSize(cc.size(490, 50)) local titles = {"玩法", "战队", "排名", "积分"} for i=1, #titles do local title = titles[i] G_EapAbbreviation.createSystemLabel(imgBack3, cc.p(61.25+(i-1)*122.5, 25), title, 25, nil, true) local content = "-" self.m_lblCnts[i] = G_EapAbbreviation.createSystemLabel(imgBack3, cc.p(61.25+(i-1)*122.5, -25), content, 25, cc.c3b(0x1e, 0x23, 0x36), true) end for i=1, 3 do local imgLine = G_EapAbbreviation.createImageView(self.imgPath[3], imgBack3, cc.p(i*122.5, 25)) imgLine:setScaleX(0.04) end --赛事规则 self.btnDes = ccui.Button:create(self.imgPath[5]) self.btnDes:setPosition(cc.p(475, 185)) self.btnDes:setScale(0.585) imgBack2:addChild(self.btnDes) addButtonListener(self.btnDes, function() print("LayerTeam btnDes clicked === ") local coreId = G_EapSdkMgr.m_matchInfos[1] and G_EapSdkMgr.m_matchInfos[1].coreId if not G_EapSdkMgr.m_rulesDes and coreId then G_EapSocketLogin.request_core_info(coreId) end self.m_parent.m_parent:showLayer(LAYER_ENUM.LAYER_TEAM_RULE) end) --排行榜 self.btnRank = ccui.Button:create(self.imgPath[6]) self.btnRank:setPosition(cc.p(70, 175)) self.btnRank:setScale(0.585) imgBack2:addChild(self.btnRank) addButtonListener(self.btnRank, function() print("LayerTeam btnRank clicked === ") self.m_parent.m_parent:showLayer(LAYER_ENUM.LAYER_TEAM_RANK) end) --战队详情 self.btnGo = ccui.Button:create(self.imgPath[7]) self.btnGo:setPosition(cc.p(455, 20)) -- self.btnGo:setScale(0.585) imgBack2:addChild(self.btnGo) addButtonListener(self.btnGo, function() self.m_parent.m_parent:showLayer(LAYER_ENUM.LAYER_TEAM_DETAIL) end) end return LayerTeam