Compare commits
4 Commits
0396990aa8
...
3b8ba6a93e
| Author | SHA1 | Date |
|---|---|---|
|
|
3b8ba6a93e | |
|
|
4dd6c23f7f | |
|
|
5d28daf0c7 | |
|
|
d25fc48437 |
|
|
@ -490,7 +490,7 @@ function M:OnRenderRecordItemNew(obj, mainRecord, root_id)
|
||||||
obj:GetController("more").onChanged:Set(function() end)
|
obj:GetController("more").onChanged:Set(function() end)
|
||||||
obj:GetController("more").selectedIndex = 0
|
obj:GetController("more").selectedIndex = 0
|
||||||
obj:GetController("more").onChanged:Set(function(context)
|
obj:GetController("more").onChanged:Set(function(context)
|
||||||
self:MoreChanged(context, mainRecord.uid)
|
self:MoreChanged(context, mainRecord.uid, obj)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local btn_check_members = obj:GetChild("btn_check_members")
|
local btn_check_members = obj:GetChild("btn_check_members")
|
||||||
|
|
@ -536,7 +536,7 @@ function M:OnRenderRecordItemNew(obj, mainRecord, root_id)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:MoreChanged(context, id)
|
function M:MoreChanged(context, id, obj)
|
||||||
print("lingmeng MoreChanged", context.sender.selectedIndex)
|
print("lingmeng MoreChanged", context.sender.selectedIndex)
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
local time_type = self._view:GetController("type").selectedIndex
|
local time_type = self._view:GetController("type").selectedIndex
|
||||||
|
|
@ -569,6 +569,7 @@ function M:MoreChanged(context, id)
|
||||||
-- end
|
-- end
|
||||||
-- end)
|
-- end)
|
||||||
-- else
|
-- else
|
||||||
|
show_total_table[myInfo.father].list:SetChildIndex(obj, show_total_table[myInfo.father].childCount - 1)
|
||||||
self:RecursionGetAllRecordData(0, id, myInfo.father)
|
self:RecursionGetAllRecordData(0, id, myInfo.father)
|
||||||
-- end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
@ -577,6 +578,9 @@ function M:MoreChanged(context, id)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local info = show_total_table[id]
|
local info = show_total_table[id]
|
||||||
|
if info.father then
|
||||||
|
show_total_table[info.father].list:SetChildIndex(obj, 0)
|
||||||
|
end
|
||||||
info.list:RemoveChildrenToPool()
|
info.list:RemoveChildrenToPool()
|
||||||
self:RecursionChangeHeight(id, -info.childCount)
|
self:RecursionChangeHeight(id, -info.childCount)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,705 @@
|
||||||
|
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 = {}
|
||||||
|
self.ctr_search = self._view:GetController('search')
|
||||||
|
|
||||||
|
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._data_record = {}
|
||||||
|
self._selectedLev = 0
|
||||||
|
self:GetRecordData(0)
|
||||||
|
--self:ShowPeopleNum()
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:InitView()
|
||||||
|
BaseWindow.init(self, "ui://NewGroup/View_GroupPartnerStatAlone")
|
||||||
|
|
||||||
|
local group = DataManager.groups:get(self.group_id)
|
||||||
|
|
||||||
|
self.lst_record = self._view:GetChild("lst_record")
|
||||||
|
|
||||||
|
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()
|
||||||
|
self.lst_record:RemoveChildren(0, -1, true)
|
||||||
|
self.lst_record = nil
|
||||||
|
self.lst_record = self._view:GetChild("lst_record")
|
||||||
|
self.record_data = {}
|
||||||
|
if self._view:GetController('search').selectedIndex == 1 then
|
||||||
|
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.item_result = self._view:GetChild('lst_member_find')
|
||||||
|
self.item_result:RemoveChildren()
|
||||||
|
self:NewRecordTableFind(res.Data.members[1])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
else
|
||||||
|
self:GetRecordData(0)
|
||||||
|
end
|
||||||
|
end, { showDay = group.lev < 3 and 30 or 7 })
|
||||||
|
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)
|
||||||
|
|
||||||
|
-- 搜索玩家
|
||||||
|
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
|
||||||
|
ctr_search.selectedIndex = 1
|
||||||
|
self.item_result = self._view:GetChild('lst_member_find')
|
||||||
|
self.item_result:RemoveChildren()
|
||||||
|
self:NewRecordTableFind(res.Data.members[1])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
local btn_back = self._view:GetChild('btn_back')
|
||||||
|
btn_back.onClick:Set(
|
||||||
|
function()
|
||||||
|
self._view:GetChild('tex_id').text = ""
|
||||||
|
if #self.record_total_data == 0 then
|
||||||
|
self:GetRecordData(0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:InsertTableRecord(lev, data)
|
||||||
|
self._data_record.count = (self._data_record.count or 0) + 1
|
||||||
|
if self._data_record[lev] then
|
||||||
|
table.insert(self._data_record[lev], data)
|
||||||
|
else
|
||||||
|
self._data_record[lev] = {}
|
||||||
|
table.insert(self._data_record[lev], data)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:InitListRecord()
|
||||||
|
if self.lst_record then
|
||||||
|
self.lst_record = self._view:GetChild("lst_record")
|
||||||
|
self.lst_record.itemRenderer = function(index, obj)
|
||||||
|
|
||||||
|
end
|
||||||
|
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
||||||
|
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:GetRecordData()
|
||||||
|
ViewUtil.ShowModalWait()
|
||||||
|
local group = DataManager.groups:get(self.group_id)
|
||||||
|
local time_type = self._view:GetController("type").selectedIndex
|
||||||
|
if self.begin_time ~= nil and self.end_time ~= nil then
|
||||||
|
time_type = 0
|
||||||
|
end
|
||||||
|
if not self.lst_record then
|
||||||
|
self.lst_record = self._view:GetChild("lst_record")
|
||||||
|
end
|
||||||
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
if group.lev == 1 then
|
||||||
|
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:GetPropLog({}, 0, time_type)
|
||||||
|
else
|
||||||
|
self:GetFristData(fgCtr, 0, time_type)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:GetFristData(fgCtr, index, time_type)
|
||||||
|
fgCtr:FG_GetPartnerStat(self.group_id, index * 67, 67, time_type, self.begin_time, self.end_time, function(res)
|
||||||
|
ViewUtil.CloseModalWait()
|
||||||
|
|
||||||
|
if res.ReturnCode == 0 then
|
||||||
|
if not self.lst_record then
|
||||||
|
self.lst_record = self._view:GetChild("lst_record")
|
||||||
|
end
|
||||||
|
|
||||||
|
local members = res.Data.members
|
||||||
|
if members and #members and #self.record_data == 0 then
|
||||||
|
local mytable = {}
|
||||||
|
local othertable = {}
|
||||||
|
for i = 1, #members do
|
||||||
|
if members[i].uid == DataManager.SelfUser.account_id then
|
||||||
|
self.record_data[#self.record_data + 1] = members[i]
|
||||||
|
table.insert(mytable, members[i])
|
||||||
|
else
|
||||||
|
table.insert(othertable, members[i])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self._data_record[1] = mytable
|
||||||
|
self._data_record[2] = othertable
|
||||||
|
else
|
||||||
|
if index == 0 and (not members or #members == 0) then
|
||||||
|
ViewUtil.ErrorTip(nil, "你不是合伙人")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, "当前成员获取失败")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:GetPropLog(members, index, time_type)
|
||||||
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
fgCtr:FG_GetPropLog(self.group_id, index * 67, 67, self.begin_time, self.end_time, function(res)
|
||||||
|
if res.ReturnCode ~= 0 then
|
||||||
|
ViewUtil.CloseModalWait()
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, "获取排名信息失败")
|
||||||
|
else
|
||||||
|
local info = res.Data
|
||||||
|
self.groupumberTemp.total_round = info.count
|
||||||
|
self.groupumberTemp.valid_round = info.valid_count * 100
|
||||||
|
self.groupumberTemp.reward_hp = info.pump
|
||||||
|
self.groupumberTemp.total_win = 0
|
||||||
|
ViewUtil.CloseModalWait()
|
||||||
|
fgCtr:FG_GetMembersCount(self.group_id, function(res)
|
||||||
|
ViewUtil.CloseModalWait()
|
||||||
|
if res.ReturnCode == 0 then
|
||||||
|
self.groupumberTemp.hpall = {}
|
||||||
|
self.groupumberTemp.hpall.hp = res.Data.hp_num1 + res.Data.otherHp
|
||||||
|
self.record_data[1] = self.groupumberTemp
|
||||||
|
self._data_record[1] = self.groupumberTemp
|
||||||
|
fgCtr:FG_GetPartnerStat(self.group_id, index * 67, 67, time_type, self.begin_time, self.end_time,
|
||||||
|
function(res)
|
||||||
|
ViewUtil.CloseModalWait()
|
||||||
|
|
||||||
|
if res.ReturnCode == 0 then
|
||||||
|
if not self.lst_record then
|
||||||
|
self.lst_record = self._view:GetChild("lst_record")
|
||||||
|
end
|
||||||
|
|
||||||
|
local members = res.Data.members
|
||||||
|
if members and #members and #self.record_data == 0 then
|
||||||
|
self._data_record[2] = members
|
||||||
|
else
|
||||||
|
if index == 0 and (not members or #members == 0) then
|
||||||
|
ViewUtil.ErrorTip(nil, "你不是合伙人")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, "当前成员获取失败")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, "目标没有总线值")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:FillRecordItem(data, obj)
|
||||||
|
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
|
||||||
|
|
||||||
|
local tex_total_score = obj:GetChild("tex_total_score")
|
||||||
|
local ctr_show_total = obj:GetController("show_total")
|
||||||
|
if data.hpall then
|
||||||
|
tex_total_score.text = data.hpall.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
|
||||||
|
obj:GetChild('tex_reward').text = d2ad(data.reward_hp)
|
||||||
|
|
||||||
|
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)
|
||||||
|
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
|
||||||
|
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
|
||||||
|
|
||||||
|
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.hpall then
|
||||||
|
tex_total_score.text = d2ad(mainRecord.hpall.hp)
|
||||||
|
ctr_show_total.selectedIndex = 1
|
||||||
|
else
|
||||||
|
ctr_show_total.selectedIndex = 0
|
||||||
|
end
|
||||||
|
obj:GetChild("tex_round_valid").text = d2ad((mainRecord.reward_tongji or 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('tex_reward').text = d2ad(mainRecord.reward_tongji or mainRecord.reward_hp)
|
||||||
|
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, obj)
|
||||||
|
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, {})
|
||||||
|
ViewUtil.CloseModalWait()
|
||||||
|
else
|
||||||
|
self:RecursionGetNumberRecord(mainRecord.uid, root_id or mainRecord.uid, 0)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:MoreChanged(context, id, obj)
|
||||||
|
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
|
||||||
|
local show_total_table = self.ctr_search.selectedIndex == 0 and self.record_total_data or
|
||||||
|
self.record_total_data_Find
|
||||||
|
self.lastY = self.lst_record.scrollPane.posY
|
||||||
|
if context.sender.selectedIndex == 1 then
|
||||||
|
self.record_data = {}
|
||||||
|
|
||||||
|
local myInfo = show_total_table[id]
|
||||||
|
pt(myInfo, id, self.group_id)
|
||||||
|
if myInfo then
|
||||||
|
ViewUtil:ShowModalWait()
|
||||||
|
if myInfo.lev == 1 or not myInfo.father then
|
||||||
|
self:RecursionGetRecordData(0, 0, id)
|
||||||
|
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
|
||||||
|
show_total_table[myInfo.father].list:SetChildIndex(obj, show_total_table[myInfo.father].childCount - 1)
|
||||||
|
self:RecursionGetAllRecordData(0, id, myInfo.father)
|
||||||
|
-- end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
ViewUtil.ErrorTip(nil, "统计页面失效,请重新打开")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local info = show_total_table[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 * 67,
|
||||||
|
67,
|
||||||
|
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 = {}
|
||||||
|
if #tempTable > 0 then
|
||||||
|
one = table.remove(tempTable)
|
||||||
|
end
|
||||||
|
if one ~= nil then
|
||||||
|
self:RecursionGetNumberRecordByLev1(tempTable, one.uid, id)
|
||||||
|
else
|
||||||
|
ViewUtil.ShowModalWait("没有下级成员")
|
||||||
|
end
|
||||||
|
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
|
||||||
|
ViewUtil.ShowModalWait(nil)
|
||||||
|
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 * 67, 67,
|
||||||
|
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:RecursionGetRecordData(index, isMe, fatherId)
|
||||||
|
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 * 67, 67, time_type, self.begin_time, self.end_time, function(res)
|
||||||
|
if res.ReturnCode == 0 then
|
||||||
|
local members = res.Data.members
|
||||||
|
if #members > 0 then
|
||||||
|
for i = 1, #members do
|
||||||
|
if members[i].uid ~= DataManager.SelfUser.account_id then
|
||||||
|
self.record_data[#self.record_data + 1] = members[i]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self:RecursionGetRecordData(index + 1, isMe, fatherId)
|
||||||
|
else
|
||||||
|
self:NewRecordTableChildHou(self.record_data, isMe, fatherId)
|
||||||
|
-- self.lst_record.numItems = #self.record_data
|
||||||
|
ViewUtil.CloseModalWait()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
ViewUtil.CloseModalWait()
|
||||||
|
ViewUtil:ErrorTip(res.ReturnCode, "获取下级合伙人失败")
|
||||||
|
return
|
||||||
|
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 * 67, 67,
|
||||||
|
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(index + 1, id, root_id)
|
||||||
|
else
|
||||||
|
self:NewRecordTableChildHou(self.record_data, 0, id)
|
||||||
|
-- self.lst_record.numItems = #self.record_data
|
||||||
|
ViewUtil.CloseModalWait()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
ViewUtil.CloseModalWait()
|
||||||
|
ViewUtil:ErrorTip(res.ReturnCode, "获取下级合伙人失败")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:RecursionChangeHeight(fatherId, childNum)
|
||||||
|
if self.ctr_search.selectedIndex == 0 then
|
||||||
|
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
|
||||||
|
else
|
||||||
|
self.record_total_data_Find[fatherId].childCount = self.record_total_data_Find[fatherId].childCount + childNum
|
||||||
|
self.record_total_data_Find[fatherId].list.height = self.record_total_data_Find[fatherId].list.height +
|
||||||
|
childNum * 113
|
||||||
|
self.record_total_data_Find[fatherId].obj.height = self.record_total_data_Find[fatherId].obj.height +
|
||||||
|
childNum * 113
|
||||||
|
if self.record_total_data_Find[fatherId].father ~= nil and self.record_total_data_Find[fatherId].father ~= DataManager.SelfUser.account_id then
|
||||||
|
self:RecursionChangeHeight(self.record_total_data_Find[fatherId].father, childNum)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
@ -315,62 +315,68 @@ PlayerSettings:
|
||||||
- m_Textures: []
|
- m_Textures: []
|
||||||
m_Width: 192
|
m_Width: 192
|
||||||
m_Height: 192
|
m_Height: 192
|
||||||
m_Kind: 0
|
m_Kind: 1
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
- m_Textures: []
|
- m_Textures: []
|
||||||
m_Width: 144
|
m_Width: 144
|
||||||
m_Height: 144
|
m_Height: 144
|
||||||
m_Kind: 0
|
m_Kind: 1
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
- m_Textures: []
|
- m_Textures: []
|
||||||
m_Width: 96
|
m_Width: 96
|
||||||
m_Height: 96
|
m_Height: 96
|
||||||
m_Kind: 0
|
m_Kind: 1
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
- m_Textures: []
|
- m_Textures: []
|
||||||
m_Width: 72
|
m_Width: 72
|
||||||
m_Height: 72
|
m_Height: 72
|
||||||
m_Kind: 0
|
m_Kind: 1
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
- m_Textures: []
|
- m_Textures: []
|
||||||
m_Width: 48
|
m_Width: 48
|
||||||
m_Height: 48
|
m_Height: 48
|
||||||
m_Kind: 0
|
m_Kind: 1
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
- m_Textures: []
|
- m_Textures: []
|
||||||
m_Width: 36
|
m_Width: 36
|
||||||
m_Height: 36
|
m_Height: 36
|
||||||
m_Kind: 0
|
m_Kind: 1
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
- m_Textures: []
|
- m_Textures:
|
||||||
|
- {fileID: 0}
|
||||||
m_Width: 192
|
m_Width: 192
|
||||||
m_Height: 192
|
m_Height: 192
|
||||||
m_Kind: 1
|
m_Kind: 0
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
- m_Textures: []
|
- m_Textures:
|
||||||
|
- {fileID: 0}
|
||||||
m_Width: 144
|
m_Width: 144
|
||||||
m_Height: 144
|
m_Height: 144
|
||||||
m_Kind: 1
|
m_Kind: 0
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
- m_Textures: []
|
- m_Textures:
|
||||||
|
- {fileID: 0}
|
||||||
m_Width: 96
|
m_Width: 96
|
||||||
m_Height: 96
|
m_Height: 96
|
||||||
m_Kind: 1
|
m_Kind: 0
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
- m_Textures: []
|
- m_Textures:
|
||||||
|
- {fileID: 0}
|
||||||
m_Width: 72
|
m_Width: 72
|
||||||
m_Height: 72
|
m_Height: 72
|
||||||
m_Kind: 1
|
m_Kind: 0
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
- m_Textures: []
|
- m_Textures:
|
||||||
|
- {fileID: 0}
|
||||||
m_Width: 48
|
m_Width: 48
|
||||||
m_Height: 48
|
m_Height: 48
|
||||||
m_Kind: 1
|
m_Kind: 0
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
- m_Textures: []
|
- m_Textures:
|
||||||
|
- {fileID: 0}
|
||||||
m_Width: 36
|
m_Width: 36
|
||||||
m_Height: 36
|
m_Height: 36
|
||||||
m_Kind: 1
|
m_Kind: 0
|
||||||
m_SubKind:
|
m_SubKind:
|
||||||
- m_BuildTarget: iPhone
|
- m_BuildTarget: iPhone
|
||||||
m_Icons:
|
m_Icons:
|
||||||
|
|
@ -464,7 +470,8 @@ PlayerSettings:
|
||||||
m_Height: 20
|
m_Height: 20
|
||||||
m_Kind: 2
|
m_Kind: 2
|
||||||
m_SubKind: iPad
|
m_SubKind: iPad
|
||||||
- m_Textures: []
|
- m_Textures:
|
||||||
|
- {fileID: 0}
|
||||||
m_Width: 1024
|
m_Width: 1024
|
||||||
m_Height: 1024
|
m_Height: 1024
|
||||||
m_Kind: 4
|
m_Kind: 4
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue