频繁离线头像偶尔会不显示

master
罗家炜 2025-09-13 22:45:23 +08:00
parent e7fc4aeab5
commit 1a8080ae85
7 changed files with 27 additions and 5 deletions

View File

@ -92,8 +92,14 @@ function M:InitView(url)
ViewUtil.ErrorTip(self._view, "该功能还会开放,敬请期待")
end)
local clickTime = 0
local btn_family = self._view:GetChild("btn_family")
btn_family.onClick:Add(function()
if not self._flag_loadImageSucces and clickTime < 3 then
ViewUtil.ShowOneChooose({ showText = string.format("请等待头像加载完成,再点击%d次,无视头像不加载进入圈子", 3 - clickTime) })
clickTime = clickTime + 1
return
end
local user = DataManager.SelfUser
if user.group_id ~= 0 then
self:ReconnectRoom(user.group_id)
@ -160,7 +166,10 @@ function M:InitView(url)
end)
local btn_head = view:GetChild("btn_head")
ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject)
ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject, "Lobby", function()
printlog("load Callback")
self._flag_loadImageSucces = true
end)
btn_head.onClick:Set(function()
-- local headView = HeadView.new(DataManager.SelfUser, nil, function()
-- view:GetChild("tex_name").text = DataManager.SelfUser.nick_name
@ -497,8 +506,19 @@ function M:GetPlayerInfoData()
if result then
self:ShowPlayerInfo(data.raffle, data.diamo, data.newMail)
if data.group_id ~= 0 then
-- 重连
self:ReconnectRoom(data.groupId)
-- 重连,确保头像加载成功才能重连
ViewUtil.ShowModalWait(self._root_view, " ")
coroutine.start(function()
local waitTimes = 0
while not self._flag_loadImageSucces do
if waitTimes > 10 then
break
end
coroutine.wait(0.2)
end
ViewUtil.CloseModalWait()
self:ReconnectRoom(data.groupId)
end)
end
end
end)

View File

@ -6,7 +6,9 @@
<relation target="" sidePair="width-width,height-height"/>
</image>
<group id="n4_n2h8" name="bg" xy="-234,-915" size="3000,3000"/>
<component id="n6_n2h8" name="btn_center" src="n2h87imc" fileName="component/pop_oneChoose/btn_oneChoose.xml" xy="1062,676" size="408,159"/>
<text id="n9_n2h8" name="text_show" xy="698,438" size="1138,218" font="ui://27vd145bh35o7ilb" fontSize="48" color="#61270f" align="center" vAlign="middle" leading="8" letterSpacing="6" autoSize="none" text="下载地址已复制,请到浏览器粘贴下载地址已复制,请到浏览器粘贴下载地址已复制,请到浏览器粘贴"/>
<component id="n12_xpru" name="btn_center" src="eeqmcgp" fileName="buttons/Btn_Common.xml" xy="1095,699" size="340,125" aspect="true">
<Button title=" " icon="ui://27vd145bxblm7jbl"/>
</component>
<text id="n9_n2h8" name="text_show" xy="698,438" size="1138,253" font="ui://27vd145bh35o7ilb" fontSize="48" color="#61270f" align="center" vAlign="middle" leading="8" letterSpacing="6" autoSize="none" text="下载地址已复制,请到浏览器粘贴下载地址已复制,请到浏览器粘贴下载地址已复制,请到浏览器粘贴"/>
</displayList>
</component>