-- 冻结茶馆Layout local ClubDongJie = class("ClubDongJie" , cc.UIView); local ClubDefine = require("luaScript.Protocol.Club.ClubDefine") function ClubDongJie:ctor(clubId,opType) ClubDongJie.super.ctor(self) local ui = loadUI("res/ui/ui_club/ui_club_dongjie.ui") self.ui = ui; self:addChild(ui); -- self.Info = data; self.clubInfo = app.club_php.clubList[clubId] self.opType = opType end function ClubDongJie:onEnter() ClubDongJie.super.onEnter(self) 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) 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) --关闭 self.ui.Items.Button_close:registerClick(handler(self , self.onClose)) self.ui.Items.Button_cancel:registerClick(handler(self , self.onClose)) --确认创建 self.ui.Items.Button_confirm:registerClick(handler(self , self.onConfirm)) --绑定回调 self:bindEvent(app.club_php , GAME_EVENT.CLUB_SET , handler(self , self.changeSetCallbackEnd)); --初始化界面 self:init(); end function ClubDongJie:changeSetCallbackEnd(event) if event.setType == GAME_CLUB_SET_STATE.Club_status then self:removeFromParent() end end function ClubDongJie:onClose() playBtnCloseEffect() self:removeFromParent() end function ClubDongJie:onConfirm() playBtnEffect() --确认后关闭当前提示框 self:removeFromParent() --状态操作茶馆(参数1:群ID,参数2:状态操作类型,参数3:1正常2冻结0解散) local statue = 1; if self.opType == 1 then --解冻 statue = 1; elseif self.opType == 2 then --冻结 statue = 2; elseif self.opType == 0 then --解散 statue = 0; elseif self.opType == 3 then --退出 app.club_php:requestExitClub(self.clubInfo.clubId); return; end app.club_php:requestSetClub(self.clubInfo.clubId,GAME_CLUB_SET_STATE.Club_status,statue); end function ClubDongJie:init() --茶馆名 self.ui.Items.Text_club_name:setText(self.clubInfo.clubName); --茶馆id self.ui.Items.Text_club_id:setText(self.clubInfo.clubId); if self.opType == 1 then --解冻 --标题 self.ui.Items.ImageView_title:loadTexture("res/ui/zy_club/club_room/club_dong_jie/club_title_font_jiedong.png") --内容 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) elseif self.opType == 2 then --冻结 --标题 self.ui.Items.ImageView_title:loadTexture("res/ui/zy_club/club_room/club_dong_jie/club_title_font_dongjie.png") --内容 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) else --退出 --标题 self.ui.Items.ImageView_title:loadTexture("res/ui/zy_club/club_room/club_dong_jie/club_title_font_exit.png") --内容 self.ui.Items.Text_dongjie_content:setText(app.club_php:getCestIsOpen(app.club_php.clubID) and PLN.CLUB_CEST_EXIT or PLN.CLUB_EXIT) if app.club_php:getCestIsOpen(app.club_php.clubID) then self.ui.Items.ImageView_title:loadTexture("res/ui/zy_club/club_room/club_dong_jie/club_title_font_exit_saishi.png") end end end return ClubDongJie