diff --git a/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua b/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua index 4a00f48b..94406d96 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua @@ -1,53 +1,42 @@ local FamilyJoinAndCreate = {} -local M = FamilyJoinAndCreate - -function FamilyJoinAndCreate.new(root) - setmetatable(M, { __index = root }) - local self = setmetatable({}, { __index = M }) +function FamilyJoinAndCreate:init(root) local fgCtr = ControllerManager.GetController(NewGroupController) - local createOrJoin = self._view:GetController('createOrJoin') - + --local createOrJoin = self._view:GetController('createOrJoin') + self._view = root._view:GetChild('com_createAndJoin') + self.style = self._view:GetController('cStyle') self._currenIndex = 0 - self.tex_num = self._view:GetChild('text_inputNum') - self._view:GetChild('btn_joinFamily').onClick:Add(function() - createOrJoin.selectedIndex = 1 - end) - self._view:GetChild('btn_createFamily').onClick:Add(function() - createOrJoin.selectedIndex = 0 - end) - self._view:GetChild('list_num').onClickItem:Set(handler(self, self.OnNumButtonAction)) + self:KeyBoardInit() - local input_name = self._view:GetChild('input_name') - local input_wxId = self._view:GetChild('input_wxId') - input_name.onChanged:Set(function() - input_name.alpha = 1 - end) - input_name.onFocusOut:Set(function() - if #input_name.text > 0 then - input_name.alpha = 1 - else - input_name.alpha = 0.5 - end - end) + self.tex_num = self._view:GetChild('text_FamilyId') + self.input_name = self._view:GetChild('input_name') + self.input_wxId = self._view:GetChild('input_wxId') - input_wxId.onChanged:Set(function() - input_wxId.alpha = 1 - end) - input_wxId.onFocusOut:Set(function() - if #input_wxId.text > 0 then - input_wxId.alpha = 1 - else - input_wxId.alpha = 0.5 - end - end) self._view:GetChild('btn_create').onClick:Add(function() + + if self.style.selectedIndex ~= 1 then + self.style.selectedIndex = 1 + return + end + end) + + self._view:GetChild('btn_join').onClick:Add(function() + + if self.style.selectedIndex ~= 0 then + self.style.selectedIndex = 0 + return + end + + self:JoinRoom(self.tex_num.text) + end) + + self._view:GetChild('btn_c').onClick:Add(function() fgCtr:FG_GroupList(function(res) - fgCtr:FG_CreateGroup(input_name.text, 1, 2, function(res) + fgCtr:FG_CreateGroup(self.input_name.text, 1, 2, function(res) if res.ReturnCode == 0 then - self.familyType.selectedIndex = 1 + --self.familyType.selectedIndex = 1 self:ConnetFamily(1, DataManager.groups.groupList, true) else ViewUtil.ErrorTip(res.ReturnCode, '创建大联盟失败!') @@ -58,33 +47,72 @@ function FamilyJoinAndCreate.new(root) return self end -function M:OnNumButtonAction(context) - local item = context.data - local index = self._view:GetChild('list_num'):GetChildIndex(item) - if index < 9 or index == 10 then - if (self._currenIndex < 6) then - self._currenIndex = self._currenIndex + 1 - self.tex_num.text = self.tex_num.text .. (index < 9 and index + 1 or index - 10) - if (self._currenIndex == 6) then - self:JoinRoom(self.tex_num.text) - end - end - elseif index == 9 then - self:ClearNumTex() - else - if (self._currenIndex > 0) then - self._currenIndex = self._currenIndex - 1 - self.tex_num.text = string.sub(self.tex_num.text, 0, self._currenIndex) +function FamilyJoinAndCreate:KeyBoardInit() + self.list_keyBoard = self._view:GetChild('list_keyBoard') + + print("self.list_keyBoard.numItems", self.list_keyBoard.numItems) + + for i=0, self.list_keyBoard.numItems -1 do + local btn = self.list_keyBoard:GetChildAt(i) + local btnStyle = btn:GetController('cStyle') + local num = i + 1 + + if num <= 9 then + btn:GetChild('text_num').text = num + btn.onClick:Set(function() + print(num) + self:NumTexInput(num) + end) + elseif num == 10 then + btnStyle.selectedIndex = 1 + btn.onClick:Set(function() + print(i) + self:ClearNumTex() + end) + elseif num == 11 then + btn:GetChild('text_num').text = 0 + btn.onClick:Set(function() + print(num) + self:NumTexInput(0) + end) + elseif num == 12 then + btnStyle.selectedIndex = 2 + btn.onClick:Set(function() + print(num) + self:BackNumTex() + end) end end end -function M:ClearNumTex() +function FamilyJoinAndCreate:NumTexInput(num) + 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 +end + +function FamilyJoinAndCreate:BackNumTex() + + if #self.tex_num.text <= 0 then + return + end + + local cur = #self.tex_num.text + self.tex_num.text = string.sub(self.tex_num.text, 0, cur -1) +end + +function FamilyJoinAndCreate:ClearNumTex() self.tex_num.text = "" self._currenIndex = 0 end -function M:JoinRoom(roomId) +function FamilyJoinAndCreate:JoinRoom(roomId) local fgCtr = ControllerManager.GetController(NewGroupController) --后端似乎还未调通 self:ClearNumTex() @@ -107,4 +135,4 @@ function M:JoinRoom(roomId) -- end) end -return M +return FamilyJoinAndCreate diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua new file mode 100644 index 00000000..bba9b373 --- /dev/null +++ b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua @@ -0,0 +1,92 @@ +--region LOCAL + +local FamilyMyFamily = {} +local root = {} +local rootLastIndex = 0 + +local function HideMainView() + rootLastIndex = root.familyType.selectedIndex + root.familyType.selectedIndex = 0 +end + +local function ShowMainView() + root.familyType.selectedIndex = rootLastIndex or 1 +end + +function FamilyMyFamily:TryShow(r) + if not self._view then + self:Init() + root = r + end + + self:Show() +end + +--endregion + + + +function FamilyMyFamily:Show() + HideMainView() + BaseView.Show(self) +end + +function FamilyMyFamily:Close() + BaseView.Close(self) + ShowMainView() +end + +function FamilyMyFamily:Init() + setmetatable(FamilyMyFamily, { __index = BaseView }) + self:InitView('ui://Family/com_myFamily') + + self._view:GetChild("btn_close").onClick:Set(function() + self:Close() + end) + + self.loader_icon = self._view:GetChild("loader_icon") + self.tex_fName = self._view:GetChild("tex_fName") + self.tex_wxId = self._view:GetChild("tex_wxId") + self.tex_fNumber = self._view:GetChild("tex_fNumber") + self.tex_cradNum = self._view:GetChild("tex_cradNum") + self.tex_nocice = self._view:GetChild("tex_nocice") + self.tex_playerName = self._view:GetChild("tex_playerName") + + self.btn_quitFamily = self._view:GetChild("btn_quitFamily") + self.btn_playSet = self._view:GetChild("btn_playSet") + self.btn_invite = self._view:GetChild("btn_invite") + self.btn_czRecord = self._view:GetChild("btn_czRecord") + 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_playSet.onClick:Set(function() + self:Close() + root:PlayEdit() + end) + + self.btn_invite.onClick:Set(function() + self:Close() + root:ShareWx() + end) + + self.btn_buyCrad.onClick:Set(function() + self:Close() + root:ShowShop() + end) + + self.btn_checkNumber.onClick:Set(function() + self:Close() + root:AllNumber() + end) + + self.btn_applyMsg.onClick:Set(function() + self:Close() + root:AuditNumber() + end) + + return self +end + +return FamilyMyFamily \ 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 8fd7c0ab..aa6d65b0 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -9,6 +9,7 @@ local FamilyNumberRecord = import(".Family.FamilyNumberRecord") local FamilyAuditNumber = import(".Family.FamilyAuditNumber") local FamilyJoinAndCreate = import(".Family.FamilyJoinAndCreate") local FamilyBanDeskmate = import(".Family.FamilyBanDeskmate") +local FamilyMyFamily = import(".Family.FamilyMyFamily") --- FamilyView = {} @@ -52,6 +53,11 @@ function M:init(url) self._child_familyNumberRecord = FamilyNumberRecord.New(self) self.lastType = 1 end) + + -------绑定我的亲友圈按钮 + view:GetChild('btn_myfamily').onClick:Set(function() + FamilyMyFamily:TryShow(self) + end) end function M:InitCloseClick() @@ -80,7 +86,7 @@ function M:CreateFamily(frist) self.lastType = 1 end self._view:GetController('createOrJoin').selectedIndex = 0 - self._child_familyJoinAndCreate = FamilyJoinAndCreate.new(self) + self._child_familyJoinAndCreate = FamilyJoinAndCreate:init(self) end function M:JoinFamily(frist) @@ -89,7 +95,7 @@ function M:JoinFamily(frist) self.lastType = 1 end self._view:GetController('createOrJoin').selectedIndex = 1 - self._child_familyJoinAndCreate = FamilyJoinAndCreate.new(self) + self._child_familyJoinAndCreate = FamilyJoinAndCreate:init(self) end function M:PlayEdit() @@ -323,7 +329,8 @@ function M:UpdateFamilyRoom(fgCtr, id) return end obj:GetChild('text_title').text = playList[index].game_name - obj:GetChild('Label_details'):GetChild('title').text = playList[index].config + local mode = ExtendManager.GetExtendConfig(playList[index].gameId):GetGameInfo() + obj:GetChild('Label_details'):GetChild('title').text = mode:LoadConfigToDetail(playList[index].config) obj:GetController('type').selectedIndex = 1 obj:GetChild('btn_del').onClick:Add(function() fgCtr:FG_DelPlay(id, playList[index].id, function() diff --git a/wb_new_ui/assets/Common/images/win/Rectangle 145.png b/wb_new_ui/assets/Common/images/win/Rectangle 145.png new file mode 100644 index 00000000..0bbe9bd7 Binary files /dev/null and b/wb_new_ui/assets/Common/images/win/Rectangle 145.png differ diff --git a/wb_new_ui/assets/Common/images/win/Rectangle 157.png b/wb_new_ui/assets/Common/images/win/Rectangle 157.png new file mode 100644 index 00000000..9db8861c Binary files /dev/null and b/wb_new_ui/assets/Common/images/win/Rectangle 157.png differ diff --git a/wb_new_ui/assets/Common/package.xml b/wb_new_ui/assets/Common/package.xml index f14e9edc..974fcc20 100644 --- a/wb_new_ui/assets/Common/package.xml +++ b/wb_new_ui/assets/Common/package.xml @@ -1206,6 +1206,8 @@ + + diff --git a/wb_new_ui/assets/Family/ChatRoom/Component/item_player.xml b/wb_new_ui/assets/Family/ChatRoom/Component/item_player.xml new file mode 100644 index 00000000..78796399 --- /dev/null +++ b/wb_new_ui/assets/Family/ChatRoom/Component/item_player.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Family/ChatRoom/Component/item_record.xml b/wb_new_ui/assets/Family/ChatRoom/Component/item_record.xml new file mode 100644 index 00000000..518e664e --- /dev/null +++ b/wb_new_ui/assets/Family/ChatRoom/Component/item_record.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Family/ChatRoom/Image/Group 343(1).png b/wb_new_ui/assets/Family/ChatRoom/Image/Group 343(1).png new file mode 100644 index 00000000..fae0aae0 Binary files /dev/null and b/wb_new_ui/assets/Family/ChatRoom/Image/Group 343(1).png differ diff --git a/wb_new_ui/assets/Family/ChatRoom/Image/dayingjia.png b/wb_new_ui/assets/Family/ChatRoom/Image/dayingjia.png new file mode 100644 index 00000000..d277c0e9 Binary files /dev/null and b/wb_new_ui/assets/Family/ChatRoom/Image/dayingjia.png differ diff --git a/wb_new_ui/assets/Family/ChatRoom/com_chatRoom.xml b/wb_new_ui/assets/Family/ChatRoom/com_chatRoom.xml new file mode 100644 index 00000000..161276f7 --- /dev/null +++ b/wb_new_ui/assets/Family/ChatRoom/com_chatRoom.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Family/CreateAndJoin/Component/Label_createExplanation.xml b/wb_new_ui/assets/Family/CreateAndJoin/Component/Label_createExplanation.xml index 8ecb0565..cc52d6f0 100644 --- a/wb_new_ui/assets/Family/CreateAndJoin/Component/Label_createExplanation.xml +++ b/wb_new_ui/assets/Family/CreateAndJoin/Component/Label_createExplanation.xml @@ -1,7 +1,7 @@ - + diff --git a/wb_new_ui/assets/Family/CreateAndJoin/Component/btn_create.xml b/wb_new_ui/assets/Family/CreateAndJoin/Component/btn_create.xml index a8c82b92..2e33d00a 100644 --- a/wb_new_ui/assets/Family/CreateAndJoin/Component/btn_create.xml +++ b/wb_new_ui/assets/Family/CreateAndJoin/Component/btn_create.xml @@ -1,8 +1,10 @@ - + - + + +