57 lines
1.3 KiB
Lua
57 lines
1.3 KiB
Lua
|
|
require 'FairyGUI'
|
||
|
|
|
||
|
|
local FamilyChatRoom = {}
|
||
|
|
|
||
|
|
--[[
|
||
|
|
function FamilyChatRoom.New()
|
||
|
|
--转移进family界面
|
||
|
|
--setmetatable(FamilyChatRoom, { __index = BaseWindow })
|
||
|
|
--local inst = setmetatable({}, { __index = FamilyChatRoom})
|
||
|
|
|
||
|
|
inst:Init(com)
|
||
|
|
|
||
|
|
return inst
|
||
|
|
end
|
||
|
|
]]
|
||
|
|
|
||
|
|
function FamilyChatRoom:Init(com, root)
|
||
|
|
--转移进family界面
|
||
|
|
--self._full = true
|
||
|
|
--self._full_offset = false
|
||
|
|
--self._animation = false
|
||
|
|
--BaseWindow.init(self, "ui://Family/com_chatRoom")
|
||
|
|
|
||
|
|
self.root = root
|
||
|
|
self._view = com
|
||
|
|
|
||
|
|
self.list_chat = self._view:GetChild("list_chat")
|
||
|
|
self.btn_quit = self._view:GetChild("btn_quit")
|
||
|
|
|
||
|
|
self.btn_quit.onClick:Set(function()
|
||
|
|
self:Close()
|
||
|
|
end)
|
||
|
|
|
||
|
|
return self
|
||
|
|
end
|
||
|
|
|
||
|
|
function FamilyChatRoom:Close()
|
||
|
|
local cChatRoom = self.root._view:GetController("cIsChatRoom")
|
||
|
|
cChatRoom.selectedIndex = 0
|
||
|
|
end
|
||
|
|
|
||
|
|
function FamilyChatRoom:Show()
|
||
|
|
local cChatRoom = self.root._view:GetController("cIsChatRoom")
|
||
|
|
cChatRoom.selectedIndex = 1
|
||
|
|
|
||
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||
|
|
fgCtr:GetChatRoom(self.root._group.id, function(res)
|
||
|
|
self:GetChatCallBack(res)
|
||
|
|
end)
|
||
|
|
end
|
||
|
|
|
||
|
|
function FamilyChatRoom:GetChatCallBack(res)
|
||
|
|
print("收到聊天室协议")
|
||
|
|
pt(res)
|
||
|
|
end
|
||
|
|
|
||
|
|
return FamilyChatRoom
|