You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
3.1 KiB

  1. local BaseLayer = require("luaScript.ModuleEapSdk.BaseLayers.BaseLayer")
  2. local LayerTeam = class("LayerTeam", BaseLayer)
  3. function LayerTeam.createWithData(__node, __zorder)
  4. local layer = LayerTeam.new()
  5. layer.m_parent = __node
  6. __node:addChild(layer, __zorder)
  7. return layer
  8. end
  9. function LayerTeam:myShow()
  10. -- self:addListener(true)
  11. self:initData()
  12. self:initUI()
  13. end
  14. function LayerTeam:myClose()
  15. end
  16. function LayerTeam:initData()
  17. self.m_lblCnts = {}
  18. end
  19. function LayerTeam:initUI()
  20. self.imgPath = {
  21. "res/ModuleEapSdk/eapsdk_public_back_bg1.png",
  22. "res/ModuleEapSdk/eapsdk_public_back_bg2.png",
  23. "res/ModuleEapSdk/eapsdk_public_back_bg3.png",
  24. "res/ModuleEapSdk/eapsdk_bg_bj_sp1.png",
  25. "res/ModuleEapSdk/eapsdk_wj_icon_question.png",
  26. "res/ModuleEapSdk/eapsdk_wj_btn_rank.png",
  27. "res/ModuleEapSdk/eapsdk_btn_teamDetail.png",
  28. }
  29. local fix_x = display.width
  30. local fix_y = display.cy
  31. 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))
  32. imgBack2:setSize(cc.size(530, 204))
  33. local imgBack3 = G_EapAbbreviation.createImageView(self.imgPath[4], imgBack2, cc.p(265, 140), true, 2, 8102, cc.p(0.5, 1))
  34. imgBack3:setSize(cc.size(490, 50))
  35. local titles = {"玩法", "战队", "排名", "积分"}
  36. for i=1, #titles do
  37. local title = titles[i]
  38. G_EapAbbreviation.createSystemLabel(imgBack3, cc.p(61.25+(i-1)*122.5, 25), title, 25, nil, true)
  39. local content = "-"
  40. 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)
  41. end
  42. for i=1, 3 do
  43. local imgLine = G_EapAbbreviation.createImageView(self.imgPath[3], imgBack3, cc.p(i*122.5, 25))
  44. imgLine:setScaleX(0.04)
  45. end
  46. --赛事规则
  47. self.btnDes = ccui.Button:create(self.imgPath[5])
  48. self.btnDes:setPosition(cc.p(475, 185))
  49. self.btnDes:setScale(0.585)
  50. imgBack2:addChild(self.btnDes)
  51. addButtonListener(self.btnDes, function()
  52. print("LayerTeam btnDes clicked === ")
  53. local coreId = G_EapSdkMgr.m_matchInfos[1] and G_EapSdkMgr.m_matchInfos[1].coreId
  54. if not G_EapSdkMgr.m_rulesDes and coreId then
  55. G_EapSocketLogin.request_core_info(coreId)
  56. end
  57. self.m_parent.m_parent:showLayer(LAYER_ENUM.LAYER_TEAM_RULE)
  58. end)
  59. --排行榜
  60. self.btnRank = ccui.Button:create(self.imgPath[6])
  61. self.btnRank:setPosition(cc.p(70, 175))
  62. self.btnRank:setScale(0.585)
  63. imgBack2:addChild(self.btnRank)
  64. addButtonListener(self.btnRank, function()
  65. print("LayerTeam btnRank clicked === ")
  66. self.m_parent.m_parent:showLayer(LAYER_ENUM.LAYER_TEAM_RANK)
  67. end)
  68. --战队详情
  69. self.btnGo = ccui.Button:create(self.imgPath[7])
  70. self.btnGo:setPosition(cc.p(455, 20))
  71. -- self.btnGo:setScale(0.585)
  72. imgBack2:addChild(self.btnGo)
  73. addButtonListener(self.btnGo, function()
  74. self.m_parent.m_parent:showLayer(LAYER_ENUM.LAYER_TEAM_DETAIL)
  75. end)
  76. end
  77. return LayerTeam