--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) 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") 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 end end function BanDesk:Reflash() -- 最后一个添加ban按钮 local addBanItem = self.list_banItem:AddItemFromPool() addBanItem:GetController("cStyle").selectedIndex = 1 --addBanItem end return BanDesk