群统计搜索也可以递归打开,点展开会记录当前列表位置,展开后自动回归

master
罗家炜 2025-06-22 01:28:58 +08:00
parent af006a117c
commit 28e318dc64
4 changed files with 74 additions and 37 deletions

View File

@ -987,11 +987,10 @@ function M:OnUpdate()
local func = self._gamectr:PopEvent()
if (func ~= nil) then
local result, resultInfo = pcall(func)
print("lingmeng PopEvent", result, resultInfo)
if result then
else
printlog("lingmeng eror", resultInfo)
error(resultInfo)
self._gamectr = ControllerManager.GetController(GameController)
if self._gamectr then
self._gamectr:ResetConnect()

View File

@ -19,6 +19,7 @@ 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 })
@ -44,12 +45,32 @@ function M:NewRecordTable(lev)
obj:GetController("more").selectedIndex = 1
end
function M:NewRecordTableFind(data)
self.record_total_data_Find = {}
local item_result = self._view:GetChild('lst_member_find')
item_result:RemoveChildren()
local mainRecord = data
local obj = self.item_result:AddItemFromPool()
self:OnRenderRecordItemNew(obj, mainRecord)
local tempTable = {}
tempTable.obj = obj
tempTable.father = DataManager.SelfUser.account_id
tempTable.childCount = 0
tempTable.list = obj:GetChild("lst_record")
tempTable.list.height = 0
self.record_total_data_Find[mainRecord.uid] = tempTable
obj:GetController("more").selectedIndex = 1
end
function M:NewRecordTableChildHou(table, isMe, fatherId)
local show_total_table = self.ctr_search.selectedIndex == 0 and self.record_total_data or self
.record_total_data_Find
isMe = isMe or 0
print("lingmeng NewRecordTableChild", isMe, fatherId)
pt(table)
local childNum = #table - isMe
local fatherList = self.record_total_data[fatherId].list
local fatherList = show_total_table[fatherId].list
self:RecursionChangeHeight(fatherId, childNum)
for i = 1 + isMe, childNum + isMe do
local mainRecord = table[i]
@ -63,21 +84,24 @@ function M:NewRecordTableChildHou(table, isMe, fatherId)
tempTable.list = obj:GetChild("lst_record")
tempTable.list.height = 0
tempTable.obj.height = 113
self.record_total_data[mainRecord.uid] = tempTable
show_total_table[mainRecord.uid] = tempTable
end
self.lst_record.scrollPane:SetPosY(self.lastY or 0, false)
end
function M:NewRecordTableChildQian(table, isMe, fatherId)
local show_total_table = self.ctr_search.selectedIndex == 0 and self.record_total_data or self
.record_total_data_Find
isMe = isMe or 0
print("lingmeng NewRecordTableChild", isMe, fatherId)
pt(table)
local childNum = #table - isMe
local fatherList = self.record_total_data[fatherId].list
if self.record_total_data[fatherId].showMumber then
local fatherList = show_total_table[fatherId].list
if show_total_table[fatherId].showMumber then
ViewUtil.ErrorTip(nil, "已展示全部普通成员")
return
end
self.record_total_data[fatherId].showMumber = true
show_total_table[fatherId].showMumber = true
self:RecursionChangeHeight(fatherId, childNum)
for i = 1 + isMe, childNum + isMe do
local mainRecord = table[i]
@ -91,8 +115,9 @@ function M:NewRecordTableChildQian(table, isMe, fatherId)
tempTable.list = obj:GetChild("lst_record")
tempTable.list.height = 0
tempTable.obj.height = 113
self.record_total_data[mainRecord.uid] = tempTable
show_total_table[mainRecord.uid] = tempTable
end
self.lst_record.scrollPane:SetPosY(self.lastY or 0, false)
end
-- function M:ShowPeopleNum()
@ -203,25 +228,21 @@ function M:InitView()
else
self._view:GetChild('tex_id').text = ''
ctr_search.selectedIndex = 1
local item_result = self._view:GetChild('lst_member_find')
item_result:RemoveChildren()
for j = 1, #res.Data.members do
local tem = item_result:AddItemFromPool()
self:FillRecordItem(res.Data.members[j], tem)
end
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.lst_record.numItems = #self.record_data
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)
@ -480,9 +501,13 @@ function M:MoreChanged(context, id)
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 = self.record_total_data[id]
local myInfo = show_total_table[id]
pt(myInfo, id, self.group_id)
if myInfo then
ViewUtil:ShowModalWait()
@ -509,7 +534,7 @@ function M:MoreChanged(context, id)
ViewUtil.ErrorTip(nil, "统计页面失效,请重新打开")
end
else
local info = self.record_total_data[id]
local info = show_total_table[id]
info.list:RemoveChildrenToPool()
self:RecursionChangeHeight(id, -info.childCount)
end
@ -714,11 +739,22 @@ function M:RecursionGetAllRecordData(index, id, root_id)
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)
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

