local BaseLayer = require("luaScript.ModuleEapSdk.BaseLayers.BaseLayer") local LayerBottom = EapClass("LayerBottom", BaseLayer) function LayerBottom.createWithData(__node, __zorder) local layer = LayerBottom.new() layer.m_parent = __node __node:addChild(layer, __zorder) return layer end function LayerBottom:myShow() -- self:addListener(true) self:initData() self:initUI() end function LayerBottom:myClose() end function LayerBottom:getCurSel() return self.m_curSel end function LayerBottom:initData() self.m_curSel = 1 end function LayerBottom: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_wj_tab_game_off.png", "res/ModuleEapSdk/eapsdk_wj_tab_game_on.png", --5 "res/ModuleEapSdk/eapsdk_wj_tab_mine_off.png", "res/ModuleEapSdk/eapsdk_wj_tab_mine_on.png", "res/ModuleEapSdk/eapsdk_bg_bj_sp3.png", "res/ModuleEapSdk/eapsdk_wj_tab_store_off.png", "res/ModuleEapSdk/eapsdk_wj_tab_store_on.png", --10 } local fix_x = display.width local fix_y = display.cy local imgBack2 = G_EapAbbreviation.createImageView(self.imgPath[8], self, cc.p(fix_x, fix_y-255), false, 1, 1103, cc.p(1, 0.5)) -- imgBack2:setSize(cc.size(564, 90)) imgBack2:setScale(0.6) local btnMenus = cc.Node:create() btnMenus:setPosition(cc.p(fix_x-282, fix_y-255)) self:addChild(btnMenus, 2) self.btnMatch = ccui.ImageView:create(self.imgPath[5]) self.btnMatch:setPosition(cc.p(-188, 0)) btnMenus:addChild(self.btnMatch) addButtonListener(self.btnMatch, function() print("self.btnMatch clicked ========= ") self.m_curSel = 1 self.btnMatch:setTouchEnabled(false) self.btnInfo:setTouchEnabled(true) self.btnStore:setTouchEnabled(true) self.btnMatch:loadTexture(self.imgPath[5]) self.btnInfo:loadTexture(self.imgPath[6]) self.btnStore:loadTexture(self.imgPath[9]) if G_EapSdkMgr.m_isMatching then if EAP_MATCH_STAGE == EAP_STAGE_SCORE then -- local isClick = G_EapSdkMgr:getClickEnter() -- if isClick ~= 1 and not G_EapSdkMgr.EapPhone then -- G_LayerMain:showLayer(LAYER_ENUM.LAYER_FREE) -- else G_LayerMain:showLayer(LAYER_ENUM.LAYER_MATCH) -- end elseif EAP_MATCH_STAGE == EAP_STAGE_PLATFORM then G_LayerMain:showLayer(LAYER_ENUM.LAYER_PLATFORM_MATCH) elseif EAP_MATCH_STAGE == EAP_STAGE_TEAM then G_LayerMain:showLayer(LAYER_ENUM.LAYER_TEAM) end else if EAP_MATCH_STAGE == EAP_STAGE_SCORE then G_LayerMain:showLayer(LAYER_ENUM.LAYER_END) elseif EAP_MATCH_STAGE == EAP_STAGE_PLATFORM then G_LayerMain:showLayer(LAYER_ENUM.LAYER_PLATFORM_FREE) elseif EAP_MATCH_STAGE == EAP_STAGE_TEAM then G_LayerMain:showLayer(LAYER_ENUM.LAYER_TEAM) end end end) self.btnInfo = ccui.ImageView:create(self.imgPath[6]) self.btnInfo:setPosition(cc.p(188, 0)) btnMenus:addChild(self.btnInfo) addButtonListener(self.btnInfo, function() print("self.btnInfo clicked ========= ") self.m_curSel = 3 self.btnMatch:setTouchEnabled(true) self.btnInfo:setTouchEnabled(false) self.btnStore:setTouchEnabled(true) self.btnMatch:loadTexture(self.imgPath[4]) self.btnInfo:loadTexture(self.imgPath[7]) self.btnStore:loadTexture(self.imgPath[9]) G_LayerMain:showLayer(LAYER_ENUM.LAYER_INFO) end) self.btnStore = ccui.ImageView:create(self.imgPath[9]) self.btnStore:setPosition(cc.p(0, 0)) btnMenus:addChild(self.btnStore) addButtonListener(self.btnStore, function() print("self.btnInfo clicked ========= ") self.m_curSel = 2 self.btnMatch:setTouchEnabled(true) self.btnInfo:setTouchEnabled(true) self.btnStore:setTouchEnabled(false) self.btnMatch:loadTexture(self.imgPath[4]) self.btnInfo:loadTexture(self.imgPath[6]) self.btnStore:loadTexture(self.imgPath[10]) G_LayerMain:showLayer(LAYER_ENUM.LAYER_STORE) end) self.btnMatch:setScale(0.6) self.btnInfo:setScale(0.6) self.btnStore:setScale(0.6) self.btnMatch:setTouchEnabled(false) self.btnInfo:setTouchEnabled(true) self.btnStore:setTouchEnabled(true) end return LayerBottom