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

37 lines
1.0 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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