2025-12-18 20:23:31 +08:00
|
|
|
local FamilyCreateView = import(".FamilyZuo.FamilyCreateView")
|
|
|
|
|
local FamilyJoinView = import(".FamilyZuo.FamilyJoinView")
|
|
|
|
|
local FamilyManagerView = import(".FamilyZuo.FamilyManagerView")
|
|
|
|
|
local FamilyPlayListView = import(".FamilyZuo.FamilyPlayListView")
|
2025-12-20 21:48:58 +08:00
|
|
|
local FamilyRoomCardView = import(".FamilyZuo.FamilyRoomCardView")
|
2026-01-22 14:46:11 +08:00
|
|
|
local FamilyEventView = import(".FamilyZuo.FamilyEventView")
|
2026-02-26 19:16:10 +08:00
|
|
|
local FamilyPayRecordView = import(".FamilyZuo.FamilyPayRecordView")
|
|
|
|
|
|
|
|
|
|
local FamilyRecord = import(".Family.FamilyRecord")
|
2025-12-18 20:23:31 +08:00
|
|
|
|
|
|
|
|
FamilyViewZuo = {}
|
|
|
|
|
|
|
|
|
|
local M = FamilyViewZuo
|
|
|
|
|
|
|
|
|
|
function FamilyViewZuo.new()
|
|
|
|
|
UIPackage.AddPackage("base/Family/ui/Family")
|
|
|
|
|
|
|
|
|
|
setmetatable(M, { __index = BaseView })
|
|
|
|
|
local self = setmetatable({}, { __index = M })
|
|
|
|
|
self.class = 'FamilyMainZuoView'
|
|
|
|
|
self._full = true
|
|
|
|
|
self._full_offset = false
|
|
|
|
|
self._fristRoom = true
|
|
|
|
|
self:init('ui://Family/Main_zuo')
|
|
|
|
|
return self
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:init(url)
|
|
|
|
|
BaseView.InitView(self, url)
|
|
|
|
|
local view = self._view
|
2026-01-22 14:46:11 +08:00
|
|
|
self._mgr_ctr = ControllerManager.GetController(GroupMgrController)
|
2025-12-18 20:23:31 +08:00
|
|
|
--退出按钮
|
|
|
|
|
view:GetChild('btn_exit').onClick:Set(function()
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
--亲友圈列表
|
|
|
|
|
self._viewList_familyList = view:GetChild('familyList')
|
|
|
|
|
self._viewList_familyList.itemRenderer = handler(self, self.FamilyListRenderer)
|
2026-01-22 14:46:11 +08:00
|
|
|
self._viewList_familyList.onClickItem:Set(handler(self, self.ClickFamilyList))
|
2025-12-18 20:23:31 +08:00
|
|
|
|
|
|
|
|
view:GetController('showList').onChanged:Set(function(context)
|
|
|
|
|
if context.sender.selectedIndex == 0 then
|
|
|
|
|
view:GetTransition('familyListExit'):Play(1, 0, function()
|
|
|
|
|
view:GetChild('showList').visible = false
|
|
|
|
|
end)
|
|
|
|
|
else
|
|
|
|
|
view:GetChild('showList').visible = true
|
|
|
|
|
view:GetTransition('familyLisrShow'):Play(1, 0, function()
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
--房间列表
|
|
|
|
|
self._viewList_tableList = view:GetChild('list_roomTable')
|
|
|
|
|
self._viewList_tableList.itemRenderer = handler(self, self.FamilyTableRenderer)
|
2025-12-24 00:16:37 +08:00
|
|
|
view:GetChild('click_closePlayDetail').onClick:Set(function()
|
|
|
|
|
view:GetController('showPlayDetail').selectedIndex = 0
|
|
|
|
|
end)
|
2025-12-18 20:23:31 +08:00
|
|
|
|
|
|
|
|
--创建亲友圈和加入亲友圈
|
|
|
|
|
view:GetChild('btn_createFamily').onClick:Set(function()
|
|
|
|
|
FamilyCreateView.new({}, function()
|
|
|
|
|
self._viewList_familyList.numItems = #DataManager.groups
|
|
|
|
|
end)
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
view:GetChild('btn_joinFamily').onClick:Set(function()
|
|
|
|
|
FamilyJoinView.new()
|
|
|
|
|
end)
|
|
|
|
|
|
2026-01-07 21:43:41 +08:00
|
|
|
--邀请按钮
|
|
|
|
|
view:GetChild('btn_service').onClick:Set(function()
|
|
|
|
|
ViewUtil:ErrorTip("还没又加载微信")
|
|
|
|
|
end)
|
|
|
|
|
|
2025-12-18 20:23:31 +08:00
|
|
|
--管理页面
|
|
|
|
|
view:GetChild('btn_manager').onClick:Set(function()
|
2026-01-20 18:46:16 +08:00
|
|
|
FamilyManagerView.new({ pageType = 1 })
|
2026-01-04 21:54:26 +08:00
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
--成员页面
|
|
|
|
|
view:GetChild('btn_menber').onClick:Set(function()
|
2026-01-20 18:46:16 +08:00
|
|
|
FamilyManagerView.new({ pageType = 2 })
|
2025-12-18 20:23:31 +08:00
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
--新玩法管理
|
|
|
|
|
view:GetChild('btn_showPlayEdit').onClick:Set(function()
|
|
|
|
|
FamilyPlayListView.new({})
|
|
|
|
|
end)
|
2025-12-20 21:48:58 +08:00
|
|
|
|
|
|
|
|
--充值房卡
|
|
|
|
|
view:GetChild('btn_chongFangka').onClick:Set(function()
|
|
|
|
|
FamilyRoomCardView.new({})
|
|
|
|
|
end)
|
2026-02-26 19:16:10 +08:00
|
|
|
|
|
|
|
|
--战绩页面
|
|
|
|
|
view:GetChild('btn_record').onClick:Set(function()
|
|
|
|
|
FamilyManagerView.new({ pageType = 3 })
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
--展示用于显示未支付账单
|
|
|
|
|
view:GetChild('btn_showPay').onClick:Set(function()
|
|
|
|
|
FamilyPayRecordView.new({})
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
--临时展示旧页面
|
|
|
|
|
view:GetChild('btn_temp').onClick:Set(function()
|
|
|
|
|
if not self._ViewChild_Record or not self._ViewChild_Record.ShouRanks then
|
|
|
|
|
self._ViewChild_Record = FamilyRecord.New(self, DataManager.CurrenGroup.id)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
self._ViewChild_Record:ShouRanks()
|
|
|
|
|
end)
|
2025-12-18 20:23:31 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--列表渲染类函数--
|
|
|
|
|
function M:FamilyListRenderer(index, obj)
|
|
|
|
|
local groupList = DataManager.groups.groupList
|
|
|
|
|
obj:GetChild('text_name').text = groupList[index + 1].name
|
|
|
|
|
obj:GetChild('text_num').text = string.format("在线:1")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:FamilyTableRenderer(index, obj)
|
|
|
|
|
self._group = DataManager.CurrenGroup
|
|
|
|
|
local playList = self._group.playList
|
|
|
|
|
local roomList = self._group.rooms
|
|
|
|
|
local tmp
|
2025-12-24 00:16:37 +08:00
|
|
|
local showDeatilFct = function()
|
2025-12-29 20:14:45 +08:00
|
|
|
|
2025-12-24 00:16:37 +08:00
|
|
|
end
|
2025-12-18 20:23:31 +08:00
|
|
|
if index < #playList then -- 默认玩法,开桌子之类的
|
|
|
|
|
tmp = playList[index + 1]
|
|
|
|
|
for i = 1, tmp.maxPlayers do
|
|
|
|
|
local head = obj:GetChild(string.format("head%s", i))
|
|
|
|
|
head:GetChild('btn_head').icon = ""
|
|
|
|
|
head.onClick:Set(function(context)
|
2026-01-20 18:46:16 +08:00
|
|
|
self:ClickMachRoom(context, tmp, i)
|
2025-12-18 20:23:31 +08:00
|
|
|
end)
|
|
|
|
|
end
|
2025-12-24 00:16:37 +08:00
|
|
|
obj:GetChild('icon').onClick:Set(function(context)
|
2025-12-29 20:14:45 +08:00
|
|
|
self:ClickTableShowDetail({ type = 1, info = tmp, index = index })
|
2025-12-24 00:16:37 +08:00
|
|
|
end)
|
2025-12-29 20:14:45 +08:00
|
|
|
if self._view:GetController('showPlayDetail').selectedIndex == 1 then
|
|
|
|
|
self:ClickTableShowDetail({ type = 1, info = tmp, index = index })
|
|
|
|
|
end
|
2026-01-20 18:46:16 +08:00
|
|
|
obj:GetChild('text_roundNum').text = string.format("(0/%s)",
|
|
|
|
|
ExtendManager.GetExtendConfig(tmp.gameId):GetGameInfo():LoadConfigOneInfo(tmp.config, tmp.hpData, "maxRound") or
|
|
|
|
|
0)
|
2025-12-18 20:23:31 +08:00
|
|
|
elseif index - #playList < #roomList then --存在的桌子
|
|
|
|
|
local roomInfo = roomList[index - #playList + 1]
|
|
|
|
|
tmp = self._group:getPlay(roomInfo.pid)
|
|
|
|
|
local plist = roomInfo.plist
|
|
|
|
|
for i = 1, 4 do
|
|
|
|
|
if i <= #plist then
|
|
|
|
|
local btn = obj:GetChild(string.format("head%s", i))
|
|
|
|
|
btn:GetController('zuo').selectedIndex = 1
|
|
|
|
|
btn:GetChild('text_name').text = plist[i].nick
|
|
|
|
|
ImageLoad.Load(plist[i].portrait, btn:GetChild('btn_head')._iconObject)
|
|
|
|
|
else
|
|
|
|
|
local btn = obj:GetChild(string.format("head%s", i))
|
|
|
|
|
btn:GetController('zuo').selectedIndex = 0
|
|
|
|
|
btn:GetChild("btn_head").icon = "ui://Family/icon_luozuo"
|
|
|
|
|
btn.onClick:Set(function(context)
|
2026-01-20 18:46:16 +08:00
|
|
|
self:ClickJoinRoom(context, roomInfo, i)
|
2025-12-18 20:23:31 +08:00
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
end
|
2025-12-24 00:16:37 +08:00
|
|
|
obj:GetChild('icon').onClick:Set(function(context)
|
2025-12-29 20:14:45 +08:00
|
|
|
self:ClickTableShowDetail({ type = 2, info = roomInfo, index = index })
|
2025-12-24 00:16:37 +08:00
|
|
|
end)
|
2025-12-29 20:14:45 +08:00
|
|
|
if self._view:GetController('showPlayDetail').selectedIndex == 1 then
|
|
|
|
|
self:ClickTableShowDetail({ type = 2, info = roomInfo, index = index })
|
|
|
|
|
end
|
2026-01-20 18:46:16 +08:00
|
|
|
obj:GetChild('text_roundNum').text = string.format("(%s/%s)", roomInfo.round, roomInfo.times)
|
2025-12-18 20:23:31 +08:00
|
|
|
end
|
|
|
|
|
obj:GetController('playerNum').selectedIndex = tmp.maxPlayers - 2
|
|
|
|
|
obj:GetChild('text_playName').text = tmp.name
|
2026-01-04 21:54:26 +08:00
|
|
|
obj.icon = string.format("ui://Family/icon_table%s", (self.localTextDesk[tmp.gameId] or 0) + 1)
|
2025-12-18 20:23:31 +08:00
|
|
|
end
|
|
|
|
|
|
2026-01-20 18:46:16 +08:00
|
|
|
--点击切换亲友圈
|
|
|
|
|
function M:ClickFamilyList(context)
|
|
|
|
|
local index = context.sender.selectedIndex
|
2026-01-22 14:46:11 +08:00
|
|
|
self:EnterFamily(index + 1)
|
2026-01-20 18:46:16 +08:00
|
|
|
end
|
|
|
|
|
|
2025-12-18 20:23:31 +08:00
|
|
|
--进入亲友圈
|
|
|
|
|
function M:EnterFamily(index_family, only)
|
|
|
|
|
local groups = DataManager.groups.groupList
|
|
|
|
|
index_family = index_family or 1
|
|
|
|
|
if index_family > #groups then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
local familyId = groups[index_family].id
|
|
|
|
|
fgCtr:FG_EnterGroup(familyId, function(res)
|
|
|
|
|
if res.ReturnCode ~= 0 then
|
|
|
|
|
if only then
|
|
|
|
|
ViewUtil.ErrorTip(res.ReturnCode, "进入亲友圈失败")
|
|
|
|
|
else
|
|
|
|
|
self:EnterFamily(index_family + 1)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
DataManager.CurrenGroup = DataManager.groups:get(familyId)
|
|
|
|
|
self._group = DataManager.CurrenGroup
|
|
|
|
|
local view = self._view
|
|
|
|
|
view:GetChild('text_familyName').text = self._group.name
|
|
|
|
|
view:GetChild('text_familyid').text = self._group.id
|
2026-01-04 21:54:26 +08:00
|
|
|
view:GetChild('text_fangka').text = self._group.groupDiamo
|
2025-12-18 20:23:31 +08:00
|
|
|
self._viewList_familyList.selectedIndex = index_family - 1
|
|
|
|
|
self:UpdateRoom()
|
2026-01-22 14:46:11 +08:00
|
|
|
--初始化事件
|
|
|
|
|
if not self._familyEventView then
|
|
|
|
|
self._familyEventView = FamilyEventView.new(self)
|
|
|
|
|
self._familyEventView:AddListener()
|
|
|
|
|
end
|
2025-12-18 20:23:31 +08:00
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--房间处理方法
|
|
|
|
|
function M:UpdateRoom()
|
|
|
|
|
local group = self._group
|
2026-01-04 21:54:26 +08:00
|
|
|
local playList = group.playList
|
|
|
|
|
local roomList = group.rooms
|
2025-12-18 20:23:31 +08:00
|
|
|
self._viewList_tableList.numItems = #playList + #roomList
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--点击玩法创建桌子
|
2026-01-20 18:46:16 +08:00
|
|
|
function M:ClickMachRoom(context, playinfo, selectSeat)
|
2026-03-04 19:37:03 +08:00
|
|
|
if playinfo.maxPlayers == 2 and (not DataManager.SelfUser.pay_code or #DataManager.SelfUser.pay_code < 6) then
|
|
|
|
|
ViewUtil:ErrorTip("没有绑定二维码不能进入双人游戏")
|
|
|
|
|
return
|
|
|
|
|
end
|
2025-12-18 20:23:31 +08:00
|
|
|
local group = DataManager.CurrenGroup
|
|
|
|
|
local roomCtr = ControllerManager.GetController(RoomController)
|
2026-01-20 18:46:16 +08:00
|
|
|
roomCtr:PublicJoinRoom({
|
|
|
|
|
cmd = Protocol.WEB_FG_MATCH_ROOM,
|
|
|
|
|
roomid = "",
|
|
|
|
|
is_null = true,
|
|
|
|
|
group_id = group.id,
|
|
|
|
|
pid = playinfo.id,
|
|
|
|
|
selectSeat = selectSeat
|
|
|
|
|
},
|
2025-12-18 20:23:31 +08:00
|
|
|
function(response)
|
|
|
|
|
if (response.ReturnCode == -1) then
|
|
|
|
|
ViewUtil.CloseModalWait2()
|
|
|
|
|
|
|
|
|
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, 'response.ReturnCode == -1')
|
|
|
|
|
-- RestartGame()
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if response.ReturnCode ~= 0 then
|
|
|
|
|
ViewUtil.CloseModalWait2()
|
|
|
|
|
|
|
|
|
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
|
|
|
|
-- ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
UpdateBeat:Remove(self.OnUpdate, self)
|
|
|
|
|
FamilyView.lastId = group.id
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Main, playinfo.gameId,
|
|
|
|
|
{ _flag_showTip = true })
|
|
|
|
|
ViewUtil.CloseModalWait2()
|
|
|
|
|
end
|
2026-01-20 18:46:16 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
2025-12-18 20:23:31 +08:00
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-29 20:14:45 +08:00
|
|
|
--点击桌子查看信息
|
|
|
|
|
function M:ClickTableShowDetail(data)
|
2025-12-24 00:16:37 +08:00
|
|
|
local data = data or {}
|
|
|
|
|
if data.type then
|
2025-12-29 20:14:45 +08:00
|
|
|
self._view:GetController('showPlayDetail').selectedIndex = 1
|
|
|
|
|
local detailView = self._view:GetChild('comp_playDetail')
|
|
|
|
|
local detailType = detailView:GetController('type')
|
|
|
|
|
local tableIcon = self._viewList_tableList:GetChildAt(data.index):GetChild('icon')
|
|
|
|
|
local gxy = tableIcon:LocalToGlobal(Vector2.New(tableIcon.width, tableIcon.height) / 2)
|
|
|
|
|
detailView.xy = self._view:GlobalToLocal(gxy) - Vector2.New(detailView.width / 2, detailView.height)
|
|
|
|
|
local playinfo = data.info
|
|
|
|
|
|
|
|
|
|
detailView:GetChild('btn_createRoom').onClick:Set(function(context)
|
2026-01-20 18:46:16 +08:00
|
|
|
self:ClickMachRoom(context, data.info, 0)
|
2025-12-29 20:14:45 +08:00
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
detailView:GetChild('btn_joinRoom').onClick:Set(function(context)
|
2026-01-20 18:46:16 +08:00
|
|
|
self:ClickJoinRoom(context, data.info, 0)
|
2025-12-29 20:14:45 +08:00
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
detailView:GetChild('btn_inviteRoom').onClick:Set(function(context)
|
|
|
|
|
ViewUtil:ErrorTip("暂时还未联通微信")
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
detailView:GetChild('btn_delRoom').onClick:Set(function(context)
|
2026-01-04 21:54:26 +08:00
|
|
|
self:JieSanRomm(self._group.id, data.info.id)
|
2025-12-29 20:14:45 +08:00
|
|
|
end)
|
|
|
|
|
|
2025-12-24 00:16:37 +08:00
|
|
|
if data.type == 1 then
|
2025-12-29 20:14:45 +08:00
|
|
|
detailType.selectedIndex = 0
|
2025-12-24 00:16:37 +08:00
|
|
|
elseif data.type == 2 then
|
2025-12-29 20:14:45 +08:00
|
|
|
local stype = 1
|
|
|
|
|
if self._group.lev and self._group.lev == 1 then
|
|
|
|
|
stype = stype + 2
|
|
|
|
|
end
|
|
|
|
|
if playinfo.plist and #playinfo.plist > 0 and playinfo.plist[1].aid == DataManager.SelfUser.account_id then
|
|
|
|
|
stype = stype + 1
|
|
|
|
|
end
|
|
|
|
|
playinfo = self._group:getPlay(playinfo.pid)
|
|
|
|
|
detailType.selectedIndex = stype
|
2025-12-24 00:16:37 +08:00
|
|
|
end
|
2025-12-29 20:14:45 +08:00
|
|
|
detailView:GetChild('text_playDetail').text = ExtendManager.GetExtendConfig(playinfo.gameId):GetGameInfo()
|
|
|
|
|
:LoadConfigToDetail(playinfo.config, playinfo.hpData)
|
2025-12-24 00:16:37 +08:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-29 20:14:45 +08:00
|
|
|
--点击解散房间
|
|
|
|
|
function M:JieSanRomm(groupId, roomId)
|
|
|
|
|
local _curren_msg =
|
|
|
|
|
MsgWindow.new(
|
|
|
|
|
self._root_view,
|
|
|
|
|
'确定要解散该房间吗?',
|
|
|
|
|
MsgWindow.MsgMode.OkAndCancel
|
|
|
|
|
)
|
|
|
|
|
_curren_msg.onOk:Add(
|
|
|
|
|
function()
|
|
|
|
|
ViewUtil.ShowModalWait2(self._root_view)
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
|
|
|
|
|
fgCtr:FG_RemoveRoom(
|
|
|
|
|
groupId,
|
|
|
|
|
roomId,
|
|
|
|
|
function(res)
|
|
|
|
|
ViewUtil.CloseModalWait2()
|
|
|
|
|
if res.ReturnCode ~= 0 then
|
|
|
|
|
ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!')
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
_curren_msg:Show()
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-18 20:23:31 +08:00
|
|
|
--点击桌子进入游戏
|
2026-01-20 18:46:16 +08:00
|
|
|
function M:ClickJoinRoom(context, room, selectSeat)
|
2026-03-02 14:48:52 +08:00
|
|
|
|
|
|
|
|
if room.maxPlayers == 2 and (not DataManager.SelfUser.pay_code or #DataManager.SelfUser.pay_code < 6) then
|
|
|
|
|
ViewUtil:ErrorTip("没有绑定二维码不能进入双人游戏")
|
|
|
|
|
return
|
|
|
|
|
end
|
2025-12-18 20:23:31 +08:00
|
|
|
local group = DataManager.CurrenGroup
|
|
|
|
|
local roomCtr = ControllerManager.GetController(RoomController)
|
|
|
|
|
roomCtr:PublicJoinRoom(
|
2026-01-20 18:46:16 +08:00
|
|
|
{
|
|
|
|
|
cmd = Protocol.WEB_FG_JOIN_ROOM,
|
|
|
|
|
roomid = room.id,
|
|
|
|
|
is_null = true,
|
|
|
|
|
group_id = group.id,
|
|
|
|
|
pid = room.pid,
|
|
|
|
|
selectSeat = selectSeat
|
|
|
|
|
},
|
|
|
|
|
|
2025-12-18 20:23:31 +08:00
|
|
|
function(response)
|
|
|
|
|
if (response.ReturnCode == -1) then
|
|
|
|
|
ViewUtil.CloseModalWait2()
|
|
|
|
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, 'response.ReturnCode == -1')
|
|
|
|
|
-- RestartGame()
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if response.ReturnCode ~= 0 then
|
|
|
|
|
ViewUtil.CloseModalWait2()
|
|
|
|
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
|
|
|
|
-- ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
|
|
|
else
|
|
|
|
|
UpdateBeat:Remove(self.OnUpdate, self)
|
|
|
|
|
FamilyView.lastId = group.id
|
2025-12-29 20:14:45 +08:00
|
|
|
ViewManager.ChangeView(ViewManager.View_Main, self._group:getPlay(room.pid).gameId,
|
|
|
|
|
{ _flag_showTip = true })
|
2025-12-18 20:23:31 +08:00
|
|
|
ViewUtil.CloseModalWait2()
|
|
|
|
|
end
|
2026-01-20 18:46:16 +08:00
|
|
|
end
|
2025-12-18 20:23:31 +08:00
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
|
|
function M:FillData()
|
2026-01-04 21:54:26 +08:00
|
|
|
local view = self._view
|
2025-12-18 20:23:31 +08:00
|
|
|
local groups = DataManager.groups.groupList
|
|
|
|
|
self._viewList_familyList.numItems = #groups
|
2026-01-04 21:54:26 +08:00
|
|
|
self.localTextDesk = FamilyPlayListView:EncodeDeskType()
|
2025-12-18 20:23:31 +08:00
|
|
|
|
|
|
|
|
self:EnterFamily()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:Close()
|
|
|
|
|
getmetatable(M).__index.Close(self)
|
|
|
|
|
-- UpdateBeat:Remove(self.OnUpdate, self)
|
|
|
|
|
coroutine.stopAll()
|
|
|
|
|
BaseWindow.DestroyAll()
|
|
|
|
|
DSTweenManager.ClearTween()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:Destroy()
|
|
|
|
|
getmetatable(M).__index.Destroy(self)
|
|
|
|
|
-- UpdateBeat:Remove(self.OnUpdate, self)
|
|
|
|
|
coroutine.stopAll()
|
|
|
|
|
BaseWindow.DestroyAll()
|
|
|
|
|
DSTweenManager.ClearTween()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:Show()
|
|
|
|
|
ViewUtil.ShowModalWait2()
|
|
|
|
|
|
|
|
|
|
self:FillData()
|
|
|
|
|
ViewUtil.CloseModalWait2()
|
|
|
|
|
|
|
|
|
|
BaseView.Show(self)
|
|
|
|
|
-- UpdateBeat:Add(self.OnUpdate, self)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return M
|