hengyang_client/lua_probject/base_project/Game/View/Lobby/LobbyGiftDiamond.lua

34 lines
986 B
Lua
Raw Normal View History

2025-10-16 16:26:09 +08:00
local LobbyGiftDiamond = {}
local M = LobbyGiftDiamond
function M.new()
setmetatable(M, { __index = BaseWindow })
local self = setmetatable({}, { __index = M })
self.class = "LobbyGiftDiamond"
self._close_destroy = true
self:init("ui://Lobby/GiftDiamond")
return self
end
function M:init(url)
BaseWindow.init(self, url)
self._view:GetChild('btn_center').onClick:Set(function()
local text_id = self._view:GetChild('input_id').text
local text_num = self._view:GetChild('input_num').text
local lobbyCtr = ControllerManager.GetController(LoddyController)
lobbyCtr:GiftDiamond({ tagId = tonumber(text_id), diamo = tonumber(text_num) }, function(res)
if res.ReturnCode == 0 then
self:Destroy()
ViewUtil.ErrorTip(-1, "赠送房卡成功")
else
ViewUtil.ErrorTip(res.ReturnCode, "赠送房卡失败")
end
end)
end)
end
return M