2025-04-01 10:48:36 +08:00
|
|
|
|
local FamilyInviteFamilyView = import('.Family.FamilyInviteFamilyView')
|
|
|
|
|
|
local CreatePlayView = import('.Family.CreatePlayView')
|
2025-04-16 21:16:27 +08:00
|
|
|
|
local GroupGameSettingView = import(".NewGroup.MngView.GroupGameSettingView_jaingxi")
|
2025-05-21 16:04:00 +08:00
|
|
|
|
local LobbyShopView = import(".Lobby.LobbyShopView")
|
2025-06-19 14:38:23 +08:00
|
|
|
|
local FamilAllRank = import(".Family.FamilAllRank")
|
2025-06-20 17:25:43 +08:00
|
|
|
|
local FamilyNumberRecord = import(".Family.FamilyNumberRecord")
|
|
|
|
|
|
local FamilyRecord = import(".Family.FamilyRecord")
|
2025-04-01 10:48:36 +08:00
|
|
|
|
|
2025-05-09 14:56:23 +08:00
|
|
|
|
---无窗口
|
|
|
|
|
|
local FamilyAllNumbers = import(".Family.FamilyAllNumbers")
|
2025-05-21 14:22:02 +08:00
|
|
|
|
local FamilyAuditNumber = import(".Family.FamilyAuditNumber")
|
|
|
|
|
|
local FamilyJoinAndCreate = import(".Family.FamilyJoinAndCreate")
|
2025-06-17 18:09:58 +08:00
|
|
|
|
local FamilyEventView = import(".Family.FamilyEventView")
|
2025-06-17 17:51:24 +08:00
|
|
|
|
local FamilyBanDesk = import(".Family.FamilyBanDesk")
|
2025-06-17 15:29:16 +08:00
|
|
|
|
local FamilyMyFamily = import(".Family.FamilyMyFamily")
|
2025-06-19 14:29:16 +08:00
|
|
|
|
local FamilyRoomCard = import(".Family.FamilyRoomCard")
|
2025-06-20 01:55:55 +08:00
|
|
|
|
local FamilyMyfamilyList = import(".Family.FamilyMyfamilyList")
|
2025-06-25 22:49:44 +08:00
|
|
|
|
local FamilyChatRoom = import(".Family.FamilyChatRoom")
|
2025-06-25 22:21:05 +08:00
|
|
|
|
local FamilyMsgRecord = import(".Family.FamilyMsgRecord")
|
2025-05-09 14:56:23 +08:00
|
|
|
|
---
|
2025-04-01 10:48:36 +08:00
|
|
|
|
FamilyView = {}
|
|
|
|
|
|
|
|
|
|
|
|
local M = FamilyView
|
2025-05-08 16:02:39 +08:00
|
|
|
|
|
2025-04-01 10:48:36 +08:00
|
|
|
|
function FamilyView.new()
|
|
|
|
|
|
UIPackage.AddPackage("base/Family/ui/Family")
|
|
|
|
|
|
|
|
|
|
|
|
setmetatable(M, { __index = BaseView })
|
|
|
|
|
|
local self = setmetatable({}, { __index = M })
|
|
|
|
|
|
self.class = 'FamilyMainView'
|
|
|
|
|
|
self._full = true
|
|
|
|
|
|
self._close_destroy = false
|
|
|
|
|
|
self._fristRoom = true
|
|
|
|
|
|
self:init('ui://Family/Main')
|
|
|
|
|
|
return self
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:init(url)
|
|
|
|
|
|
BaseView.InitView(self, url)
|
|
|
|
|
|
self._full_offset = false
|
|
|
|
|
|
local view = self._view
|
2025-06-25 22:49:44 +08:00
|
|
|
|
|
2025-06-26 02:28:24 +08:00
|
|
|
|
-- FamilyChatRoom = FamilyChatRoom:Init(view:GetChild('com_chatRoom'), self)
|
2025-06-25 22:49:44 +08:00
|
|
|
|
|
2025-04-01 10:48:36 +08:00
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
|
|
|
|
|
|
|
self.familyType = view:GetController('familyType')
|
2025-05-17 15:00:23 +08:00
|
|
|
|
self.btn_close = view:GetChild('btn_close')
|
2025-06-20 01:55:55 +08:00
|
|
|
|
self.btn_myFamilyList = view:GetChild("btn_myFamilyList")
|
|
|
|
|
|
self.btn_creatFamily = view:GetChild("btn_creatFamily")
|
|
|
|
|
|
self.btn_joinFamily = view:GetChild("btn_joinFamily")
|
2025-06-17 18:09:58 +08:00
|
|
|
|
self._mgr_ctr = ControllerManager.GetController(GroupMgrController)
|
2025-06-20 01:55:55 +08:00
|
|
|
|
self.cMyfamilyList = view:GetController("cMyfamilyList")
|
|
|
|
|
|
self.btn_quitMyfamilyTab = view:GetChild("btn_quitMyfamilyTab")
|
2025-06-25 22:49:44 +08:00
|
|
|
|
self.btn_chatRoom = view:GetChild("btn_chatRoom")
|
2025-05-17 15:00:23 +08:00
|
|
|
|
|
|
|
|
|
|
self:InitCloseClick()
|
2025-04-01 10:48:36 +08:00
|
|
|
|
|
|
|
|
|
|
fgCtr:FG_GroupList(function(res)
|
|
|
|
|
|
local groups = res.Data.groups
|
|
|
|
|
|
if #groups > 0 then
|
|
|
|
|
|
self.familyType.selectedIndex = 1
|
|
|
|
|
|
self:ConnetFamily(1, groups, true)
|
|
|
|
|
|
else
|
2025-05-22 11:34:59 +08:00
|
|
|
|
self:JoinFamily(true)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
end)
|
2025-05-16 10:55:12 +08:00
|
|
|
|
-------绑定成员战绩按钮
|
|
|
|
|
|
view:GetChild('btn_family_record').onClick:Set(function()
|
|
|
|
|
|
self._child_familyNumberRecord = FamilyNumberRecord.New(self)
|
2025-05-17 15:00:23 +08:00
|
|
|
|
self.lastType = 1
|
|
|
|
|
|
end)
|
2025-06-17 18:09:58 +08:00
|
|
|
|
|
|
|
|
|
|
if FamilyEventView then
|
|
|
|
|
|
self._familyEventView = FamilyEventView.new(self)
|
|
|
|
|
|
self._familyEventView:_evtAddPlay()
|
|
|
|
|
|
end
|
2025-06-17 15:29:16 +08:00
|
|
|
|
-------绑定我的亲友圈按钮
|
|
|
|
|
|
view:GetChild('btn_myfamily').onClick:Set(function()
|
2025-06-20 01:55:55 +08:00
|
|
|
|
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
|
2025-06-17 15:29:16 +08:00
|
|
|
|
end)
|
2025-06-25 22:49:44 +08:00
|
|
|
|
|
|
|
|
|
|
self.btn_chatRoom.onClick:Set(function()
|
|
|
|
|
|
--local view = FamilyChatRoom.New()
|
|
|
|
|
|
--view:Show()
|
|
|
|
|
|
FamilyChatRoom:Show()
|
|
|
|
|
|
end)
|
2025-05-17 15:00:23 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:InitCloseClick()
|
|
|
|
|
|
self.btn_close.onClick:Set(function()
|
2025-05-30 13:35:36 +08:00
|
|
|
|
print("lingmengfamily", self.lastType, self.familyType.selectedIndex)
|
2025-05-17 15:00:23 +08:00
|
|
|
|
if not self.lastType or self.familyType.selectedIndex == 1 then
|
|
|
|
|
|
ControllerManager.ChangeController(LoddyController)
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
|
|
|
|
else
|
|
|
|
|
|
self.familyType.selectedIndex = self.lastType
|
|
|
|
|
|
if self.lastType == 3 then
|
|
|
|
|
|
self.lastType = 1
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
2025-05-16 10:55:12 +08:00
|
|
|
|
end)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2025-05-08 16:02:39 +08:00
|
|
|
|
function M:ShareWx()
|
2025-04-01 10:48:36 +08:00
|
|
|
|
local familyInviteFamilyView = FamilyInviteFamilyView.new()
|
|
|
|
|
|
familyInviteFamilyView:Show()
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-06-25 22:21:05 +08:00
|
|
|
|
function M:MsgView()
|
|
|
|
|
|
self.lastType = self.familyType.selectedIndex
|
|
|
|
|
|
self.familyType.selectedIndex = 0
|
|
|
|
|
|
local view = FamilyMsgRecord.New(function()
|
|
|
|
|
|
self.familyType.selectedIndex = self.lastType
|
|
|
|
|
|
end)
|
|
|
|
|
|
view:Show()
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:SetIsOpenChatRoom()
|
|
|
|
|
|
local value = 1
|
2025-06-26 00:15:48 +08:00
|
|
|
|
if self._group.isOpenChatRoom == 1 then
|
2025-06-25 22:21:05 +08:00
|
|
|
|
value = 0
|
|
|
|
|
|
elseif self._group.isOpenChatRoom == 0 then
|
|
|
|
|
|
value = 1
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-06-30 17:48:47 +08:00
|
|
|
|
local mgr_ctr = ControllerManager.GetController(GroupMgrController)
|
|
|
|
|
|
mgr_ctr:FG_OPEN_ISOPEN_CHATROOM()
|
|
|
|
|
|
|
|
|
|
|
|
--[[
|
2025-06-25 22:21:05 +08:00
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
|
fgCtr:SetIsOpenChatRoom(self._group.id, value, function(res)
|
|
|
|
|
|
print("设置开启聊天室协议")
|
|
|
|
|
|
pt(res)
|
|
|
|
|
|
|
2025-06-26 00:15:48 +08:00
|
|
|
|
if res.ReturnCode ~= 0 then
|
2025-06-25 22:21:05 +08:00
|
|
|
|
return
|
|
|
|
|
|
end
|
|
|
|
|
|
self._group.isOpenChatRoom = value
|
|
|
|
|
|
self:RefalshMoreBtn()
|
2025-06-30 17:48:47 +08:00
|
|
|
|
end)]]
|
2025-06-25 22:21:05 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:SetCanWatch()
|
|
|
|
|
|
local value = 1
|
2025-06-26 00:15:48 +08:00
|
|
|
|
if self._group.isWatch == 1 then
|
2025-06-25 22:21:05 +08:00
|
|
|
|
value = 0
|
|
|
|
|
|
elseif self._group.isWatch == 0 then
|
|
|
|
|
|
value = 1
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
|
fgCtr:SetCanWatch(self._group.id, value, function(res)
|
|
|
|
|
|
print("设置是否观战")
|
|
|
|
|
|
pt(res)
|
|
|
|
|
|
|
2025-06-26 00:15:48 +08:00
|
|
|
|
if res.ReturnCode ~= 0 then
|
2025-06-25 22:21:05 +08:00
|
|
|
|
return
|
|
|
|
|
|
end
|
|
|
|
|
|
self._group.isWatch = value
|
|
|
|
|
|
self:RefalshMoreBtn()
|
|
|
|
|
|
end)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-06-18 14:48:00 +08:00
|
|
|
|
function M:FamilyRecord()
|
2025-06-20 17:25:43 +08:00
|
|
|
|
if not self._ViewChild_Record or not self._ViewChild_Record.ShouRanks then
|
|
|
|
|
|
self._ViewChild_Record = FamilyRecord.New(self, self._group.id)
|
|
|
|
|
|
return
|
|
|
|
|
|
end
|
|
|
|
|
|
self._ViewChild_Record:ShouRanks()
|
2025-06-18 14:48:00 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2025-05-22 11:34:59 +08:00
|
|
|
|
function M:CreateFamily(frist)
|
2025-05-08 16:02:39 +08:00
|
|
|
|
self.familyType.selectedIndex = 3
|
2025-05-22 11:34:59 +08:00
|
|
|
|
if not frist then
|
|
|
|
|
|
self.lastType = 1
|
|
|
|
|
|
end
|
2025-05-08 16:02:39 +08:00
|
|
|
|
self._view:GetController('createOrJoin').selectedIndex = 0
|
2025-06-17 15:29:16 +08:00
|
|
|
|
self._child_familyJoinAndCreate = FamilyJoinAndCreate:init(self)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2025-05-22 11:34:59 +08:00
|
|
|
|
function M:JoinFamily(frist)
|
2025-05-08 16:02:39 +08:00
|
|
|
|
self.familyType.selectedIndex = 3
|
2025-05-22 11:34:59 +08:00
|
|
|
|
if not frist then
|
|
|
|
|
|
self.lastType = 1
|
|
|
|
|
|
end
|
2025-05-08 16:02:39 +08:00
|
|
|
|
self._view:GetController('createOrJoin').selectedIndex = 1
|
2025-06-17 15:29:16 +08:00
|
|
|
|
self._child_familyJoinAndCreate = FamilyJoinAndCreate:init(self)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2025-05-08 16:02:39 +08:00
|
|
|
|
function M:PlayEdit()
|
|
|
|
|
|
self.familyType.selectedIndex = 2
|
|
|
|
|
|
self.lastType = 1
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2025-06-20 01:55:55 +08:00
|
|
|
|
function M:OpenMyFamily(groupId)
|
|
|
|
|
|
FamilyMyFamily:TryShow(groupId, self)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-05-09 14:56:23 +08:00
|
|
|
|
function M:AllNumber()
|
|
|
|
|
|
self.lastType = 1
|
2025-06-20 01:55:55 +08:00
|
|
|
|
self._child_familyAllNumbers = FamilyAllNumbers.new(self._group, self)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2025-05-21 14:22:02 +08:00
|
|
|
|
function M:AuditNumber()
|
|
|
|
|
|
self.lastType = 1
|
|
|
|
|
|
self._child_familyAuditNumber = FamilyAuditNumber.new(self)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-05-21 16:04:00 +08:00
|
|
|
|
function M:ShowShop()
|
2025-06-19 14:29:16 +08:00
|
|
|
|
--self._child_familyLobbyShopView = LobbyShopView.new(self, self._group.id)
|
|
|
|
|
|
--self._child_familyLobbyShopView:Show()
|
|
|
|
|
|
|
|
|
|
|
|
FamilyRoomCard:TryShow()
|
2025-05-21 16:04:00 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2025-06-19 14:38:23 +08:00
|
|
|
|
function M:ShowAllRank()
|
2025-06-20 17:25:43 +08:00
|
|
|
|
if not self._ViewChild_AllRank or not self._ViewChild_AllRank.ShouRanks then
|
2025-06-19 14:38:23 +08:00
|
|
|
|
self._ViewChild_AllRank = FamilAllRank.New(self, self._group.id)
|
2025-06-20 17:25:43 +08:00
|
|
|
|
return
|
2025-06-19 14:38:23 +08:00
|
|
|
|
end
|
2025-06-20 17:25:43 +08:00
|
|
|
|
self._ViewChild_AllRank:ShouRanks()
|
2025-06-19 14:38:23 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2025-06-20 01:55:55 +08:00
|
|
|
|
function M:OpenAllNumber(group)
|
|
|
|
|
|
self.lastType = 1
|
|
|
|
|
|
self._child_familyAllNumbers = FamilyAllNumbers.new(group, self)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-05-30 13:35:36 +08:00
|
|
|
|
function M:MoreBtn()
|
|
|
|
|
|
local ctr_more = self._view:GetController('moreBtn')
|
|
|
|
|
|
self._view:GetChild('bg_moreBtnBack').onClick:Set(function()
|
|
|
|
|
|
ctr_more.selectedIndex = 0
|
|
|
|
|
|
end)
|
|
|
|
|
|
ctr_more.selectedIndex = 1
|
|
|
|
|
|
self:ChangeMore()
|
2025-06-25 22:21:05 +08:00
|
|
|
|
self:RefalshMoreBtn()
|
2025-05-30 13:35:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:BanFamily()
|
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
2025-06-06 19:48:45 +08:00
|
|
|
|
fgCtr:FG_UpdateGroupInfo(self._group.id, self._group.name, "", not self._group.ban, self._group.dissolve_opt,
|
2025-05-30 13:35:36 +08:00
|
|
|
|
self._group.kick_opt, self._group.apply, self._group.ban_chat1, self._group.ban_chat2, self._group.option, 0,
|
|
|
|
|
|
function(res)
|
|
|
|
|
|
if res.ReturnCode ~= 0 then
|
|
|
|
|
|
ViewUtil.ErrorTip(res.ReturnCode, "一键打样失败")
|
|
|
|
|
|
else
|
|
|
|
|
|
self._view:GetController('familyBan').selectedIndex = self._group.ban and 1 or 0
|
|
|
|
|
|
end
|
|
|
|
|
|
end)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-06-06 19:48:45 +08:00
|
|
|
|
function M:BanDeskmate()
|
2025-06-17 17:51:24 +08:00
|
|
|
|
self.FamilyBanDesk = FamilyBanDesk:TryShow(self)
|
2025-06-06 19:48:45 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2025-04-01 10:48:36 +08:00
|
|
|
|
function M:ChangeNumber(fgCtr, group_id, limit, num, minus_only, sort_type)
|
|
|
|
|
|
local list_familyNumber = self._view:GetChild('list_familyNumber')
|
|
|
|
|
|
list_familyNumber:SetVirtual()
|
2025-05-22 18:32:34 +08:00
|
|
|
|
fgCtr:FG_GroupMembers12(group_id, limit, num, 2, 2, function(res)
|
2025-05-09 14:56:23 +08:00
|
|
|
|
local members = self._group.members
|
2025-04-11 12:49:08 +08:00
|
|
|
|
-- print("==========================res.Data.members")
|
2025-05-09 14:56:23 +08:00
|
|
|
|
pt(self._group.members)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
ViewUtil:CloseModalWait()
|
|
|
|
|
|
if res.ReturnCode ~= 0 then
|
|
|
|
|
|
ViewUtil.ErrorTip(res.ReturnCode, "获取成员列表失败")
|
|
|
|
|
|
else
|
|
|
|
|
|
list_familyNumber.itemRenderer = function(index, obj)
|
2025-05-22 11:22:14 +08:00
|
|
|
|
obj:GetChild('title').text = members[index + 1].nick
|
2025-05-22 18:32:34 +08:00
|
|
|
|
obj:GetController('type').selectedIndex = members[index + 1].online and members[index + 1].online or 0
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end
|
2025-05-22 18:32:34 +08:00
|
|
|
|
list_familyNumber.numItems = #self._group.members
|
2025-04-01 10:48:36 +08:00
|
|
|
|
return 1
|
|
|
|
|
|
end
|
|
|
|
|
|
end)
|
|
|
|
|
|
return 0
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:ConnetFamilyRoom(fgCtr, id)
|
|
|
|
|
|
fgCtr:FG_EnterGroup(id, function(res)
|
|
|
|
|
|
ViewUtil:CloseModalWait()
|
|
|
|
|
|
if res.ReturnCode ~= 0 then
|
|
|
|
|
|
ViewUtil.ErrorTip(res.ReturnCode, "获取房间列表列表失败")
|
|
|
|
|
|
else
|
|
|
|
|
|
self:UpdateFamilyRoom(fgCtr, id)
|
2025-06-06 19:48:45 +08:00
|
|
|
|
self._view:GetController('familyBan').selectedIndex = self._group.ban and 1 or 0
|
2025-04-01 10:48:36 +08:00
|
|
|
|
return 1
|
|
|
|
|
|
end
|
|
|
|
|
|
end)
|
|
|
|
|
|
return 0
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:UpdateFamilyRoom(fgCtr, id)
|
2025-04-10 11:19:20 +08:00
|
|
|
|
local list_room = self._view:GetChild('list_room')
|
2025-04-01 10:48:36 +08:00
|
|
|
|
list_room:SetVirtual()
|
|
|
|
|
|
local list_gamePlay = self._view:GetChild('list_gamePlay')
|
|
|
|
|
|
list_gamePlay:SetVirtual()
|
2025-05-22 11:22:14 +08:00
|
|
|
|
self._view:GetChild('n364').text = string.format("已开启%s桌游戏", self._group.room_num)
|
2025-04-01 13:56:18 +08:00
|
|
|
|
local playList = self._group.playList
|
2025-04-09 13:53:34 +08:00
|
|
|
|
--初始化玩法列表,用于房间使用
|
|
|
|
|
|
local playGameInfoTable = {}
|
|
|
|
|
|
for i = 1, #playList do
|
|
|
|
|
|
playGameInfoTable[playList[i].id] = {
|
|
|
|
|
|
gameId = playList[i].gameId,
|
|
|
|
|
|
config = playList[i].config,
|
|
|
|
|
|
name = playList[i].name,
|
2025-05-22 11:22:14 +08:00
|
|
|
|
gameName = playList[i].game_name,
|
2025-04-09 13:53:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
end
|
2025-04-01 13:56:18 +08:00
|
|
|
|
local roomList = self._group.rooms
|
2025-05-22 18:14:21 +08:00
|
|
|
|
print("lingmengroomList")
|
|
|
|
|
|
pt(roomList)
|
2025-05-30 13:35:36 +08:00
|
|
|
|
pt(playList)
|
2025-04-10 11:19:20 +08:00
|
|
|
|
local roomCtr = ControllerManager.GetController(RoomController)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
list_room.itemRenderer = function(index, obj)
|
|
|
|
|
|
if index < #roomList then
|
2025-04-01 17:21:53 +08:00
|
|
|
|
local newIndex = index + 1
|
2025-06-09 19:10:02 +08:00
|
|
|
|
local gameId = playGameInfoTable[roomList[newIndex].pid].gameId
|
|
|
|
|
|
local config = ExtendManager.GetExtendConfig(gameId)
|
2025-04-11 16:27:29 +08:00
|
|
|
|
local mode = config:GetGameInfo()
|
|
|
|
|
|
local gamePlay = mode:LoadConfigToDetail(playGameInfoTable[roomList[newIndex].pid].config)
|
|
|
|
|
|
obj:GetChild('Label_gameRule').title = gamePlay
|
2025-05-22 11:22:14 +08:00
|
|
|
|
obj:GetChild('game_type').text = string.format("(%s)%s", playGameInfoTable[roomList[newIndex].pid].gameName,
|
|
|
|
|
|
playGameInfoTable[roomList[newIndex].pid].name,
|
2025-04-09 13:53:34 +08:00
|
|
|
|
roomList[newIndex].id)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 1
|
2025-05-30 13:35:36 +08:00
|
|
|
|
obj:GetController('num').selectedIndex = roomList[newIndex].maxPlayers - 2
|
2025-06-26 02:28:24 +08:00
|
|
|
|
-- if self._group.isWatch == 1 then
|
|
|
|
|
|
-- 允许观战
|
|
|
|
|
|
obj:GetController('type').selectedIndex = 1
|
|
|
|
|
|
-- end
|
2025-05-30 13:35:36 +08:00
|
|
|
|
local plist = roomList[newIndex].plist
|
|
|
|
|
|
local insertName = ""
|
|
|
|
|
|
for i = 1, #plist do
|
|
|
|
|
|
ImageLoad.Load(plist[i].portrait, obj:GetChild(string.format("player%d", i))._iconObject)
|
|
|
|
|
|
insertName = string.format("%s、%s", plist[i].nick, insertName)
|
|
|
|
|
|
end
|
|
|
|
|
|
obj:GetChild('Label_joinPlayers').text = insertName
|
2025-04-01 13:56:18 +08:00
|
|
|
|
obj:GetChild('btn_joinGame').onClick:Set(function()
|
2025-04-01 10:48:36 +08:00
|
|
|
|
roomCtr:PublicJoinRoom(
|
2025-04-01 13:56:18 +08:00
|
|
|
|
Protocol.WEB_FG_JOIN_ROOM,
|
2025-04-01 17:21:53 +08:00
|
|
|
|
roomList[newIndex].id,
|
2025-06-09 16:30:22 +08:00
|
|
|
|
id,
|
2025-04-01 10:48:36 +08:00
|
|
|
|
function(response)
|
|
|
|
|
|
if (response.ReturnCode == -1) then
|
2025-04-10 11:19:20 +08:00
|
|
|
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, 'response.ReturnCode == -1')
|
2025-04-01 10:48:36 +08:00
|
|
|
|
-- RestartGame()
|
|
|
|
|
|
return
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if response.ReturnCode ~= 0 then
|
|
|
|
|
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
|
|
|
|
|
-- ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
|
|
|
|
return
|
|
|
|
|
|
else
|
2025-06-12 15:17:53 +08:00
|
|
|
|
UpdateBeat:Remove(self.OnUpdate, self)
|
2025-06-09 19:10:02 +08:00
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Main, gameId)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
end,
|
|
|
|
|
|
id,
|
2025-04-01 17:21:53 +08:00
|
|
|
|
roomList[newIndex].pid
|
2025-04-01 10:48:36 +08:00
|
|
|
|
)
|
|
|
|
|
|
end)
|
2025-06-09 16:30:22 +08:00
|
|
|
|
obj:GetChild('btn_watch').onClick:Set(function()
|
|
|
|
|
|
roomCtr:PublicWitnessRoom(
|
|
|
|
|
|
Protocol.WEB_FG_Witness_ROOM,
|
|
|
|
|
|
roomList[newIndex].id,
|
|
|
|
|
|
id,
|
|
|
|
|
|
function(response)
|
|
|
|
|
|
if (response.ReturnCode == -1) then
|
|
|
|
|
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, 'response.ReturnCode == -1')
|
|
|
|
|
|
-- RestartGame()
|
|
|
|
|
|
return
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if response.ReturnCode ~= 0 then
|
|
|
|
|
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
|
|
|
|
|
-- ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
|
|
|
|
return
|
|
|
|
|
|
else
|
2025-06-12 15:17:53 +08:00
|
|
|
|
UpdateBeat:Remove(self.OnUpdate, self)
|
2025-06-10 16:11:48 +08:00
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Witness, gameId)
|
2025-06-09 16:30:22 +08:00
|
|
|
|
end
|
2025-06-09 19:10:02 +08:00
|
|
|
|
end,
|
|
|
|
|
|
gameId,
|
|
|
|
|
|
roomList[newIndex].pid
|
2025-06-09 16:30:22 +08:00
|
|
|
|
)
|
2025-06-09 17:41:34 +08:00
|
|
|
|
-- self._gamectr = ControllerManager.GetController(GameController)
|
|
|
|
|
|
-- self._gamectr:WitnessGame(DataManager.SelfUser.account_id, id, roomList[newIndex].id)
|
2025-06-09 16:30:22 +08:00
|
|
|
|
end)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
else
|
2025-04-01 17:21:53 +08:00
|
|
|
|
local newIndex = index - #roomList + 1
|
2025-04-11 16:27:29 +08:00
|
|
|
|
local config = ExtendManager.GetExtendConfig(playList[newIndex].gameId)
|
|
|
|
|
|
local mode = config:GetGameInfo()
|
|
|
|
|
|
local gamePlay = mode:LoadConfigToDetail(playList[newIndex].config)
|
|
|
|
|
|
obj:GetChild('Label_gameRule').title = gamePlay
|
2025-05-22 11:22:14 +08:00
|
|
|
|
obj:GetChild('game_type').text = string.format("(%s)%s", playList[newIndex].game_name, playList[newIndex]
|
|
|
|
|
|
.name)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 0
|
2025-05-30 13:35:36 +08:00
|
|
|
|
obj:GetController('num').selectedIndex = playList[newIndex].maxPlayers - 2
|
2025-04-01 13:56:18 +08:00
|
|
|
|
obj:GetChild('btn_joinGame').onClick:Set(function()
|
2025-04-10 11:19:20 +08:00
|
|
|
|
roomCtr:PublicJoinRoom(
|
|
|
|
|
|
Protocol.WEB_FG_MATCH_ROOM,
|
|
|
|
|
|
"",
|
|
|
|
|
|
true,
|
|
|
|
|
|
function(response)
|
|
|
|
|
|
if (response.ReturnCode == -1) then
|
|
|
|
|
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, 'response.ReturnCode == -1')
|
|
|
|
|
|
-- RestartGame()
|
|
|
|
|
|
return
|
|
|
|
|
|
end
|
2025-04-01 10:48:36 +08:00
|
|
|
|
|
2025-04-10 11:19:20 +08:00
|
|
|
|
if response.ReturnCode ~= 0 then
|
|
|
|
|
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
|
|
|
|
|
-- ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
|
|
|
|
return
|
|
|
|
|
|
else
|
2025-06-12 15:17:53 +08:00
|
|
|
|
UpdateBeat:Remove(self.OnUpdate, self)
|
2025-04-10 11:19:20 +08:00
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Main, playList[newIndex].gameId)
|
|
|
|
|
|
end
|
|
|
|
|
|
end,
|
|
|
|
|
|
id,
|
|
|
|
|
|
playList[newIndex].id
|
|
|
|
|
|
)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end)
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
list_gamePlay.itemRenderer = function(index, obj)
|
|
|
|
|
|
if index == 0 then
|
2025-06-19 14:38:23 +08:00
|
|
|
|
obj:GetController('type').selectedIndex = 0
|
2025-04-01 10:48:36 +08:00
|
|
|
|
obj:GetChild('num').text = string.format("%d/7", #playList)
|
2025-04-01 20:09:43 +08:00
|
|
|
|
obj:GetChild('btn_addPlay').onClick:Set(function()
|
|
|
|
|
|
local tem = GroupGameSettingView.new(self.blur_view, id, 0, nil, function(play)
|
|
|
|
|
|
local group = DataManager.groups:get(id)
|
|
|
|
|
|
group:addPlay(play)
|
|
|
|
|
|
-- self:FillView()
|
2025-04-01 10:48:36 +08:00
|
|
|
|
self:UpdateFamilyRoom(fgCtr, id)
|
2025-04-01 20:09:43 +08:00
|
|
|
|
printlog("刷新玩法===>>>>")
|
|
|
|
|
|
group.update_play = true
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end)
|
2025-04-01 20:09:43 +08:00
|
|
|
|
tem:Show()
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end)
|
|
|
|
|
|
return
|
|
|
|
|
|
end
|
|
|
|
|
|
obj:GetChild('text_title').text = playList[index].game_name
|
2025-06-17 15:29:16 +08:00
|
|
|
|
local mode = ExtendManager.GetExtendConfig(playList[index].gameId):GetGameInfo()
|
2025-06-27 21:33:42 +08:00
|
|
|
|
local pId = playList[index].id
|
2025-06-17 15:29:16 +08:00
|
|
|
|
obj:GetChild('Label_details'):GetChild('title').text = mode:LoadConfigToDetail(playList[index].config)
|
2025-06-19 14:38:23 +08:00
|
|
|
|
obj:GetChild('text_playName').text = playList[index].name
|
2025-04-01 10:48:36 +08:00
|
|
|
|
obj:GetController('type').selectedIndex = 1
|
2025-06-19 14:38:23 +08:00
|
|
|
|
obj:GetChild('btn_del').onClick:Set(function()
|
|
|
|
|
|
ViewUtil.ShowTwoChooose("是否要删除该玩法", function()
|
2025-06-27 21:33:42 +08:00
|
|
|
|
fgCtr:FG_DelPlay(id, playList[index].id, function(res)
|
|
|
|
|
|
if res.ReturnCode ~= 0 then
|
|
|
|
|
|
local msg = Table_Error_code_Map[res.ReturnCode] or {}
|
|
|
|
|
|
msg = msg.note or "操作失败"
|
|
|
|
|
|
ViewUtil.ShowBannerOnScreenCenter(msg)
|
|
|
|
|
|
return
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-06-19 14:38:23 +08:00
|
|
|
|
self:UpdateFamilyRoom(fgCtr, id)
|
|
|
|
|
|
end)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end)
|
|
|
|
|
|
end)
|
2025-06-27 21:33:42 +08:00
|
|
|
|
obj:GetChild("btn_edit").onClick:Set(function()
|
|
|
|
|
|
local tem = GroupGameSettingView.new(self.blur_view, id, pId, nil, function(play)
|
|
|
|
|
|
local group = DataManager.groups:get(id)
|
|
|
|
|
|
group:addPlay(play)
|
|
|
|
|
|
-- self:FillView()
|
|
|
|
|
|
self:UpdateFamilyRoom(fgCtr, id)
|
|
|
|
|
|
printlog("刷新玩法===>>>>")
|
|
|
|
|
|
group.update_play = true
|
|
|
|
|
|
end)
|
|
|
|
|
|
tem:Show()
|
|
|
|
|
|
end)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end
|
2025-04-10 11:19:20 +08:00
|
|
|
|
local all_num = #playList + #roomList
|
2025-04-11 12:49:08 +08:00
|
|
|
|
-- print("=================================================list_room", list_room, list_room.numItems, all_num)
|
2025-04-10 11:19:20 +08:00
|
|
|
|
pt(list_room)
|
|
|
|
|
|
list_room.numItems = all_num
|
2025-04-01 10:48:36 +08:00
|
|
|
|
list_gamePlay.numItems = #playList + 1
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:ConnetFamily(index, groups, isCreate)
|
|
|
|
|
|
UpdateBeat:Remove(self.OnUpdate, self)
|
|
|
|
|
|
ViewUtil:CloseModalWait()
|
|
|
|
|
|
|
|
|
|
|
|
local list_family = self._view:GetChild('list_family')
|
2025-04-08 15:41:54 +08:00
|
|
|
|
list_family:SetVirtual()
|
2025-04-01 10:48:36 +08:00
|
|
|
|
self._group = DataManager.groups:get(groups[index].id)
|
2025-05-22 11:22:14 +08:00
|
|
|
|
self._view:GetChild('text_familyId').text = self._group.id
|
2025-06-06 19:48:45 +08:00
|
|
|
|
print("===================================self._group")
|
2025-04-01 20:09:43 +08:00
|
|
|
|
pt(self._group)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
self._roomNum = self._group.room_num
|
|
|
|
|
|
|
|
|
|
|
|
if isCreate then
|
2025-04-08 15:41:54 +08:00
|
|
|
|
list_family.itemRenderer = function(i, obj)
|
|
|
|
|
|
local j = i + 1
|
2025-05-22 11:22:14 +08:00
|
|
|
|
obj.text = groups[j].name
|
2025-04-08 15:41:54 +08:00
|
|
|
|
obj.onClick:Add(function()
|
2025-04-01 20:09:43 +08:00
|
|
|
|
self:ConnetFamily(j, DataManager.groups.groupList, false)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end)
|
|
|
|
|
|
end
|
2025-04-08 15:41:54 +08:00
|
|
|
|
list_family.numItems = #groups
|
2025-05-22 11:22:14 +08:00
|
|
|
|
if list_family.selectedIndex == -1 then
|
|
|
|
|
|
list_family.selectedIndex = 0
|
|
|
|
|
|
end
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
|
|
|
|
|
|
|
ViewUtil.ShowModalWait(self._root_view, "正在加载亲友圈权限中......")
|
2025-04-01 20:09:43 +08:00
|
|
|
|
self:ChangeOther(tonumber(self._group.lev) + 1)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
allLoad = 1
|
|
|
|
|
|
|
|
|
|
|
|
ViewUtil.ShowModalWait(self._root_view, "正在加载成员列表中......")
|
|
|
|
|
|
allLoad = allLoad +
|
2025-04-01 20:09:43 +08:00
|
|
|
|
self:ChangeNumber(fgCtr, self._group.id, 0, self._group.total_member_num, false,
|
2025-04-01 10:48:36 +08:00
|
|
|
|
1)
|
|
|
|
|
|
|
|
|
|
|
|
ViewUtil.ShowModalWait(self._root_view, "正在加载房间列表中......")
|
|
|
|
|
|
|
2025-04-01 20:09:43 +08:00
|
|
|
|
allLoad = allLoad + self:ConnetFamilyRoom(fgCtr, self._group.id)
|
2025-04-01 10:48:36 +08:00
|
|
|
|
UpdateBeat:Add(self.OnUpdate, self)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-06-12 15:17:53 +08:00
|
|
|
|
-- function M:Destroy()
|
|
|
|
|
|
-- UpdateBeat:Remove(self.OnUpdate, self)
|
|
|
|
|
|
-- BaseView:Destroy()
|
|
|
|
|
|
-- end
|
|
|
|
|
|
|
2025-04-01 10:48:36 +08:00
|
|
|
|
function M:OnUpdate()
|
2025-05-22 15:57:34 +08:00
|
|
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
|
|
|
|
local heatTime = os.time()
|
2025-04-01 10:48:36 +08:00
|
|
|
|
-- --12001事件
|
2025-06-17 18:09:58 +08:00
|
|
|
|
local func = self._mgr_ctr:PopEvent()
|
|
|
|
|
|
if (func ~= nil) then
|
|
|
|
|
|
local success, result = pcall(func)
|
|
|
|
|
|
if success then
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
print("witness error")
|
|
|
|
|
|
print(result)
|
|
|
|
|
|
-- self._gamectr = ControllerManager.GetController(GameController)
|
|
|
|
|
|
-- if self._gamectr then
|
|
|
|
|
|
-- self._gamectr:ResetConnect()
|
|
|
|
|
|
-- end
|
|
|
|
|
|
end
|
|
|
|
|
|
--func()
|
|
|
|
|
|
end
|
2025-05-22 11:22:14 +08:00
|
|
|
|
if self._group.update_room then
|
|
|
|
|
|
-- if self._roomNum == self._group.room_num then
|
|
|
|
|
|
-- for i = 1, self._group.room_num do
|
|
|
|
|
|
-- if self._group.rooms[i] and #self._group.rooms[i].plist == 0 then
|
|
|
|
|
|
-- self._group.update_room = false
|
|
|
|
|
|
-- fgCtr:FG_RemoveRoom(
|
|
|
|
|
|
-- self._group.id,
|
|
|
|
|
|
-- self._group.rooms[i].id,
|
|
|
|
|
|
-- function(res)
|
|
|
|
|
|
-- if res.ReturnCode ~= 0 then
|
|
|
|
|
|
-- ViewUtil.ErrorTip(res.ReturnCode, string.format('删除房间-%s失败!', self._group.rooms[i].id))
|
|
|
|
|
|
-- else
|
|
|
|
|
|
-- self._roomNum = #self._group.rooms
|
|
|
|
|
|
-- end
|
|
|
|
|
|
-- end
|
|
|
|
|
|
-- )
|
|
|
|
|
|
-- end
|
|
|
|
|
|
-- end
|
|
|
|
|
|
-- else
|
|
|
|
|
|
-- self._group.update_room = false
|
|
|
|
|
|
-- -- self._group.update_room = false
|
|
|
|
|
|
-- end
|
|
|
|
|
|
-- if self._fristRoom then
|
|
|
|
|
|
self._group.update_room = false
|
|
|
|
|
|
-- self._fristRoom = true
|
|
|
|
|
|
-- end
|
|
|
|
|
|
-- -- print("====================================UpdateFamilyRoom", fgCtr, self._group.id)
|
|
|
|
|
|
self:UpdateFamilyRoom(fgCtr, self._group.id)
|
|
|
|
|
|
end
|
2025-05-30 13:35:36 +08:00
|
|
|
|
if not self.lastTime or self.lastTime - heatTime > 30 then
|
2025-05-22 15:57:34 +08:00
|
|
|
|
fgCtr:FG_SetFamilyHeartbeat(self._group.id, DataManager.SelfUser.account_id, function(res)
|
2025-05-22 18:32:34 +08:00
|
|
|
|
self:ChangeNumber(fgCtr, self._group.id, 0, self._group.total_member_num, false,
|
|
|
|
|
|
1)
|
2025-05-22 15:57:34 +08:00
|
|
|
|
pt(res)
|
|
|
|
|
|
end)
|
2025-05-30 13:35:36 +08:00
|
|
|
|
self.lastTime = heatTime
|
2025-05-22 15:57:34 +08:00
|
|
|
|
end
|
2025-04-01 10:48:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2025-05-09 14:56:23 +08:00
|
|
|
|
local IDENTITY_LIST = {
|
|
|
|
|
|
{
|
|
|
|
|
|
level = 0, --圈主
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
level = 1, --副圈主
|
|
|
|
|
|
otherList = {
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "邀请朋友",
|
|
|
|
|
|
Fct = M.ShareWx
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "游戏记录",
|
2025-06-18 14:48:00 +08:00
|
|
|
|
Fct = M.FamilyRecord
|
2025-05-09 14:56:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "玩法管理",
|
|
|
|
|
|
Fct = M.PlayEdit
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "充值房卡",
|
2025-05-21 16:04:00 +08:00
|
|
|
|
Fct = M.ShowShop
|
2025-05-09 14:56:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "申请消息",
|
2025-05-21 14:22:02 +08:00
|
|
|
|
Fct = M.AuditNumber
|
2025-05-09 14:56:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "查看成员",
|
|
|
|
|
|
Fct = M.AllNumber
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "创建亲友圈",
|
|
|
|
|
|
Fct = M.CreateFamily
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "高级选项",
|
2025-05-30 13:35:36 +08:00
|
|
|
|
Fct = M.MoreBtn
|
2025-05-09 14:56:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-05-14 19:56:12 +08:00
|
|
|
|
name = "亲友圈排行榜",
|
2025-06-19 14:38:23 +08:00
|
|
|
|
Fct = M.ShowAllRank
|
2025-05-14 19:56:12 +08:00
|
|
|
|
}
|
2025-05-09 14:56:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
level = 2, --管理员
|
|
|
|
|
|
otherList = {
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "邀请朋友",
|
|
|
|
|
|
Fct = M.ShareWx
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "游戏记录",
|
2025-06-18 14:48:00 +08:00
|
|
|
|
Fct = M.FamilyRecord
|
2025-05-09 14:56:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "玩法管理",
|
|
|
|
|
|
Fct = M.PlayEdit
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "充值房卡",
|
2025-05-21 16:04:00 +08:00
|
|
|
|
Fct = M.ShowShop
|
2025-05-09 14:56:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "申请消息",
|
2025-05-21 14:22:02 +08:00
|
|
|
|
Fct = M.AuditNumber
|
2025-05-09 14:56:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "查看成员",
|
|
|
|
|
|
Fct = M.AllNumber
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "创建亲友圈",
|
|
|
|
|
|
Fct = M.CreateFamily
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "高级选项",
|
2025-05-30 13:35:36 +08:00
|
|
|
|
Fct = M.MoreBtn
|
2025-05-09 14:56:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-05-21 14:22:02 +08:00
|
|
|
|
name = "亲友圈排行榜",
|
2025-06-19 14:38:23 +08:00
|
|
|
|
Fct = M.ShowAllRank
|
2025-05-21 14:22:02 +08:00
|
|
|
|
}
|
2025-05-09 14:56:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
level = 3, --成员
|
|
|
|
|
|
otherList = {
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "邀请朋友",
|
|
|
|
|
|
Fct = M.ShareWx
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "创建亲友圈",
|
|
|
|
|
|
Fct = M.CreateFamily
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "加入亲友圈",
|
|
|
|
|
|
Fct = M.JoinFamily
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-30 13:35:36 +08:00
|
|
|
|
local MORE_LIST = {
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "一键打样",
|
|
|
|
|
|
Fct = M.BanFamily
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "消息记录",
|
2025-06-25 22:21:05 +08:00
|
|
|
|
Fct = M.MsgView
|
2025-05-30 13:35:36 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "禁止同桌",
|
2025-06-06 19:48:45 +08:00
|
|
|
|
Fct = M.BanDeskmate
|
2025-05-30 13:35:36 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "关闭聊天室",
|
2025-06-25 22:21:05 +08:00
|
|
|
|
Fct = M.SetIsOpenChatRoom
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name = "关闭旁观",
|
|
|
|
|
|
Fct = M.SetCanWatch
|
2025-05-30 13:35:36 +08:00
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-09 14:56:23 +08:00
|
|
|
|
function M:ChangeOther(i)
|
|
|
|
|
|
local otherList = IDENTITY_LIST[i].otherList
|
|
|
|
|
|
local list_other = self._view:GetChild('list_other')
|
|
|
|
|
|
self._lev = i
|
|
|
|
|
|
list_other:SetVirtual()
|
|
|
|
|
|
list_other.itemRenderer = function(index, obj)
|
2025-05-22 11:22:14 +08:00
|
|
|
|
obj:GetChild('title').text = otherList[index + 1].name
|
2025-05-30 13:35:36 +08:00
|
|
|
|
obj.onClick:Set(handler(self, otherList[index + 1].Fct))
|
2025-05-09 14:56:23 +08:00
|
|
|
|
end
|
|
|
|
|
|
list_other.numItems = #otherList
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-05-30 13:35:36 +08:00
|
|
|
|
function M:ChangeMore()
|
|
|
|
|
|
local moreList = MORE_LIST
|
|
|
|
|
|
local list_other = self._view:GetChild('list_more')
|
|
|
|
|
|
list_other:SetVirtual()
|
|
|
|
|
|
list_other.itemRenderer = function(index, obj)
|
|
|
|
|
|
obj:GetChild('title').text = moreList[index + 1].name
|
|
|
|
|
|
obj.onClick:Set(handler(self, moreList[index + 1].Fct))
|
|
|
|
|
|
obj.onClick:Add(function()
|
|
|
|
|
|
self._view:GetController('moreBtn').selectedIndex = 0
|
|
|
|
|
|
end)
|
|
|
|
|
|
end
|
|
|
|
|
|
list_other.numItems = #moreList
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-06-25 22:21:05 +08:00
|
|
|
|
function M:RefalshMoreBtn()
|
|
|
|
|
|
-- 有空优化吧
|
|
|
|
|
|
|
|
|
|
|
|
local tex = ""
|
2025-06-26 00:15:48 +08:00
|
|
|
|
if self._group.isOpenChatRoom == 1 then
|
2025-06-25 22:21:05 +08:00
|
|
|
|
tex = "关闭聊天室"
|
|
|
|
|
|
elseif self._group.isOpenChatRoom == 0 then
|
|
|
|
|
|
tex = "打开聊天室"
|
|
|
|
|
|
end
|
|
|
|
|
|
MORE_LIST[4].name = tex
|
|
|
|
|
|
|
|
|
|
|
|
local tex = ""
|
2025-06-26 00:15:48 +08:00
|
|
|
|
if self._group.isWatch == 1 then
|
2025-06-25 22:21:05 +08:00
|
|
|
|
tex = "关闭观战"
|
|
|
|
|
|
elseif self._group.isWatch == 0 then
|
|
|
|
|
|
tex = "打开观战"
|
|
|
|
|
|
end
|
|
|
|
|
|
MORE_LIST[5].name = tex
|
|
|
|
|
|
|
|
|
|
|
|
self:ChangeMore()
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-04-01 10:48:36 +08:00
|
|
|
|
return M
|