diff --git a/lua_probject/base_project/Game/View/FamilyZuo/FamilyGamePlay.lua b/lua_probject/base_project/Game/View/FamilyZuo/FamilyGamePlay.lua index 65523290..2fb81b30 100644 --- a/lua_probject/base_project/Game/View/FamilyZuo/FamilyGamePlay.lua +++ b/lua_probject/base_project/Game/View/FamilyZuo/FamilyGamePlay.lua @@ -78,7 +78,8 @@ function M:ClickCreate() _data.game_id = info.game_id self.table_color = 0 local functionName = self._data.playInfo and fgCtr.FG_UpdatePlay or fgCtr.FG_AddPlay - functionName(fgCtr, group.id, info.game_id, _data, info.name, hpData, 1,self._data.playInfo.id, group.type, self.table_color, + local pid = self._data.playInfo and self._data.playInfo.id or 0 + functionName(fgCtr, group.id, info.game_id, _data, info.name, hpData, 1,pid, group.type, self.table_color, function(res) if self._is_destroy then return diff --git a/lua_probject/base_project/Game/View/FamilyZuo/FamilyManagerTable.lua b/lua_probject/base_project/Game/View/FamilyZuo/FamilyManagerTable.lua index 8c9642d4..a778763d 100644 --- a/lua_probject/base_project/Game/View/FamilyZuo/FamilyManagerTable.lua +++ b/lua_probject/base_project/Game/View/FamilyZuo/FamilyManagerTable.lua @@ -2,6 +2,10 @@ local ManagerChild_GamePlayView = import(".ManagerChild_GamePlayView") local ManagerChild_PlayerView = import(".ManagerChild_PlayerView") --成员 local ManagerMenberChild_PlayerView = import(".ManagerMenberChild_PlayerView") +local ManagerMenberChild_JoinsView = import(".ManagerMenberChild_JoinsView") +local ManagerMenberChild_ExitsView = import(".ManagerMenberChild_ExitsView") +local ManagerMenberChild_DisInviteView = import(".ManagerMenberChild_DisInviteView") +local ManagerMenberChild_DisSameDeskView = import(".ManagerMenberChild_DisSameDeskView") local FamilyManagerTable = {} @@ -11,7 +15,11 @@ M.ManagerTable = { { id = 1, title = "成员管理", view = ManagerChild_PlayerView }, { id = 2, title = "快速组局", view = ManagerChild_GamePlayView }, --成员管理页面 - { id = 3, title = "成员列表", view = ManagerMenberChild_PlayerView } + { id = 3, title = "成员列表", view = ManagerMenberChild_PlayerView }, + { id = 4, title = "进驻申请", view = ManagerMenberChild_JoinsView }, + { id = 5, title = "离开申请", view = ManagerMenberChild_ExitsView }, + { id = 6, title = "离开申请", view = ManagerMenberChild_DisInviteView }, + { id = 7, title = "离开申请", view = ManagerMenberChild_DisSameDeskView } } M.ManagerShow = { @@ -21,7 +29,7 @@ M.ManagerShow = { } M.ManagerMenberShow = { - { 3 }, --群主 + { 3,4,5,6,7 }, --群主 {}, --代理 {} --用户 } diff --git a/lua_probject/base_project/Game/View/FamilyZuo/FamilyMenberManagerPlayerDetailView.lua b/lua_probject/base_project/Game/View/FamilyZuo/FamilyMenberManagerPlayerDetailView.lua index 5a6e68b3..e71c7ea3 100644 --- a/lua_probject/base_project/Game/View/FamilyZuo/FamilyMenberManagerPlayerDetailView.lua +++ b/lua_probject/base_project/Game/View/FamilyZuo/FamilyMenberManagerPlayerDetailView.lua @@ -2,7 +2,7 @@ local FamilyMenberManagerPlayerDetailView = {} local M = FamilyMenberManagerPlayerDetailView -function FamilyMenberManagerPlayerDetailView.new(data,callback) +function FamilyMenberManagerPlayerDetailView.new(data, callback) setmetatable(M, { __index = BaseWindow }) local self = setmetatable({}, { __index = M }) self.class = "FamilyMenberManagerPlayerDetailView" @@ -15,13 +15,56 @@ function FamilyMenberManagerPlayerDetailView.new(data,callback) end function M:init(url) - getmetatable(M).__index.init(self,url) + getmetatable(M).__index.init(self, url) local view = self._view + view:GetChild('check_invite').onClick:Set(handler(self,self.ClickInvite)) + + view:GetChild('btn_kick').onClick:Set(handler(self, self.ClickTick)) + view:GetChild('btn_black').onClick:Set(function() + ViewUtil:ErrorTip("小黑屋功能还未开放") + end) + view:GetChild('btn_sameDesk').onClick:Set(function() + ViewUtil:ErrorTip("禁止同桌页面还没做") + end) + self:FillData() end +--点击禁止加入房间 +function M:ClickSameRoom() + +end + +--点击屏蔽游戏邀请 +function M:ClickInvite(context) + +end + +--点击踢出玩家 +function M:ClickTick() + local fgCtr = ControllerManager.GetController(NewGroupController) + local info = self._data.info + local _curren_msg = + MsgWindow.new(self._root_view, string.format("你要将【%s】踢出亲友圈吗?", info.nick), + MsgWindow.MsgMode.OkAndCancel) + _curren_msg.onOk:Add( + function() + fgCtr:FG_GroupRemoveMember(DataManager.CurrenGroup.id, info.uid, function(res) + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, "踢出玩家失败!") + else + ViewUtil:ErrorTip(string.format("踢出【%s】成功",info.nick)) + self._callback() + self:Destroy() + end + end) + end + ) + _curren_msg:Show() +end + function M:FillData() local info = self._data.info if not info then @@ -36,6 +79,11 @@ function M:FillData() view:GetChild('textTitle_levText').text = info.lev == 1 and "群主" or "成员" view:GetChild('textTitle_timeText').text = os.date("%Y-%m-%d", tonumber(info.join_time)) + local typeNum = DataManager.CurrenGroup.lev < 3 and 0 or 2 + if info.uid ~= DataManager.SelfUser.account_id then + typeNum = typeNum + 1 + end + view:GetController('type').selectedIndex = typeNum self:Show() end diff --git a/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_DisInviteView.lua b/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_DisInviteView.lua new file mode 100644 index 00000000..0039ac78 --- /dev/null +++ b/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_DisInviteView.lua @@ -0,0 +1,45 @@ +local ManagerMenberChild_DisInviteView = {} + +local M = ManagerMenberChild_DisInviteView + +function ManagerMenberChild_DisInviteView.new(data, callback) + local self = setmetatable({}, { __index = M }) + self.class = "ManagerMenberChild_DisInviteView" + self._data = data or {} + self._callback = callback + self:init("ui://Family/ManagerMenberChild_DisInvite") + return self +end + +function M:init(url) + local root = self._data.root + if not root then + ViewUtil:ErrorTip("点击太快,请重新打开页面") + return + end + local page = root._view:GetChild('page') + ViewUtil.LoadPage(page, url, function(view) + self._view = view + end) +end + +function M:FillData() + +end + +-- 打开窗口 +function M:Show() + getmetatable(M).__index.Show(self) +end + +-- 关闭窗口 +function M:Close() + getmetatable(M).__index.Close(self) +end + +-- 销毁窗口 +function M:Destroy() + getmetatable(M).__index.Destroy(self) +end + +return M diff --git a/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_DisSameDeskView.lua b/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_DisSameDeskView.lua new file mode 100644 index 00000000..0039ac78 --- /dev/null +++ b/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_DisSameDeskView.lua @@ -0,0 +1,45 @@ +local ManagerMenberChild_DisInviteView = {} + +local M = ManagerMenberChild_DisInviteView + +function ManagerMenberChild_DisInviteView.new(data, callback) + local self = setmetatable({}, { __index = M }) + self.class = "ManagerMenberChild_DisInviteView" + self._data = data or {} + self._callback = callback + self:init("ui://Family/ManagerMenberChild_DisInvite") + return self +end + +function M:init(url) + local root = self._data.root + if not root then + ViewUtil:ErrorTip("点击太快,请重新打开页面") + return + end + local page = root._view:GetChild('page') + ViewUtil.LoadPage(page, url, function(view) + self._view = view + end) +end + +function M:FillData() + +end + +-- 打开窗口 +function M:Show() + getmetatable(M).__index.Show(self) +end + +-- 关闭窗口 +function M:Close() + getmetatable(M).__index.Close(self) +end + +-- 销毁窗口 +function M:Destroy() + getmetatable(M).__index.Destroy(self) +end + +return M diff --git a/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_ExitsView.lua b/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_ExitsView.lua new file mode 100644 index 00000000..6e13742d --- /dev/null +++ b/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_ExitsView.lua @@ -0,0 +1,97 @@ +local ManagerMenberChild_ExitsView = {} + +local M = ManagerMenberChild_ExitsView + +function ManagerMenberChild_ExitsView.new(data, callback) + local self = setmetatable({}, { __index = M }) + self.class = "ManagerMenberChild_ExitsView" + self._data = data or {} + self._callback = callback + self:init("ui://Family/ManagerMenberChild_Exits") + return self +end + +function M:init(url) + local root = self._data.root + if not root then + ViewUtil:ErrorTip("点击太快,请重新打开页面") + return + end + local page = root._view:GetChild('page') + ViewUtil.LoadPage(page, url, function(view) + self._view = view + + self._viewList_player = view:GetChild('list_player') + self._viewList_player.itemRenderer = handler(self, self.PlayerRenderer) + + self:FillData() + end) +end + +function M:PlayerRenderer(index, obj) + local info = DataManager.CurrenGroup.joinsData[index + 1] + + ImageLoad.Load(info.portrait, obj:GetChild('btn_head')._iconObject) + obj:GetChild('text_name').text = info.nick + obj:GetChild('text_id').text = string.format("标识:%s", info.id) + obj:GetChild('text_time').text = os.date("%Y-%m-%d\n%H:%M",math.floor(tonumber(info.time)/1000)) + obj:GetChild('btn_assent').onClick:Set(function() + self:SendJoinsMenber(1, info.id) + end) + obj:GetChild('btn_refuse').onClick:Set(function() + self:SendJoinsMenber(0, info.id) + end) +end + +function M:SendJoinsMenber(isAllow, uid) + -- local fgCtr = ControllerManager.GetController(NewGroupController) + -- local group = DataManager.CurrenGroup + -- ViewUtil.ShowModalWait2() + -- fgCtr:FG_GroupVerifyJoin(group.id, uid, isAllow == 1, function(res1) + -- if self._is_destroy then + -- return + -- end + -- ViewUtil.CloseModalWait2() + -- if res1.ReturnCode == 0 then + -- ViewUtil:ErrorTip("设置成功") + -- group.joins = group.joins - 1 + -- group.total_member_num = group.total_member_num + isAllow + -- self:SendGetJoins(function() + -- self._viewList_player.numItems = #group.joinsData + -- end) + -- else + -- ViewUtil.ErrorTip(res1.ReturnCode, "设置失败") + -- end + -- end) +end + +function M:FillData() + local fgCtr = ControllerManager.GetController(NewGroupController) + ViewUtil.ShowModalWait2() + -- fgCtr:FG_GroupJoins(DataManager.CurrenGroup.id, function(res) + -- ViewUtil.CloseModalWait2() + -- if res.ReturnCode ~= 0 then + -- ViewUtil.ErrorTip(res.ReturnCode, "获取申请加入成员列表失败") + -- return + -- else + -- self._viewList_player.numItems = #DataManager.CurrenGroup.joinsData + -- end + -- end) +end + +-- 打开窗口 +function M:Show() + getmetatable(M).__index.Show(self) +end + +-- 关闭窗口 +function M:Close() + getmetatable(M).__index.Close(self) +end + +-- 销毁窗口 +function M:Destroy() + getmetatable(M).__index.Destroy(self) +end + +return M diff --git a/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_JoinsView.lua b/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_JoinsView.lua new file mode 100644 index 00000000..516f4c81 --- /dev/null +++ b/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_JoinsView.lua @@ -0,0 +1,95 @@ +local ManagerMenberChild_JoinsView = {} + +local M = ManagerMenberChild_JoinsView + +function ManagerMenberChild_JoinsView.new(data, callback) + local self = setmetatable({}, { __index = M }) + self.class = "ManagerMenberChild_JoinsView" + self._data = data or {} + self._callback = callback + self:init("ui://Family/ManagerMenberChild_Joins") + return self +end + +function M:init(url) + local root = self._data.root + if not root then + ViewUtil:ErrorTip("点击太快,请重新打开页面") + return + end + local page = root._view:GetChild('page') + ViewUtil.LoadPage(page, url, function(view) + self._view = view + + self._viewList_player = view:GetChild('list_player') + self._viewList_player.itemRenderer = handler(self, self.PlayerRenderer) + + self:FillData() + end) +end + +function M:PlayerRenderer(index, obj) + local info = DataManager.CurrenGroup.joinsData[index + 1] + + ImageLoad.Load(info.portrait, obj:GetChild('btn_head')._iconObject) + obj:GetChild('text_name').text = info.nick + obj:GetChild('text_id').text = string.format("标识:%s", info.id) + obj:GetChild('text_time').text = os.date("%Y-%m-%d\n%H:%M",math.floor(tonumber(info.time)/1000)) + obj:GetChild('btn_assent').onClick:Set(function() + self:SendJoinsMenber(1, info.id) + end) + obj:GetChild('btn_refuse').onClick:Set(function() + self:SendJoinsMenber(0, info.id) + end) +end + +function M:SendJoinsMenber(isAllow, uid) + local fgCtr = ControllerManager.GetController(NewGroupController) + local group = DataManager.CurrenGroup + ViewUtil.ShowModalWait2() + fgCtr:FG_GroupVerifyJoin(group.id, uid, isAllow == 1, function(res1) + if self._is_destroy then + return + end + ViewUtil.CloseModalWait2() + if res1.ReturnCode == 0 then + ViewUtil:ErrorTip("设置成功") + group.joins = group.joins - 1 + group.total_member_num = group.total_member_num + isAllow + self:FillData() + else + ViewUtil.ErrorTip(res1.ReturnCode, "设置失败") + end + end) +end + +function M:FillData() + local fgCtr = ControllerManager.GetController(NewGroupController) + ViewUtil.ShowModalWait2() + fgCtr:FG_GroupJoins(DataManager.CurrenGroup.id, function(res) + ViewUtil.CloseModalWait2() + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, "获取申请加入成员列表失败") + return + else + self._viewList_player.numItems = #DataManager.CurrenGroup.joinsData + end + end) +end + +-- 打开窗口 +function M:Show() + getmetatable(M).__index.Show(self) +end + +-- 关闭窗口 +function M:Close() + getmetatable(M).__index.Close(self) +end + +-- 销毁窗口 +function M:Destroy() + getmetatable(M).__index.Destroy(self) +end + +return M diff --git a/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_PlayerView.lua b/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_PlayerView.lua index 87e0e43a..f689a098 100644 --- a/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_PlayerView.lua +++ b/lua_probject/base_project/Game/View/FamilyZuo/ManagerMenberChild_PlayerView.lua @@ -70,7 +70,9 @@ end function M:ClickMenberList(context) local info = context.data.data - FamilyMenberManagerPlayerDetailView.new({info = info}) + FamilyMenberManagerPlayerDetailView.new({info = info},function() + self:FillData() + end) end function M:FillData() diff --git a/lua_probject/base_project/table/xieyi.text b/lua_probject/base_project/table/xieyi.text index 73f29293..f7f60751 100644 --- a/lua_probject/base_project/table/xieyi.text +++ b/lua_probject/base_project/table/xieyi.text @@ -1,3 +1,4 @@ 缺少协议 内容是自己与亲友圈的相关操作,比如说创建解散亲友圈,加入退出亲友圈 未找到协议 玩家发送申请退出亲友圈 -未找到协议 群主可以审批玩家是否退出亲友圈 \ No newline at end of file +未找到协议 群主可以审批玩家是否退出亲友圈 +未找到协议 小黑屋协议 \ No newline at end of file diff --git a/lua_probject/extend_project/extend/poker/duoduo/EXResultView.lua b/lua_probject/extend_project/extend/poker/duoduo/EXResultView.lua index 7154b40f..506e5c5b 100644 --- a/lua_probject/extend_project/extend/poker/duoduo/EXResultView.lua +++ b/lua_probject/extend_project/extend/poker/duoduo/EXResultView.lua @@ -66,14 +66,14 @@ function M:init(url, data, over, win_seat) --处理win_seat local temp_win_seat = {} - for i,v in ipairs(win_seat) do + for i, v in ipairs(win_seat) do temp_win_seat[v] = 1 end win_seat = temp_win_seat self._view:GetController('win').selectedIndex = win_seat[room.self_player.seat] and 1 or 0 local over0List = self._view:GetChild('list_over0') - table.sort(data,function(a,b) + table.sort(data, function(a, b) return a.ranking < b.ranking end) over0List.itemRenderer = function(index, obj) @@ -87,25 +87,12 @@ function M:init(url, data, over, win_seat) over0List.numItems = #data if over == 1 or (over == 2 and room.curren_round > 0) then - local bigSeat = 0 - local bigScore = 0 - for i = 1, #data do - if data[i].total_score > bigScore then - bigSeat = i - bigScore = data[i].total_score - end - end self._view:GetChild('text_roomID').text = room.room_id self._view:GetChild('text_time').text = os.date('%m-%d %H:%M', os.time()) - self._view:GetChild('text_groupID').text = room.group_id or 0 - self._view:GetController('num').selectedIndex = #data == 2 and 0 or 1 - self._view:GetController('isgroup').selectedIndex = room.group_id ~= 0 and 1 or 0 for i = 1, #data do local info = data[i] local playerInfo = room:GetPlayerBySeat(info.seat) - printlog("lingmeng clear", playerInfo.nick_name, info.total_score, i == bigSeat) - self:FillPlayerInfoEnd(self._view:GetChild(string.format("comp_playerInfo%d_over1", i)), info, playerInfo, - i == bigSeat) + self:FillPlayerInfoEnd(self._view:GetChild(string.format("comp_playerInfo%d_over1", i)), info, playerInfo) end coroutine.start(function() coroutine.wait(2) @@ -148,15 +135,20 @@ end function M:FillPlayerInfoEnd(view, info, playerInfo, bigWin) local room = DataManager.CurrenRoom - self:FillPlayerHead(view:GetChild('comp_playerInfo'), playerInfo, bigWin) - + ImageLoad.Load(playerInfo.self_user.head_url, view:GetChild('btn_head')._iconObject) + view:GetChild('text_name').text = ViewUtil.stringEllipsis(playerInfo.self_user.nick_name) + view:GetChild('text_id').text = string.format("标识:%s", playerInfo.self_user.account_id) local detailList = view:GetChild('list_detail') - - self:FillDetailChild(detailList:AddItemFromPool(), 0, info.settle_log.maxscore) - self:FillDetailChild(detailList:AddItemFromPool(), 1, info.settle_log.boomnum) - self:FillDetailChild(detailList:AddItemFromPool(), 2, + self:FillDetailChild(detailList:AddItemFromPool(), "炸弹数", info.settle_log.boomnum) + self:FillDetailChild(detailList:AddItemFromPool(), "胜局", string.format("%d赢%d输", info.settle_log.winnum, room.room_config.Times - info.settle_log.winnum)) - self:FillDetailChild(detailList:AddItemFromPool(), 3, info.total_score) + if info.total_score > 0 then + view:GetController('win').selectedIndex = 1 + view:GetChild('text_winScore').text = string.format("+%s", info.total_score) + else + view:GetController('win').selectedIndex = 0 + view:GetChild('text_loseScore').text = info.total_score + end end function M:FillPlayerHead(view, playerInfo, bigWin) @@ -166,8 +158,8 @@ function M:FillPlayerHead(view, playerInfo, bigWin) view:GetController('bigWin').selectedIndex = bigWin and 1 or 0 end -function M:FillDetailChild(view, index, value) - view:GetController('ShowTitle').selectedIndex = index +function M:FillDetailChild(view, title, value) + view:GetChild('text_title').text = title view:GetChild('text_value').text = value end diff --git a/wb_new_ui/assets/Common/buttons/Btn_CheckBoxRound.xml b/wb_new_ui/assets/Common/buttons/Btn_CheckBoxRound.xml new file mode 100644 index 00000000..371625f2 --- /dev/null +++ b/wb_new_ui/assets/Common/buttons/Btn_CheckBoxRound.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + +