2025-06-17 17:51:24 +08:00
|
|
|
--region LOCAL
|
|
|
|
|
|
|
|
|
|
local BanDesk = {}
|
|
|
|
|
local root = {}
|
|
|
|
|
local rootLastIndex = 0
|
|
|
|
|
|
|
|
|
|
local function HideMainView()
|
|
|
|
|
rootLastIndex = root.familyType.selectedIndex
|
|
|
|
|
root.familyType.selectedIndex = 0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function ShowMainView()
|
|
|
|
|
root.familyType.selectedIndex = rootLastIndex or 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--endregion
|
|
|
|
|
|
|
|
|
|
-- 禁止同桌数据
|
|
|
|
|
BanDesk.BanData = {}
|
|
|
|
|
|
|
|
|
|
function BanDesk:TryShow(r)
|
|
|
|
|
if not self._view then
|
|
|
|
|
self:Init()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
root = r
|
|
|
|
|
HideMainView()
|
|
|
|
|
self:Show()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function BanDesk:Close()
|
|
|
|
|
BaseView.Close(self)
|
|
|
|
|
ShowMainView()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function BanDesk:Init()
|
|
|
|
|
setmetatable(BanDesk, {__index = BaseView})
|
|
|
|
|
self:InitView("ui://Family/com_banDesk")
|
|
|
|
|
|
|
|
|
|
self.btn_close = self._view:GetChild("btn_close")
|
|
|
|
|
self.list_banItem = self._view:GetChild("list_banItem")
|
|
|
|
|
|
|
|
|
|
self.btn_close.onClick:Set(function()
|
|
|
|
|
self:Close()
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
self.list_banItem.itemRenderer = function(index, obj)
|
2025-06-17 18:21:07 +08:00
|
|
|
|
2025-06-17 17:51:24 +08:00
|
|
|
local data = self.BanData[index]
|
|
|
|
|
|
|
|
|
|
local tex_name = obj:GetChild("tex_name")
|
|
|
|
|
local list_BanedPlayers = obj:GetChild("list_BanedPlayers")
|
|
|
|
|
local btn_del = obj:GetChild("btn_del")
|
|
|
|
|
local btn_addBanItem = obj:GetChild("btn_addBanItem")
|
2025-06-17 18:21:07 +08:00
|
|
|
|
2025-06-17 21:49:48 +08:00
|
|
|
btn_addBanItem.onClick:Set(function()
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
local groupId = root._group
|
|
|
|
|
local userId = DataManager.SelfUser.account_id
|
|
|
|
|
local banList = {}
|
|
|
|
|
--fgCtr:FG_SetBanTable(groupId, userId, , {},function()
|
|
|
|
|
--end)
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
list_BanedPlayers.itemRenderer = function(i, o)
|
|
|
|
|
|
|
|
|
|
end
|
2025-06-17 17:51:24 +08:00
|
|
|
end
|
2025-06-17 21:49:48 +08:00
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function BanDesk:Reflash()
|
2025-06-17 18:21:07 +08:00
|
|
|
-- 最后一个添加ban按钮
|
|
|
|
|
local addBanItem = self.list_banItem:AddItemFromPool()
|
2025-06-17 21:49:48 +08:00
|
|
|
addBanItem:GetController("cStyle").selectedIndex = 1
|
|
|
|
|
|
2025-06-17 18:21:07 +08:00
|
|
|
--addBanItem
|
2025-06-17 17:51:24 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return BanDesk
|