hengyang_client/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua

62 lines
2.0 KiB
Lua

--设置窗口对象
local FamilyNumberDetail = {}
local M = FamilyNumberDetail
setmetatable(M, { __index = BaseWindow })
function FamilyNumberDetail.new(groupId,res)
local self = setmetatable({}, { __index = M })
self.class = 'FamilyNumberDetail'
self._close_destroy = true
self.groupId = groupId
self:init('ui://Family/NumberDetail',res)
return self
end
function M:init(url,res)
local fgCtr = ControllerManager.GetController(NewGroupController)
BaseWindow.init(self, url)
local info = res.Data.members[1]
self._view:GetChild('name').text = string.format("%s(%s)",info.nick,info.uid)
self._view:GetChild('text_allRounds').text = info.total_round
self._view:GetChild('text_joinTime').text = os.date('%Y-%m-%d %H:%M', info.join_time)
self._view:GetChild('text_score_majiang').text = 0
self._view:GetChild('text_score_poker').text = 0
self._view:GetChild('btn_changeTag').onClick:Set(function()
ViewUtil.ShowOneChooose("该功能还未开放")
end)
self._view:GetChild('btn_changeMJScore').onClick:Set(function()
ViewUtil.ShowOneChooose("该功能还未开放")
end)
self._view:GetChild('btn_changePokerScore').onClick:Set(function()
ViewUtil.ShowOneChooose("该功能还未开放")
end)
self._view:GetChild('btn_tick').onClick:Set(function()
ViewUtil.ShowTwoChooose(string.format("是否将用户(%s)踢出",info.nick),function()
fgCtr:FG_GroupRemoveMember(self.groupId,info.uid,self._callback_tick)
self:Destroy()
end)
end)
self._view:GetChild('btn_band').onClick:Set(function()
ViewUtil.ShowTwoChooose(string.format("是否禁止用户(%s)进入房间",info.nick),function()
fgCtr:FG_GroupRemoveMember(self.groupId,info.uid,function()
ViewUtil.ShowOneChooose("用户(%s)已禁止进入房间",info.nick)
end)
end)
end)
end
function M:SetTickCallback(callback)
self._callback_tick = callback
end
return M