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

37 lines
1.0 KiB
Lua
Raw Normal View History

2025-10-17 18:30:44 +08:00
local LobbyService = {}
local M = LobbyService
function M.new()
setmetatable(M, { __index = BaseWindow })
local self = setmetatable({}, { __index = M })
self.class = "LobbyService"
self._close_destroy = true
self:init("ui://Lobby/service")
return self
end
function M:init(url)
BaseWindow.init(self, url)
self._listView_main = self._view:GetChild('list')
self._listView_main.itemRenderer = function(index, obj)
local info = self._data_services[index + 1]
obj.text = info.wx
obj:GetChild('text_title').text = string.format("%s", info.title)
obj:GetChild('btn_copy').onClick:Set(function()
GameApplication.Instance:CopyToClipboard(info.wx) --湘北
ViewUtil.ErrorTip(-1, "复制成功")
end)
end
self:GetService()
end
function M:GetService()
self._data_services = { { title = "游戏客服", wx = "youxikefuweixing" }, { title = "黎川代理", wx = "lichuandaili" } }
self._listView_main.numItems = #self._data_services
end
return M