119 lines
3.1 KiB
Lua
119 lines
3.1 KiB
Lua
--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
|
|
|
|
--endregion
|
|
|
|
function FamilyMyFamily:TryShow(r)
|
|
self:Init()
|
|
root = r
|
|
self:Show()
|
|
end
|
|
|
|
function FamilyMyFamily:Show()
|
|
|
|
local family = root._group
|
|
pt(family)
|
|
if not family then
|
|
-- 跳转创建家族界面
|
|
root:CreateFamily()
|
|
return
|
|
end
|
|
|
|
self.tex_fName.text = family.name
|
|
self.tex_playerName.text = "亲友圈号:" .. family.id
|
|
self.tex_fNumber.text = family.member_num
|
|
self.tex_cradNum.text = family.diamo
|
|
self.tex_nocice.text = family.notice
|
|
ImageLoad.Load(family.o_portrait, self.loader_icon)
|
|
|
|
self.cStyle.selectedIndex = family.lev -1
|
|
|
|
HideMainView()
|
|
BaseWindow.Show(self)
|
|
end
|
|
|
|
function FamilyMyFamily:Close()
|
|
BaseWindow.Close(self)
|
|
ShowMainView()
|
|
end
|
|
|
|
function FamilyMyFamily:Init()
|
|
setmetatable(FamilyMyFamily, { __index = BaseWindow })
|
|
BaseWindow.init(self, 'ui://Family/com_myFamily')
|
|
-- 设置成组件的形式
|
|
self._close_destroy = true
|
|
self._full = true
|
|
self._animation = false
|
|
self._root_view:GetChild("win_mode").visible = false
|
|
|
|
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.cStyle = self._view:GetController("cStyle")
|
|
|
|
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)
|
|
|
|
self.btn_quitFamily.onClick:Set(function()
|
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
|
print("发送了退出协议 familyid = ",root._group.id)
|
|
fgCtr:FG_ExitGroup(root._group.id, function(res)
|
|
pt(res)
|
|
end)
|
|
end)
|
|
|
|
return self
|
|
end
|
|
|
|
return FamilyMyFamily |