diff --git a/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua b/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua index 94406d96..f9d8a518 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua @@ -86,15 +86,16 @@ function FamilyJoinAndCreate:KeyBoardInit() end function FamilyJoinAndCreate:NumTexInput(num) - if #self.tex_num.text > 6 then + if #self.tex_num.text >= 6 then self.tex_num.text = string.sub(self.tex_num.text, 1, 6) - end - - if #self.tex_num.text == 6 then return end self.tex_num.text = self.tex_num.text .. num + + if #self.tex_num.text == 6 then + self:JoinRoom(self.tex_num.text) + end end function FamilyJoinAndCreate:BackNumTex() diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua index bba9b373..ba02a4f7 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua @@ -13,32 +13,50 @@ local function ShowMainView() root.familyType.selectedIndex = rootLastIndex or 1 end -function FamilyMyFamily:TryShow(r) - if not self._view then - self:Init() - root = r - end +--endregion +function FamilyMyFamily:TryShow(r) + self:Init() + root = r self:Show() end ---endregion - - - function FamilyMyFamily:Show() + + local family = root._group + pt(family) + if not family then + -- 跳转创建家族界面 + root:CreateFamily() + return + end + + self.tex_fName.text = family.name + self.tex_playerName.text = "亲友圈号:" .. family.id + self.tex_fNumber.text = family.member_num + self.tex_cradNum.text = family.diamo + self.tex_nocice.text = family.notice + ImageLoad.Load(family.o_portrait, self.loader_icon) + + self.cStyle.selectedIndex = family.lev -1 + HideMainView() - BaseView.Show(self) + BaseWindow.Show(self) end function FamilyMyFamily:Close() - BaseView.Close(self) + BaseWindow.Close(self) ShowMainView() end function FamilyMyFamily:Init() - setmetatable(FamilyMyFamily, { __index = BaseView }) - self:InitView('ui://Family/com_myFamily') + setmetatable(FamilyMyFamily, { __index = BaseWindow }) + BaseWindow.init(self, 'ui://Family/com_myFamily') + -- 设置成组件的形式 + self._close_destroy = true + self._full = true + self._animation = false + self._root_view:GetChild("win_mode").visible = false self._view:GetChild("btn_close").onClick:Set(function() self:Close() @@ -60,6 +78,7 @@ function FamilyMyFamily:Init() self.btn_buyCrad = self._view:GetChild("btn_buyCrad") self.btn_checkNumber = self._view:GetChild("btn_checkNumber") + self.cStyle = self._view:GetController("cStyle") self.btn_playSet.onClick:Set(function() self:Close() @@ -86,6 +105,14 @@ function FamilyMyFamily:Init() root:AuditNumber() end) + self.btn_quitFamily.onClick:Set(function() + local fgCtr = ControllerManager.GetController(NewGroupController) + print("发送了退出协议 familyid = ",root._group.id) + fgCtr:FG_ExitGroup(root._group.id, function(res) + pt(res) + end) + end) + return self end diff --git a/lua_probject/base_project/Game/View/Family/FamilyRoomCard.lua b/lua_probject/base_project/Game/View/Family/FamilyRoomCard.lua new file mode 100644 index 00000000..e879380e --- /dev/null +++ b/lua_probject/base_project/Game/View/Family/FamilyRoomCard.lua @@ -0,0 +1,60 @@ +local data = { + {num = 50,colorIndex = 0}, + {num = 200,colorIndex = 1}, + {num = 1000,colorIndex = 2}, +} + +--#region + +local FamilyRoomCard ={} + +local function charge(num) + print('充值',num) +end + +--#endregion + +function FamilyRoomCard:TryShow() + local Instance = self.New() + Instance:Show() +end + +function FamilyRoomCard.New() + setmetatable(FamilyRoomCard, {__index = BaseWindow}) + local Instance = setmetatable({}, {__index = FamilyRoomCard}) + BaseWindow.init(Instance, "ui://Family/com_roomCard") + + Instance._close_destroy = true + Instance.list_bayCrad = Instance._view:GetChild("list_bayCrad") + Instance.tex_curCard = Instance._view:GetChild('tex_curCard') + Instance.tex_famliyCard = Instance._view:GetChild("tex_famliyCard") + + Instance.list_bayCrad.itemRenderer = function(index, obj) + local _idx = index +1 + local num = data[_idx].num + + obj:GetChild("tex_cardNum").text = num + obj:GetController("cColor").selectedIndex = data[_idx].colorIndex + + obj.onClick:Set(function() + + charge(num) + print('房卡',num) + end) + end + + Instance.list_bayCrad.numItems = #data + + return Instance +end + +function FamilyRoomCard:Show() + + self.tex_curCard.text = "当前帐号房卡:" .. DataManager.SelfUser.diamo + + --self.tex_famliyCard.text = "亲友圈房卡:" .. + + BaseWindow.Show(self) +end + +return FamilyRoomCard \ No newline at end of file diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index bbe20d26..0c0bf0ae 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -12,6 +12,7 @@ local FamilyEventView = import(".Family.FamilyEventView") local FamilyBanDesk = import(".Family.FamilyBanDesk") local FamilyMyFamily = import(".Family.FamilyMyFamily") local FamilyRecord = import(".Family.FamilyRecord") +local FamilyRoomCard = import(".Family.FamilyRoomCard") --- FamilyView = {} @@ -125,8 +126,10 @@ function M:AuditNumber() end function M:ShowShop() - self._child_familyLobbyShopView = LobbyShopView.new(self, self._group.id) - self._child_familyLobbyShopView:Show() + --self._child_familyLobbyShopView = LobbyShopView.new(self, self._group.id) + --self._child_familyLobbyShopView:Show() + + FamilyRoomCard:TryShow() end function M:MoreBtn() diff --git a/wb_new_ui/assets/Family/CreateAndJoin/com_createAndJoin.xml b/wb_new_ui/assets/Family/CreateAndJoin/com_createAndJoin.xml index b1d904d4..cad44d14 100644 --- a/wb_new_ui/assets/Family/CreateAndJoin/com_createAndJoin.xml +++ b/wb_new_ui/assets/Family/CreateAndJoin/com_createAndJoin.xml @@ -1,6 +1,6 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/wb_new_ui/assets/Family/MyFamily/com_myFamily.xml b/wb_new_ui/assets/Family/MyFamily/com_myFamily.xml index 6200d833..c6dd1394 100644 --- a/wb_new_ui/assets/Family/MyFamily/com_myFamily.xml +++ b/wb_new_ui/assets/Family/MyFamily/com_myFamily.xml @@ -1,13 +1,20 @@ + + + + + - - + + + + @@ -25,14 +32,29 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Family/NumberDetail/Component/btn_assistant.xml b/wb_new_ui/assets/Family/NumberDetail/Component/btn_assistant.xml index 8e118e37..91bfe176 100644 --- a/wb_new_ui/assets/Family/NumberDetail/Component/btn_assistant.xml +++ b/wb_new_ui/assets/Family/NumberDetail/Component/btn_assistant.xml @@ -1,11 +1,18 @@ - + + + + + + + +