战况发送协议修改
parent
c5f712125d
commit
fb6977c9c3
|
|
@ -409,7 +409,19 @@ function M:FG_QueryPartnerList(group_id, query_id, query_nick, callback)
|
||||||
end)
|
end)
|
||||||
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 _client = ControllerManager.GroupClient
|
||||||
local data = {}
|
local data = {}
|
||||||
data.id = group_id
|
data.id = group_id
|
||||||
|
|
@ -422,6 +434,7 @@ function M:FG_GetMemberStat(group_id, query_id, partner_id, limit, num, time_typ
|
||||||
end
|
end
|
||||||
data.limit = limit
|
data.limit = limit
|
||||||
data.num = num
|
data.num = num
|
||||||
|
data.sortType = sortType
|
||||||
_client:send(Protocol.WEB_FG_GET_MEMBER_STAT, data, function(res)
|
_client:send(Protocol.WEB_FG_GET_MEMBER_STAT, data, function(res)
|
||||||
callback(res)
|
callback(res)
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ function M:InitInfo()
|
||||||
{ uid = DataManager.SelfUser.account_id, nick = DataManager.SelfUser.nick_name }, obj)
|
{ uid = DataManager.SelfUser.account_id, nick = DataManager.SelfUser.nick_name }, obj)
|
||||||
-- obj:GetController('show').selectedIndex = 1
|
-- obj:GetController('show').selectedIndex = 1
|
||||||
obj.data.selected = true
|
obj.data.selected = true
|
||||||
|
ViewUtil.ShowModalWait("正在获取成员中")
|
||||||
self:RecursionGetNumber1(0, DataManager.SelfUser.account_id, {})
|
self:RecursionGetNumber1(0, DataManager.SelfUser.account_id, {})
|
||||||
--将外面设置为最外圈页面
|
--将外面设置为最外圈页面
|
||||||
self.ctr_index.selectedIndex = #self.page_config
|
self.ctr_index.selectedIndex = #self.page_config
|
||||||
|
|
@ -78,6 +79,7 @@ function M:PartnerRender(data, obj)
|
||||||
if obj.data.listNum then
|
if obj.data.listNum then
|
||||||
self:RecursionReSize(obj)
|
self:RecursionReSize(obj)
|
||||||
else
|
else
|
||||||
|
ViewUtil.ShowModalWait("正在获取成员中")
|
||||||
self:RecursionGetNumber1(0, data.uid, {})
|
self:RecursionGetNumber1(0, data.uid, {})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -112,7 +114,6 @@ function M:SetListShow(list, isShow, myID)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:RecursionGetNumber1(index, id, tempTable)
|
function M:RecursionGetNumber1(index, id, tempTable)
|
||||||
ViewUtil.ShowModalWait("正在获取成员中")
|
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GroupSubMembers(
|
fgCtr:FG_GroupSubMembers(
|
||||||
self.group_id,
|
self.group_id,
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,10 @@ function M:InitView()
|
||||||
self.lst_record.itemRenderer = function(index, obj)
|
self.lst_record.itemRenderer = function(index, obj)
|
||||||
self:OnRenderRecordItem(index, obj)
|
self:OnRenderRecordItem(index, obj)
|
||||||
end
|
end
|
||||||
-- self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
self.lst_record.scrollPane.onPullUpRelease:Set(function()
|
||||||
-- self:GetRecordData(self.lst_record.numItems)
|
self._data_index = self._data_index + 1
|
||||||
-- end)
|
self:GetRecoedData(self._data_index * 3, self._data_selectedSortType)
|
||||||
|
end)
|
||||||
|
|
||||||
self.lst_record_find = self._view:GetChild("lst_member_find")
|
self.lst_record_find = self._view:GetChild("lst_member_find")
|
||||||
self.lst_record_find:SetVirtual()
|
self.lst_record_find:SetVirtual()
|
||||||
|
|
@ -125,7 +126,7 @@ function M:InitView()
|
||||||
qid = tonumber(text) or 0
|
qid = tonumber(text) or 0
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetMemberStat(self.group_id, qid, DataManager.SelfUser.account_id,
|
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)
|
function(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
local members = res.Data.members
|
local members = res.Data.members
|
||||||
|
|
@ -163,87 +164,121 @@ function M:InitView()
|
||||||
self.btn_totalWin = self._view:GetChild('btn_totalWin')
|
self.btn_totalWin = self._view:GetChild('btn_totalWin')
|
||||||
self.btn_totalWin.onClick:Set(
|
self.btn_totalWin.onClick:Set(
|
||||||
function()
|
function()
|
||||||
self.btn_totalRound:GetController("type").selectedIndex = 0
|
-- self.btn_totalRound:GetController("type").selectedIndex = 0
|
||||||
self.btn_total:GetController("type").selectedIndex = 0
|
-- self.btn_total:GetController("type").selectedIndex = 0
|
||||||
self.btn_reward: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")
|
local type = self.btn_totalWin:GetController("type")
|
||||||
type.selectedIndex = type.selectedIndex == 0 and 1 or 3 - type.selectedIndex
|
self._data_index = 0
|
||||||
|
self.record_data = {}
|
||||||
if type.selectedIndex == 1 then
|
if type.selectedIndex == 0 then
|
||||||
table.sort(self.record_data, function(a, b)
|
self._data_selectedSortType = 1
|
||||||
return a.score > b.score
|
else
|
||||||
end)
|
self._data_selectedSortType = 3 - self._data_selectedSortType
|
||||||
elseif type.selectedIndex == 2 then
|
|
||||||
table.sort(self.record_data, function(a, b)
|
|
||||||
return a.score < b.score
|
|
||||||
end)
|
|
||||||
end
|
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
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
self.btn_totalRound = self._view:GetChild('btn_totalRound')
|
self.btn_totalRound = self._view:GetChild('btn_totalRound')
|
||||||
self.btn_totalRound.onClick:Set(
|
self.btn_totalRound.onClick:Set(
|
||||||
function()
|
function()
|
||||||
self.btn_totalWin:GetController("type").selectedIndex = 0
|
-- self.btn_totalWin:GetController("type").selectedIndex = 0
|
||||||
self.btn_total:GetController("type").selectedIndex = 0
|
-- self.btn_total:GetController("type").selectedIndex = 0
|
||||||
self.btn_reward: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")
|
local type = self.btn_totalRound:GetController("type")
|
||||||
type.selectedIndex = type.selectedIndex == 0 and 1 or 3 - type.selectedIndex
|
self._data_index = 0
|
||||||
if type.selectedIndex == 1 then
|
self.record_data = {}
|
||||||
table.sort(self.record_data, function(a, b)
|
if type.selectedIndex == 0 then
|
||||||
return a.round > b.round
|
self._data_selectedSortType = 3
|
||||||
end)
|
else
|
||||||
elseif type.selectedIndex == 2 then
|
self._data_selectedSortType = 7 - self._data_selectedSortType
|
||||||
table.sort(self.record_data, function(a, b)
|
|
||||||
return a.round < b.round
|
|
||||||
end)
|
|
||||||
end
|
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
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
self.btn_total = self._view:GetChild('btn_total')
|
self.btn_total = self._view:GetChild('btn_total')
|
||||||
self.btn_total.onClick:Set(
|
self.btn_total.onClick:Set(
|
||||||
function()
|
function()
|
||||||
self.btn_totalWin:GetController("type").selectedIndex = 0
|
-- self.btn_totalWin:GetController("type").selectedIndex = 0
|
||||||
self.btn_totalRound:GetController("type").selectedIndex = 0
|
-- self.btn_totalRound:GetController("type").selectedIndex = 0
|
||||||
self.btn_reward: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")
|
local type = self.btn_total:GetController("type")
|
||||||
type.selectedIndex = type.selectedIndex == 0 and 1 or 3 - type.selectedIndex
|
self._data_index = 0
|
||||||
|
self.record_data = {}
|
||||||
if type.selectedIndex == 1 then
|
if type.selectedIndex == 0 then
|
||||||
table.sort(self.record_data, function(a, b)
|
self._data_selectedSortType = 5
|
||||||
return a.win > b.win
|
else
|
||||||
end)
|
self._data_selectedSortType = 11 - self._data_selectedSortType
|
||||||
elseif type.selectedIndex == 2 then
|
|
||||||
table.sort(self.record_data, function(a, b)
|
|
||||||
return a.win < b.win
|
|
||||||
end)
|
|
||||||
end
|
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
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
self.btn_reward = self._view:GetChild('btn_reward')
|
self.btn_reward = self._view:GetChild('btn_reward')
|
||||||
self.btn_reward.onClick:Set(
|
self.btn_reward.onClick:Set(
|
||||||
function()
|
function()
|
||||||
self.btn_totalWin:GetController("type").selectedIndex = 0
|
-- self.btn_totalWin:GetController("type").selectedIndex = 0
|
||||||
self.btn_totalRound:GetController("type").selectedIndex = 0
|
-- self.btn_totalRound:GetController("type").selectedIndex = 0
|
||||||
self.btn_total:GetController("type").selectedIndex = 0
|
-- self.btn_total:GetController("type").selectedIndex = 0
|
||||||
local type = self.btn_reward:GetController("type")
|
local type = self.btn_reward:GetController("type")
|
||||||
type.selectedIndex = type.selectedIndex == 0 and 1 or 3 - type.selectedIndex
|
self._data_index = 0
|
||||||
|
self.record_data = {}
|
||||||
if type.selectedIndex == 1 then
|
if type.selectedIndex == 0 then
|
||||||
table.sort(self.record_data, function(a, b)
|
self._data_selectedSortType = 7
|
||||||
return a.pump > b.pump
|
else
|
||||||
end)
|
self._data_selectedSortType = 15 - self._data_selectedSortType
|
||||||
elseif type.selectedIndex == 2 then
|
|
||||||
table.sort(self.record_data, function(a, b)
|
|
||||||
return a.pump < b.pump
|
|
||||||
end)
|
|
||||||
end
|
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
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
@ -254,9 +289,10 @@ function M:GetRecordData(index)
|
||||||
-- if group.lev == 1 and self._data_choosePlayyer.uid == DataManager.SelfUser.account_id then
|
-- if group.lev == 1 and self._data_choosePlayyer.uid == DataManager.SelfUser.account_id then
|
||||||
-- self:RecursionGetRankData(0)
|
-- self:RecursionGetRankData(0)
|
||||||
-- else
|
-- else
|
||||||
|
self._data_index = 0
|
||||||
self.record_data = {}
|
self.record_data = {}
|
||||||
self.lst_record.numItems = 0
|
self.lst_record.numItems = 0
|
||||||
self:RecursionGetRecoedData(0)
|
self:GetRecoedData(0, 5)
|
||||||
-- end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -264,16 +300,17 @@ function M:RefrenRecordData(data)
|
||||||
self._data_choosePlayyer = data
|
self._data_choosePlayyer = data
|
||||||
local group = DataManager.groups:get(self.group_id)
|
local group = DataManager.groups:get(self.group_id)
|
||||||
-- pt("lingmeng GetRecordData2", self.group_id, self._data_choosePlayyer, group.lev)
|
-- pt("lingmeng GetRecordData2", self.group_id, self._data_choosePlayyer, group.lev)
|
||||||
|
self._data_index = 0
|
||||||
self.record_data = {}
|
self.record_data = {}
|
||||||
self.lst_record.numItems = 0
|
self.lst_record.numItems = 0
|
||||||
self:RecursionGetRecoedData(0)
|
self:GetRecoedData(0, 5)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:RecursionGetRecoedData(index)
|
function M:RecursionGetRecoedData(index)
|
||||||
ViewUtil.ShowModalWait("正在获取数据中")
|
ViewUtil.ShowModalWait("正在获取数据中")
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
fgCtr:FG_GetMemberStat(self.group_id, 0, self._data_choosePlayyer.uid,
|
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)
|
function(res)
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
local members = res.Data.members
|
local members = res.Data.members
|
||||||
|
|
@ -291,9 +328,9 @@ function M:RecursionGetRecoedData(index)
|
||||||
self.btn_totalWin:GetController("type").selectedIndex = 0
|
self.btn_totalWin:GetController("type").selectedIndex = 0
|
||||||
self.btn_total:GetController("type").selectedIndex = 0
|
self.btn_total:GetController("type").selectedIndex = 0
|
||||||
self.btn_reward:GetController("type").selectedIndex = 0
|
self.btn_reward:GetController("type").selectedIndex = 0
|
||||||
table.sort(self.record_data, function(a, b)
|
-- table.sort(self.record_data, function(a, b)
|
||||||
return a.round > b.round
|
-- return a.round > b.round
|
||||||
end)
|
-- end)
|
||||||
self.lst_record.numItems = #self.record_data
|
self.lst_record.numItems = #self.record_data
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
@ -304,6 +341,56 @@ function M:RecursionGetRecoedData(index)
|
||||||
end)
|
end)
|
||||||
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)
|
function M:RecursionGetRankData(index)
|
||||||
ViewUtil.ShowModalWait()
|
ViewUtil.ShowModalWait()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue