diff --git a/lua_probject/base_project/Game/View/Family/FamilyAllNumbers.lua b/lua_probject/base_project/Game/View/Family/FamilyAllNumbers.lua index 4e0702c8..fccb4f7f 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyAllNumbers.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyAllNumbers.lua @@ -4,9 +4,10 @@ local FamilyInviteFamilyView = {} local M = FamilyInviteFamilyView -function FamilyInviteFamilyView.new(root) +function FamilyInviteFamilyView.new(group, root) setmetatable(M, { __index = root }) local self = setmetatable({}, { __index = M }) + self._group = group local numbers = self._group.members print("lingmengFamilyInviteFamilyView", self._group.lev) pt(self._group) diff --git a/lua_probject/base_project/Game/View/Family/FamilyAuditNumber.lua b/lua_probject/base_project/Game/View/Family/FamilyAuditNumber.lua index d88161b7..50320dce 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyAuditNumber.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyAuditNumber.lua @@ -1,3 +1,6 @@ +--local NumberRemark = import(".FamilyNumberRemark") +local GroupSetTagView = import("..NewGroup.GroupSetTagView") + local FamilyAuditNumber = {} local M = FamilyAuditNumber @@ -46,8 +49,11 @@ function M:ClickBtn(isAllow, uid) if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败") else - ViewUtil.ShowOneChooose("审核成功") + --ViewUtil.ShowOneChooose("审核成功") self:InitList() + --NumberRemark:TryShow() + local tagView = GroupSetTagView.new(self._group.id, uid) + tagView:Show() end end) end diff --git a/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua b/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua index f9d8a518..d73888b3 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua @@ -118,9 +118,10 @@ function FamilyJoinAndCreate:JoinRoom(roomId) --后端似乎还未调通 self:ClearNumTex() fgCtr:FG_JoinGroup(tonumber(roomId), function(res) - if res.ReturnCode ~= 0 then - ViewUtil.ShowOneChooose("加入失败" .. res.ReturnCode) + if res.ReturnCode == 0 then + ViewUtil.ShowOneChooose("已申请加入亲友圈" .. res.ReturnCode) else + ViewUtil.ShowOneChooose("申请加入亲友圈失败" .. res.ReturnCode) end end) --先换成邀请玩家 diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua index cf2e0cfb..920e7d19 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua @@ -13,32 +13,17 @@ 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) +function FamilyMyFamily:TryShow(groupId, r) self:Init() root = r + self.groupId = groupId self:Show() end function FamilyMyFamily:Show() - local family = root._group - --pt(family) - if not family then - -- 跳转创建家族界面 - root:CreateFamily() - return - end - self:Refalsh() HideMainView() @@ -52,7 +37,8 @@ end function FamilyMyFamily:Refalsh() - local family = root._group + --local family = root._group + local family = DataManager.groups.groupMap[self.groupId] self.tex_fName.text = family.name self.tex_playerName.text = "亲友圈号:" .. family.id @@ -66,11 +52,13 @@ end function FamilyMyFamily:Init() setmetatable(FamilyMyFamily, { __index = BaseWindow }) - BaseWindow.init(self, 'ui://Family/com_myFamily') - -- 设置成组件的形式 + self._close_destroy = true self._full = true self._animation = false + self._full_offset = false + BaseWindow.init(self, 'ui://Family/com_myFamily') + -- 隐藏背景图 self._root_view:GetChild("win_mode").visible = false self._view:GetChild("btn_close").onClick:Set(function() @@ -119,7 +107,8 @@ function FamilyMyFamily:Init() self.btn_checkNumber.onClick:Set(function() self:Close() - root:AllNumber() + local family = DataManager.groups.groupMap[self.groupId] + root:OpenAllNumber(family) end) self.btn_applyMsg.onClick:Set(function() @@ -167,21 +156,14 @@ function FamilyMyFamily:Init() ViewUtil.ErrorTip(res.ReturnCode, "更改公告失败,请稍后再试") else ViewUtil.ErrorTip(res.ReturnCode, "修改成功!") + family.notice = self.input_notice.text self:Refalsh() + self.cWindow.selectedIndex = 0 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/Family/FamilyMyfamilyList.lua b/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua new file mode 100644 index 00000000..c35b6948 --- /dev/null +++ b/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua @@ -0,0 +1,99 @@ +local FamilyMyFamily = import(".FamilyMyFamily") + +--#region LOCAL + +local FamilyMyfamilyList = {} + +local function HideMainView(self) + self.rootLastIndex = self.FamilyView.familyType.selectedIndex + self.FamilyView.familyType.selectedIndex = 0 +end + +local function ShowMainView(self) + self.FamilyView.familyType.selectedIndex = self.rootLastIndex or 1 +end + +--#endregion + +function FamilyMyfamilyList:TryShow(root) + local Instance = self.New(root) + Instance:Show() +end + +function FamilyMyfamilyList.New(root) + setmetatable(FamilyMyfamilyList, { __index = BaseWindow }) + local Instance = setmetatable({}, { __index = FamilyMyfamilyList }) + Instance._full = true + Instance._close_destroy = true + Instance._full_offset = false + + BaseWindow.init(Instance, "ui://Family/com_myFamilyList") + -- 隐藏背景图 + Instance._root_view:GetChild("win_mode").visible = false + + Instance.FamilyView = root + Instance:Init() + + return Instance +end + +function FamilyMyfamilyList:Refalsh() + self.list_familys.numItems = #DataManager.groups.groupList +end + +function FamilyMyfamilyList:Show() + HideMainView(self) + self:Refalsh() + BaseWindow.Show(self) +end + +function FamilyMyfamilyList:Init() + + self.list_familys = self._view:GetChild("list_familys") + self.btn_close = self._view:GetChild("btn_close") + + self.btn_close.onClick:Set(function() + self:Close() + end) + + self.list_familys.itemRenderer = function(index, obj) + local groups = DataManager.groups.groupList + local group = groups[index +1] + + local tex_familyId = obj:GetChild("tex_familyId") + local tex_familyName = obj:GetChild("tex_familyName") + local tex_familyNumber = obj:GetChild("tex_familyNumber") + local btn_familyManage = obj:GetChild("btn_familyManage") + local btn_record = obj:GetChild("btn_record") + local btn_rank = obj:GetChild("btn_rank") + local loader_icon = obj:GetChild("loader_icon") + + tex_familyId.text = group.id + tex_familyName.text = group.name + tex_familyNumber.text = group.total_member_num + ImageLoad.Load(group.o_portrait, loader_icon) + + btn_familyManage.onClick:Set(function() + self:Close() + self.FamilyView:OpenMyFamily(group.id) + end) + + btn_record.onClick:Set(function() + self:Close() + self.FamilyView:FamilyRecord() + end) + + btn_rank.onClick:Set(function() + + end) + end + + pt(DataManager.groups.groupList) +end + +function FamilyMyfamilyList:Close() + ShowMainView(self) + BaseWindow.Close(self) +end + +return FamilyMyfamilyList \ No newline at end of file diff --git a/lua_probject/base_project/Game/View/Family/FamilyNumberRemark.lua b/lua_probject/base_project/Game/View/Family/FamilyNumberRemark.lua new file mode 100644 index 00000000..14cf2c0e --- /dev/null +++ b/lua_probject/base_project/Game/View/Family/FamilyNumberRemark.lua @@ -0,0 +1,42 @@ +local FamilyNumberRemark = {} + +function FamilyNumberRemark:TryShow() + local inst = self.New() + inst:Init() + inst:Show() +end + +function FamilyNumberRemark.New() + setmetatable(FamilyNumberRemark, { __index = BaseWindow }) + local inst = setmetatable({}, { __index = FamilyNumberRemark }) + inst._close_destroy = true + inst._close_zone = true + BaseWindow.init(inst, "ui://Family/com_numberRemark") + + inst:Init() + return inst +end + +function FamilyNumberRemark:Show() + BaseWindow.Show(self) +end + +function FamilyNumberRemark:Init() + + self.input_remark = self._view:GetChild("input_remark") + self.btn_quit = self._view:GetChild("btn_quit") + self.btn_confirm = self._view:GetChild("btn_confirm") + self.btn_bg = self._view:GetChild("btn_bg") + + self.btn_bg.onClick:Set(function() + self:Close() + end) + + self.btn_quit.onClick:Set(function() + self:Close() + end) + + self.btn_confirm.onClick:Set() +end + +return FamilyNumberRemark \ 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 f0ce3ac3..cf23ad41 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -13,6 +13,7 @@ local FamilyBanDesk = import(".Family.FamilyBanDesk") local FamilyMyFamily = import(".Family.FamilyMyFamily") local FamilyRecord = import(".Family.FamilyRecord") local FamilyRoomCard = import(".Family.FamilyRoomCard") +local FamilyMyfamilyList = import(".Family.FamilyMyfamilyList") --- FamilyView = {} @@ -39,7 +40,12 @@ function M:init(url) self.familyType = view:GetController('familyType') self.btn_close = view:GetChild('btn_close') + self.btn_myFamilyList = view:GetChild("btn_myFamilyList") + self.btn_creatFamily = view:GetChild("btn_creatFamily") + self.btn_joinFamily = view:GetChild("btn_joinFamily") self._mgr_ctr = ControllerManager.GetController(GroupMgrController) + self.cMyfamilyList = view:GetController("cMyfamilyList") + self.btn_quitMyfamilyTab = view:GetChild("btn_quitMyfamilyTab") self:InitCloseClick() @@ -64,11 +70,29 @@ function M:init(url) end -------绑定我的亲友圈按钮 view:GetChild('btn_myfamily').onClick:Set(function() - FamilyMyFamily:TryShow(self) + self.cMyfamilyList.selectedIndex = 1 + end) + + self.btn_myFamilyList.onClick:Set(function() + self.cMyfamilyList.selectedIndex = 0 + --FamilyMyFamily:TryShow(self) + FamilyMyfamilyList:TryShow(self) + end) + + self.btn_creatFamily.onClick:Set(function() + self.cMyfamilyList.selectedIndex = 0 + self:CreateFamily() + end) + + self.btn_joinFamily.onClick:Set(function() + self.cMyfamilyList.selectedIndex = 0 + self:CreateFamily() + end) + + self.btn_quitMyfamilyTab.onClick:Set(function() + self.cMyfamilyList.selectedIndex = 0 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() @@ -118,9 +142,13 @@ function M:PlayEdit() self.lastType = 1 end +function M:OpenMyFamily(groupId) + FamilyMyFamily:TryShow(groupId, self) +end + function M:AllNumber() self.lastType = 1 - self._child_familyAllNumbers = FamilyAllNumbers.new(self) + self._child_familyAllNumbers = FamilyAllNumbers.new(self._group, self) end function M:AuditNumber() @@ -135,6 +163,11 @@ function M:ShowShop() FamilyRoomCard:TryShow() end +function M:OpenAllNumber(group) + self.lastType = 1 + self._child_familyAllNumbers = FamilyAllNumbers.new(group, self) +end + function M:MoreBtn() local ctr_more = self._view:GetController('moreBtn') self._view:GetChild('bg_moreBtnBack').onClick:Set(function() diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupSetTagView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupSetTagView.lua index b87b35ec..f06080b1 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupSetTagView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupSetTagView.lua @@ -4,6 +4,7 @@ local GroupSetTagView = {} local M = GroupSetTagView function GroupSetTagView.new(group_id, member, callback) + UIPackage.AddPackage('base/newgroup/ui/NewGroup') setmetatable(M, {__index = BaseWindow}) local self = setmetatable({}, {__index = M}) self.class = "GroupSetTagView" @@ -18,14 +19,19 @@ function M:init(url, member) BaseWindow.init(self,url) local tex_tag = self._view:GetChild("tex_tag") + + --[[ 你是谁,为什么会在这里 if tag ~= 0 then tex_tag.text = member.score end + ]] + self._view:GetChild("btn_ok").onClick:Set(function() ViewUtil.ShowModalWait(nil) - local score = tonumber(tex_tag.text) or 0 + --local score = tonumber(tex_tag.text) or 0 + local score = tex_tag.text local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_SetMemberTag(self.group_id, member.uid, score, function(res) + fgCtr:FG_SetMemberTag(self.group_id, member, score, function(res) if self._is_destroy then return end @@ -34,7 +40,7 @@ function M:init(url, member) ViewUtil.ErrorTip(res.ReturnCode, "备注失败") else ViewUtil.ShowBannerOnScreenCenter("备注成功") - member.score = score + --member.score = score self:Destroy() self.callback(true) end diff --git a/wb_new_ui/assets/Family/CreateAndJoin/com_createAndJoin.xml b/wb_new_ui/assets/Family/CreateAndJoin/com_createAndJoin.xml index cad44d14..08d51729 100644 --- a/wb_new_ui/assets/Family/CreateAndJoin/com_createAndJoin.xml +++ b/wb_new_ui/assets/Family/CreateAndJoin/com_createAndJoin.xml @@ -14,9 +14,9 @@ - + - + diff --git a/wb_new_ui/assets/Family/Main.xml b/wb_new_ui/assets/Family/Main.xml index 057b133e..f9f67063 100644 --- a/wb_new_ui/assets/Family/Main.xml +++ b/wb_new_ui/assets/Family/Main.xml @@ -1,6 +1,6 @@ - + @@ -9,6 +9,7 @@ + @@ -323,5 +324,13 @@ + + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Family/Main/Image/hall_club_common_tittle_icon1.png b/wb_new_ui/assets/Family/Main/Image/hall_club_common_tittle_icon1.png new file mode 100644 index 00000000..190d0bdb Binary files /dev/null and b/wb_new_ui/assets/Family/Main/Image/hall_club_common_tittle_icon1.png differ diff --git a/wb_new_ui/assets/Family/MyFamily/Component/btn_bg.xml b/wb_new_ui/assets/Family/MyFamily/Component/btn_bg.xml index a54dec69..8460c3fc 100644 --- a/wb_new_ui/assets/Family/MyFamily/Component/btn_bg.xml +++ b/wb_new_ui/assets/Family/MyFamily/Component/btn_bg.xml @@ -3,7 +3,6 @@ - diff --git a/wb_new_ui/assets/Family/MyFamily/Component/btn_familyManage.xml b/wb_new_ui/assets/Family/MyFamily/Component/btn_familyManage.xml new file mode 100644 index 00000000..80b70888 --- /dev/null +++ b/wb_new_ui/assets/Family/MyFamily/Component/btn_familyManage.xml @@ -0,0 +1,10 @@ + + + + + + + + +