View File

@ -412,7 +412,9 @@ function M:CmdAddCard(cmd, index)
data.cmd = cmd.cmd
local _room = self._room
local u = data.player_card_data[cmd.seat]
u.card_list[#u.card_list + 1] = cmd.data.card
if u then
u.card_list[#u.card_list + 1] = cmd.data.card
end
--pt(u.card_list)
end

View File

@ -2,7 +2,7 @@
<component size="1396,760">
<controller name="type" pages="0,,1,,2," selected="0"/>
<controller name="mng" pages="0,,1," selected="0"/>
<controller name="search" pages="0,,1," selected="0"/>
<controller name="search" pages="0,,1," selected="1"/>
<displayList>
<image id="n192_imp5" name="n192" src="imp57ihq" fileName="images/Group 778.png" xy="0,31" size="1396,698"/>
<list id="n184_b5ny" name="lst_mgr_index" xy="150,-658" size="612,53" group="n83_kwi0" visible="false" layout="row" overflow="hidden" colGap="1" defaultItem="ui://27vd145beeqmch0" selectionController="type">
@ -78,7 +78,7 @@
<item/>
<item/>
</list>
<list id="n190_dji9" name="lst_member_find" xy="25,168" size="1346,482" overflow="scroll" lineGap="5" defaultItem="ui://m7iejg46f6brhww" autoClearItems="true">
<list id="n190_dji9" name="lst_member_find" xy="25,261" size="1346,452" overflow="scroll" lineGap="5" defaultItem="ui://m7iejg46f6brhww" autoClearItems="true">
<gearDisplay controller="search" pages="1"/>
<relation target="" sidePair="width-width"/>
<item/>
@ -88,15 +88,15 @@
<item/>
</list>
<image id="n181_b8zx" name="n181" pkg="m7iejg46" src="b8zx7i4g" fileName="合伙人统计.png" xy="-250,-145" visible="false" alpha="0.5"/>
<component id="n191_dji9" name="btn_back" src="efnuhdk" fileName="component/Btn/Btn_back1.xml" xy="361,19" size="71,54">
<component id="n191_dji9" name="btn_back" src="efnuhdk" fileName="component/Btn/Btn_back1.xml" xy="1298,131" size="71,54">
<gearDisplay controller="search" pages="1"/>
<Button controller="search" page="0"/>
</component>
<image id="n193_imp5" name="n193" src="yscl7iby" fileName="images/allNumber/Group 583.png" xy="940,120" size="220,71" group="n195_imp5"/>
<text id="n194_imp5" name="tex_id" xy="942,119" size="215,71" group="n195_imp5" font="Microsoft YaHei" fontSize="40" color="#2b2b2b" vAlign="middle" autoSize="shrink" bold="true" autoClearText="true" text="" input="true" prompt="请输入玩家id" maxLength="8"/>
<group id="n195_imp5" name="n195" xy="940,119" size="220,72" group="n197_imp5" advanced="true"/>
<component id="n196_imp5" name="btn_search" src="dzx8hbb" fileName="component/Btn/btn_req.xml" xy="1161,121" group="n197_imp5"/>
<group id="n197_imp5" name="group_search" xy="940,119" size="359,76" advanced="true">
<image id="n193_imp5" name="n193" src="yscl7iby" fileName="images/allNumber/Group 583.png" xy="920,120" size="220,71" group="n195_imp5"/>
<text id="n194_imp5" name="tex_id" xy="922,119" size="215,71" group="n195_imp5" font="Microsoft YaHei" fontSize="40" color="#2b2b2b" vAlign="middle" autoSize="shrink" bold="true" autoClearText="true" text="" input="true" prompt="请输入玩家id" maxLength="8"/>
<group id="n195_imp5" name="n195" xy="920,119" size="220,72" group="n197_imp5" advanced="true"/>
<component id="n196_imp5" name="btn_search" src="dzx8hbb" fileName="component/Btn/btn_req.xml" xy="1141,121" group="n197_imp5"/>
<group id="n197_imp5" name="group_search" xy="920,119" size="359,76" advanced="true">
<relation target="" sidePair="center-center%"/>
</group>
<component id="n198_imp5" name="btn_close" src="ilon7ib9" fileName="mgr/component/numberHpAlone/btn_close.xml" xy="1337,21"/>