64 lines
2.0 KiB
Lua
64 lines
2.0 KiB
Lua
--local NumberRemark = import(".FamilyNumberRemark")
|
|
local GroupSetTagView = import("..NewGroup.GroupSetTagView")
|
|
|
|
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
|
|
if isAllow == 1 then
|
|
local tagView = GroupSetTagView.new(self._group.id, uid)
|
|
tagView:Show()
|
|
else
|
|
|
|
end
|
|
self:InitList()
|
|
end
|
|
end)
|
|
end
|
|
|
|
return M
|