补充上传
parent
ceaa9dfb55
commit
ab2c4df351
|
|
@ -14,21 +14,6 @@ local function ShowMainView(self)
|
||||||
self.root.familyType.selectedIndex = rootLastIndex or 1
|
self.root.familyType.selectedIndex = rootLastIndex or 1
|
||||||
end
|
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)
|
local function RemoveItem(table, condition)
|
||||||
for _,item in pairs(table) do
|
for _,item in pairs(table) do
|
||||||
if condition(item) then
|
if condition(item) then
|
||||||
|
|
@ -56,6 +41,7 @@ local function GetPlayerFromGroupData(playerId, group)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function AllUid(deskList)
|
local function AllUid(deskList)
|
||||||
|
|
||||||
local re = {}
|
local re = {}
|
||||||
pt(deskList)
|
pt(deskList)
|
||||||
for _, player in pairs(deskList) do
|
for _, player in pairs(deskList) do
|
||||||
|
|
@ -65,6 +51,7 @@ local function AllUid(deskList)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function AddPlayer(data, self)
|
local function AddPlayer(data, self)
|
||||||
|
|
||||||
if self.sending then
|
if self.sending then
|
||||||
ViewUtil.ShowBannerOnScreenCenter("正在操作中。。")
|
ViewUtil.ShowBannerOnScreenCenter("正在操作中。。")
|
||||||
return
|
return
|
||||||
|
|
@ -111,13 +98,25 @@ local function DelPalyer(data, uid, self)
|
||||||
end
|
end
|
||||||
players = fix
|
players = fix
|
||||||
|
|
||||||
|
self.sending = true
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local function DelDesk(data, self)
|
local function DelDesk(data, self)
|
||||||
|
|
||||||
if self.sending then
|
if self.sending then
|
||||||
ViewUtil.ShowBannerOnScreenCenter("正在操作中。。")
|
ViewUtil.ShowBannerOnScreenCenter("正在操作中。。")
|
||||||
return
|
return
|
||||||
|
|
@ -227,6 +226,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
function BanDesk:TryShow(r)
|
function BanDesk:TryShow(r)
|
||||||
|
|
||||||
local view = BanDesk.New()
|
local view = BanDesk.New()
|
||||||
|
|
||||||
self.root = r
|
self.root = r
|
||||||
|
|
@ -259,6 +259,7 @@ function BanDesk.New()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BanDesk:Init()
|
function BanDesk:Init()
|
||||||
|
|
||||||
self.sending = false
|
self.sending = false
|
||||||
|
|
||||||
self.btn_close = self._view:GetChild("btn_close")
|
self.btn_close = self._view:GetChild("btn_close")
|
||||||
|
|
@ -292,39 +293,10 @@ function BanDesk:Init()
|
||||||
list_banItemRenderer(index, obj, self)
|
list_banItemRenderer(index, obj, self)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
function BanDesk:Reflash()
|
function BanDesk:Reflash()
|
||||||
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
local groupId = self.root._group.id
|
local groupId = self.root._group.id
|
||||||
|
|
||||||
|
|
@ -334,6 +306,7 @@ function BanDesk:Reflash()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BanDesk:GetBanTableCallback(res)
|
function BanDesk:GetBanTableCallback(res)
|
||||||
|
|
||||||
self.BanData = Sort(res.Data.ban_list)
|
self.BanData = Sort(res.Data.ban_list)
|
||||||
self.list_banItem.numItems = #self.BanData
|
self.list_banItem.numItems = #self.BanData
|
||||||
|
|
||||||
|
|
@ -342,6 +315,7 @@ function BanDesk:GetBanTableCallback(res)
|
||||||
local btn_addBanItem = addBanItem:GetChild("btn_addBanItem")
|
local btn_addBanItem = addBanItem:GetChild("btn_addBanItem")
|
||||||
addBanItem:GetController("cStyle").selectedIndex = 1
|
addBanItem:GetController("cStyle").selectedIndex = 1
|
||||||
btn_addBanItem.onClick:Set(function()
|
btn_addBanItem.onClick:Set(function()
|
||||||
|
|
||||||
if self.sending then
|
if self.sending then
|
||||||
ViewUtil.ShowBannerOnScreenCenter("正在操作中。。")
|
ViewUtil.ShowBannerOnScreenCenter("正在操作中。。")
|
||||||
return
|
return
|
||||||
|
|
@ -372,4 +346,5 @@ function BanDesk:CloseRemaskWindow()
|
||||||
self.cSetName.selectedIndex = 0
|
self.cSetName.selectedIndex = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return BanDesk
|
return BanDesk
|
||||||
|
|
@ -54,6 +54,7 @@ function FamilyMyFamily:TryShow(groupId, r)
|
||||||
end
|
end
|
||||||
|
|
||||||
function FamilyMyFamily:Show()
|
function FamilyMyFamily:Show()
|
||||||
|
|
||||||
self:Refalsh()
|
self:Refalsh()
|
||||||
|
|
||||||
HideMainView()
|
HideMainView()
|
||||||
|
|
@ -66,6 +67,7 @@ function FamilyMyFamily:Close()
|
||||||
end
|
end
|
||||||
|
|
||||||
function FamilyMyFamily:Refalsh()
|
function FamilyMyFamily:Refalsh()
|
||||||
|
|
||||||
self.family = DataManager.groups.groupMap[self.groupId]
|
self.family = DataManager.groups.groupMap[self.groupId]
|
||||||
|
|
||||||
self.tex_fName.text = self.family.name
|
self.tex_fName.text = self.family.name
|
||||||
|
|
@ -192,54 +194,7 @@ function FamilyMyFamily:Init()
|
||||||
self.btn_confirmNotice.onClick:Set(ChangeNotice)
|
self.btn_confirmNotice.onClick:Set(ChangeNotice)
|
||||||
|
|
||||||
self.btn_hideNumber.onClick:Set(function()
|
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)
|
|
||||||
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
|
if self.isShowContenting == true then
|
||||||
ViewUtil.ShowBannerOnScreenCenter("设置中,请稍后再试。。")
|
ViewUtil.ShowBannerOnScreenCenter("设置中,请稍后再试。。")
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue