亲友圈审核
parent
6e547f8c9c
commit
24a65c8f08
|
|
@ -69,7 +69,7 @@ function M:FillList(numbers)
|
||||||
print("lingmengtextBtn_detail")
|
print("lingmengtextBtn_detail")
|
||||||
fgCtr:FG_FindMember(self._group.id, numbers[i].uid, function(res)
|
fgCtr:FG_FindMember(self._group.id, numbers[i].uid, function(res)
|
||||||
local familyNumberDetail = FamilyNumberDetail.new(self._group.id, self._group.lev, res)
|
local familyNumberDetail = FamilyNumberDetail.new(self._group.id, self._group.lev, res)
|
||||||
familyNumberDetail:SetTickCallback(self.TickNumberCallback)
|
familyNumberDetail:SetTickCallback(handler(self, self.TickNumberCallback))
|
||||||
familyNumberDetail:Show()
|
familyNumberDetail:Show()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
@ -77,9 +77,9 @@ function M:FillList(numbers)
|
||||||
self._viewList_allNumbers.numItems = #numbers
|
self._viewList_allNumbers.numItems = #numbers
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.TickNumberCallback(res)
|
function M:TickNumberCallback(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
-- self:FillList(self._group.members)
|
self:FillList(self._group.members)
|
||||||
else
|
else
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, "删除成员失败")
|
ViewUtil.ErrorTip(res.ReturnCode, "删除成员失败")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
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
|
||||||
|
|
@ -0,0 +1,110 @@
|
||||||
|
local FamilyJoinAndCreate = {}
|
||||||
|
|
||||||
|
local M = FamilyJoinAndCreate
|
||||||
|
|
||||||
|
function FamilyJoinAndCreate.new(root)
|
||||||
|
setmetatable(M, { __index = root })
|
||||||
|
local self = setmetatable({}, { __index = M })
|
||||||
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
local createOrJoin = self._view:GetController('createOrJoin')
|
||||||
|
|
||||||
|
|
||||||
|
self._currenIndex = 0
|
||||||
|
self.tex_num = self._view:GetChild('text_inputNum')
|
||||||
|
|
||||||
|
self._view:GetChild('btn_joinFamily').onClick:Add(function()
|
||||||
|
createOrJoin.selectedIndex = 1
|
||||||
|
end)
|
||||||
|
self._view:GetChild('btn_createFamily').onClick:Add(function()
|
||||||
|
createOrJoin.selectedIndex = 0
|
||||||
|
end)
|
||||||
|
self._view:GetChild('list_num').onClickItem:Set(handler(self, self.OnNumButtonAction))
|
||||||
|
|
||||||
|
local input_name = self._view:GetChild('input_name')
|
||||||
|
local input_wxId = self._view:GetChild('input_wxId')
|
||||||
|
input_name.onChanged:Set(function()
|
||||||
|
input_name.alpha = 1
|
||||||
|
end)
|
||||||
|
input_name.onFocusOut:Set(function()
|
||||||
|
if #input_name.text > 0 then
|
||||||
|
input_name.alpha = 1
|
||||||
|
else
|
||||||
|
input_name.alpha = 0.5
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
input_wxId.onChanged:Set(function()
|
||||||
|
input_wxId.alpha = 1
|
||||||
|
end)
|
||||||
|
input_wxId.onFocusOut:Set(function()
|
||||||
|
if #input_wxId.text > 0 then
|
||||||
|
input_wxId.alpha = 1
|
||||||
|
else
|
||||||
|
input_wxId.alpha = 0.5
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
self._view:GetChild('btn_create').onClick:Add(function()
|
||||||
|
fgCtr:FG_GroupList(function(res)
|
||||||
|
fgCtr:FG_CreateGroup(input_name.text, 1, 2, function(res)
|
||||||
|
if res.ReturnCode == 0 then
|
||||||
|
self.familyType.selectedIndex = 1
|
||||||
|
self:ConnetFamily(1, DataManager.groups.groupList, true)
|
||||||
|
else
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, '创建大联盟失败!')
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:OnNumButtonAction(context)
|
||||||
|
local item = context.data
|
||||||
|
local index = self._view:GetChild('list_num'):GetChildIndex(item)
|
||||||
|
if index < 9 or index == 10 then
|
||||||
|
if (self._currenIndex < 6) then
|
||||||
|
self._currenIndex = self._currenIndex + 1
|
||||||
|
self.tex_num.text = self.tex_num.text .. (index < 9 and index + 1 or index - 10)
|
||||||
|
if (self._currenIndex == 6) then
|
||||||
|
self:JoinRoom(self.tex_num.text)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif index == 9 then
|
||||||
|
self:ClearNumTex()
|
||||||
|
else
|
||||||
|
if (self._currenIndex > 0) then
|
||||||
|
self._currenIndex = self._currenIndex - 1
|
||||||
|
self.tex_num.text = string.sub(self.tex_num.text, 0, self._currenIndex)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:ClearNumTex()
|
||||||
|
self.tex_num.text = ""
|
||||||
|
self._currenIndex = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:JoinRoom(roomId)
|
||||||
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
--后端似乎还未调通
|
||||||
|
self:ClearNumTex()
|
||||||
|
fgCtr:FG_JoinGroup(tonumber(roomId), function(res)
|
||||||
|
if res.ReturnCode ~= 0 then
|
||||||
|
ViewUtil.ShowOneChooose("加入失败" .. res.ReturnCode)
|
||||||
|
else
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
--先换成邀请玩家
|
||||||
|
-- fgCtr:FG_AddMember(self._group.id, tonumber(roomId), function(res)
|
||||||
|
-- if (res.ReturnCode == 0) then
|
||||||
|
-- ViewUtil.ShowBannerOnScreenCenter('添加成功!', 1)
|
||||||
|
-- else
|
||||||
|
-- ViewUtil.ErrorTip(res.ReturnCode, '邀请玩家失败!')
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- self:ChangeNumber(fgCtr, self._group.id, 0, self._group.total_member_num1, false,
|
||||||
|
-- 1)
|
||||||
|
-- end)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
@ -5,6 +5,8 @@ local GroupGameSettingView = import(".NewGroup.MngView.GroupGameSettingView_jain
|
||||||
---无窗口
|
---无窗口
|
||||||
local FamilyAllNumbers = import(".Family.FamilyAllNumbers")
|
local FamilyAllNumbers = import(".Family.FamilyAllNumbers")
|
||||||
local FamilyNumberRecord = import(".Family.FamilyNumberRecord")
|
local FamilyNumberRecord = import(".Family.FamilyNumberRecord")
|
||||||
|
local FamilyAuditNumber = import(".Family.FamilyAuditNumber")
|
||||||
|
local FamilyJoinAndCreate = import(".Family.FamilyJoinAndCreate")
|
||||||
---
|
---
|
||||||
FamilyView = {}
|
FamilyView = {}
|
||||||
|
|
||||||
|
|
@ -29,7 +31,6 @@ function M:init(url)
|
||||||
local view = self._view
|
local view = self._view
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
|
||||||
local createOrJoin = view:GetController('createOrJoin')
|
|
||||||
self.familyType = view:GetController('familyType')
|
self.familyType = view:GetController('familyType')
|
||||||
self.btn_close = view:GetChild('btn_close')
|
self.btn_close = view:GetChild('btn_close')
|
||||||
|
|
||||||
|
|
@ -44,55 +45,6 @@ function M:init(url)
|
||||||
self.familyType.selectedIndex = 3
|
self.familyType.selectedIndex = 3
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
--------初始化创建和加入亲友圈界面---------------
|
|
||||||
self._currenIndex = 0
|
|
||||||
self.tex_num = view:GetChild('text_inputNum')
|
|
||||||
|
|
||||||
view:GetChild('btn_joinFamily').onClick:Add(function()
|
|
||||||
createOrJoin.selectedIndex = 1
|
|
||||||
self.lastType = 3
|
|
||||||
end)
|
|
||||||
view:GetChild('btn_createFamily').onClick:Add(function()
|
|
||||||
createOrJoin.selectedIndex = 0
|
|
||||||
self.lastType = 3
|
|
||||||
end)
|
|
||||||
view:GetChild('list_num').onClickItem:Set(handler(self, self.OnNumButtonAction))
|
|
||||||
|
|
||||||
local input_name = view:GetChild('input_name')
|
|
||||||
local input_wxId = view:GetChild('input_wxId')
|
|
||||||
input_name.onChanged:Set(function()
|
|
||||||
input_name.alpha = 1
|
|
||||||
end)
|
|
||||||
input_name.onFocusOut:Set(function()
|
|
||||||
if #input_name.text > 0 then
|
|
||||||
input_name.alpha = 1
|
|
||||||
else
|
|
||||||
input_name.alpha = 0.5
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
input_wxId.onChanged:Set(function()
|
|
||||||
input_wxId.alpha = 1
|
|
||||||
end)
|
|
||||||
input_wxId.onFocusOut:Set(function()
|
|
||||||
if #input_wxId.text > 0 then
|
|
||||||
input_wxId.alpha = 1
|
|
||||||
else
|
|
||||||
input_wxId.alpha = 0.5
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
view:GetChild('btn_create').onClick:Add(function()
|
|
||||||
fgCtr:FG_GroupList(function(res)
|
|
||||||
fgCtr:FG_CreateGroup(input_name.text, 1, 2, function(res)
|
|
||||||
if res.ReturnCode == 0 then
|
|
||||||
self.familyType.selectedIndex = 1
|
|
||||||
self:ConnetFamily(1, DataManager.groups.groupList, true)
|
|
||||||
else
|
|
||||||
ViewUtil.ErrorTip(res.ReturnCode, '创建大联盟失败!')
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end)
|
|
||||||
end)
|
|
||||||
-------绑定成员战绩按钮
|
-------绑定成员战绩按钮
|
||||||
view:GetChild('btn_family_record').onClick:Set(function()
|
view:GetChild('btn_family_record').onClick:Set(function()
|
||||||
self._child_familyNumberRecord = FamilyNumberRecord.New(self)
|
self._child_familyNumberRecord = FamilyNumberRecord.New(self)
|
||||||
|
|
@ -109,7 +61,6 @@ function M:InitCloseClick()
|
||||||
self.familyType.selectedIndex = self.lastType
|
self.familyType.selectedIndex = self.lastType
|
||||||
if self.lastType == 3 then
|
if self.lastType == 3 then
|
||||||
self.lastType = 1
|
self.lastType = 1
|
||||||
createOrJoin.selectedIndex = (createOrJoin.selectedIndex + 1) % 2
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
@ -124,6 +75,7 @@ function M:CreateFamily()
|
||||||
self.familyType.selectedIndex = 3
|
self.familyType.selectedIndex = 3
|
||||||
self.lastType = 1
|
self.lastType = 1
|
||||||
self._view:GetController('createOrJoin').selectedIndex = 0
|
self._view:GetController('createOrJoin').selectedIndex = 0
|
||||||
|
self._child_familyJoinAndCreate = FamilyJoinAndCreate.new(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:JoinFamily()
|
function M:JoinFamily()
|
||||||
|
|
@ -142,6 +94,11 @@ function M:AllNumber()
|
||||||
self._child_familyAllNumbers = FamilyAllNumbers.new(self)
|
self._child_familyAllNumbers = FamilyAllNumbers.new(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M:AuditNumber()
|
||||||
|
self.lastType = 1
|
||||||
|
self._child_familyAuditNumber = FamilyAuditNumber.new(self)
|
||||||
|
end
|
||||||
|
|
||||||
function M:ChangeNumber(fgCtr, group_id, limit, num, minus_only, sort_type)
|
function M:ChangeNumber(fgCtr, group_id, limit, num, minus_only, sort_type)
|
||||||
local list_familyNumber = self._view:GetChild('list_familyNumber')
|
local list_familyNumber = self._view:GetChild('list_familyNumber')
|
||||||
list_familyNumber:SetVirtual()
|
list_familyNumber:SetVirtual()
|
||||||
|
|
@ -334,56 +291,6 @@ function M:ConnetFamily(index, groups, isCreate)
|
||||||
UpdateBeat:Add(self.OnUpdate, self)
|
UpdateBeat:Add(self.OnUpdate, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
----------创建和加入---------------------
|
|
||||||
function M:OnNumButtonAction(context)
|
|
||||||
local item = context.data
|
|
||||||
local index = self._view:GetChild('list_num'):GetChildIndex(item)
|
|
||||||
if index < 9 or index == 10 then
|
|
||||||
if (self._currenIndex < 6) then
|
|
||||||
self._currenIndex = self._currenIndex + 1
|
|
||||||
self.tex_num.text = self.tex_num.text .. (index < 9 and index + 1 or index - 10)
|
|
||||||
if (self._currenIndex == 6) then
|
|
||||||
self:JoinRoom(self.tex_num.text)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elseif index == 9 then
|
|
||||||
self:ClearNumTex()
|
|
||||||
else
|
|
||||||
if (self._currenIndex > 0) then
|
|
||||||
self._currenIndex = self._currenIndex - 1
|
|
||||||
self.tex_num.text = string.sub(self.tex_num.text, 0, self._currenIndex)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:ClearNumTex()
|
|
||||||
self.tex_num.text = ""
|
|
||||||
self._currenIndex = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:JoinRoom(roomId)
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
||||||
--后端似乎还未调通
|
|
||||||
self:ClearNumTex()
|
|
||||||
fgCtr:FG_JoinGroup(tonumber(roomId), function(res)
|
|
||||||
if res.ReturnCode ~= 0 then
|
|
||||||
ViewUtil.ShowOneChooose("加入失败" .. res.ReturnCode)
|
|
||||||
else
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
--先换成邀请玩家
|
|
||||||
-- fgCtr:FG_AddMember(self._group.id, tonumber(roomId), function(res)
|
|
||||||
-- if (res.ReturnCode == 0) then
|
|
||||||
-- ViewUtil.ShowBannerOnScreenCenter('添加成功!', 1)
|
|
||||||
-- else
|
|
||||||
-- ViewUtil.ErrorTip(res.ReturnCode, '邀请玩家失败!')
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- self:ChangeNumber(fgCtr, self._group.id, 0, self._group.total_member_num1, false,
|
|
||||||
-- 1)
|
|
||||||
-- end)
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:OnUpdate()
|
function M:OnUpdate()
|
||||||
-- --12001事件
|
-- --12001事件
|
||||||
-- if self._group.update_room then
|
-- if self._group.update_room then
|
||||||
|
|
@ -444,7 +351,7 @@ local IDENTITY_LIST = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "申请消息",
|
name = "申请消息",
|
||||||
Fct = M.ShareWx
|
Fct = M.AuditNumber
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "查看成员",
|
name = "查看成员",
|
||||||
|
|
@ -486,7 +393,7 @@ local IDENTITY_LIST = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "申请消息",
|
name = "申请消息",
|
||||||
Fct = M.ShareWx
|
Fct = M.AuditNumber
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "查看成员",
|
name = "查看成员",
|
||||||
|
|
@ -501,13 +408,9 @@ local IDENTITY_LIST = {
|
||||||
Fct = M.CreateFamily
|
Fct = M.CreateFamily
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "添加助理",
|
name = "亲友圈排行榜",
|
||||||
Fct = M.CreateFamily
|
Fct = M.CreateFamily
|
||||||
},
|
}
|
||||||
{
|
|
||||||
name = "加入亲友圈",
|
|
||||||
Fct = M.JoinFamily
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue