Files
tianrunCRM/Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/TRPSelectServer.lua
2020-07-28 21:02:59 +08:00

75 lines
2.0 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPSelectServer:TRBasePanel 邮件列表
local TRPSelectServer = class("TRPSelectServer", TRBasePanel)
local uiobjs = {}
-- 初始化,只会调用一次
function TRPSelectServer:init(csObj)
TRPSelectServer.super.init(self, csObj)
self:setEventDelegate()
end
-- 设置数据
---@param paras _ParamTRPSelectServer
function TRPSelectServer:setData(paras)
self.mdata = paras
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPSelectServer:show()
end
-- 刷新
function TRPSelectServer:refresh()
end
-- 关闭页面
function TRPSelectServer:hide()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPSelectServer:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
--[[
if cmd == xx then
end
]]
end
end
function TRPSelectServer:setEventDelegate()
self.EventDelegate = {
ButtonServer = function()
hideTopPanel(self.csSelf)
NetProto.setSeverPublish()
Utl.doCallback(self.mdata.callback)
end,
ButtonServerDev = function()
hideTopPanel(self.csSelf)
NetProto.setSeverDev()
Utl.doCallback(self.mdata.callback)
end,
ButtonServerLoc = function()
hideTopPanel(self.csSelf)
NetProto.setSeverLocal()
Utl.doCallback(self.mdata.callback)
end
}
end
-- 处理ui上的事件例如点击等
function TRPSelectServer:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
end
end
-- 当顶层页面发生变化时回调
function TRPSelectServer:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPSelectServer