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.

180 lines
5.3 KiB

  1. -- 成员列表Layout
  2. local TiantiMain = class("TiantiMain" , cc.UIView);
  3. function TiantiMain:ctor()
  4. TiantiMain.super.ctor(self)
  5. self:loadUI()
  6. end
  7. function TiantiMain:loadUI()
  8. local ui = loadUI("res/ui/ui_tianti/ui_tianti_main.ui")
  9. self.ui = ui;
  10. self:addChild(ui);
  11. end
  12. function TiantiMain:onEnter()
  13. TiantiMain.super.onEnter(self)
  14. self:registerButton()
  15. self:initBindEvent()
  16. self:showTiantiRule()
  17. self:onRequestBaomingInfo({type=1})
  18. self:onRequestTiantiGameInfo()
  19. self.isBaoming = false
  20. end
  21. function TiantiMain:showTiantiRule()
  22. self.ui.Items.Text_rule:setVisible(false);
  23. self.ui.Items.ScrollView_rule:hideAllBar()
  24. self.ui.Items.ScrollView_rule:getInnerContainer():setAutoSize(true)
  25. local mListView = self.ui.Items.ScrollView_rule
  26. mListView:removeAllChildren()
  27. local content = {
  28. "1、《悠闲麻将川南》与中玺体育CEST智力竞技大赛合作推出川南CEST专业线下赛,大赛将线上海选,在线下举办盛大的直播比赛;\n",
  29. "2、线下比赛名额通过本游戏中天梯赛排名海选,海选时间2021年7月1日至2021年11月30日;\n",
  30. "3、选手报名参赛后,海选时间内的游戏数据,参与CEST海选赛排名,如7月1日开赛, 7月15号报名选手的游戏数据仍旧从7月1号算起;\n",
  31. "4、CEST天梯赛排名数据,来自CEST海选赛的比赛数据,根据比赛数据计算标准分,根据标准分进行排名。在2021年11月30日,确定最终天梯赛排名,根据排名确定线下赛事参与选手;\n",
  32. "5、CEST海选赛排行榜分为日榜、周榜、月榜、总榜,四个榜单;\n",
  33. "6、平台每周或每月不定期根据排行榜排名为选手发放CEST兑换积分奖励。\n",
  34. }
  35. for k,v in ipairs(content) do
  36. local item = self.ui.Items.Text_rule:getCopied()
  37. item:setString(v)
  38. mListView:addChild(item,0);
  39. end
  40. mListView:requestDoLayout()
  41. mListView:doLayout()
  42. mListView:jumpToTopOnSizeChanged()
  43. end
  44. function TiantiMain:registerButton()
  45. -- self.ui.Items.Button_close:registerClick(handler(self,self.onClose))
  46. self.ui.Items.Layout_:registerClick(handler(self,self.onClose))
  47. self.ui.Items.Button_rank:registerClick(handler(self,self.onRank))
  48. self.ui.Items.Button_jifen_shangcheng:registerClick(handler(self,self.onShangcheng))
  49. self.ui.Items.Button_jifen_baomingcanjia:registerClick(handler(self,self.onBaomingcanjia))
  50. self.ui.Items.Button_jifen_baomingxinxi:registerClick(handler(self,self.onBaomingxinxi))
  51. end
  52. function TiantiMain:onClose()
  53. playBtnCloseEffect()
  54. self:removeFromParent()
  55. end
  56. function TiantiMain:onRank()
  57. playBtnEffect()
  58. showTooltip("敬请期待!")
  59. -- local view = import("luaScript.Views.Tianti.TiantiRank"):new()
  60. -- view:setAnchorPoint(cc.p(0.5, 0.5))
  61. -- app:showWaitDialog(view)
  62. end
  63. function TiantiMain:onShangcheng()
  64. playBtnEffect()
  65. -- local view = import("luaScript.Views.Tianti.TiantiBaoming"):new()
  66. -- view:setAnchorPoint(cc.p(0.5, 0.5))
  67. -- app:showWaitDialog(view)
  68. if self.isBaoming then
  69. showTooltip("敬请期待!")
  70. -- local url = "http://youxianapidev.dingdingqipai.com/index-cn.php?action=group.cestloginto&uid="..tostring(app.user.loginInfo.uid)
  71. -- app.plugin:callUrl(url)
  72. else
  73. showTooltip("您尚未报名,无法进入积分商城兑换奖品!")
  74. end
  75. end
  76. function TiantiMain:onBaomingcanjia()
  77. playBtnEffect()
  78. showTooltip("敬请期待!")
  79. -- local view = import("luaScript.Views.Tianti.TiantiBaoming"):new()
  80. -- view:setAnchorPoint(cc.p(0.5, 0.5))
  81. -- app:showWaitDialog(view)
  82. end
  83. function TiantiMain:onBaomingxinxi()
  84. playBtnEffect()
  85. showTooltip("敬请期待!")
  86. -- local view = import("luaScript.Views.Tianti.TiantiBaomingInfo"):new()
  87. -- view:setAnchorPoint(cc.p(0.5, 0.5))
  88. -- app:showWaitDialog(view)
  89. end
  90. function TiantiMain:initBindEvent()
  91. --权限发生改变
  92. -- self:bindEvent(app.club_php , GAME_EVENT.CLUB_CHANGE_ROLE , handler(self , self.onChangeRole));
  93. -- --绑定比赛开关回调
  94. -- self:bindEvent(app.club_php , GAME_EVENT.CLUB_SET , handler(self , self.onSetSuccess));
  95. -- --解散茶馆
  96. -- self:bindEvent(app.club_php , GAME_EVENT.CLUB_JIE_SAN , handler(self , self.onClubJieSanEvent))
  97. -- --打开下级
  98. -- self:bindEvent(app.club_php , GAME_EVENT.CLUB_TEAM_VIEW , handler(self , self.openClubTeamView))
  99. self:bindEvent(app.club_php , GAME_EVENT.CLUB_TIANTI_BAOMING_REG , handler(self , self.onRequestBaomingInfo))
  100. end
  101. function TiantiMain:onRequestBaomingInfo(result)
  102. if result.type == 1 then -- 报名才去获取
  103. app.club_php:requestTiantiBaomingInfo(handler(self,self.updateBaomingBtn))
  104. end
  105. end
  106. function TiantiMain:updateBaomingBtn(result)
  107. if result.phone then
  108. self.ui.Items.Button_jifen_baomingcanjia:setVisible(false)
  109. self.ui.Items.Button_jifen_baomingxinxi:setVisible(true)
  110. self.isBaoming = true
  111. end
  112. end
  113. function TiantiMain:onRequestTiantiGameInfo()
  114. app.club_php:requestTiantiGameInfo(handler(self,self.updateGameInfo))
  115. end
  116. function TiantiMain:updateGameInfo(result)
  117. if result.tianscore and not tolua.isnull(self.ui.Items.Text_cur_leiji_tiantifen) then
  118. self.ui.Items.Text_cur_leiji_tiantifen:setText(tostring(result.tianscore))
  119. end
  120. if result.cestpoint and not tolua.isnull(self.ui.Items.Text_shangcheng_duihuan_jifen) then
  121. self.ui.Items.Text_shangcheng_duihuan_jifen:setText(tostring(result.cestpoint))
  122. end
  123. end
  124. function TiantiMain:updateInfo()
  125. end
  126. return TiantiMain