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.

107 lines
3.2 KiB

  1. -- 冻结茶馆Layout
  2. local ClubDongJie = class("ClubDongJie" , cc.UIView);
  3. local ClubDefine = require("luaScript.Protocol.Club.ClubDefine")
  4. function ClubDongJie:ctor(clubId,opType)
  5. ClubDongJie.super.ctor(self)
  6. local ui = loadUI("res/ui/ui_club/ui_club_dongjie.ui")
  7. self.ui = ui;
  8. self:addChild(ui);
  9. -- self.Info = data;
  10. self.clubInfo = app.club_php.clubList[clubId]
  11. self.opType = opType
  12. end
  13. function ClubDongJie:onEnter()
  14. ClubDongJie.super.onEnter(self)
  15. self.ui.Items.Text_name:setString(app.club_php:getCestIsOpen(app.club_php.clubID) and PLN.CLUB_CEST_DONG_JIE_CLUB_NAME or PLN.CLUB_DONG_JIE_CLUB_NAME)
  16. self.ui.Items.Text_id:setString(app.club_php:getCestIsOpen(app.club_php.clubID) and PLN.CLUB_CEST_DONG_JIE_CLUB_ID or PLN.CLUB_DONG_JIE_CLUB_ID)
  17. --关闭
  18. self.ui.Items.Button_close:registerClick(handler(self , self.onClose))
  19. self.ui.Items.Button_cancel:registerClick(handler(self , self.onClose))
  20. --确认创建
  21. self.ui.Items.Button_confirm:registerClick(handler(self , self.onConfirm))
  22. --绑定回调
  23. self:bindEvent(app.club_php , GAME_EVENT.CLUB_SET , handler(self , self.changeSetCallbackEnd));
  24. --初始化界面
  25. self:init();
  26. end
  27. function ClubDongJie:changeSetCallbackEnd(event)
  28. if event.setType == GAME_CLUB_SET_STATE.Club_status then
  29. self:removeFromParent()
  30. end
  31. end
  32. function ClubDongJie:onClose()
  33. playBtnCloseEffect()
  34. self:removeFromParent()
  35. end
  36. function ClubDongJie:onConfirm()
  37. playBtnEffect()
  38. --确认后关闭当前提示框
  39. self:removeFromParent()
  40. --状态操作茶馆(参数1:群ID,参数2:状态操作类型,参数3:1正常2冻结0解散)
  41. local statue = 1;
  42. if self.opType == 1 then
  43. --解冻
  44. statue = 1;
  45. elseif self.opType == 2 then
  46. --冻结
  47. statue = 2;
  48. elseif self.opType == 0 then
  49. --解散
  50. statue = 0;
  51. elseif self.opType == 3 then
  52. --退出
  53. app.club_php:requestExitClub(self.clubInfo.clubId);
  54. return;
  55. end
  56. app.club_php:requestSetClub(self.clubInfo.clubId,GAME_CLUB_SET_STATE.Club_status,statue);
  57. end
  58. function ClubDongJie:init()
  59. --茶馆名
  60. self.ui.Items.Text_club_name:setText(self.clubInfo.clubName);
  61. --茶馆id
  62. self.ui.Items.Text_club_id:setText(self.clubInfo.clubId);
  63. if self.opType == 1 then
  64. --解冻
  65. --标题
  66. self.ui.Items.ImageView_title:loadTexture("res/ui/zy_club/club_room/club_dong_jie/club_title_font_jiedong.png")
  67. --内容
  68. self.ui.Items.Text_dongjie_content:setText(app.club_php:getCestIsOpen(app.club_php.clubID) and PLN.CLUB_CEST_JIE_DONG or PLN.CLUB_JIE_DONG)
  69. elseif self.opType == 2 then
  70. --冻结
  71. --标题
  72. self.ui.Items.ImageView_title:loadTexture("res/ui/zy_club/club_room/club_dong_jie/club_title_font_dongjie.png")
  73. --内容
  74. self.ui.Items.Text_dongjie_content:setText(app.club_php:getCestIsOpen(app.club_php.clubID) and PLN.CLUB_CEST_DONG_JIE or PLN.CLUB_DONG_JIE)
  75. else
  76. --退出
  77. --标题
  78. self.ui.Items.ImageView_title:loadTexture("res/ui/zy_club/club_room/club_dong_jie/club_title_font_exit.png")
  79. --内容
  80. self.ui.Items.Text_dongjie_content:setText(app.club_php:getCestIsOpen(app.club_php.clubID) and PLN.CLUB_CEST_EXIT or PLN.CLUB_EXIT)
  81. if app.club_php:getCestIsOpen(app.club_php.clubID) then
  82. self.ui.Items.ImageView_title:loadTexture("res/ui/zy_club/club_room/club_dong_jie/club_title_font_exit_saishi.png")
  83. end
  84. end
  85. end
  86. return ClubDongJie