diff --git a/lua_probject/base_project/Game/View/Family/FamilyBanDesk.lua b/lua_probject/base_project/Game/View/Family/FamilyBanDesk.lua new file mode 100644 index 00000000..9e0fd2c6 --- /dev/null +++ b/lua_probject/base_project/Game/View/Family/FamilyBanDesk.lua @@ -0,0 +1,57 @@ +--region LOCAL + +local BanDesk = {} +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 + +--endregion + +-- 禁止同桌数据 +BanDesk.BanData = {} + +function BanDesk:TryShow(r) + if not self._view then + self:Init() + end + + root = r + HideMainView() + self:Show() +end + +function BanDesk:Close() + BaseView.Close(self) + ShowMainView() +end + +function BanDesk:Init() + setmetatable(BanDesk, {__index = BaseView}) + self:InitView("ui://Family/com_banDesk") + + self.btn_close = self._view:GetChild("btn_close") + self.list_banItem = self._view:GetChild("list_banItem") + + self.btn_close.onClick:Set(function() + self:Close() + end) + + self.list_banItem.itemRenderer = function(index, obj) + local data = self.BanData[index] + + local tex_name = obj:GetChild("tex_name") + local list_BanedPlayers = obj:GetChild("list_BanedPlayers") + local btn_del = obj:GetChild("btn_del") + local btn_addBanItem = obj:GetChild("btn_addBanItem") + end +end + +return BanDesk \ No newline at end of file diff --git a/lua_probject/base_project/Game/View/Family/FamilyBanDeskmate.lua b/lua_probject/base_project/Game/View/Family/FamilyBanDeskmate.lua deleted file mode 100644 index 2446910b..00000000 --- a/lua_probject/base_project/Game/View/Family/FamilyBanDeskmate.lua +++ /dev/null @@ -1,56 +0,0 @@ -local FamilyNumberDetail = import(".FamilyNumberDetail") - -local FamilyBanDeskmate = {} - -local M = FamilyBanDeskmate - -function FamilyBanDeskmate.new(root) - setmetatable(M, { __index = root }) - local self = setmetatable({}, { __index = M }) - - - local numbers = self._group.members - local fgCtr = ControllerManager.GetController(NewGroupController) - if #numbers == 0 then - ViewUtil.ShowModalWait() - fgCtr:FG_GroupMembers(self._group.id, 0, self._group.total_member_num, false, 1, function(res) - numbers = self._group.members - -- print("==========================res.Data.members") - pt(self._group.members) - ViewUtil:CloseModalWait() - if res.ReturnCode ~= 0 then - ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败") - else - self:GetAllDeskmate(numbers) - end - end) - else - self:GetAllDeskmate(numbers) - end - self:initBtn() - return self -end - -function M:initBtn() - -end - -function M:GetAllDeskmate(numbers) - local fgCtr = ControllerManager.GetController(NewGroupController) - local Deskmate = {} - ViewUtil.ShowModalWait() - for i = 1, #numbers do - fgCtr:FG_GetBanTable(self._group.id, numbers[i].uid, function(res) - if res.ReturnCode == 0 then - - else - ViewUtil.ErrorTip(res.ReturnCode, "获取禁止同桌列表失败!") - end - if i == #numbers then - ViewUtil:CloseModalWait() - end - end) - end -end - -return M 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 440e0788..ab7b723b 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -10,6 +10,8 @@ local FamilyAuditNumber = import(".Family.FamilyAuditNumber") local FamilyJoinAndCreate = import(".Family.FamilyJoinAndCreate") local FamilyBanDeskmate = import(".Family.FamilyBanDeskmate") local FamilyEventView = import(".Family.FamilyEventView") +local FamilyBanDesk = import(".Family.FamilyBanDesk") +local FamilyMyFamily = import(".Family.FamilyMyFamily") --- FamilyView = {} @@ -59,6 +61,10 @@ function M:init(url) self._familyEventView = FamilyEventView.new(self) self._familyEventView:_evtAddPlay() end + -------绑定我的亲友圈按钮 + view:GetChild('btn_myfamily').onClick:Set(function() + FamilyMyFamily:TryShow(self) + end) end function M:InitCloseClick() @@ -87,7 +93,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) @@ -96,7 +102,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() @@ -142,7 +148,7 @@ function M:BanFamily() end function M:BanDeskmate() - self._child_familyAllNumbers = FamilyBanDeskmate.new(self) + self.FamilyBanDesk = FamilyBanDesk:TryShow(self) end function M:ChangeNumber(fgCtr, group_id, limit, num, minus_only, sort_type) @@ -330,7 +336,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/Extend_Poker_ChunTian/package.xml b/wb_new_ui/assets/Extend_Poker_ChunTian/package.xml index 5e4b09d0..3c73cd66 100644 --- a/wb_new_ui/assets/Extend_Poker_ChunTian/package.xml +++ b/wb_new_ui/assets/Extend_Poker_ChunTian/package.xml @@ -622,6 +622,9 @@ + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Extend_Poker_SuoHaNew/package.xml b/wb_new_ui/assets/Extend_Poker_SuoHaNew/package.xml index 141a0de4..192b26bb 100644 --- a/wb_new_ui/assets/Extend_Poker_SuoHaNew/package.xml +++ b/wb_new_ui/assets/Extend_Poker_SuoHaNew/package.xml @@ -533,6 +533,9 @@ + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Family/BanDesk/Component/btn_addBanItem.xml b/wb_new_ui/assets/Family/BanDesk/Component/btn_addBanItem.xml new file mode 100644 index 00000000..eace45d0 --- /dev/null +++ b/wb_new_ui/assets/Family/BanDesk/Component/btn_addBanItem.xml @@ -0,0 +1,10 @@ + + +