diff --git a/lua_probject/base_project/Game/View/LobbyView.lua b/lua_probject/base_project/Game/View/LobbyView.lua index 9bbf0273..6e2670ca 100644 --- a/lua_probject/base_project/Game/View/LobbyView.lua +++ b/lua_probject/base_project/Game/View/LobbyView.lua @@ -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) diff --git a/wb_new_ui/assets/Common/pop_oneChoose.xml b/wb_new_ui/assets/Common/pop_oneChoose.xml index 65e72632..93c17843 100644 --- a/wb_new_ui/assets/Common/pop_oneChoose.xml +++ b/wb_new_ui/assets/Common/pop_oneChoose.xml @@ -6,7 +6,9 @@ - - + +