2025-06-03 18:16:29 +08:00
|
|
|
local TimeSettingPanel = import(".TimeSettingPanelTog")
|
|
|
|
|
local GroupPartnerStatMember = import(".GroupPartnerStatMember")
|
|
|
|
|
local GroupPartnerStatPlay = import(".GroupPartnerStatPlay")
|
|
|
|
|
local GroupNumberInputView = import(".GroupNumberInputView")
|
|
|
|
|
-- 开桌统计
|
|
|
|
|
local GroupMngPartnerStatViewAlone = {}
|
|
|
|
|
|
|
|
|
|
local M = GroupMngPartnerStatViewAlone
|
|
|
|
|
setmetatable(M, { __index = BaseWindow })
|
|
|
|
|
|
|
|
|
|
function GroupMngPartnerStatViewAlone.new(gid)
|
|
|
|
|
local self = setmetatable({}, { __index = M })
|
|
|
|
|
self.class = "GroupMngPartnerStatViewAlone"
|
|
|
|
|
self.group_id = gid
|
|
|
|
|
self:InitView()
|
|
|
|
|
return self
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:initData()
|
|
|
|
|
self.lst_record.numItems = 0
|
|
|
|
|
self.record_data = {}
|
|
|
|
|
|
|
|
|
|
local now_time = os.date("*t", now)
|
|
|
|
|
local today = os.time({ year = now_time.year, month = now_time.month, day = now_time.day, hour = 0, min = 0, sec = 0 })
|
|
|
|
|
self.begin_time = today
|
|
|
|
|
self.end_time = today + 86400
|
|
|
|
|
self:GetRecordData(0)
|
|
|
|
|
--self:ShowPeopleNum()
|
|
|
|
|
end
|
|
|
|
|
|
2025-06-14 05:48:35 +08:00
|
|
|
function M:NewRecordTable(lev)
|
|
|
|
|
self.record_total_data = {}
|
|
|
|
|
print("lingmeng self.lst_record3", self.lst_record)
|
|
|
|
|
local mainRecord = self.record_data[1]
|
|
|
|
|
local obj = self.lst_record:AddItemFromPool()
|
|
|
|
|
self:OnRenderRecordItemNew(obj, mainRecord)
|
|
|
|
|
local tempTable = {}
|
|
|
|
|
tempTable.lev = lev
|
|
|
|
|
tempTable.obj = obj
|
|
|
|
|
tempTable.childCount = 0
|
|
|
|
|
tempTable.list = obj:GetChild("lst_record")
|
|
|
|
|
tempTable.list.height = 0
|
|
|
|
|
self.record_total_data[mainRecord.uid] = tempTable
|
|
|
|
|
obj:GetController("more").selectedIndex = 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:NewRecordTableChildHou(table, isMe, fatherId)
|
|
|
|
|
isMe = isMe or 0
|
|
|
|
|
print("lingmeng NewRecordTableChild", isMe, fatherId)
|
|
|
|
|
pt(table)
|
|
|
|
|
local childNum = #table - isMe
|
|
|
|
|
local fatherList = self.record_total_data[fatherId].list
|
|
|
|
|
self:RecursionChangeHeight(fatherId, childNum)
|
|
|
|
|
for i = 1 + isMe, childNum + isMe do
|
|
|
|
|
local mainRecord = table[i]
|
|
|
|
|
local obj = fatherList:GetFromPool("")
|
|
|
|
|
fatherList:AddChildAt(obj, fatherList.numItems)
|
|
|
|
|
self:OnRenderRecordItemNew(obj, mainRecord, fatherId)
|
|
|
|
|
local tempTable = {}
|
|
|
|
|
tempTable.father = fatherId
|
|
|
|
|
tempTable.obj = obj
|
|
|
|
|
tempTable.childCount = 0
|
|
|
|
|
tempTable.list = obj:GetChild("lst_record")
|
|
|
|
|
tempTable.list.height = 0
|
|
|
|
|
tempTable.obj.height = 113
|
|
|
|
|
self.record_total_data[mainRecord.uid] = tempTable
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:NewRecordTableChildQian(table, isMe, fatherId)
|
|
|
|
|
isMe = isMe or 0
|
|
|
|
|
print("lingmeng NewRecordTableChild", isMe, fatherId)
|
|
|
|
|
pt(table)
|
|
|
|
|
local childNum = #table - isMe
|
|
|
|
|
local fatherList = self.record_total_data[fatherId].list
|
|
|
|
|
self:RecursionChangeHeight(fatherId, childNum)
|
|
|
|
|
for i = 1 + isMe, childNum + isMe do
|
|
|
|
|
local mainRecord = table[i]
|
|
|
|
|
local obj = fatherList:GetFromPool("")
|
|
|
|
|
fatherList:AddChildAt(obj, 0)
|
|
|
|
|
self:OnRenderRecordItemNew(obj, mainRecord, fatherId)
|
|
|
|
|
local tempTable = {}
|
|
|
|
|
tempTable.father = fatherId
|
|
|
|
|
tempTable.obj = obj
|
|
|
|
|
tempTable.childCount = 0
|
|
|
|
|
tempTable.list = obj:GetChild("lst_record")
|
|
|
|
|
tempTable.list.height = 0
|
|
|
|
|
tempTable.obj.height = 113
|
|
|
|
|
self.record_total_data[mainRecord.uid] = tempTable
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2025-06-03 18:16:29 +08:00
|
|
|
-- function M:ShowPeopleNum()
|
|
|
|
|
-- local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
-- fgCtr:FG_GetMembersCount(self.group_id,function(res)
|
|
|
|
|
|
|
|
|
|
-- ViewUtil.CloseModalWait()
|
|
|
|
|
|
|
|
|
|
-- if res.ReturnCode == 0 then
|
|
|
|
|
-- self._view:GetChild('tex_memb_num').text = res.Data.member_num
|
|
|
|
|
-- self._view:GetChild('tex_total_hp').text = d2ad(res.Data.hp_num1+res.Data.otherHp)
|
|
|
|
|
-- end
|
|
|
|
|
-- end)
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
function M:InitView()
|
|
|
|
|
BaseWindow.init(self, "ui://NewGroup/View_GroupPartnerStatAlone")
|
|
|
|
|
-- self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupPartnerStatAlone")
|
|
|
|
|
|
|
|
|
|
local group = DataManager.groups:get(self.group_id)
|
|
|
|
|
-- if group.lev ~= 3 then
|
|
|
|
|
-- self._view:GetController("mng").selectedIndex = 1
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
local lst_mgr_index = self._view:GetChild("lst_mgr_index")
|
|
|
|
|
-- lst_mgr_index.visible = false
|
|
|
|
|
-- if group.lev == 1 then
|
|
|
|
|
-- lst_mgr_index.visible = true
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
self.lst_record = self._view:GetChild("lst_record")
|
2025-06-14 05:48:35 +08:00
|
|
|
-- self.lst_record:SetVirtual()
|
|
|
|
|
-- self.lst_record.itemRenderer = function(index, obj)
|
|
|
|
|
-- self:OnRenderRecordItem(index, obj)
|
|
|
|
|
-- end
|
|
|
|
|
-- self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
|
|
|
|
-- self:GetRecordData(group.lev == 1 and self.lst_record.numItems - 1 or self.lst_record.numItems)
|
|
|
|
|
-- end)
|
2025-06-03 18:16:29 +08:00
|
|
|
|
|
|
|
|
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"),
|
|
|
|
|
-308, 0, function()
|
|
|
|
|
self.begin_time, self.end_time = self.time_panel:GetDate()
|
2025-06-14 05:48:35 +08:00
|
|
|
self.lst_record:RemoveChildren(0, -1, true)
|
|
|
|
|
self.lst_record = nil
|
|
|
|
|
self.lst_record = self._view:GetChild("lst_record")
|
|
|
|
|
self:GetRecordData(0)
|
2025-06-03 18:16:29 +08:00
|
|
|
end, true)
|
|
|
|
|
self.begin_time, self.end_time = self.time_panel:GetDate()
|
|
|
|
|
local ctr_page = self._view:GetController("type")
|
|
|
|
|
ctr_page.onChanged:Set(function()
|
|
|
|
|
self.record_data = {}
|
|
|
|
|
self.lst_record.numItems = 0
|
|
|
|
|
if ctr_page.selectedIndex == 0 then
|
|
|
|
|
local now_time = os.date("*t", now)
|
|
|
|
|
local today = os.time({ year = now_time.year, month = now_time.month, day = now_time.day, hour = 0, min = 0, sec = 0 })
|
|
|
|
|
self.begin_time = today
|
|
|
|
|
self.end_time = today + 86400
|
|
|
|
|
else
|
|
|
|
|
local now_time = os.date("*t", now)
|
|
|
|
|
local today = os.time({ year = now_time.year, month = now_time.month, day = now_time.day, hour = 0, min = 0, sec = 0 })
|
|
|
|
|
self.begin_time = today - 86400 * ctr_page.selectedIndex
|
|
|
|
|
self.end_time = today - 86400 * (ctr_page.selectedIndex - 1)
|
|
|
|
|
end
|
|
|
|
|
self:GetRecordData(0)
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
-- self._view:GetChild("btn_search").onClick:Set(function()
|
|
|
|
|
-- self.record_data = {}
|
|
|
|
|
-- self.lst_record.numItems = 0
|
|
|
|
|
|
|
|
|
|
-- self.begin_time, self.end_time = self.time_panel:GetDate()
|
|
|
|
|
-- self:GetRecordData(0)
|
|
|
|
|
-- end)
|
|
|
|
|
|
|
|
|
|
-- 搜索玩家
|
|
|
|
|
local ctr_search = self._view:GetController('search')
|
|
|
|
|
self._view:GetChild('btn_search').onClick:Set(
|
|
|
|
|
function()
|
|
|
|
|
--printlog("aaaaaaaaaa1111111111111111111111111111111111111111111111")
|
|
|
|
|
ViewUtil.ShowModalWait(nil)
|
|
|
|
|
local text = self._view:GetChild('tex_id').text
|
|
|
|
|
local qid, qnick
|
|
|
|
|
if text == "" then
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
ViewUtil.ErrorTip(nil, '输入不能为空')
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
qid = tonumber(text) or 0
|
|
|
|
|
qnick = text
|
|
|
|
|
local time_type = self._view:GetController("type").selectedIndex
|
|
|
|
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
|
|
|
|
time_type = 0
|
|
|
|
|
end
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
fgCtr:FG_FindPartnerStat(
|
|
|
|
|
self.group_id,
|
|
|
|
|
qid, 0, 6, time_type, self.begin_time, self.end_time,
|
|
|
|
|
function(res)
|
|
|
|
|
-- printlog("aaaaaaaaaaaaaaaa22222222222222222222222222222")
|
|
|
|
|
-- pt(res)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
if self._is_destroy then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
if res.ReturnCode ~= 0 then
|
|
|
|
|
ViewUtil.ErrorTip(res.ReturnCode, '找不到成员')
|
|
|
|
|
else
|
|
|
|
|
self._view:GetChild('tex_id').text = ''
|
|
|
|
|
ctr_search.selectedIndex = 1
|
|
|
|
|
local item_result = self._view:GetChild('lst_member_find')
|
2025-06-14 05:48:35 +08:00
|
|
|
item_result:RemoveChildren()
|
2025-06-03 18:16:29 +08:00
|
|
|
|
|
|
|
|
for j = 1, #res.Data.members do
|
|
|
|
|
local tem = item_result:AddItemFromPool()
|
|
|
|
|
self:FillRecordItem(res.Data.members[j], tem)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
local btn_back = self._view:GetChild('btn_back')
|
|
|
|
|
btn_back.onClick:Set(
|
|
|
|
|
function()
|
|
|
|
|
self.lst_record.numItems = #self.record_data
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:GetRecordData(index)
|
|
|
|
|
ViewUtil.ShowModalWait()
|
2025-06-07 17:26:10 +08:00
|
|
|
local group = DataManager.groups:get(self.group_id)
|
2025-06-03 18:16:29 +08:00
|
|
|
local time_type = self._view:GetController("type").selectedIndex
|
|
|
|
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
|
|
|
|
time_type = 0
|
|
|
|
|
end
|
2025-06-14 05:48:35 +08:00
|
|
|
print("lingmeng self.lst_record1", self.lst_record)
|
|
|
|
|
if not self.lst_record then
|
|
|
|
|
self.lst_record = self._view:GetChild("lst_record")
|
|
|
|
|
end
|
2025-06-03 18:16:29 +08:00
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
fgCtr:FG_GetPartnerStat(self.group_id, index, 6, time_type, self.begin_time, self.end_time, function(res)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
|
|
|
|
|
if res.ReturnCode == 0 then
|
2025-06-14 05:48:35 +08:00
|
|
|
if not self.lst_record then
|
|
|
|
|
self.lst_record = self._view:GetChild("lst_record")
|
|
|
|
|
end
|
|
|
|
|
print("lingmeng self.lst_record2", self.lst_record)
|
|
|
|
|
|
2025-06-03 18:16:29 +08:00
|
|
|
local members = res.Data.members
|
2025-06-07 17:26:10 +08:00
|
|
|
pt(members)
|
|
|
|
|
if group.lev == 1 then
|
2025-06-14 05:48:35 +08:00
|
|
|
ViewUtil.ShowModalWait("获取盟主数据中")
|
|
|
|
|
self.groupumberTemp = {}
|
|
|
|
|
self.groupumberTemp.uid = group.owner
|
|
|
|
|
self.groupumberTemp.nick = group.o_nick
|
|
|
|
|
self.groupumberTemp.total_round = 0
|
|
|
|
|
self.groupumberTemp.valid_round = 0
|
|
|
|
|
self.groupumberTemp.reward_hp = 0
|
|
|
|
|
self.groupumberTemp.total_win = 0
|
|
|
|
|
self:RecursionGetPropLog(members, 0)
|
2025-06-07 17:26:10 +08:00
|
|
|
else
|
|
|
|
|
for i = 1, #members do
|
|
|
|
|
self.record_data[#self.record_data + 1] = members[i]
|
|
|
|
|
end
|
2025-06-14 05:48:35 +08:00
|
|
|
self:NewRecordTable(0)
|
|
|
|
|
-- self.lst_record.numItems = #self.record_data
|
2025-06-03 18:16:29 +08:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- 显示奖励
|
|
|
|
|
local function __showRewardsValue(rtype, cur_value, max_value, mng)
|
|
|
|
|
local str = ""
|
|
|
|
|
if not mng then
|
|
|
|
|
str = string.format("%s%%/%s%%", cur_value, max_value)
|
|
|
|
|
else
|
|
|
|
|
str = string.format("%s%%", cur_value)
|
|
|
|
|
end
|
|
|
|
|
return str
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:FillRecordItem(data, obj)
|
2025-06-07 17:26:10 +08:00
|
|
|
local group = DataManager.groups:get(self.group_id)
|
|
|
|
|
if group.lev == 1 then
|
|
|
|
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick)
|
|
|
|
|
else
|
|
|
|
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(data.nick) .. "(" .. data.total .. ")"
|
|
|
|
|
end
|
|
|
|
|
obj:GetChild("tex_id").text = "ID:" .. data.uid
|
2025-06-03 18:16:29 +08:00
|
|
|
|
2025-06-07 17:26:10 +08:00
|
|
|
local tex_total_score = obj:GetChild("tex_total_score")
|
|
|
|
|
local ctr_show_total = obj:GetController("show_total")
|
2025-06-03 18:16:29 +08:00
|
|
|
if data._total_hp then
|
|
|
|
|
tex_total_score.text = data._total_hp
|
|
|
|
|
ctr_show_total.selectedIndex = 1
|
|
|
|
|
else
|
|
|
|
|
ctr_show_total.selectedIndex = 0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
obj:GetChild("tex_round_valid").text = d2ad(data.reward_hp + data.total_win) --d2ad(data.reward_hp) --data.valid_round / 100
|
|
|
|
|
obj:GetChild("tex_round_total").text = data.total_round
|
|
|
|
|
obj:GetChild("tex_total").text = d2ad(data.total_win)
|
|
|
|
|
obj:GetChild("tex_round_youxiao").text = data.valid_round / 100
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local btn_check_members = obj:GetChild("btn_check_members")
|
|
|
|
|
btn_check_members.onClick:Set(function()
|
|
|
|
|
ViewUtil.ShowModalWait(self._root_view)
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
2025-06-07 17:26:10 +08:00
|
|
|
if data.uid == DataManager.SelfUser.account_id then
|
|
|
|
|
fgCtr:FG_GetMembersCount(self.group_id, function(res)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
if res.ReturnCode == 0 then
|
|
|
|
|
tex_total_score.text = d2ad(res.Data.hp_num1 + res.Data.otherHp)
|
|
|
|
|
ctr_show_total.selectedIndex = 1
|
|
|
|
|
else
|
|
|
|
|
ViewUtil.ErrorTip(res.ReturnCode, "目标没有总线值")
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
else
|
|
|
|
|
fgCtr:FG_GetTotalHp(self.group_id, data.uid, function(res)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
if res.ReturnCode == 0 then
|
|
|
|
|
local hp = d2ad(res.Data.hp)
|
|
|
|
|
tex_total_score.text = hp
|
|
|
|
|
data._total_hp = hp
|
|
|
|
|
data.total = res.Data.total_member - 1
|
|
|
|
|
obj:GetChild("tex_name").text = data.nick .. "(" .. data.total .. ")"
|
|
|
|
|
ctr_show_total.selectedIndex = 1
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
2025-06-03 18:16:29 +08:00
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local btn_award = obj:GetChild("btn_award")
|
|
|
|
|
btn_award.text = d2ad(data.reward_hp) --d2ad(data.reward_hp+data.total_win)
|
|
|
|
|
btn_award.onClick:Set(function()
|
|
|
|
|
local time_type = self._view:GetController("type").selectedIndex
|
|
|
|
|
local gniv = GroupPartnerStatPlay.new(self.group_id, data.uid, data.partnerLev, DataManager.SelfUser.account_id,
|
|
|
|
|
time_type, self.begin_time, self.end_time)
|
|
|
|
|
gniv:Show()
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
local btn_detail = obj:GetChild("btn_detail")
|
|
|
|
|
btn_detail.onClick:Set(function()
|
|
|
|
|
local time_type = self._view:GetController("type").selectedIndex
|
|
|
|
|
--printlog("ccccccccccwwwwwwwwwwwwwwwwwwwwwwwwwwww ",self.begin_time," ",self.end_time)
|
|
|
|
|
local gniv = GroupPartnerStatMember.new(self.group_id, data.uid, 0, self.begin_time, self.end_time)
|
|
|
|
|
gniv:Show()
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
local btnMen = obj:GetChild("btnMen")
|
|
|
|
|
-- btnMen.text = d2ad(data.autoscore)
|
|
|
|
|
local menControl = obj:GetController("menkan")
|
|
|
|
|
|
|
|
|
|
-- if group.lev == 1 or (group.lev == 3 and group.partnerLev > 0) then
|
|
|
|
|
-- if (DataManager.SelfUser.account_id ~= data.uid) then
|
|
|
|
|
-- menControl.selectedIndex = 1
|
|
|
|
|
-- btnMen.text = d2ad(data.autoscore)
|
|
|
|
|
-- btnMen.touchable = true
|
|
|
|
|
-- else
|
|
|
|
|
-- btnMen.text = d2ad(data.autoscore)
|
|
|
|
|
-- menControl.selectedIndex = 1
|
|
|
|
|
-- btnMen.touchable = false
|
|
|
|
|
-- end
|
|
|
|
|
-- else
|
|
|
|
|
-- menControl.selectedIndex = 0
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
btnMen.onClick:Set(function()
|
|
|
|
|
local gfiv = GroupNumberInputView.new(self._root_view, function(num)
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
fgCtr:FG_SetPartnerThreshold(self.group_id, data.uid, num, function(res)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
if res.ReturnCode ~= 0 then
|
|
|
|
|
ViewUtil.ErrorTip(res.ReturnCode, "设置失败")
|
|
|
|
|
else
|
|
|
|
|
ViewUtil.ShowBannerOnScreenCenter("设置成功")
|
|
|
|
|
btnMen.text = num
|
|
|
|
|
data.autoscore = ad2d(num)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end, 0)
|
|
|
|
|
gfiv:Show()
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:OnRenderRecordItem(index, obj)
|
|
|
|
|
local data = self.record_data[index + 1]
|
|
|
|
|
self:FillRecordItem(data, obj)
|
|
|
|
|
end
|
|
|
|
|
|
2025-06-14 05:48:35 +08:00
|
|
|
function M:OnRenderRecordItemNew(obj, mainRecord, root_id)
|
|
|
|
|
obj:GetChild("tex_name").text = ViewUtil.stringEllipsis(mainRecord.nick)
|
|
|
|
|
obj:GetChild("tex_id").text = "ID:" .. mainRecord.uid
|
|
|
|
|
local tex_total_score = obj:GetChild("tex_total_score")
|
|
|
|
|
local ctr_show_total = obj:GetController("show_total")
|
|
|
|
|
if mainRecord._total_hp then
|
|
|
|
|
tex_total_score.text = mainRecord._total_hp
|
|
|
|
|
ctr_show_total.selectedIndex = 1
|
|
|
|
|
else
|
|
|
|
|
ctr_show_total.selectedIndex = 0
|
|
|
|
|
end
|
|
|
|
|
obj:GetChild("tex_round_valid").text = d2ad(mainRecord.reward_hp + mainRecord.total_win) --d2ad(data.reward_hp) --data.valid_round / 100
|
|
|
|
|
obj:GetChild("tex_round_total").text = mainRecord.total_round
|
|
|
|
|
obj:GetChild("tex_total").text = d2ad(mainRecord.total_win)
|
|
|
|
|
obj:GetChild("tex_round_youxiao").text = mainRecord.valid_round / 100
|
|
|
|
|
obj:GetChild("btn_more").visible = not mainRecord.partnerLev or mainRecord.partnerLev > 0
|
|
|
|
|
obj:GetController("more").onChanged:Set(function() end)
|
|
|
|
|
obj:GetController("more").selectedIndex = 0
|
|
|
|
|
obj:GetController("more").onChanged:Set(function(context)
|
|
|
|
|
self:MoreChanged(context, mainRecord.uid)
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
local btn_check_members = obj:GetChild("btn_check_members")
|
|
|
|
|
btn_check_members.visible = not mainRecord.partnerLev or mainRecord.partnerLev > 0
|
|
|
|
|
btn_check_members.onClick:Set(function()
|
|
|
|
|
ViewUtil.ShowModalWait(self._root_view)
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
if mainRecord.uid == DataManager.SelfUser.account_id then
|
|
|
|
|
fgCtr:FG_GetMembersCount(self.group_id, function(res)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
if res.ReturnCode == 0 then
|
|
|
|
|
tex_total_score.text = d2ad(res.Data.hp_num1 + res.Data.otherHp)
|
|
|
|
|
ctr_show_total.selectedIndex = 1
|
|
|
|
|
else
|
|
|
|
|
ViewUtil.ErrorTip(res.ReturnCode, "目标没有总线值")
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
else
|
|
|
|
|
fgCtr:FG_GetTotalHp(self.group_id, mainRecord.uid, function(res)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
if res.ReturnCode == 0 then
|
|
|
|
|
local hp = d2ad(res.Data.hp)
|
|
|
|
|
tex_total_score.text = hp
|
|
|
|
|
mainRecord._total_hp = hp
|
|
|
|
|
-- mainRecord.total = res.Data.total_member - 1
|
|
|
|
|
-- obj:GetChild("tex_name").text = data.nick .. "(" .. data.total .. ")"
|
|
|
|
|
ctr_show_total.selectedIndex = 1
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
obj:GetChild('btn_super').visible = not mainRecord.partnerLev or mainRecord.partnerLev > 0
|
|
|
|
|
obj:GetChild('btn_super').onClick:Set(function()
|
|
|
|
|
self.record_data = {}
|
|
|
|
|
if not root_id and not mainRecord.partnerLev then
|
|
|
|
|
ViewUtil.ShowModalWait("正在获取成员中")
|
|
|
|
|
self:RecursionGetNumberRecordForLev1(0, mainRecord.uid, {})
|
|
|
|
|
else
|
|
|
|
|
self:RecursionGetNumberRecord(mainRecord.uid, root_id, 0)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:MoreChanged(context, id)
|
|
|
|
|
print("lingmeng MoreChanged", context.sender.selectedIndex)
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
local time_type = self._view:GetController("type").selectedIndex
|
|
|
|
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
|
|
|
|
time_type = 0
|
|
|
|
|
end
|
|
|
|
|
if context.sender.selectedIndex == 1 then
|
|
|
|
|
self.record_data = {}
|
|
|
|
|
local myInfo = self.record_total_data[id]
|
|
|
|
|
pt(myInfo, id, self.group_id)
|
|
|
|
|
if myInfo then
|
|
|
|
|
ViewUtil:ShowModalWait()
|
|
|
|
|
if myInfo.lev == 1 then
|
|
|
|
|
fgCtr:FG_GetPartnerStat(self.group_id, 0, 6, time_type, self.begin_time, self.end_time, function(res)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
|
|
|
|
|
if res.ReturnCode == 0 then
|
|
|
|
|
local members = res.Data.members
|
|
|
|
|
for i = 1, #members do
|
|
|
|
|
self.record_data[#self.record_data + 1] = members[i]
|
|
|
|
|
end
|
|
|
|
|
self:RecursionGetRecordData(6, 0, id)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
else
|
|
|
|
|
-- if myInfo.father == nil then
|
|
|
|
|
-- fgCtr:FG_GetPartnerStat(self.group_id, 0, 6, time_type, self.begin_time, self.end_time, function(res)
|
|
|
|
|
-- ViewUtil.CloseModalWait()
|
|
|
|
|
|
|
|
|
|
-- if res.ReturnCode == 0 then
|
|
|
|
|
-- local members = res.Data.members
|
|
|
|
|
-- for i = 1, #members do
|
|
|
|
|
-- self.record_data[#self.record_data + 1] = members[i]
|
|
|
|
|
-- end
|
|
|
|
|
-- self:RecursionGetRecordData(6, 1, id)
|
|
|
|
|
-- end
|
|
|
|
|
-- end)
|
|
|
|
|
-- else
|
|
|
|
|
fgCtr:FG_GetPartnerStatMember(self.group_id, id, myInfo.father, 0, 6,
|
|
|
|
|
time_type,
|
|
|
|
|
self.begin_time,
|
|
|
|
|
self.end_time, function(res)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
if res.ReturnCode == 0 then
|
|
|
|
|
local members = res.Data.members
|
|
|
|
|
for i = 1, #members do
|
|
|
|
|
if members[i].uid ~= id then
|
|
|
|
|
self.record_data[#self.record_data + 1] = members[i]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
self:RecursionGetAllRecordData(6, id, myInfo.father)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
-- end
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
ViewUtil.ErrorTip(nil, "统计页面失效,请重新打开")
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
local info = self.record_total_data[id]
|
|
|
|
|
info.list:RemoveChildrenToPool()
|
|
|
|
|
self:RecursionChangeHeight(id, -info.childCount)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:RecursionGetNumberRecordForLev1(index, id, tempTable)
|
|
|
|
|
local time_type = self._view:GetController("type").selectedIndex
|
|
|
|
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
|
|
|
|
time_type = 0
|
|
|
|
|
end
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
fgCtr:FG_GroupMembers12(
|
|
|
|
|
self.group_id,
|
|
|
|
|
index * 10,
|
|
|
|
|
10,
|
|
|
|
|
1,
|
|
|
|
|
2,
|
|
|
|
|
function(res)
|
|
|
|
|
if res.ReturnCode ~= 0 then
|
|
|
|
|
ViewUtil.ErrorTip(res.ReturnCode, '获取成员列表失败')
|
|
|
|
|
else
|
|
|
|
|
local numbers = res.Data.members
|
|
|
|
|
if #numbers == 0 then
|
|
|
|
|
local one = table.remove(tempTable)
|
|
|
|
|
self:RecursionGetNumberRecordByLev1(tempTable, one.uid, id)
|
|
|
|
|
else
|
|
|
|
|
for i = 1, #numbers do
|
|
|
|
|
if numbers[i].lev ~= 1 and numbers[i].partnerLev == 0 then
|
|
|
|
|
table.insert(tempTable, numbers[i])
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
self:RecursionGetNumberRecordForLev1(index + 1, id, tempTable)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:RecursionGetNumberRecordByLev1(tempTable, id, root_id)
|
|
|
|
|
local time_type = self._view:GetController("type").selectedIndex
|
|
|
|
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
|
|
|
|
time_type = 0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
fgCtr:FG_GetDirectMemberStat(self.group_id, id, root_id, 0, 1,
|
|
|
|
|
time_type,
|
|
|
|
|
self.begin_time,
|
|
|
|
|
self.end_time, function(res)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
if res.ReturnCode == 0 then
|
|
|
|
|
local members = res.Data.members
|
|
|
|
|
self.record_data[#self.record_data + 1] = members[1]
|
|
|
|
|
local numberid = table.remove(tempTable)
|
|
|
|
|
if numberid then
|
|
|
|
|
self:RecursionGetNumberRecordByLev1(tempTable, numberid.uid, root_id)
|
|
|
|
|
else
|
|
|
|
|
self:NewRecordTableChildQian(self.record_data, 0, root_id)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:RecursionGetNumberRecord(id, root_id, index)
|
|
|
|
|
ViewUtil.ShowModalWait("正在获取成员中")
|
|
|
|
|
local time_type = self._view:GetController("type").selectedIndex
|
|
|
|
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
|
|
|
|
time_type = 0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
fgCtr:FG_GetDirectMemberStat(self.group_id, id, root_id, index * 10, 10,
|
|
|
|
|
time_type,
|
|
|
|
|
self.begin_time,
|
|
|
|
|
self.end_time, function(res)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
if res.ReturnCode == 0 then
|
|
|
|
|
local members = res.Data.members
|
|
|
|
|
pt(members)
|
|
|
|
|
if #members > 0 then
|
|
|
|
|
for i = 1, #members do
|
|
|
|
|
if members[i].partnerLev and members[i].partnerLev == 0 then
|
|
|
|
|
self.record_data[#self.record_data + 1] = members[i]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
self:RecursionGetNumberRecord(id, root_id, index + 1)
|
|
|
|
|
else
|
|
|
|
|
self:NewRecordTableChildQian(self.record_data, 0, id)
|
|
|
|
|
-- self.lst_record.numItems = #self.record_data
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:RecursionGetPropLog(members, index)
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
fgCtr:FG_GetPropLog(self.group_id, index * 20, 20, self.begin_time, self.end_time, function(res)
|
|
|
|
|
if res.ReturnCode ~= 0 then
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
ViewUtil.ErrorTip(res.ReturnCode, "获取排名信息失败")
|
|
|
|
|
else
|
|
|
|
|
local info = res.Data
|
|
|
|
|
if #info.hp_logs > 0 then
|
|
|
|
|
self.groupumberTemp.total_round = self.groupumberTemp.total_round + #info.hp_logs
|
|
|
|
|
self.groupumberTemp.valid_round = self.groupumberTemp.valid_round + info.valid_count * 100
|
|
|
|
|
self.groupumberTemp.reward_hp = 0
|
|
|
|
|
self.groupumberTemp.total_win = 0
|
|
|
|
|
self:RecursionGetPropLog(members, index + 1)
|
|
|
|
|
else
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
self.record_data[1] = self.groupumberTemp
|
|
|
|
|
|
|
|
|
|
for i = 1, #members do
|
|
|
|
|
self.record_data[#self.record_data + 1] = members[i]
|
|
|
|
|
end
|
|
|
|
|
self:NewRecordTable(1)
|
|
|
|
|
end
|
|
|
|
|
-- self.lst_record.numItems = #self.record_data
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:RecursionGetRecordData(index, isMe, fatherId)
|
|
|
|
|
ViewUtil.ShowModalWait()
|
|
|
|
|
local time_type = self._view:GetController("type").selectedIndex
|
|
|
|
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
|
|
|
|
time_type = 0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
fgCtr:FG_GetPartnerStat(self.group_id, index, 1, time_type, self.begin_time, self.end_time, function(res)
|
|
|
|
|
if res.ReturnCode == 0 then
|
|
|
|
|
local members = res.Data.members
|
|
|
|
|
pt(members)
|
|
|
|
|
if #members > 0 then
|
|
|
|
|
self.record_data[1] = self.groupumberTemp
|
|
|
|
|
for i = 1, #members do
|
|
|
|
|
self.record_data[#self.record_data + 1] = members[i]
|
|
|
|
|
end
|
|
|
|
|
self:RecursionGetRecordData(#self.record_data, isMe, fatherId)
|
|
|
|
|
else
|
|
|
|
|
self:NewRecordTableChildHou(self.record_data, isMe, fatherId)
|
|
|
|
|
-- self.lst_record.numItems = #self.record_data
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:RecursionGetAllRecordData(index, id, root_id)
|
|
|
|
|
ViewUtil.ShowModalWait()
|
|
|
|
|
local time_type = self._view:GetController("type").selectedIndex
|
|
|
|
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
|
|
|
|
time_type = 0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
fgCtr:FG_GetPartnerStatMember(self.group_id, id, root_id, index, 6,
|
|
|
|
|
time_type,
|
|
|
|
|
self.begin_time,
|
|
|
|
|
self.end_time, function(res)
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
if res.ReturnCode == 0 then
|
|
|
|
|
local members = res.Data.members
|
|
|
|
|
pt(members)
|
|
|
|
|
if #members > 0 then
|
|
|
|
|
for i = 1, #members do
|
|
|
|
|
if members[i].uid ~= id then
|
|
|
|
|
self.record_data[#self.record_data + 1] = members[i]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
self:RecursionGetAllRecordData(#self.record_data, id, root_id)
|
|
|
|
|
else
|
|
|
|
|
self:NewRecordTableChildHou(self.record_data, 0, id)
|
|
|
|
|
-- self.lst_record.numItems = #self.record_data
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:RecursionChangeHeight(fatherId, childNum)
|
|
|
|
|
self.record_total_data[fatherId].childCount = self.record_total_data[fatherId].childCount + childNum
|
|
|
|
|
self.record_total_data[fatherId].list.height = self.record_total_data[fatherId].list.height + childNum * 113
|
|
|
|
|
self.record_total_data[fatherId].obj.height = self.record_total_data[fatherId].obj.height + childNum * 113
|
|
|
|
|
if self.record_total_data[fatherId].father ~= nil then
|
|
|
|
|
self:RecursionChangeHeight(self.record_total_data[fatherId].father, childNum)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2025-06-03 18:16:29 +08:00
|
|
|
return M
|