From 53c1f4be2e45a1c5bf126eea1c02b628c3a57688 Mon Sep 17 00:00:00 2001 From: "DESKTOP-7R8JEQQ\\k" <1076390229@qq.com> Date: Thu, 19 Jun 2025 18:17:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Game/View/Family/FamilyMyFamily.lua | 87 ++++++++++++++++-- .../base_project/Game/View/FamilyView.lua | 3 + wb_new_ui/assets/Family/Main.xml | 28 +++--- .../Family/MyFamily/Component/btn_bg.xml | 11 +++ .../MyFamily/Component/btn_confirmNotice.xml | 10 ++ .../MyFamily/Component/btn_editNotice.xml | 10 ++ .../MyFamily/Component/btn_quitNotice.xml | 10 ++ .../Family/MyFamily/Image/CommonRes_3.png | Bin 0 -> 50147 bytes .../Family/MyFamily/Image/Rectangle 39.png | Bin 0 -> 8343 bytes .../Family/MyFamily/Image/Rectangle 40.png | Bin 0 -> 9662 bytes .../hall_club_common_btntext_queding.png | Bin 0 -> 87739 bytes .../assets/Family/MyFamily/com_myFamily.xml | 31 +++++-- wb_new_ui/assets/Family/package.xml | 8 ++ .../ART/base/Family/ui/Family_atlas0.png | Bin 2663398 -> 2734928 bytes .../ART/base/Family/ui/Family_atlas0_1.png | Bin 1544341 -> 1674367 bytes .../ART/base/Family/ui/Family_fui.bytes | Bin 86512 -> 89069 bytes 16 files changed, 168 insertions(+), 30 deletions(-) create mode 100644 wb_new_ui/assets/Family/MyFamily/Component/btn_bg.xml create mode 100644 wb_new_ui/assets/Family/MyFamily/Component/btn_confirmNotice.xml create mode 100644 wb_new_ui/assets/Family/MyFamily/Component/btn_editNotice.xml create mode 100644 wb_new_ui/assets/Family/MyFamily/Component/btn_quitNotice.xml create mode 100644 wb_new_ui/assets/Family/MyFamily/Image/CommonRes_3.png create mode 100644 wb_new_ui/assets/Family/MyFamily/Image/Rectangle 39.png create mode 100644 wb_new_ui/assets/Family/MyFamily/Image/Rectangle 40.png create mode 100644 wb_new_ui/assets/Family/MyFamily/Image/hall_club_common_btntext_queding.png diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua index ba02a4f7..cf2e0cfb 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua @@ -13,6 +13,14 @@ local function ShowMainView() root.familyType.selectedIndex = rootLastIndex or 1 end +local function SetRelation(self) + local contentPane = self._root_view:GetChild("contentPane") + --contentPane:RemoveRelation(self._root_view, RelationType.Center_Center) + contentPane.relations:ClearAll() + contentPane:AddRelation(self._root_view, RelationType.Width) + contentPane:AddRelation(self._root_view, RelationType.Height) +end + --endregion function FamilyMyFamily:TryShow(r) @@ -24,13 +32,28 @@ end function FamilyMyFamily:Show() local family = root._group - pt(family) + --pt(family) if not family then -- 跳转创建家族界面 root:CreateFamily() return end + self:Refalsh() + + HideMainView() + BaseWindow.Show(self) +end + +function FamilyMyFamily:Close() + BaseWindow.Close(self) + ShowMainView() +end + +function FamilyMyFamily:Refalsh() + + local family = root._group + self.tex_fName.text = family.name self.tex_playerName.text = "亲友圈号:" .. family.id self.tex_fNumber.text = family.member_num @@ -39,14 +62,6 @@ function FamilyMyFamily:Show() ImageLoad.Load(family.o_portrait, self.loader_icon) self.cStyle.selectedIndex = family.lev -1 - - HideMainView() - BaseWindow.Show(self) -end - -function FamilyMyFamily:Close() - BaseWindow.Close(self) - ShowMainView() end function FamilyMyFamily:Init() @@ -77,8 +92,15 @@ function FamilyMyFamily:Init() self.btn_applyMsg = self._view:GetChild("btn_applyMsg") self.btn_buyCrad = self._view:GetChild("btn_buyCrad") self.btn_checkNumber = self._view:GetChild("btn_checkNumber") + self.btn_editNotice = self._view:GetChild("btn_editNotice") + self.btn_quitNotice = self._view:GetChild("btn_quitNotice") + self.btn_bgNotice = self._view:GetChild("btn_bgNotice") + self.btn_confirmNotice = self._view:GetChild("btn_confirmNotice") + + self.input_notice = self._view:GetChild("input_notice") self.cStyle = self._view:GetController("cStyle") + self.cWindow = self._view:GetController("cWindow") self.btn_playSet.onClick:Set(function() self:Close() @@ -113,6 +135,53 @@ function FamilyMyFamily:Init() end) end) + self.btn_quitNotice.onClick:Set(function() + self.cWindow.selectedIndex = 0 + end) + + self.btn_bgNotice.onClick:Set(function() + self.cWindow.selectedIndex = 0 + end) + + self.btn_editNotice.onClick:Set(function() + self.cWindow.selectedIndex = 1 + end) + + self.btn_confirmNotice.onClick:Set(function() + local family = root._group + local fgCtr = ControllerManager.GetController(NewGroupController) + fgCtr:FG_UpdateGroupInfo( + family.id, + family.name, + self.input_notice.text, + not family.ban, + family.dissolve_opt, + family.kick_opt, + family.apply, + family.ban_chat1, + family.ban_chat2, + family.option, + 0, + function(res) + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, "更改公告失败,请稍后再试") + else + ViewUtil.ErrorTip(res.ReturnCode, "修改成功!") + self:Refalsh() + end + end + ) + end) + + SetRelation(self) + + print(string.format("myfamily x=%s height=%s", self._view.x, self._view.y)) + print(string.format("myfamily width=%s height=%s", self._view.width, self._view.height)) + + print(string.format("myfamilyroot width=%s height=%s", self._root_view.width, self._root_view.height)) + print(string.format("myfamilyroot x=%s y=%s", self._root_view.x, self._root_view.y)) + --print(string.format("familyrootParent x=%s y=%s", self._root_view.parent.width, self._root_view.parent.height)) + return self end diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index 0c0bf0ae..f0ce3ac3 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -66,6 +66,9 @@ function M:init(url) view:GetChild('btn_myfamily').onClick:Set(function() FamilyMyFamily:TryShow(self) end) + + print(string.format("familyView x=%s y=%s", self._view.x, self._view.y)) + print(string.format("familyView width=%s height=%s", self._view.width, self._view.height)) end function M:InitCloseClick() diff --git a/wb_new_ui/assets/Family/Main.xml b/wb_new_ui/assets/Family/Main.xml index 28de5891..057b133e 100644 --- a/wb_new_ui/assets/Family/Main.xml +++ b/wb_new_ui/assets/Family/Main.xml @@ -1,6 +1,6 @@ - + @@ -10,7 +10,7 @@ - + @@ -19,7 +19,7 @@ - + @@ -27,23 +27,23 @@ - + - + - + - + - + - + @@ -55,7 +55,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -88,14 +88,14 @@ - + - + @@ -106,7 +106,7 @@ - + diff --git a/wb_new_ui/assets/Family/MyFamily/Component/btn_bg.xml b/wb_new_ui/assets/Family/MyFamily/Component/btn_bg.xml new file mode 100644 index 00000000..a54dec69 --- /dev/null +++ b/wb_new_ui/assets/Family/MyFamily/Component/btn_bg.xml @@ -0,0 +1,11 @@ + + + + + + + + + +