56 lines
1.8 KiB
Lua
56 lines
1.8 KiB
Lua
|
|
local FamilyAuditNumber = {}
|
||
|
|
|
||
|
|
local M = FamilyAuditNumber
|
||
|
|
|
||
|
|
function FamilyAuditNumber.new(root)
|
||
|
|
setmetatable(M, { __index = root })
|
||
|
|
local self = setmetatable({}, { __index = M })
|
||
|
|
|
||
|
|
self:InitList()
|
||
|
|
|
||
|
|
return self
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:InitList()
|
||
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||
|
|
fgCtr:FG_GroupJoins(self._group.id, function(res)
|
||
|
|
pt(res)
|
||
|
|
if res.ReturnCode ~= 0 then
|
||
|
|
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||
|
|
else
|
||
|
|
local data = res.Data.joins
|
||
|
|
self.familyType.selectedIndex = 6
|
||
|
|
local list = self._view:GetChild('list_auditNumberList')
|
||
|
|
list:SetVirtual()
|
||
|
|
list.itemRenderer = function(index, obj)
|
||
|
|
local info = data[index + 1]
|
||
|
|
obj:GetChild('text_name').text = info.nick
|
||
|
|
obj:GetChild('text_id').text = info.id
|
||
|
|
obj:GetChild('text_time').text = os.date('%Y-%m-%d %H:%M', os.time())
|
||
|
|
ImageLoad.Load(info.portrait, obj:GetChild('btn_head')._iconObject)
|
||
|
|
obj:GetChild('btn_allow').onClick:Set(function()
|
||
|
|
self:ClickBtn(1, info.id)
|
||
|
|
end)
|
||
|
|
obj:GetChild('btn_unAllow').onClick:Set(function()
|
||
|
|
self:ClickBtn(0, info.id)
|
||
|
|
end)
|
||
|
|
end
|
||
|
|
list.numItems = #data
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:ClickBtn(isAllow, uid)
|
||
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||
|
|
fgCtr:FG_GroupVerifyJoin(self._group.id, uid, isAllow == 1, function(res)
|
||
|
|
if res.ReturnCode ~= 0 then
|
||
|
|
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
||
|
|
else
|
||
|
|
ViewUtil.ShowOneChooose("审核成功")
|
||
|
|
self:InitList()
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
end
|
||
|
|
|
||
|
|
return M
|