战况发送协议修改

master
罗家炜 2025-07-14 17:46:29 +08:00
parent c5f712125d
commit fb6977c9c3
3 changed files with 168 additions and 67 deletions

View File

@ -409,7 +409,19 @@ function M:FG_QueryPartnerList(group_id, query_id, query_nick, callback)
end)
end
function M:FG_GetMemberStat(group_id, query_id, partner_id, limit, num, time_type, begin_time, end_time, callback)
---comment 获取整线所有成员的个人战绩
---@param group_id number 联盟id
---@param query_id number 对象id如果为0查询全部成员如果不为1查看对象信息
---@param partner_id number 上级id
---@param limit number 限制数量
---@param num number 起始位置
---@param time_type number 时间类型 3为按提供时间查询
---@param begin_time number 开始时间戳
---@param end_time number 结束时间戳
---@param sortType number 排序类型1-8整除2为排序类型输赢比赛分score场次round大赢家win),赠送分pump余除2为排序顺序1为倒序2为正序
---@param callback function
function M:FG_GetMemberStat(group_id, query_id, partner_id, limit, num, time_type, begin_time, end_time, sortType,
callback)
local _client = ControllerManager.GroupClient
local data = {}
data.id = group_id
@ -422,6 +434,7 @@ function M:FG_GetMemberStat(group_id, query_id, partner_id, limit, num, time_typ
end
data.limit = limit
data.num = num
data.sortType = sortType
_client:send(Protocol.WEB_FG_GET_MEMBER_STAT, data, function(res)
callback(res)
end)

View File

@ -31,6 +31,7 @@ function M:InitInfo()
{ uid = DataManager.SelfUser.account_id, nick = DataManager.SelfUser.nick_name }, obj)
-- obj:GetController('show').selectedIndex = 1
obj.data.selected = true
ViewUtil.ShowModalWait("正在获取成员中")
self:RecursionGetNumber1(0, DataManager.SelfUser.account_id, {})
--将外面设置为最外圈页面
self.ctr_index.selectedIndex = #self.page_config
@ -78,6 +79,7 @@ function M:PartnerRender(data, obj)
if obj.data.listNum then
self:RecursionReSize(obj)
else
ViewUtil.ShowModalWait("正在获取成员中")
self:RecursionGetNumber1(0, data.uid, {})
end
end
@ -112,7 +114,6 @@ function M:SetListShow(list, isShow, myID)
end
function M:RecursionGetNumber1(index, id, tempTable)
ViewUtil.ShowModalWait("正在获取成员中")
local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_GroupSubMembers(
self.group_id,

View File

@ -61,9 +61,10 @@ function M:InitView()
self.lst_record.itemRenderer = function(index, obj)
self:OnRenderRecordItem(index, obj)
end
-- self.lst_record.scrollPane.onPullUpRelease:Set(function()
-- self:GetRecordData(self.lst_record.numItems)
-- end)
self.lst_record.scrollPane.onPullUpRelease:Set(function()
self._data_index = self._data_index + 1
self:GetRecoedData(self._data_index * 3, self._data_selectedSortType)
end)
self.lst_record_find = self._view:GetChild("lst_member_find")
self.lst_record_find:SetVirtual()
@ -125,7 +126,7 @@ function M:InitView()
qid = tonumber(text) or 0
local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_GetMemberStat(self.group_id, qid, DataManager.SelfUser.account_id,
0, 6, 3, self.begin_time, self.end_time,
0, 6, 3, self.begin_time, self.end_time, 1,
function(res)
if res.ReturnCode == 0 then
local members = res.Data.members
@ -163,87 +164,121 @@ function M:InitView()
self.btn_totalWin = self._view:GetChild('btn_totalWin')
self.btn_totalWin.onClick:Set(
function()
self.btn_totalRound:GetController("type").selectedIndex = 0
self.btn_total:GetController("type").selectedIndex = 0
self.btn_reward:GetController("type").selectedIndex = 0
-- self.btn_totalRound:GetController("type").selectedIndex = 0
-- self.btn_total:GetController("type").selectedIndex = 0
-- self.btn_reward:GetController("type").selectedIndex = 0
-- local type = self.btn_totalWin:GetController("type")
-- type.selectedIndex = type.selectedIndex == 0 and 1 or 3 - type.selectedIndex
local type = self.btn_totalWin:GetController("type")
type.selectedIndex = type.selectedIndex == 0 and 1 or 3 - type.selectedIndex
if type.selectedIndex == 1 then
table.sort(self.record_data, function(a, b)
return a.score > b.score
end)
elseif type.selectedIndex == 2 then
table.sort(self.record_data, function(a, b)
return a.score < b.score
end)
self._data_index = 0
self.record_data = {}
if type.selectedIndex == 0 then
self._data_selectedSortType = 1
else
self._data_selectedSortType = 3 - self._data_selectedSortType
end
self.lst_record:RefreshVirtualList()
-- if type.selectedIndex == 1 then
-- table.sort(self.record_data, function(a, b)
-- return a.score > b.score
-- end)
-- elseif type.selectedIndex == 2 then
-- table.sort(self.record_data, function(a, b)
-- return a.score < b.score
-- end)
-- end
-- self.lst_record:RefreshVirtualList()
self:GetRecoedData(0, self._data_selectedSortType)
end
)
self.btn_totalRound = self._view:GetChild('btn_totalRound')
self.btn_totalRound.onClick:Set(
function()
self.btn_totalWin:GetController("type").selectedIndex = 0
self.btn_total:GetController("type").selectedIndex = 0
self.btn_reward:GetController("type").selectedIndex = 0
-- self.btn_totalWin:GetController("type").selectedIndex = 0
-- self.btn_total:GetController("type").selectedIndex = 0
-- self.btn_reward:GetController("type").selectedIndex = 0
-- local type = self.btn_totalRound:GetController("type")
-- type.selectedIndex = type.selectedIndex == 0 and 1 or 3 - type.selectedIndex
local type = self.btn_totalRound:GetController("type")
type.selectedIndex = type.selectedIndex == 0 and 1 or 3 - type.selectedIndex
if type.selectedIndex == 1 then
table.sort(self.record_data, function(a, b)
return a.round > b.round
end)
elseif type.selectedIndex == 2 then
table.sort(self.record_data, function(a, b)
return a.round < b.round
end)
self._data_index = 0
self.record_data = {}
if type.selectedIndex == 0 then
self._data_selectedSortType = 3
else
self._data_selectedSortType = 7 - self._data_selectedSortType
end
self.lst_record:RefreshVirtualList()
-- if type.selectedIndex == 1 then
-- table.sort(self.record_data, function(a, b)
-- return a.round > b.round
-- end)
-- elseif type.selectedIndex == 2 then
-- table.sort(self.record_data, function(a, b)
-- return a.round < b.round
-- end)
-- end
-- self.lst_record:RefreshVirtualList()
self:GetRecoedData(0, self._data_selectedSortType)
end
)
self.btn_total = self._view:GetChild('btn_total')
self.btn_total.onClick:Set(
function()
self.btn_totalWin:GetController("type").selectedIndex = 0
self.btn_totalRound:GetController("type").selectedIndex = 0
self.btn_reward:GetController("type").selectedIndex = 0
-- self.btn_totalWin:GetController("type").selectedIndex = 0
-- self.btn_totalRound:GetController("type").selectedIndex = 0
-- self.btn_reward:GetController("type").selectedIndex = 0
-- local type = self.btn_total:GetController("type")
-- type.selectedIndex = type.selectedIndex == 0 and 1 or 3 - type.selectedIndex
local type = self.btn_total:GetController("type")
type.selectedIndex = type.selectedIndex == 0 and 1 or 3 - type.selectedIndex
if type.selectedIndex == 1 then
table.sort(self.record_data, function(a, b)
return a.win > b.win
end)
elseif type.selectedIndex == 2 then
table.sort(self.record_data, function(a, b)
return a.win < b.win
end)
self._data_index = 0
self.record_data = {}
if type.selectedIndex == 0 then
self._data_selectedSortType = 5
else
self._data_selectedSortType = 11 - self._data_selectedSortType
end
self.lst_record:RefreshVirtualList()
-- if type.selectedIndex == 1 then
-- table.sort(self.record_data, function(a, b)
-- return a.win > b.win
-- end)
-- elseif type.selectedIndex == 2 then
-- table.sort(self.record_data, function(a, b)
-- return a.win < b.win
-- end)
-- end
-- self.lst_record:RefreshVirtualList()
self:GetRecoedData(0, self._data_selectedSortType)
end
)
self.btn_reward = self._view:GetChild('btn_reward')
self.btn_reward.onClick:Set(
function()
self.btn_totalWin:GetController("type").selectedIndex = 0
self.btn_totalRound:GetController("type").selectedIndex = 0
self.btn_total:GetController("type").selectedIndex = 0
-- self.btn_totalWin:GetController("type").selectedIndex = 0
-- self.btn_totalRound:GetController("type").selectedIndex = 0
-- self.btn_total:GetController("type").selectedIndex = 0
local type = self.btn_reward:GetController("type")
type.selectedIndex = type.selectedIndex == 0 and 1 or 3 - type.selectedIndex
if type.selectedIndex == 1 then
table.sort(self.record_data, function(a, b)
return a.pump > b.pump
end)
elseif type.selectedIndex == 2 then
table.sort(self.record_data, function(a, b)
return a.pump < b.pump
end)
self._data_index = 0
self.record_data = {}
if type.selectedIndex == 0 then
self._data_selectedSortType = 7
else
self._data_selectedSortType = 15 - self._data_selectedSortType
end
self.lst_record:RefreshVirtualList()
-- if type.selectedIndex == 1 then
-- table.sort(self.record_data, function(a, b)
-- return a.pump > b.pump
-- end)
-- elseif type.selectedIndex == 2 then
-- table.sort(self.record_data, function(a, b)
-- return a.pump < b.pump
-- end)
-- end
-- self.lst_record:RefreshVirtualList()
self:GetRecoedData(0, self._data_selectedSortType)
end
)
end
@ -254,9 +289,10 @@ function M:GetRecordData(index)
-- if group.lev == 1 and self._data_choosePlayyer.uid == DataManager.SelfUser.account_id then
-- self:RecursionGetRankData(0)
-- else
self._data_index = 0
self.record_data = {}
self.lst_record.numItems = 0
self:RecursionGetRecoedData(0)
self:GetRecoedData(0, 5)
-- end
end
@ -264,16 +300,17 @@ function M:RefrenRecordData(data)
self._data_choosePlayyer = data
local group = DataManager.groups:get(self.group_id)
-- pt("lingmeng GetRecordData2", self.group_id, self._data_choosePlayyer, group.lev)
self._data_index = 0
self.record_data = {}
self.lst_record.numItems = 0
self:RecursionGetRecoedData(0)
self:GetRecoedData(0, 5)
end
function M:RecursionGetRecoedData(index)
ViewUtil.ShowModalWait("正在获取数据中")
local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_GetMemberStat(self.group_id, 0, self._data_choosePlayyer.uid,
index * 67, 67, 3, self.begin_time, self.end_time,
index * 67, 67, 3, self.begin_time, self.end_time, 5,
function(res)
if res.ReturnCode == 0 then
local members = res.Data.members
@ -291,9 +328,9 @@ function M:RecursionGetRecoedData(index)
self.btn_totalWin:GetController("type").selectedIndex = 0
self.btn_total:GetController("type").selectedIndex = 0
self.btn_reward:GetController("type").selectedIndex = 0
table.sort(self.record_data, function(a, b)
return a.round > b.round
end)
-- table.sort(self.record_data, function(a, b)
-- return a.round > b.round
-- end)
self.lst_record.numItems = #self.record_data
end
else
@ -304,6 +341,56 @@ function M:RecursionGetRecoedData(index)
end)
end
function M:GetRecoedData(index, type)
ViewUtil.ShowModalWait("正在获取数据中")
local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_GetMemberStat(self.group_id, 0, self._data_choosePlayyer.uid,
index, 3, 3, self.begin_time, self.end_time, type,
function(res)
if res.ReturnCode == 0 then
local members = res.Data.members
ViewUtil.CloseModalWait()
if members and #members > 0 then
for i = 1, #members do
if members[i].round > 0 then
members[i].pump = 0 - members[i].pump
self.record_data[#self.record_data + 1] = members[i]
end
end
self.btn_totalRound:GetController("type").selectedIndex = 0
self.btn_totalWin:GetController("type").selectedIndex = 0
self.btn_total:GetController("type").selectedIndex = 0
self.btn_reward:GetController("type").selectedIndex = 0
self._data_selectedSortType = 0
if type / 2 <= 1 then
if type <= 0 then
ViewUtil.ErrorTip(nil, "排序种类出错")
return
end
self.btn_totalWin:GetController("type").selectedIndex = 2 - type % 2
elseif type / 2 <= 2 then
self.btn_totalRound:GetController("type").selectedIndex = 2 - type % 2
elseif type / 2 <= 3 then
self.btn_total:GetController("type").selectedIndex = 2 - type % 2
elseif type / 2 <= 4 then
self.btn_reward:GetController("type").selectedIndex = 2 - type % 2
else
ViewUtil.ErrorTip(nil, "排序种类出错")
return
end
self._data_selectedSortType = type
self.lst_record.numItems = #self.record_data
else
self._data_index = self._data_index - 1
end
else
ViewUtil.CloseModalWait()
ViewUtil.ErrorTip(res.ReturnCode)
return
end
end)
end
function M:RecursionGetRankData(index)
ViewUtil.ShowModalWait()
local fgCtr = ControllerManager.GetController(NewGroupController)