补充上传
parent
ceaa9dfb55
commit
ab2c4df351
|
|
@ -14,23 +14,8 @@ local function ShowMainView(self)
|
|||
self.root.familyType.selectedIndex = rootLastIndex or 1
|
||||
end
|
||||
|
||||
local function LoadData(BanData)
|
||||
|
||||
end
|
||||
|
||||
local function GetIconFromGroupData(playerId, group)
|
||||
local player = group.memberMap[playerId]
|
||||
if player then
|
||||
return player.portrait
|
||||
end
|
||||
|
||||
print("玩家不在group中,无法找到头像 玩家id=", playerId)
|
||||
|
||||
return ""
|
||||
end
|
||||
|
||||
local function RemoveItem(table, condition)
|
||||
for _, item in pairs(table) do
|
||||
for _,item in pairs(table) do
|
||||
if condition(item) then
|
||||
table[_] = nil
|
||||
end
|
||||
|
|
@ -38,7 +23,7 @@ local function RemoveItem(table, condition)
|
|||
|
||||
--修复下标
|
||||
local re = {}
|
||||
for _, item in pairs(table) do
|
||||
for _,item in pairs(table) do
|
||||
re[#re + 1] = item
|
||||
end
|
||||
|
||||
|
|
@ -51,11 +36,12 @@ local function GetPlayerFromGroupData(playerId, group)
|
|||
return player
|
||||
end
|
||||
|
||||
print("玩家不在group中, 玩家id=", playerId)
|
||||
print("玩家不在group中, 玩家id=",playerId)
|
||||
return nil
|
||||
end
|
||||
|
||||
local function AllUid(deskList)
|
||||
|
||||
local re = {}
|
||||
pt(deskList)
|
||||
for _, player in pairs(deskList) do
|
||||
|
|
@ -65,6 +51,7 @@ local function AllUid(deskList)
|
|||
end
|
||||
|
||||
local function AddPlayer(data, self)
|
||||
|
||||
if self.sending then
|
||||
ViewUtil.ShowBannerOnScreenCenter("正在操作中。。")
|
||||
return
|
||||
|
|
@ -83,7 +70,7 @@ local function AddPlayer(data, self)
|
|||
ViewUtil.ShowBannerOnScreenCenter("设置失败")
|
||||
return
|
||||
end
|
||||
data.deskList[#data.deskList + 1] = { uid = number.uid }
|
||||
data.deskList[#data.deskList + 1] = {uid = number.uid}
|
||||
self:ReflashDesk()
|
||||
end)
|
||||
end)
|
||||
|
|
@ -111,13 +98,25 @@ local function DelPalyer(data, uid, self)
|
|||
end
|
||||
players = fix
|
||||
|
||||
self.sending = true
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:FG_SetBanTable1(self.root._group.id, data.deskId, players, data.deskName, function() self:ReflashDesk() end)
|
||||
fgCtr:FG_SetBanTable1(self.root._group.id, data.deskId, players, data.deskName, function(res)
|
||||
self.sending = false
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ShowBannerOnScreenCenter("删除失败")
|
||||
return
|
||||
end
|
||||
data.deskList = RemoveItem(data.deskList, function(item)
|
||||
if item.uid == uid then
|
||||
return true
|
||||
end
|
||||
end)
|
||||
self:ReflashDesk()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
local function DelDesk(data, self)
|
||||
|
||||
if self.sending then
|
||||
ViewUtil.ShowBannerOnScreenCenter("正在操作中。。")
|
||||
return
|
||||
|
|
@ -186,7 +185,7 @@ local function list_BanedPlayersRenderer(index, obj, data, self, fatherIndex)
|
|||
end
|
||||
|
||||
local function list_banItemRenderer(index, obj, self)
|
||||
local data = self.BanData[index + 1]
|
||||
local data = self.BanData[index +1]
|
||||
--print("刷新关系")
|
||||
--pt(data)
|
||||
local tex_name = obj:GetChild("tex_name")
|
||||
|
|
@ -227,6 +226,7 @@ end
|
|||
|
||||
|
||||
function BanDesk:TryShow(r)
|
||||
|
||||
local view = BanDesk.New()
|
||||
|
||||
self.root = r
|
||||
|
|
@ -259,6 +259,7 @@ function BanDesk.New()
|
|||
end
|
||||
|
||||
function BanDesk:Init()
|
||||
|
||||
self.sending = false
|
||||
|
||||
self.btn_close = self._view:GetChild("btn_close")
|
||||
|
|
@ -292,48 +293,20 @@ function BanDesk:Init()
|
|||
list_banItemRenderer(index, obj, self)
|
||||
end
|
||||
|
||||
|
||||
-- list_BanedPlayers.itemRenderer = function(playerIndex, playerObj)
|
||||
|
||||
-- local loader_icon = playerObj:GetChild("loader_icon")
|
||||
-- local tex_name = playerObj:GetChild("tex_name")
|
||||
|
||||
-- local player = data.deskList[playerIndex + 1]
|
||||
-- playerObj:GetController("cStyle").selectedIndex = 0
|
||||
-- tex_name.text = player.nick
|
||||
-- local img = GetIconFromGroupData(player.uid, self.root._group)
|
||||
-- ImageLoad.Load(img, loader_icon)
|
||||
|
||||
-- local btn_delPlayer = playerObj:GetChild("btn_delPlayer")
|
||||
-- btn_delPlayer.onClick:Set(function()
|
||||
-- -- 删除玩家按钮
|
||||
-- self.changedIndex = index
|
||||
-- DelPalyer(data, player.uid, self)
|
||||
-- end)
|
||||
-- end
|
||||
|
||||
-- list_BanedPlayers.numItems = #data.deskList
|
||||
|
||||
-- local add_play = list_BanedPlayers:AddItemFromPool()
|
||||
-- add_play:GetController("cStyle").selectedIndex = 1
|
||||
-- add_play:GetChild("btn_addPlayer").onClick:Set(function()
|
||||
-- -- 添加玩家按钮
|
||||
-- self.changedIndex = index
|
||||
-- AddPlayer(data, self)
|
||||
-- end)
|
||||
-- end
|
||||
end
|
||||
|
||||
function BanDesk:Reflash()
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
local groupId = self.root._group.id
|
||||
|
||||
fgCtr:FG_GetBanTable1(groupId, function(res)
|
||||
fgCtr:FG_GetBanTable1(groupId,function(res)
|
||||
self:GetBanTableCallback(res)
|
||||
end)
|
||||
end
|
||||
|
||||
function BanDesk:GetBanTableCallback(res)
|
||||
|
||||
self.BanData = Sort(res.Data.ban_list)
|
||||
self.list_banItem.numItems = #self.BanData
|
||||
|
||||
|
|
@ -342,6 +315,7 @@ function BanDesk:GetBanTableCallback(res)
|
|||
local btn_addBanItem = addBanItem:GetChild("btn_addBanItem")
|
||||
addBanItem:GetController("cStyle").selectedIndex = 1
|
||||
btn_addBanItem.onClick:Set(function()
|
||||
|
||||
if self.sending then
|
||||
ViewUtil.ShowBannerOnScreenCenter("正在操作中。。")
|
||||
return
|
||||
|
|
@ -372,4 +346,5 @@ function BanDesk:CloseRemaskWindow()
|
|||
self.cSetName.selectedIndex = 0
|
||||
end
|
||||
|
||||
|
||||
return BanDesk
|
||||
|
|
@ -54,6 +54,7 @@ function FamilyMyFamily:TryShow(groupId, r)
|
|||
end
|
||||
|
||||
function FamilyMyFamily:Show()
|
||||
|
||||
self:Refalsh()
|
||||
|
||||
HideMainView()
|
||||
|
|
@ -66,6 +67,7 @@ function FamilyMyFamily:Close()
|
|||
end
|
||||
|
||||
function FamilyMyFamily:Refalsh()
|
||||
|
||||
self.family = DataManager.groups.groupMap[self.groupId]
|
||||
|
||||
self.tex_fName.text = self.family.name
|
||||
|
|
@ -75,7 +77,7 @@ function FamilyMyFamily:Refalsh()
|
|||
self.tex_nocice.text = self.family.notice
|
||||
ImageLoad.Load(self.family.o_portrait, self.loader_icon)
|
||||
|
||||
self.cStyle.selectedIndex = self.family.lev - 1
|
||||
self.cStyle.selectedIndex = self.family.lev -1
|
||||
|
||||
-- index = 0 是显示隐藏按钮
|
||||
self.showNumber = self.family.isShow
|
||||
|
|
@ -166,7 +168,7 @@ function FamilyMyFamily:Init()
|
|||
|
||||
self.btn_quitFamily.onClick:Set(function()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
print("发送了退出协议 familyid = ", self.family.id)
|
||||
print("发送了退出协议 familyid = ",self.family.id)
|
||||
fgCtr:FG_ExitGroup(self.family.id, function(res)
|
||||
if res.ReturnCode ~= 0 then
|
||||
return
|
||||
|
|
@ -192,6 +194,7 @@ function FamilyMyFamily:Init()
|
|||
self.btn_confirmNotice.onClick:Set(ChangeNotice)
|
||||
|
||||
self.btn_hideNumber.onClick:Set(function()
|
||||
|
||||
if self.isShowContenting == true then
|
||||
ViewUtil.ShowBannerOnScreenCenter("设置中,请稍后再试。。")
|
||||
return
|
||||
|
|
@ -201,7 +204,7 @@ function FamilyMyFamily:Init()
|
|||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
self.isShowContenting = true
|
||||
fgCtr:FG_SetGroupShow(0, self.family.id, function(res)
|
||||
fgCtr:FG_SetGroupShow(0, self.family.id, function (res)
|
||||
print("收到协议M:FG_SetGroupShow")
|
||||
pt(res)
|
||||
self.isShowContenting = false
|
||||
|
|
@ -225,55 +228,7 @@ function FamilyMyFamily:Init()
|
|||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
self.isShowContenting = true
|
||||
fgCtr:FG_SetGroupShow(1, self.family.id, function(res)
|
||||
print("收到协议M:FG_SetGroupShow")
|
||||
pt(res)
|
||||
self.isShowContenting = false
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ShowBannerOnScreenCenter("设置失败,请稍后再试。。")
|
||||
return
|
||||
end
|
||||
self.family.isShow = 1
|
||||
self:Refalsh()
|
||||
ViewUtil.ShowBannerOnScreenCenter("设置成功")
|
||||
end)
|
||||
end)
|
||||
|
||||
self.btn_hideNumber.onClick:Set(function()
|
||||
if self.isShowContenting == true then
|
||||
ViewUtil.ShowBannerOnScreenCenter("设置中,请稍后再试。。")
|
||||
return
|
||||
end
|
||||
|
||||
print("点击了")
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
self.isShowContenting = true
|
||||
fgCtr:FG_SetGroupShow(0, self.family.id, function(res)
|
||||
print("收到协议M:FG_SetGroupShow")
|
||||
pt(res)
|
||||
self.isShowContenting = false
|
||||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ShowBannerOnScreenCenter("设置失败,请稍后再试。。")
|
||||
return
|
||||
end
|
||||
self.family.isShow = 0
|
||||
self:Refalsh()
|
||||
ViewUtil.ShowBannerOnScreenCenter("设置成功")
|
||||
end)
|
||||
end)
|
||||
|
||||
self.btn_showNumber.onClick:Set(function()
|
||||
if self.isShowContenting == true then
|
||||
ViewUtil.ShowBannerOnScreenCenter("设置中,请稍后再试。。")
|
||||
return
|
||||
end
|
||||
|
||||
print("点击了")
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
self.isShowContenting = true
|
||||
fgCtr:FG_SetGroupShow(1, self.family.id, function(res)
|
||||
fgCtr:FG_SetGroupShow(1, self.family.id, function (res)
|
||||
print("收到协议M:FG_SetGroupShow")
|
||||
pt(res)
|
||||
self.isShowContenting = false
|
||||
|
|
|
|||
Loading…
Reference in New Issue