hengyang_client/lua_probject/base_project/Game/View/FamilyZuo/FamilyJoinView.lua

64 lines
1.4 KiB
Lua
Raw Normal View History

2025-12-18 20:23:31 +08:00
local FamilyJoinView = {}
local M = FamilyJoinView
function FamilyJoinView.new(data, callback)
setmetatable(M, { __index = BaseWindow })
local self = setmetatable({}, { __index = M })
self.class = "FamilyJoinView"
self._data = data
self._callback = callback
self._close_destroy = true
self:init("ui://Family/FamilyJoin")
return self
end
function M:init(url)
getmetatable(M).__index.init(self, url)
local view = self._view
view:GetChild('btn_confirm').onClick:Set(function()
local gid = view:GetChild('input_familyName').text
if #gid == 0 then
ViewUtil:ErrorTip("输入的亲友圈id不能为空")
return
end
ViewUtil.ShowModalWait2()
local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_JoinGroup(tonumber(gid), function(res)
ViewUtil.CloseModalWait2()
if res.ReturnCode ~= 0 then
ViewUtil.ErrorTip(res.ReturnCode)
end
self:Destroy()
end,"")
end)
view:GetChild('btn_cancel').onClick:Set(function()
self:Destroy()
end)
self:Show()
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